|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mss.ea.core.VectorStream
Stream of individuals based on Vector.
Field Summary | |
protected java.util.Vector |
stream
Vector that is encapsulated as a stream. |
protected int |
streamIndex
Current position in the stream. |
Fields inherited from interface mss.ea.core.IndividualStream |
serialVersionUID |
Constructor Summary | |
VectorStream()
Constructor. |
|
VectorStream(java.util.Collection c)
Constructor with initial collection. |
|
VectorStream(Individual[] ia)
Constructor with initial array. |
Method Summary | |
void |
add(Individual i)
Puts an individual to the stream at the current position. |
void |
add(Individual i,
int index)
Adds an individual to a specific position in the stream. |
void |
append(Individual i)
Puts an individual to the end of the stream. |
void |
empty()
Removes all individuals from this stream. |
Individual |
get(int index)
Gets an individual from a specific position in the stream. |
boolean |
hasNext()
Indicates that there is a next individual at the current pointer position. |
boolean |
hasPrevious()
Indicates that there is a previous individual at the current pointer position. |
Individual |
next()
Gets the next individual from the current position in the stream. |
Individual |
previous()
Gets the previous individual from the current position in the stream. |
void |
reset()
Sets the internal pointer before the first individual in the stream. |
void |
resetEnd()
Sets the internal pointer after the last individual in the stream. |
void |
resize(int capacity)
Resizes the stream. |
void |
set(Individual i,
int index)
Replaces an individual at a specific position with the given individual. |
int |
size()
Returns the size of the stream. |
Individual[] |
toArray()
Returns the contents of the stream as an array. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector stream
protected int streamIndex
Constructor Detail |
public VectorStream()
public VectorStream(java.util.Collection c)
c
- collection of individualspublic VectorStream(Individual[] ia)
ia
- array of individualsMethod Detail |
public void empty()
IndividualStream
empty
in interface IndividualStream
public void add(Individual i)
IndividualStream
add
in interface IndividualStream
mss.ea.core.IndividualStream
i
- individual to addpublic void add(Individual i, int index)
IndividualStream
add
in interface IndividualStream
mss.ea.core.IndividualStream
i
- individual to addindex
- positionNoSuchElementException
- should be thrown in case of an illegal access, but must not be caughtpublic void append(Individual i)
IndividualStream
append
in interface IndividualStream
mss.ea.core.IndividualStream
i
- individual to appendpublic Individual get(int index)
IndividualStream
get
in interface IndividualStream
mss.ea.core.IndividualStream
index
- positionNoSuchElementException
- should be thrown in case of an illegal access, but must not be caughtpublic void set(Individual i, int index)
IndividualStream
set
in interface IndividualStream
mss.ea.core.IndividualStream
i
- individual to insert into streamindex
- position of replacementNoSuchElementException
- should be thrown in case of an illegal access, but must not be caughtpublic Individual next()
IndividualStream
next
in interface IndividualStream
mss.ea.core.IndividualStream
public boolean hasNext()
IndividualStream
hasNext
in interface IndividualStream
mss.ea.core.IndividualStream
public Individual previous()
IndividualStream
previous
in interface IndividualStream
mss.ea.core.IndividualStream
public boolean hasPrevious()
IndividualStream
hasPrevious
in interface IndividualStream
mss.ea.core.IndividualStream
public void reset()
IndividualStream
reset
in interface IndividualStream
public void resetEnd()
IndividualStream
resetEnd
in interface IndividualStream
public void resize(int capacity)
IndividualStream
resize
in interface IndividualStream
mss.ea.core.IndividualStream
size
- size of streampublic int size()
IndividualStream
size
in interface IndividualStream
mss.ea.core.IndividualStream
public java.lang.String toString()
toString
in class java.lang.Object
public Individual[] toArray()
IndividualStream
toArray
in interface IndividualStream
mss.ea.core.IndividualStream
|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |