Interface ArrayWritable<T>
-
- Type Parameters:
T
- type class. This is a marker parameter that is not reflected in the signatures, but can be respected by methods requiring type information.
- All Known Subinterfaces:
Alphabet<I>
,GrowingAlphabet<I>
,ProceduralInputAlphabet<I>
,ProceduralOutputAlphabet<O>
,VPAlphabet<I>
- All Known Implementing Classes:
AbstractAlphabet
,AbstractVPAlphabet
,ArrayAlphabet
,CharRange
,CharStringRange
,DefaultProceduralInputAlphabet
,DefaultProceduralOutputAlphabet
,DefaultVPAlphabet
,DynamicList
,EnumAlphabet
,FastAlphabet
,GrowingMapAlphabet
,GrowingVPAlphabet
,IntRange
,ListAlphabet
,MapAlphabet
,SingletonAlphabet
,Word
public interface ArrayWritable<T>
Unified interface for (collection) classes that allow writing their contents to an array. The intended behavior differs from the standard JavaCollection.toArray(Object[])
method in the following way:- It is
possible to specify a source offset for this collection, i.e., how many elements are skipped before the target array
is written to. Note that if the collection does not define an iteration order, the set of elements which are omitted
is unspecified if
offset > 0
. - It is possible to specify an offset for the destination array, i.e., at which position to begin writing into the destination array.
- It is possible to specify the number of elements
to be written. Again, if this collection does not define an iteration order, the set of elements which are omitted if
num < size()
is unspecified.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
size()
The size of this container.void
writeToArray(int offset, @Nullable Object[] array, int tgtOfs, int num)
Writes the contents of this container to an array.
-
-
-
Method Detail
-
writeToArray
void writeToArray(int offset, @Nullable Object[] array, int tgtOfs, int num)
Writes the contents of this container to an array. The behavior of calling this method should be equivalent toSystem.arraycopy(this.toArray(), offset, array, tgtOfs, num);
- Parameters:
offset
- how many elements of this container to skip.array
- the array in which to store the elements.tgtOfs
- the starting offset in the target array.num
- the maximum number of elements to copy.
-
size
int size()
The size of this container.
-
-