Interface TokenSequence

    • Method Detail

      • size

        int size()
        Gets the length of the sequence.
        Returns:
        the number of tokens in the sequence.
      • isNull

        boolean isNull​(int index)
        Indicates whether the specified token has a null value.
        Parameters:
        index - the index of the token
        Returns:
        true if the element is null, false otherwise
      • compareElement

        int compareElement​(int index,
                           TokenValued value)
        Compares the value of the specified token to the token at which the given port is positioned.
        Parameters:
        index - the index of the token
        value - the input port positioned at the token for comparison
        Returns:
        0 if the values are equal, 1 if the sequence token value is greater, -1 if the sequence token value is lesser. A null value is greater than any other non-null; two null values compare as equal.
      • compareElements

        int compareElements​(int lhsIndex,
                            int rhsIndex)
        Compares the values of the tokens at the specified positions.
        Parameters:
        lhsIndex - the index of the left-hand element
        rhsIndex - the index of the right-hand element
        Returns:
        0 if the values are equal, 1 if the left hand value is greater, -1 if the left hand value is lesser. A null value is greater than any other non-null; two null values compare as equal.
      • getElementComparator

        ElementComparator getElementComparator​(TokenOrder sortOrder)
        Gets an ElementComparator for this sequence using the specified ordering.
        Parameters:
        sortOrder - the desired ordering
        Returns:
        an ElementComparator for this sequence.
      • getToken

        TokenValued getToken​(int index)
        Gets the value at the specified position.
        Parameters:
        index - the index of the token
        Returns:
        the value
      • hashCode

        int hashCode​(int index)
        Gets the hash code for the token at the specified position.
        Parameters:
        index - the index of the token
        Returns:
        the hash code for the token
      • toString

        String toString​(int index)
        Gets the string representation of the token at the specified position.
        Parameters:
        index - the index of the token
        Returns:
        the string representation of the token
      • newValueIterator

        TokenValuedIterator newValueIterator()
        Creates an iterator over the non-null values of this sequence. The iterator will automatically be reset as modifications are made to the sequence.
        Returns:
        an newly-created iterator over the non-null values of this sequence.