gnu.lists

Class FVector

public class FVector extends SimpleVector implements Externalizable, Consumable, Comparable

Simple adjustable-length vector whose elements are Object references.
Field Summary
Object[]data
protected static Object[]empty
Constructor Summary
FVector()
FVector(int num)
FVector(int num, Object o)
FVector(Object[] data)
Reuses the argument without making a copy!
FVector(List seq)
Method Summary
protected voidclearBuffer(int start, int count)
intcompareTo(Object obj)
voidconsume(Consumer out)
booleanconsumeNext(int ipos, Consumer out)
voidconsumePosRange(int iposStart, int iposEnd, Consumer out)
booleanequals(Object obj)
Objectget(int index)
protected ObjectgetBuffer()
ObjectgetBuffer(int index)
intgetBufferLength()
Get the allocated length of the data buffer.
voidreadExternal(ObjectInput in)
voidsetAll(Object new_value)
ObjectsetBuffer(int index, Object value)
voidsetBufferLength(int length)
voidshift(int srcStart, int dstStart, int count)
voidwriteExternal(ObjectOutput out)

Field Detail

data

public Object[] data

empty

protected static Object[] empty

Constructor Detail

FVector

public FVector()

FVector

public FVector(int num)

FVector

public FVector(int num, Object o)

FVector

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

FVector

public FVector(List seq)

Method Detail

clearBuffer

protected void clearBuffer(int start, int count)

compareTo

public int compareTo(Object obj)

consume

public void consume(Consumer out)

consumeNext

public boolean consumeNext(int ipos, Consumer out)

consumePosRange

public void consumePosRange(int iposStart, int iposEnd, Consumer out)

equals

public boolean equals(Object obj)

get

public final Object get(int index)

getBuffer

protected Object getBuffer()

getBuffer

public final Object getBuffer(int index)

getBufferLength

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

readExternal

public void readExternal(ObjectInput in)

setAll

public final void setAll(Object new_value)

setBuffer

public final Object setBuffer(int index, Object value)

setBufferLength

public void setBufferLength(int length)

shift

public void shift(int srcStart, int dstStart, int count)

writeExternal

public void writeExternal(ObjectOutput out)

Serial Data: Write the number of elements (using writeInt), followed by the elements in order (written using writeObject). (It might seem simpler (and increase sharing) to just call writeObject(value), but that exposes the implementation.)