ajanta.pattern
Class PatternCollection

java.lang.Object
  |
  +--ajanta.pattern.Pattern
        |
        +--ajanta.pattern.PatternCollection
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
Loop, Selection, Sequence, Set, Split

public abstract class PatternCollection
extends Pattern

This is an abstract class which represents aggregation of patterns. It consists of a list of patterns and its next method can be given different semantics to derive the pattern such as sequence , set etc.

See Also:
Sequence, Set, Serialized Form

Field Summary
protected  int current
          Index to the pattern to be performed next
protected  java.util.Vector list
          Vector of patterns
 
Fields inherited from class ajanta.pattern.Pattern
action, DONE, FAILED, NOTDONE, status
 
Constructor Summary
PatternCollection()
           
 
Method Summary
 ajanta.pattern.ItinEntry currentEntry()
           
 ajanta.pattern.ItinEntry firstEntry()
          It finds the first ItinEntry in the PatternCollection and return it to the caller.
 void insert(ajanta.pattern.Pattern p)
          Add a new pattern to the list of patterns
protected  void join()
          It calls the join method of the Pattern at current position
 void print()
          It basically prints info about the pattern collection by recursively calling print method on each of its elements in the list and as well as its current pointer in the list
protected  void reset()
          It sets the status of all the patterns in the list to NOTDONE
 
Methods inherited from class ajanta.pattern.Pattern
getName, next, scan, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

protected java.util.Vector list
Vector of patterns


current

protected int current
Index to the pattern to be performed next

Constructor Detail

PatternCollection

public PatternCollection()
Method Detail

reset

protected void reset()
It sets the status of all the patterns in the list to NOTDONE

Specified by:
reset in class Pattern

insert

public void insert(ajanta.pattern.Pattern p)
Add a new pattern to the list of patterns

Parameters:
p - Pattern to be added

join

protected void join()
It calls the join method of the Pattern at current position


currentEntry

public ajanta.pattern.ItinEntry currentEntry()
Returns:
If the status of the PatternCollection is DONE then it returns null else it returns Pattern at current location

firstEntry

public ajanta.pattern.ItinEntry firstEntry()
It finds the first ItinEntry in the PatternCollection and return it to the caller. If the PatternCollection entries are themselves PatternCollection then it recursively call firstEntry on them till one finds a instance of ItinEntry.


print

public void print()
It basically prints info about the pattern collection by recursively calling print method on each of its elements in the list and as well as its current pointer in the list

Specified by:
print in class Pattern