Class EncodableSet<E>

  • Type Parameters:
    E - set element type.
    All Implemented Interfaces:
    Encodable, Iterable<E>, Collection<E>, Set<E>

    public abstract class EncodableSet<E>
    extends Object
    implements Set<E>, Encodable

    Generic implementation of a set structure that can be stored in SLEE CMP fields with sensible serialisation semantics. This class essentially provides a layer on top of some other set implementation, delegating method calls on the Set interface through to the underlying set implementation, while handling the serialisation and deserialisation of the set’s state via the contract provided by the Encodable interface.

    In order to use this set, a subclass must be implemented that:

    • Provides at least a public constructor satisfying the contract of the Encodable interface.

    • Implements the abstract writeValue and readValue methods defined in this class.

    This implementation provides the ability to specify what type of set structure to use as a backing store from a set of predefined types. A subclass may use an alternative set implementation by:

    Rhino 2.4.0
    • Constructor Detail

      • EncodableSet

        public EncodableSet​(EncodableSet.BackingStore backingStore)

        Create an EncodableSet using the specified backing store.

        backingStore - the backing store to use.
      • EncodableSet

        protected EncodableSet​(EncodableSet.BackingStore backingStore,
                               Set<E> set)

        Create an EncodableSet using the specified backing store and set. This constructor may be used to create an EncodableSet that wraps a pre-existing set.

        backingStore - the backing store to use.
        set - the initial set state.
      • EncodableSet

        protected EncodableSet​(DataInput in,
                               ClassLoader cl,
                               DecoderUtils utils)
                        throws IOException

        Creates an EncodableSet with state restored from the specified input stream.

        in - the input stream to read set state from.
        cl - classloader that can be used to resolve class dependencies.
        utils - additional utility decoding functions.
        IOException - if an I/O error occurs.