/**
* Constructor - creates an initially empty
sequence of
* capacity 64 (maximum possible number
of knight moves)
*/
public KnightSequence ()
{
sequence = new ChessPosition[64];
currentSize = 0;
}
/**
* "Getter" - returns current size of collection
*/
public int getCurrentSize()
{
return currentSize;
}
/**----------------------------------------------------------------
* Returns a string giving the sequence
of moves in the sequence
* This is a passive, or internal, iteration
*/
public String toString()
{
String result = "";
for (int which = 0; which < currentSize;
which++)
result += sequence[which].toString()
+ " ";
return result;
}
/**
* Adds a position to the end of the sequence
* Returns true if operation succeeded.
* Returns false if sequence is at capacity
*/
public boolean add(ChessPosition aPosition)
{
return false;
}
/**
* Start an active, or external, iteration
*/
public void startIteration()
{
// stub
}
/**
* Returns true if the iteration has a
current value
* at the moment (that is, if we are not
at the end
* of the sequence)
*/
public boolean hasCurrentValue()
{
// stub
return false;
}
/**
* Return the current value in an active
iteration
*/
public ChessPosition getCurrentValue()
{
// stub
return sequence[0];
}
/**
* Move to next element in an active iteration
*/
public void advanceToNextElement()
{
// stub
}
}