public class CharLiteral extends AbstractIntegerLiteral
| Modifier and Type | Field and Description |
|---|---|
private char |
charVal
The actual char this CharLiteral represents.
|
| Constructor and Description |
|---|
CharLiteral(char charVal)
Creates a new CharLiteral from the given char.
|
CharLiteral(ExtList children,
java.lang.String valueStr)
Creates a new CharLiteral from the given String.
|
CharLiteral(java.lang.String valueStr)
Creates a new CharLiteral from the given String.
|
| Modifier and Type | Method and Description |
|---|---|
KeYJavaType |
getKeYJavaType(Services javaServ)
retrieves the literal's type
|
long |
getValue()
Returns the decimal value of the char.
|
java.lang.String |
getValueString() |
protected char |
parseFromString(java.lang.String sourceStr)
Parses the String and extracts the actual value of the literal.
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
java.lang.String |
toString()
toString
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
computeHashCode, equals, equalsModRenaming, getLDTName, representsDecLiteralgetKeYJavaType, matchgetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCommentsgetEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPositionpublic CharLiteral(char charVal)
charVal - a char value.public CharLiteral(ExtList children, java.lang.String valueStr)
children - an ExtList with all children(comments). May contain: CommentsvalueStr - a string.public CharLiteral(java.lang.String valueStr)
'c' (with c being an arbitrary char).valueStr - a string.public long getValue()
getValue in class AbstractIntegerLiteralpublic void visit(Visitor v)
SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.java.io.IOException - occasionally thrown.public KeYJavaType getKeYJavaType(Services javaServ)
LiteralgetKeYJavaType in class LiteraljavaServ - the Services offering access to the Java modelpublic java.lang.String toString()
JavaSourceElementtoString in class AbstractIntegerLiteralpublic java.lang.String getValueString()
getValueString in class AbstractIntegerLiteralprotected char parseFromString(java.lang.String sourceStr)
sourceStr - the String containing the literal surrounded by single-quotesjava.lang.NumberFormatException - if the given String does not represent a syntactically valid
character literal or the literal is not surrounded by single-quotes