ca.quine.jcommons.transform.transforms
Class Position

java.lang.Object
  |
  +--ca.quine.jcommons.transform.transforms.Position

public class Position
extends Object


Constructor Summary
Position(SegmentList segmentList, int position)
           
 
Method Summary
 void addTransitions(Map stateMap, String stateName)
          Add all legal transitions from the starting state except for self-referential ones.
 Position copy()
           
 SegmentStructure currentSegment()
           
 boolean hasNext(SegmentList outerList)
           
 boolean hasParent()
           
 boolean hasRequiredChild()
           
 boolean isLastChild()
           
 void moveToParent()
           
 boolean nextChild()
           
 int nextPosition()
           
 int nextPositionNoRepeats()
          If called repeatedly from the first segment position, each segment will be visited exactly once, in the order given in the segment-map file.
 boolean nextSibling()
          Moves the position to the next sibling, and returns true if there is a next sibling.
static String parent(int level, String stateName)
           
static String parent(String prefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Position

public Position(SegmentList segmentList,
                int position)
Method Detail

currentSegment

public SegmentStructure currentSegment()

nextPosition

public int nextPosition()

copy

public Position copy()

nextSibling

public boolean nextSibling()
Moves the position to the next sibling, and returns true if there is a next sibling.


nextChild

public boolean nextChild()

hasNext

public boolean hasNext(SegmentList outerList)

isLastChild

public boolean isLastChild()

hasParent

public boolean hasParent()

moveToParent

public void moveToParent()

nextPositionNoRepeats

public int nextPositionNoRepeats()
If called repeatedly from the first segment position, each segment will be visited exactly once, in the order given in the segment-map file.

Returns:
the new level, or Integer.MAX_VALUE if there is no next position

addTransitions

public void addTransitions(Map stateMap,
                           String stateName)
Add all legal transitions from the starting state except for self-referential ones. We'll handle those later.

Parameters:
stateMap -
stateName -

parent

public static String parent(int level,
                            String stateName)

parent

public static String parent(String prefix)

hasRequiredChild

public boolean hasRequiredChild()