eaLib API Docs
Last Modified : January 7 2002

mss.ea.core
Interface IndividualStream

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ArrayStream, VectorStream, ListStream

public interface IndividualStream
extends java.io.Serializable

Interface for a stream of individuals.

Since:
0.1
Version:
$Revision: 1.3 $ $Date: 2001/11/22 12:54:09 $
Author:
Andreas Rummler

Field Summary
static long serialVersionUID
          Serialization version identifier.
 
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 size)
          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.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serialization version identifier.
Method Detail

empty

public void empty()
Removes all individuals from this stream.

add

public void add(Individual i)
Puts an individual to the stream at the current position. The internal pointer is not moved to the next element, so a call to next() returns the element just inserted.
Parameters:
i - individual to add

add

public void add(Individual i,
                int index)
Adds an individual to a specific position in the stream.
Parameters:
i - individual to add
index - position
Throws:
NoSuchElementException - should be thrown in case of an illegal access, but must not be caught

append

public void append(Individual i)
Puts an individual to the end of the stream.
Parameters:
i - individual to append

get

public Individual get(int index)
Gets an individual from a specific position in the stream.
Parameters:
index - position
Returns:
individual at given position
Throws:
NoSuchElementException - should be thrown in case of an illegal access, but must not be caught

set

public void set(Individual i,
                int index)
Replaces an individual at a specific position with the given individual.
Parameters:
i - individual to insert into stream
index - position of replacement
Throws:
NoSuchElementException - should be thrown in case of an illegal access, but must not be caught

next

public Individual next()
Gets the next individual from the current position in the stream.
Returns:
individual from stream

hasNext

public boolean hasNext()
Indicates that there is a next individual at the current pointer position.
Returns:
true, if there is a next individual on the stream

previous

public Individual previous()
Gets the previous individual from the current position in the stream.
Returns:
individual from stream

hasPrevious

public boolean hasPrevious()
Indicates that there is a previous individual at the current pointer position.
Returns:
true, if there is a previous individual on the stream

reset

public void reset()
Sets the internal pointer before the first individual in the stream.

resetEnd

public void resetEnd()
Sets the internal pointer after the last individual in the stream.

resize

public void resize(int size)
Resizes the stream.
Parameters:
size - size of stream

size

public int size()
Returns the size of the stream.
Returns:
size of stream

toArray

public Individual[] toArray()
Returns the contents of the stream as an array.
Returns:
array with individuals in stream

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS