Package picasso.parser.tokens
Class StringToken
- java.lang.Object
-
- picasso.parser.tokens.Token
-
- picasso.parser.tokens.StringToken
-
public class StringToken extends Token
Represents a token for a string (e.g., an expression loaded from a file). Using equals, a StringToken object compares as true only to another StringToken object with the same string value. A StringToken is immutable, once created it doesn't change.
-
-
Constructor Summary
Constructors Constructor Description StringToken(String value)
Constructs a token representing the given string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
boolean
isConstant()
Returns true if this token represents a constant, false otherwiseboolean
isFunction()
Returns true if this token represents a function, false otherwiseString
toString()
Represents the token by its descriptionString
value()
-
-
-
Constructor Detail
-
StringToken
public StringToken(String value)
Constructs a token representing the given string.- Parameters:
value
- the value of this string token
-
-
Method Detail
-
equals
public boolean equals(Object o)
-
value
public String value()
- Returns:
- the value of this token
-
toString
public String toString()
Description copied from class:Token
Represents the token by its description
-
isConstant
public boolean isConstant()
Description copied from class:Token
Returns true if this token represents a constant, false otherwise- Specified by:
isConstant
in classToken
- Returns:
- true iff this Token represents a constant
-
isFunction
public boolean isFunction()
Description copied from class:Token
Returns true if this token represents a function, false otherwise- Specified by:
isFunction
in classToken
- Returns:
- true iff this Token represents a function
-
-