net.sourceforge.cilib.algorithm
Class AlgorithmStack

java.lang.Object
  extended by net.sourceforge.cilib.algorithm.AlgorithmStack

public class AlgorithmStack
extends Object

Maintain the currently running algorithm stack. The currently executing algorithm will be on the top of the stack.


Constructor Summary
AlgorithmStack()
          Create a new AlgorithmStack instance.
 
Method Summary
 List<Algorithm> asList()
          Return an unmodifiable list of Algorithm instances.
 Algorithm peek()
          Get the Algorithm that is currently at the top of the stack.
 Algorithm pop()
          Remove the current top of the stack and return it.
 void push(Algorithm algorithm)
          Push the current Algorithm onto the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmStack

public AlgorithmStack()
Create a new AlgorithmStack instance.

Method Detail

push

public void push(Algorithm algorithm)
Push the current Algorithm onto the stack.

Parameters:
algorithm - The Algorithm to push.

pop

public Algorithm pop()
Remove the current top of the stack and return it.

Returns:
The previous instance that was the top of the stack.

peek

public Algorithm peek()
Get the Algorithm that is currently at the top of the stack.

Returns:
The current top Algorithm.

asList

public List<Algorithm> asList()
Return an unmodifiable list of Algorithm instances. The list is the path of currently running algorithms. The returned list will have a size > 1, if and only if the algorithm is a composition of other algorithms.

Returns:
An unmodifiable list of algorithms instances.


Copyright © 2009 CIRG. All Rights Reserved.