Class NameAndStream


  • class NameAndStream
    extends Object
    Store a variable name, stream, isTimer, isNegated and number characters consumed information.
    • Constructor Detail

      • NameAndStream

        NameAndStream​(String text,
                      String locationDescription)
               throws TrafficControlException
        Parse a TrafCOD identifier and extract all required information.
        Parameters:
        text - String; the TrafCOD identifier (may be followed by more text)
        locationDescription - String; description of the location in the input file
        Throws:
        TrafficControlException - when text is not a valid TrafCOD variable name
    • Method Detail

      • isNegated

        public boolean isNegated()
        Was a negation operator ('N') embedded in the name?
        Returns:
        boolean
      • getStream

        public short getStream()
        Retrieve the stream number.
        Returns:
        short; the stream number
      • getName

        public String getName()
        Retrieve the name.
        Returns:
        String; the name (without the stream number)
      • getNumberOfChars

        public int getNumberOfChars()
        Retrieve the number of characters consumed from the input.
        Returns:
        int; the number of characters consumed from the input