net.janino
Class Java.UnaryOperation
java.lang.Object
|
+--net.janino.Java.Located
|
+--net.janino.Java.Atom
|
+--net.janino.Java.Rvalue
|
+--net.janino.Java.BooleanRvalue
|
+--net.janino.Java.UnaryOperation
- All Implemented Interfaces:
- Java.Locatable
- Enclosing class:
- Java
- public static class Java.UnaryOperation
- extends Java.BooleanRvalue
This class implements the unary operators "+", "-", "~" and "!".
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Java.UnaryOperation
public Java.UnaryOperation(Scanner.Location location,
java.lang.String operator,
Java.Rvalue operand)
getType
public IClass getType()
throws Java.CompileException
- Overrides:
getType
in class Java.Atom
compileGet
public IClass compileGet(ClassFile.CodeAttribute codeAttribute)
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Generates code that determines the value of the
Java.Rvalue
and puts it on the operand stack. This method relies on that the
"context" of the Java.Rvalue
is on top of the operand stack
(see Java.Rvalue.compileContext(ClassFile.CodeAttribute)
).
- Overrides:
compileGet
in class Java.BooleanRvalue
- Following copied from class:
net.janino.Java.Rvalue
- Returns:
- The type of the
Java.Rvalue
compileBoolean
public void compileBoolean(ClassFile.CodeAttribute codeAttribute,
ClassFile.CodeAttribute.Offset dst,
boolean orientation)
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Some
Java.Rvalue
s compile more efficiently when their value is the
condition for a branch.
Notice that if "this" is a constant, then either "dst" is never
branched to, or it is unconditionally branched to. "Unexamined code"
errors may result during bytecode validation.
- Overrides:
compileBoolean
in class Java.Rvalue
getConstantValue
public java.lang.Object getConstantValue()
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Attempts to evaluate as a constant expression.
- Overrides:
getConstantValue
in class Java.Rvalue
- Following copied from class:
net.janino.Java.Rvalue
- Returns:
- null if value is not constant; otherwise a String, Byte,
Short, Integer, Boolean, Character, Float, Long or Double
getNegatedConstantValue
public java.lang.Object getNegatedConstantValue()
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Attempts to evaluate the negated value of a constant
Java.Rvalue
.
This is particularly relevant for the smalles value of a numeric
literal.
- Overrides:
getNegatedConstantValue
in class Java.Rvalue
- Following copied from class:
net.janino.Java.Rvalue
- Returns:
- null if value is not constant; otherwise a String, Byte,
Short, Integer, Boolean, Character, Float, Long or Double