E- specifies the homogenous, concrete
EFieldtype stored in this list.
public final class EFieldList<E extends EField> extends EAbstractList<E> implements java.io.Serializable, java.lang.Cloneable
EFieldelements. The difference between this class and
EFieldis that this list contains homogenous field elements: all the fields must belong to the same concrete class (that is, a non-abstract class). Homogeneity decreases the serialized buffer size and decreases the serialization/de-serialization processing time. The reason is that the listed
EFieldclass is serialized once and its data type is used for all field elements. Contrast this
EFieldwhich allows heterogenous elements. Each field class must be serialized and its associated data type used to serialize the element. This greatly increases the serialized buffer size and processing time.
In short, when transmitting a homogenous
EFieldList is to be preferred over
This class extends
ArrayList, providing all the
features available in that class.
There is no limit as to the number of elements which may be
placed into this list. But care must be taken not to overflow
ByteBuffer when serializing for transport.
EFieldList to be instantiated without
using the generic parameter. That allows non-
objects to be placed into the list. Another problem is using
EField class as the generic parameter.
EFieldList does not protect against these uses,
resulting in undefined and unwanted behavior.
EFieldList should be declared with a concrete
|Constructor and Description|
Creates an empty field list instance with an initial capacity of ten.
Creates a field list instance containing the same elements as
Creates an empty field list instance with the specified initial capacity.
|Modifier and Type||Method and Description|
Returns the stored element class.
add, add, addAll, addAll, clear, isReadOnly, iterator, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, setReadOnly, sort, subList
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, lastIndexOf, size, spliterator, toArray, toArray, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
public EFieldList(int initialCapacity)
initialCapacity- initial list capacity.
public EFieldList(java.util.Collection<E> c)
cand in the order returned by the collection's iterator.
c- place this collection's element into this field list.
public java.lang.Class<E> elementClass()
nullif the list is empty.