gnu.lists
Class FVector

java.lang.Object
  extended by gnu.lists.AbstractSequence
      extended by gnu.lists.SimpleVector
          extended by gnu.lists.FVector
All Implemented Interfaces:
Array, Consumable, Sequence, java.io.Externalizable, java.io.Serializable, java.lang.Comparable, java.lang.Iterable, java.util.Collection, java.util.List

public class FVector
extends SimpleVector
implements java.io.Externalizable, Consumable, java.lang.Comparable

Simple adjustable-length vector whose elements are Object references.

See Also:
Serialized Form

Field Summary
 java.lang.Object[] data
           
protected static java.lang.Object[] empty
           
 
Fields inherited from class gnu.lists.SimpleVector
size
 
Fields inherited from interface gnu.lists.Sequence
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, GROUP_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
 
Constructor Summary
FVector()
           
FVector(int num)
           
FVector(int num, java.lang.Object o)
           
FVector(java.util.List seq)
           
FVector(java.lang.Object[] data)
          Reuses the argument without making a copy!
 
Method Summary
protected  void clearBuffer(int start, int count)
           
 int compareTo(java.lang.Object obj)
           
 void consume(Consumer out)
           
 boolean consumeNext(int ipos, Consumer out)
          Copy an element specified by a position pair to a Consumer.
 void consumePosRange(int iposStart, int iposEnd, Consumer out)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object get(int index)
          See java.util.List.
protected  java.lang.Object getBuffer()
           
 java.lang.Object getBuffer(int index)
           
 int getBufferLength()
          Get the allocated length of the data buffer.
 void readExternal(java.io.ObjectInput in)
           
 void setAll(java.lang.Object new_value)
           
 java.lang.Object setBuffer(int index, java.lang.Object value)
           
 void setBufferLength(int length)
           
 void shift(int srcStart, int dstStart, int count)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class gnu.lists.SimpleVector
add, add, addAll, addPos, clear, compareToInt, compareToLong, consume, createPos, fill, fill, fillPosRange, getElementKind, getNextKind, getPosNext, getRowMajor, getTag, intAt, intAtBuffer, isAfterPos, longAt, longAtBuffer, nextIndex, nextPos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, setSize, size, transpose
 
Methods inherited from class gnu.lists.AbstractSequence
addAll, append, append, append, baseUriOfPos, compare, compare, compare, contains, containsAll, copyPos, createRelativePos, elements, endPos, equals, firstAttributePos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextTypeName, getNextTypeObject, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, parentPos, previousPos, rank, releasePos, set, setPosNext, setPosPrevious, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gnu.lists.Sequence
elements, isEmpty
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList, toArray, toArray
 
Methods inherited from interface gnu.lists.Array
get, getEffectiveIndex, getLowBound, getSize, isEmpty, rank, set
 

Field Detail

data

public java.lang.Object[] data

empty

protected static java.lang.Object[] empty
Constructor Detail

FVector

public FVector()

FVector

public FVector(int num)

FVector

public FVector(int num,
               java.lang.Object o)

FVector

public FVector(java.lang.Object[] data)
Reuses the argument without making a copy!


FVector

public FVector(java.util.List seq)
Method Detail

getBufferLength

public int getBufferLength()
Get the allocated length of the data buffer.

Specified by:
getBufferLength in class SimpleVector

setBufferLength

public void setBufferLength(int length)
Specified by:
setBufferLength in class SimpleVector

getBuffer

protected java.lang.Object getBuffer()
Specified by:
getBuffer in class SimpleVector

shift

public void shift(int srcStart,
                  int dstStart,
                  int count)
Overrides:
shift in class SimpleVector

getBuffer

public final java.lang.Object getBuffer(int index)
Specified by:
getBuffer in class SimpleVector

get

public final java.lang.Object get(int index)
Description copied from class: AbstractSequence
See java.util.List.

Specified by:
get in interface Sequence
Specified by:
get in interface java.util.List
Overrides:
get in class SimpleVector

setBuffer

public final java.lang.Object setBuffer(int index,
                                        java.lang.Object value)
Specified by:
setBuffer in class SimpleVector

clearBuffer

protected void clearBuffer(int start,
                           int count)
Specified by:
clearBuffer in class SimpleVector

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class AbstractSequence

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

setAll

public final void setAll(java.lang.Object new_value)

consumeNext

public boolean consumeNext(int ipos,
                           Consumer out)
Description copied from class: AbstractSequence
Copy an element specified by a position pair to a Consumer.

Overrides:
consumeNext in class SimpleVector
Returns:
if hasNext(ipos).

consumePosRange

public void consumePosRange(int iposStart,
                            int iposEnd,
                            Consumer out)
Overrides:
consumePosRange in class SimpleVector

consume

public void consume(Consumer out)
Specified by:
consume in interface Consumable
Overrides:
consume in class AbstractSequence

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException