Class NameAndStream
java.lang.Object
org.opentrafficsim.trafficcontrol.trafcod.NameAndStream
Store a variable name, stream, isTimer, isNegated and number characters consumed information.
-
Constructor Summary
ConstructorDescriptionNameAndStream
(String text, String locationDescription) Parse a TrafCOD identifier and extract all required information. -
Method Summary
-
Constructor Details
-
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 Details
-
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
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
-
toString
-