jmarkov.basic
Interface States<S extends State>

Type Parameters:
S - States set
All Superinterfaces:
java.lang.Iterable<S>
All Known Implementing Classes:
StatesSet

public interface States<S extends State>
extends java.lang.Iterable<S>

This interface represents a set of objects State. The user must choose his own data structure and define the constuctors, or provide a mechanism to generate the sates on-the-fly. A convinience class, StatesSet, is provided if the states are to be stored.

Author:
Andres Sarmiento and Germán Riaño - Universidad de Los Andes
See Also:
StatesSet

Method Summary
 boolean isClosed()
          The set is closed if all elements have been added.
 java.util.Iterator<S> iterator()
          This function must be implemented.
 int numerateStates()
          This method numerates all states and returns the number of states found.
 int size()
          Returns the number of elements.
 

Method Detail

iterator

java.util.Iterator<S> iterator()
This function must be implemented. Must return an iterator over the states.

Specified by:
iterator in interface java.lang.Iterable<S extends State>

size

int size()
Returns the number of elements.

Returns:
the number of State elements.

numerateStates

int numerateStates()
This method numerates all states and returns the number of states found. Afther this method is called it is illegal to add more states to the set.

Returns:
The number of states.

isClosed

boolean isClosed()
The set is closed if all elements have been added.

Returns:
true if the set is closed.