public interface IJExpression extends IJGenerable
Unlike most of CodeModel, JExpressions are built bottom-up ( meaning you start from leaves and then gradually build complicated expressions by combining them.)
IJExpression
defines a series of composer methods, which returns a
complicated expression (by often taking other IJExpression
s as
parameters. For example, you can build "5+2" by
JExpr.lit(5).add(JExpr.lit(2))
generate
@Nonnull IJExpression minus()
-[this]" from "[this]
.@Nonnull IJExpression not()
![this]" from "[this]
.@Nonnull IJExpression complement()
~[this]" from "[this]
.@Nonnull IJExpression incr()
[this]++" from "[this]
.@Nonnull IJExpression preincr()
++[this]" from "[this]
.@Nonnull IJExpression decr()
[this]--" from "[this]
.@Nonnull IJExpression predecr()
--[this]" from "[this]
.@Nonnull IJExpression plus(@Nonnull IJExpression right)
right
- value to add[this]+[right]
.@Nonnull IJExpression plus(double right)
right
- value to add[this]+[right]
.@Nonnull IJExpression plus(float right)
right
- value to add[this]+[right]
.@Nonnull IJExpression plus(int right)
right
- value to add[this]+[right]
.@Nonnull IJExpression plus(long right)
right
- value to add[this]+[right]
.@Nonnull IJExpression plus(@Nonnull String right)
right
- value to add[this]+[right]
.@Nonnull IJExpression minus(@Nonnull IJExpression right)
right
- value to add[this]-[right]
.@Nonnull IJExpression minus(double right)
right
- value to subtract[this]-[right]
.@Nonnull IJExpression minus(float right)
right
- value to subtract[this]-[right]
.@Nonnull IJExpression minus(int right)
right
- value to subtract[this]-[right]
.@Nonnull IJExpression minus(long right)
right
- value to subtract[this]-[right]
.@Nonnull IJExpression mul(@Nonnull IJExpression right)
right
- value to multiply[this]*[right]
.@Nonnull IJExpression mul(double right)
right
- value to multiply[this]*[right]
.@Nonnull IJExpression mul(float right)
right
- value to multiply[this]*[right]
.@Nonnull IJExpression mul(int right)
right
- value to multiply[this]*[right]
.@Nonnull IJExpression mul(long right)
right
- value to multiply[this]*[right]
.@Nonnull IJExpression div(@Nonnull IJExpression right)
right
- value to divide through[this]/[right]
.@Nonnull IJExpression div(double right)
right
- value to divide through[this]/[right]
.@Nonnull IJExpression div(float right)
right
- value to divide through[this]/[right]
.@Nonnull IJExpression div(int right)
right
- value to divide through[this]/[right]
.@Nonnull IJExpression div(long right)
right
- value to divide through[this]/[right]
.@Nonnull IJExpression mod(@Nonnull IJExpression right)
right
- value to mod with[this]%[right]
.@Nonnull IJExpression shl(@Nonnull IJExpression right)
right
- number of bits to shift[this]<<[right]
.@Nonnull IJExpression shl(int right)
right
- number of bits to shift[this]<<[right]
.@Nonnull IJExpression shr(@Nonnull IJExpression right)
right
- number of bits to shift[this] >> [right]
.@Nonnull IJExpression shr(int right)
right
- number of bits to shift[this] >> [right]
.@Nonnull IJExpression shrz(@Nonnull IJExpression right)
right
- number of bits to shift[this] >>> [right]
.@Nonnull IJExpression shrz(int right)
right
- number of bits to shift[this] >>> [right]
.@Nonnull IJExpression band(@Nonnull IJExpression right)
right
- value to combine with[this] & [right]
.@Nonnull IJExpression bor(@Nonnull IJExpression right)
right
- value to combine with[this] | [right]
.@Nonnull IJExpression cand(@Nonnull IJExpression right)
right
- value to combine with[this] && [right]
.@Nonnull IJExpression cor(@Nonnull IJExpression right)
right
- value to combine with[this] || [right]
.@Nonnull IJExpression xor(@Nonnull IJExpression right)
right
- value to combine with[this] ^ [right]
.@Nonnull IJExpression lt(@Nonnull IJExpression right)
right
- value to compare to[this] < [right]
.@Nonnull IJExpression lt0()
[this] < 0
.@Nonnull IJExpression lte(@Nonnull IJExpression right)
right
- value to compare to[this] <= [right]
.@Nonnull IJExpression lte0()
[this] <= 0
.@Nonnull IJExpression gt(@Nonnull IJExpression right)
right
- value to compare to[this] > [right]
.@Nonnull IJExpression gt0()
[this] > 0
.@Nonnull IJExpression gte(@Nonnull IJExpression right)
right
- value to compare to[this] >= [right]
.@Nonnull IJExpression gte0()
[this] >= 0
.@Nonnull IJExpression eq(@Nonnull IJExpression right)
right
- expression to compare toexpr == right
@Nonnull IJExpression eqNull()
eq (JExpr._null ())
expr == null
@Nonnull IJExpression eq0()
eq (JExpr.lit (0))
expr == 0
@Nonnull IJExpression ne(@Nonnull IJExpression right)
right
- expression to compare toexpr != right
@Nonnull IJExpression neNull()
ne (JExpr._null ())
expr != null
@Nonnull IJExpression ne0()
ne (JExpr.lit (0))
expr != 0
@Nonnull IJExpression _instanceof(@Nonnull AbstractJType right)
right
- type to check[this] instanceof [right]
.@Nonnull JInvocation invoke(@Nonnull JMethod method)
method
- Method to be invoked[this].[method]
. Arguments shall be added to the
returned JInvocation
object.@Nonnull JInvocation invoke(@Nonnull String method)
method
- name of the method to invoke[this].[method]
. Arguments shall be added to the
returned JInvocation
object.@Nonnull JArrayCompRef component(@Nonnull IJExpression index)
index
- array index[this] [ [index] ]
@Nonnull JArrayCompRef component(int index)
index
- array index[this] [ [index] ]
@Nonnull JArrayCompRef component0()
[this] [0]
Copyright © 2013–2015 Philip Helger. All rights reserved.