E - specifies the homogenous, concrete EField
type stored in this list.public final class EFieldList<E extends EField> extends EAbstractList<E> implements Serializable, Cloneable
ArrayList specifically containing EField
elements. The difference between this class and
EField[] is 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 EField class is serialized once and
its data type is used for all field elements. Contrast this
EField[] which 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 EField list,
EFieldList is to be preferred over EField[].
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
the eBus ByteBuffer when serializing for transport.
Java allows EFieldList to be instantiated without
using the generic parameter. That allows non-EField
objects to be placed into the list. Another problem is using
an abstract 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
EField subclass.
mReadOnlyFlagmodCount| Constructor and Description |
|---|
EFieldList()
Creates an empty field list instance with an initial
capacity of ten.
|
EFieldList(Collection<E> c)
Creates a field list instance containing the same elements
as
c and in the order returned by the collection's
iterator. |
EFieldList(int initialCapacity)
Creates an empty field list instance with the specified
initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
Class<E> |
elementClass()
Returns the stored element class.
|
add, add, addAll, addAll, clear, isReadOnly, iterator, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, setReadOnly, sort, subListclone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, lastIndexOf, size, spliterator, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic EFieldList()
public EFieldList(int initialCapacity)
initialCapacity - initial list capacity.public EFieldList(Collection<E> c)
c and in the order returned by the collection's
iterator.c - place this collection's element into this field
list.NullPointerException - if c is null.Copyright © 2019. All rights reserved.