abstract class AbstractJExpr extends java.lang.Object implements JExpr, Writable
| Modifier and Type | Field and Description |
|---|---|
private CachingLinkedHashMap<java.lang.String,JAssignableExpr> |
fieldCache |
private JExpr |
length |
private int |
prec |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJExpr(int prec) |
| Modifier and Type | Method and Description |
|---|---|
JExpr |
_instanceof(java.lang.Class<?> type)
Get a type-testing expression using the
instanceof operator. |
JExpr |
_instanceof(JType type)
Get a type-testing expression using the
instanceof operator. |
JExpr |
_instanceof(java.lang.String type)
Get a type-testing expression using the
instanceof operator. |
JCall |
_new(java.lang.Class<?> type)
Get an expression to construct a new inner class instance of this instance expression.
|
JCall |
_new(JType type)
Get an expression to construct a new inner class instance of this instance expression.
|
JCall |
_new(java.lang.String type)
Get an expression to construct a new inner class instance of this instance expression.
|
JAnonymousClassDef |
_newAnon(java.lang.Class<?> type)
Construct a new anonymous subclass of the given type, which must be an inner class of the type of this
expression.
|
JAnonymousClassDef |
_newAnon(JType type)
Construct a new anonymous subclass of the given type, which must be an inner class of the type of this
expression.
|
JAnonymousClassDef |
_newAnon(java.lang.String type)
Construct a new anonymous subclass of the given type, which must be an inner class of the type of this
expression.
|
JAssignableExpr |
$v(java.lang.String name)
Get a field of this object instance (shorthand for
JExpr.field(String). |
JExpr |
and(JExpr e1)
Combine this expression with another using the binary
&& operator. |
JExpr |
band(JExpr e1)
Combine this expression with another using the binary
& operator. |
JExpr |
bor(JExpr e1)
Combine this expression with another using the binary
| operator. |
JExpr |
bxor(JExpr e1)
Combine this expression with another using the binary
^ operator. |
JCall |
call(java.lang.String name)
Call the given method on this expression.
|
JExpr |
cast(java.lang.Class<?> type)
Get an expression which is a cast of this expression to the given type.
|
JExpr |
cast(JType type)
Get an expression which is a cast of this expression to the given type.
|
JExpr |
cast(java.lang.String type)
Get an expression which is a cast of this expression to the given type.
|
JExpr |
comp()
Invert this expression using the unary
~ operator. |
JExpr |
cond(JExpr ifTrue,
JExpr ifFalse)
Combine this expression with two others using the ternary
? : operator. |
JExpr |
div(JExpr e1)
Combine this expression with another using the binary
/ operator. |
JExpr |
eq(JExpr e1)
Combine this expression with another using the binary
== operator. |
JAssignableExpr |
field(java.lang.String name)
Get a field of this object instance.
|
JExpr |
ge(JExpr e1)
Combine this expression with another using the binary
>= operator. |
JExpr |
gt(JExpr e1)
Combine this expression with another using the binary
> operator. |
JExpr |
idx(int idx)
Get an element of this array expression.
|
JAssignableExpr |
idx(JExpr idx)
Get an element of this array expression.
|
JExpr |
le(JExpr e1)
Combine this expression with another using the binary
<= operator. |
JExpr |
length()
Get the
length expression of this array expression. |
JExpr |
lshr(JExpr e1)
Combine this expression with another using the binary
>>> operator. |
JExpr |
lt(JExpr e1)
Combine this expression with another using the binary
< operator. |
JExpr |
minus(JExpr e1)
Combine this expression with another using the binary
- operator. |
JExpr |
mod(JExpr e1)
Combine this expression with another using the binary
% operator. |
JExpr |
ne(JExpr e1)
Combine this expression with another using the binary
!= operator. |
JExpr |
neg()
Negate this expression using the unary
- operator. |
JExpr |
not()
Invert this expression using the unary
! operator. |
(package private) static AbstractJExpr |
of(JExpr expr) |
JExpr |
or(JExpr e1)
Combine this expression with another using the binary
|| operator. |
JExpr |
paren()
Explicitly wrap this expression in parentheses.
|
JExpr |
plus(JExpr e1)
Combine this expression with another using the binary
+ operator. |
int |
prec() |
JExpr |
shl(JExpr e1)
Combine this expression with another using the binary
<< operator. |
JExpr |
shr(JExpr e1)
Combine this expression with another using the binary
>> operator. |
JExpr |
times(JExpr e1)
Combine this expression with another using the binary
* operator. |
private final int prec
private CachingLinkedHashMap<java.lang.String,JAssignableExpr> fieldCache
private JExpr length
static AbstractJExpr of(JExpr expr)
public JExpr plus(JExpr e1)
JExpr+ operator.public JExpr minus(JExpr e1)
JExpr- operator.public JExpr times(JExpr e1)
JExpr* operator.public JExpr div(JExpr e1)
JExpr/ operator.public JExpr mod(JExpr e1)
JExpr% operator.public JExpr neg()
JExpr- operator.public JExpr band(JExpr e1)
JExpr& operator.public JExpr bor(JExpr e1)
JExpr| operator.public JExpr bxor(JExpr e1)
JExpr^ operator.public JExpr shr(JExpr e1)
JExpr>> operator.public JExpr lshr(JExpr e1)
JExpr>>> operator.public JExpr shl(JExpr e1)
JExpr<< operator.public JExpr comp()
JExpr~ operator.public JExpr and(JExpr e1)
JExpr&& operator.public JExpr or(JExpr e1)
JExpr|| operator.public JExpr not()
JExpr! operator.public JExpr eq(JExpr e1)
JExpr== operator.public JExpr ne(JExpr e1)
JExpr!= operator.public JExpr lt(JExpr e1)
JExpr< operator.public JExpr gt(JExpr e1)
JExpr> operator.public JExpr le(JExpr e1)
JExpr<= operator.public JExpr ge(JExpr e1)
JExpr>= operator.public JExpr cond(JExpr ifTrue, JExpr ifFalse)
JExpr? : operator.public JExpr paren()
JExprpublic JExpr _instanceof(java.lang.String type)
JExprinstanceof operator._instanceof in interface JExprtype - the type to testpublic JExpr _instanceof(JType type)
JExprinstanceof operator._instanceof in interface JExprtype - the type to testpublic JExpr _instanceof(java.lang.Class<?> type)
JExprinstanceof operator._instanceof in interface JExprtype - the type to testpublic JExpr cast(java.lang.String type)
JExprpublic JExpr cast(JType type)
JExprpublic JExpr cast(java.lang.Class<?> type)
JExprpublic JCall call(java.lang.String name)
JExprpublic JCall _new(java.lang.String type)
JExprpublic JCall _new(JType type)
JExprpublic JCall _new(java.lang.Class<?> type)
JExprpublic JAnonymousClassDef _newAnon(java.lang.String type)
JExprpublic JAnonymousClassDef _newAnon(JType type)
JExprpublic JAnonymousClassDef _newAnon(java.lang.Class<?> type)
JExprpublic JAssignableExpr field(java.lang.String name)
JExprpublic JAssignableExpr $v(java.lang.String name)
JExprJExpr.field(String).public JAssignableExpr idx(JExpr idx)
JExprpublic JExpr idx(int idx)
JExprpublic JExpr length()
JExprlength expression of this array expression.public int prec()