laser.regularlanguage.fsa
Class SourceStateIterator<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.fsa.SourceStateIterator<L>
All Implemented Interfaces:
java.util.Iterator<FSAStateInterface<L>>

public class SourceStateIterator<L extends LabelInterface>
extends java.lang.Object
implements java.util.Iterator<FSAStateInterface<L>>

The SourceStateIterator class provides a way to convert the given Set of FSATransitionInterfaces into an Iterator over the FSAStateInterfaces that are the sources of those transitions.

Author:
Jamieson M. Cobleigh (laser-software@cs.umass.edu), Heather M. Conboy

Constructor Summary
SourceStateIterator(java.util.Set<? extends FSATransitionInterface<L>> transitions)
          Creates a new SourceStateIterator.
 
Method Summary
 boolean hasNext()
          Returns true if this Iterator has more elements to be iterated over and false otherwise.
 FSAStateInterface<L> next()
          Returns the next element of this Iterator if it exists.
 void remove()
          Removes from the underlying collection the last element returned by this Iterator (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceStateIterator

public SourceStateIterator(java.util.Set<? extends FSATransitionInterface<L>> transitions)
Creates a new SourceStateIterator.

Parameters:
transitions - The Set of transitions to be iterated over
Method Detail

hasNext

public boolean hasNext()
Returns true if this Iterator has more elements to be iterated over and false otherwise.

Specified by:
hasNext in interface java.util.Iterator<FSAStateInterface<L extends LabelInterface>>
Returns:
True if there are more elements and false otherwise

next

public FSAStateInterface<L> next()
Returns the next element of this Iterator if it exists.

Specified by:
next in interface java.util.Iterator<FSAStateInterface<L extends LabelInterface>>
Returns:
The next element if it exists
Throws:
java.util.NoSuchElementException - if there are no more elements

remove

public void remove()
Removes from the underlying collection the last element returned by this Iterator (optional operation).

Specified by:
remove in interface java.util.Iterator<FSAStateInterface<L extends LabelInterface>>
Throws:
java.lang.UnsupportedOperationException - is always thrown since this method is not supported