ix.icore.process
Class PNodeEnd

java.lang.Object
  extended by ix.icore.process.TimePoint
      extended by ix.icore.process.PNodeEnd
All Implemented Interfaces:
HasStatus

public class PNodeEnd
extends TimePoint
implements HasStatus

One end of a PNode.


Field Summary
 
Fields inherited from class ix.icore.process.TimePoint
tpn_mark
 
Constructor Summary
PNodeEnd(End end, PNode node)
           
 
Method Summary
static void addOrdering(java.util.Map idToNodeMap, Ordering ord)
           
 void computeStatus()
           
static PNodeEnd fromRef(java.util.Map idToNodeMap, NodeEndRef ref)
           
 End getEnd()
           
 long getMark(int markIndex)
          Returns the current mark-value for this node-end.
 PNode getNode()
           
 PNodeEnd getOtherNodeEnd()
           
 java.util.List getPredecessors()
           
 java.util.List getShadowedEnds()
          Returns a list containing all the node-ends that are forced by ordering constraints to be after this one.
 Status getStatus()
           
 java.util.List getSuccessors()
           
 boolean isMarked(int markIndex, long mark)
          Determines whether this node-end is marked by the indicated mark.
 void linkAfter(PNodeEnd from)
           
 void linkBefore(PNodeEnd to)
           
 long markEndsBefore(int markIndex)
          Marks all node-ends that are forced by ordering contstraints to be before this one, then returns the (new) mark.
 long markShadowedEnds(int markIndex)
          Marks all node-ends that are forced by ordering contstraints to be after this one, then returns the (new) mark.
 void setStatus(Status s)
           
 java.lang.String toString()
           
 void unlink()
           
 
Methods inherited from class ix.icore.process.TimePoint
addPostConstraint, addPreConstraint, clear, getMaxTime, getMinTime, getPostConstraints, getPreConstraints, hasUnboundedMax, removePostConstraint, removePreConstraint, setMaxTime, setMinTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PNodeEnd

public PNodeEnd(End end,
                PNode node)
Method Detail

fromRef

public static PNodeEnd fromRef(java.util.Map idToNodeMap,
                               NodeEndRef ref)

addOrdering

public static void addOrdering(java.util.Map idToNodeMap,
                               Ordering ord)

getNode

public PNode getNode()

getEnd

public End getEnd()

getOtherNodeEnd

public PNodeEnd getOtherNodeEnd()

getStatus

public Status getStatus()
Specified by:
getStatus in interface HasStatus

setStatus

public void setStatus(Status s)
Specified by:
setStatus in interface HasStatus

computeStatus

public void computeStatus()
Specified by:
computeStatus in interface HasStatus

getPredecessors

public java.util.List getPredecessors()

getSuccessors

public java.util.List getSuccessors()

linkBefore

public void linkBefore(PNodeEnd to)

linkAfter

public void linkAfter(PNodeEnd from)

unlink

public void unlink()

isMarked

public boolean isMarked(int markIndex,
                        long mark)
Determines whether this node-end is marked by the indicated mark.

Each PNodeEnd has, internally, a small array of marks, so that node-ends can be marked for more than one purpose by an angorithm that uses marks. That's what the 'markIndex' parameter is about. It is obviously necessary to be very careful with this, and it is best to use marks only "locally" within an algorithm, rather than relying on a markIndex to have a lasting significance. Marks are not context-layered, which is another sense in which they should be used "locally".

Marks are obtained by calling Ip2ModelManager.nextMark(), using this node's model-manager, but marking methods often do that for you automatically and then return the new mark when they're done.


getMark

public long getMark(int markIndex)
Returns the current mark-value for this node-end. To check whether this node-end has a particular make value, the isMarked(int, long) method should be called instead.


markShadowedEnds

public long markShadowedEnds(int markIndex)
Marks all node-ends that are forced by ordering contstraints to be after this one, then returns the (new) mark. This node-end is also marked. Then the isMarked(int, long) method can be used to tell whether a node-end is marked by that mark. See that method for more about marking.


markEndsBefore

public long markEndsBefore(int markIndex)
Marks all node-ends that are forced by ordering contstraints to be before this one, then returns the (new) mark. This node-end is also marked. Then the isMarked(int, long) method can be used to tell whether a node-end is marked by that mark. See that method for more about marking.


getShadowedEnds

public java.util.List getShadowedEnds()
Returns a list containing all the node-ends that are forced by ordering constraints to be after this one.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object