|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--condor.classad.Expr | +--condor.classad.Constant
A constant (Integer, Real, etc.). The constant is wrapped so that it may be used as a node in an expression tree. To conserve space, there is at most one Constant instance with any given value.
Expr
Field Summary | |
static Constant |
Error
A default error constant |
static Constant |
False
The unique boolean Constant false |
static Constant |
True
The unique boolean constant true |
static Constant |
Undef
A default undefined constant |
Fields inherited from class condor.classad.Expr |
ABSOLUTE_TIME, AND, ATTRIBUTE, BIT_COMPLEMENT, BITAND, BITOR, BITXOR, BOOLEAN, BRIEF, CALL, COMPACT, COND, dblevel, DIFFERENT, DIV, EQUAL, ERROR, formatFlags, formatIndent, GREATER, GREATER_EQ, INTEGER, LEFT_SHIFT, LESS, LESS_EQ, LIST, MAXPREC, MINIMAL_PARENTHESES, MINUS, MOD, MULTI_LINE_ADS, MULTI_LINE_LISTS, NO_ESCAPE_STRINGS, NOT, NOT_EQUAL, OP, opName, OR, PLUS, READABLE, REAL, RECORD, RELATIVE_TIME, RIGHT_SHIFT, SAME, SELECTION, SHOW_ERROR_DETAIL, SHOW_INSTANCES, STRING, SUBSCRIPT, TIMES, type, UMINUS, UNDEFINED, UPLUS, URIGHT_SHIFT |
Method Summary | |
static Constant |
getInstance(char[] buf,
int start,
int stop)
Create a String Constant from a character array, processing backslash escapes. |
static Constant |
getInstance(Date value)
Create an absolute time Constant. |
static Constant |
getInstance(double value)
Returns the unique real constant with value "value", creating one if necessary. |
static Constant |
getInstance(int value)
Returns the unique integer constant with value "value", creating one if necessary. |
static Constant |
getInstance(long value)
Returns the unique time constant with value "value", creating one if necessary. |
static Constant |
getInstance(String value)
Returns the unique String constant with value "value", creating one if necessary. |
int |
intValue()
Get the integer value of this Constant if possible. |
long |
milliseconds()
Convert a time value to milliseconds. |
protected int |
prec()
The precedence of this expression node (MAXPREC). |
double |
realValue()
Get the double floating point value of this Constant if possible. |
String |
stringValue()
Get the string value of this Constant if possible. |
boolean |
toBoolean()
Convernience function: Convert to a boolean. |
String |
toString()
Convert to a string |
Methods inherited from class condor.classad.Expr |
db, db, disableFormatFlags, enableFormatFlags, eval, getFormatFlags, isConstant, isNormalForm, mark, mark, mark, reEval, select, setFormatFlags, toString, typeName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Constant Undef
public static final Constant Error
public static final Constant True
public static final Constant False
Method Detail |
public static final Constant getInstance(int value)
value
- the value of the Constant.public static final Constant getInstance(double value)
value
- the value of the Constant.public static final Constant getInstance(String value)
value
- the value of the Constant.public static final Constant getInstance(char[] buf, int start, int stop)
buf
- the array of characters.start
- the index preceding the first character to be used.stop
- the index following the last characater to be used.public static final Constant getInstance(Date value)
value
- the value of the Constant.public static final Constant getInstance(long value)
value
- the value of the constant in millisecondspublic String toString()
toString
in class Expr
public boolean toBoolean()
public int intValue() throws ArithmeticException
ArithmeticException
- if this Constant is not an integer.public double realValue() throws ArithmeticException
ArithmeticException
- if this Constant is not an instance of
IntegerConstant or RealConstant.public String stringValue() throws ArithmeticException
ArithmeticException
- if this Constant is not an instance of
StringConstant.public long milliseconds() throws ArithmeticException
ArithmeticException
- if this Constant is not a time value.protected int prec()
prec
in class Expr
Expr.MINIMAL_PARENTHESES
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |