public class StringLiteral extends Literal
| Constructor and Description |
|---|
StringLiteral(java.lang.String s)
Constructs a string literal with the specified string value.
|
| Modifier and Type | Method and Description |
|---|---|
StringLiteral |
clone()
Returns a clone of the string literal.
|
static void |
defaultPrint(StringLiteral l,
java.io.PrintWriter o)
Prints a literal to a stream.
|
boolean |
equals(java.lang.Object o)
Compares the string literal with the specified object for equality.
|
java.lang.String |
getValue()
Returns the value of the string literal.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
void |
setValue(java.lang.String value)
Sets the value of the literal with the specified string value.
|
void |
stripQuotes()
Removes outer quotes from the string; this class automatically
prints quotes around the string so it does not need to store them.
|
java.lang.String |
toString()
Returns a string representation of the string literal.
|
compareTo, findExpression, getChildren, getParent, getStatement, hashCode, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verifypublic StringLiteral(java.lang.String s)
public StringLiteral clone()
public static void defaultPrint(StringLiteral l, java.io.PrintWriter o)
l - The literal to print.o - The writer on which to print the literal.public java.lang.String toString()
toString in class Expressionpublic boolean equals(java.lang.Object o)
equals in class Expressiono - the object to be compared with.o!=null, this.getClass()==o.getClass(),
and this.children.equals(o.children) ||
this.children==o.children==nullpublic java.lang.String getValue()
public static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void setValue(java.lang.String value)
public void stripQuotes()