Class NameAndStream
- java.lang.Object
-
- org.opentrafficsim.trafficcontrol.trafcod.NameAndStream
-
class NameAndStream extends Object
Store a variable name, stream, isTimer, isNegated and number characters consumed information.
-
-
Constructor Summary
Constructors Constructor Description NameAndStream(String text, String locationDescription)
Parse a TrafCOD identifier and extract all required information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Retrieve the name.int
getNumberOfChars()
Retrieve the number of characters consumed from the input.short
getStream()
Retrieve the stream number.boolean
isNegated()
Was a negation operator ('N') embedded in the name?String
toString()
-
-
-
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
-
-