# Interface: com.pnfsoftware.jeb.core.units.code.java.IJavaConstant

Java AST interface to represent a literal or constant value. 

 Constant types are: the eight primitive types \(boolean, byte, char, short, int, long, float, double\) and the string type. 

 Rendering of a literal may be [customized](#setName(String)) \(overridden\).

## Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaConstant`


## Method: getBoolean
- return type: `boolean`

Description: Retrieve the boolean value.
return: the value
throws: if the constant is not a boolean

## Method: getByte
- return type: `byte`

Description: Retrieve the byte value.
return: the byte value
throws: if the constant is not a byte

## Method: getChar
- return type: `char`

Description: Retrieve the character value.
return: the character value
throws: if the constant is not a char

## Method: getDouble
- return type: `double`

Description: Retrieve the double value.
return: the double value
throws: if the constant is not a double

## Method: getFloat
- return type: `float`

Description: Retrieve the float value.
return: the float value
throws: if the constant is not a float

## Method: getInt
- return type: `int`

Description: Retrieve the integer value.
return: the integer value
throws: if the constant is not an int

## Method: getLong
- return type: `long`

Description: Retrieve the long value.
return: the long value
throws: if the constant is not a long

## Method: getName
- return type: `java.lang.String`

Description: Retrieve the optional custom name to override rendering. This is only applicable to non\-String immediates.
return: a name override, or null

## Method: getShort
- return type: `short`

Description: Retrieve the short value.
return: the short value
throws: if the constant is not a short

## Method: getString
- return type: `java.lang.String`

Description: Retrieve the string value.
return: the string value
throws: if the constant is not a string

## Method: getType
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`

Description: Retrieve the constant type.
return: the type signature, null if the constant is 'null'

## Method: isFalse
- return type: `boolean`

Description: Determine if a constant is the false literal. This method does not raise.
return: true if the constant is a boolean false, false otherwise

## Method: isMinusOne
- return type: `boolean`

Description: Determine if a constant is a numeric literal whose value is \-1. This method does not raise.
return: true if the constant is a numeric literal whose value is \-1, false otherwise

## Method: isNegative
- return type: `boolean`

Description: Determine if a constant is a numeric literal whose value is strictly negative. This method does not raise.
return: true if the constant is a numeric literal whose value is strictly negative, false         otherwise

## Method: isNull
- return type: `boolean`

Description: Determine if the constant is the 'null' literal.
return: true if the constant is 'null'

## Method: isOne
- return type: `boolean`

Description: Determine if a constant is a numeric literal whose value is 1. This method does not raise.
return: true if the constant is a numeric literal whose value is 1, false otherwise

## Method: isPositive
- return type: `boolean`

Description: Determine if a constant is a numeric literal whose value is strictly positive. This method does not raise.
return: true if the constant is a numeric literal whose value is strictly positive, false         otherwise

## Method: isString
- return type: `boolean`

Description: Determine if the constant is of type `java.lang.String`. Convenience routine.
return: true if the constant is a Java string

## Method: isTrue
- return type: `boolean`

Description: Determine if a constant is the true literal. This method does not raise.
return: true if the constant is a boolean true, false otherwise

## Method: isZero
- return type: `boolean`

Description: Determine if a constant is a numeric literal whose value is 0. This method does not raise.
return: true if the constant is a numeric literal whose value is 0, false otherwise

## Method: setName
- parameter: `name`, type: `java.lang.String`

Description: Set a custom name to override rendering. This is only applicable to non\-String immediates.
parameter: name: a name override, or null

