Class DotToken

  • All Implemented Interfaces:
    java.lang.Iterable<DotTokenStep>

    public class DotToken
    extends java.lang.Object
    implements java.lang.Iterable<DotTokenStep>
    • Constructor Detail

      • DotToken

        public DotToken​(LocalDotNode startPosition,
                        java.lang.Double startTime,
                        boolean fade)
    • Method Detail

      • getLastTime

        public java.lang.Double getLastTime()
        Returns:
        the last known time stamp in this token; Can return null.
      • getLastPosition

        public LocalDotNode getLastPosition()
        Returns the last known dot node in this token.
        Returns:
      • getTarget

        public LocalDotNode getTarget​(int index)
        Gets the target dot node after the edge of the given index. -1 gives the start position
        Parameters:
        index -
        Returns:
      • getTimestamp

        public java.lang.Double getTimestamp​(int index)
        Gets
        Parameters:
        index -
        Returns:
        the arrival time stamp of the step at the given index. -1 gives the start time.
      • setTimestampOfPoint

        public void setTimestampOfPoint​(int index,
                                        java.lang.Double timestamp)
      • getAllTokensRecursively

        public java.util.Set<DotToken> getAllTokensRecursively()
        Returns a set containing this token and all its subtokens.
        Returns:
      • addStepInNode

        public void addStepInNode​(LocalDotNode node,
                                  java.lang.Double arrivalTime)
      • addStepOverEdge

        public void addStepOverEdge​(LocalDotEdge edge,
                                    java.lang.Double arrivalTime)
      • addSubToken

        public void addSubToken​(DotToken token)
      • getSubTokensAtPoint

        public java.util.Set<DotToken> getSubTokensAtPoint​(int index)
        Returns a set of tokens that start after the given index. Subtokens cannot start at the start of the token, so -1 is not a valid input.
        Parameters:
        index -
        Returns:
      • getLastSubTokens

        public java.util.Set<DotToken> getLastSubTokens()
        Returns the set of subtokens that start at the last known position in this token.
        Returns:
      • getStartPosition

        public LocalDotNode getStartPosition()
        Returns the start dot node of this token.
        Returns:
      • setStartTime

        public void setStartTime​(double startTime)
      • getStartTime

        public java.lang.Double getStartTime()
        Returns the start time of this token.
        Returns:
      • isFade

        public boolean isFade()
        Returns whether this token is supposed to be faded in and out at start and end.
        Returns:
      • toString

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

        public java.lang.String toString​(int indent)
      • hasSubTokensAt

        public boolean hasSubTokensAt​(int index)
        Returns whether there are subtokens after the given index. A token cannot have subtokens at its start position, so -1 is not a valid input.
        Parameters:
        index -
        Returns:
      • getTokenDestination

        public int getTokenDestination​(int index)
        Given an index, returns the index of the parallel join where index is the parallel split of.
        Parameters:
        index -
        Returns:
      • isParallelJoin

        public boolean isParallelJoin​(int index)
        Returns whether the position after index is a parallel join, i.e. has ending sub tokens.
        Parameters:
        index -
        Returns:
      • isAllTimestampsSet

        public boolean isAllTimestampsSet()
        Returns whether all timestamps have been set
        Returns:
      • iterator

        public java.util.Iterator<DotTokenStep> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<DotTokenStep>
      • size

        public int size()