Class CompoundBaseToken

  • Direct Known Subclasses:
    NestedBaseTokens, SequenceBaseToken

    public abstract class CompoundBaseToken
    extends BaseToken
    CompoundBaseToken is the abstract base class for all tokens processed by the low level BaseTokenScanner that are made up of two or more BaseTokens.
    Author:
    djl 2009.03.14
    • Constructor Detail

      • CompoundBaseToken

        public CompoundBaseToken()
    • Method Detail

      • getTokens

        public abstract BaseToken[] getTokens()
        Return an array of BaseTokens making up the receiver.
        Returns:
        the an array of BaseTokens making up the receiver.
      • size

        public int size()
        Return the size of the collection of BaseTokens making up the receiver.
        Returns:
        the size of the BaseTocken collection making up the receiver
      • get

        public BaseToken get​(int index)
        Return the BaseToken at the given index
        Parameters:
        index - the zero base index for retreiving a BaseToken
        Returns:
        the BaseToken at the given index
      • isLeaf

        public boolean isLeaf()
        Answer whether this token is a leaf token.
        Specified by:
        isLeaf in class BaseToken
        Returns:
        the answer to the question "is this token a leaf?"
      • isCompound

        public boolean isCompound()
        Answer whether this token is a compound token.
        Specified by:
        isCompound in class BaseToken
        Returns:
        the answer to the question "is this token compound?"
      • match

        public boolean match​(String s,
                             boolean fIgnoreCaseFlag)
        Answer whether this token matches the given string.
        Specified by:
        match in class BaseToken
        Parameters:
        s - the String to match agains
        fIgnoreCaseFlag - the flag that controls if case matters
        Returns:
        the answer to the question "does this token match a given string?
      • toString

        public String toString()
        Return a human-readable description for this token.
        Overrides:
        toString in class Object
        Returns:
        a String description of the token