public class integer extends int64
unknown value
representation and the core comparison logic.
All Progress language features related to integer/decimal data
types are implemented in the MathOps class (except comparison
logic which is in CompareOps. All Progress integer/decimal
features are supported including all functionality that can be accessed
via operators and built-in Progress functions.
NumberType.FormatSpecBaseDataType.Type, BaseDataType.WrapperHandlerSECS_IN_A_DAY, SECS_IN_A_MIN, SECS_IN_AN_HOURFORMAT_DEC_SEP, FORMAT_GROUP_SEP, SIGN_CR, SIGN_DB, SIGN_DR, SIGN_LEFT_MINUS, SIGN_LEFT_PLUS, SIGN_NONE, SIGN_PAREN, SIGN_PAREN_EMBED, SIGN_RIGHT_MINUS, SIGN_RIGHT_PLUS| Constructor and Description |
|---|
integer()
Default constructor which creates an instance representing the
unknown value. |
integer(BaseDataType value)
This is a special c'tor which should be used only when converting the
value returned by a function or method with polymorphic return type into the
expected type (i.e.
|
integer(boolean value)
Constructs an instance after copying the parameter's data into the
internal representation of this class.
|
integer(java.lang.Boolean value)
Constructs an instance after copying the parameter's data into the
internal representation of this class.
|
integer(character value)
Constructs an instance after converting the string representation
of a number into an integer.
|
integer(date value)
Constructs an instance after copying the parameter's data into the
internal representation of this class.
|
integer(decimal value)
Constructs an instance after casting the parameter into the internal representation of this
class.
|
integer(double value)
Constructs an instance after casting the parameter into the internal
representation of this class.
|
integer(int value)
Constructs an instance after casting the parameter into the internal
representation of this class.
|
integer(int64 value)
Constructs an instance after casting the parameter into the internal representation of this
class.
|
integer(integer value)
Constructs an instance after casting the parameter into the internal representation of this
class.
|
integer(logical value)
Constructs an instance after copying the parameter's data into the
internal representation of this class.
|
integer(long value)
Constructs an instance after casting the parameter into the internal representation of this
class.
|
integer(java.lang.Number value)
Constructs an instance after copying the parameter's data into the
internal representation of this class.
|
integer(object<? extends LegacyEnum> enm)
Constructs an instance wth the given enum's value.
|
integer(java.lang.String value)
Constructs an instance after converting the string representation
of a number into an integer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assign(NumberType value)
Sets the state (data and unknown value) of this instance based on the state of the passed
instance.
|
void |
assign(Undoable value)
Sets the state (data and unknown value) of this instance based on the
state of the passed instance.
|
protected boolean |
checkBounds(long value,
boolean warn)
Checks if
value can be assigned to this data type. |
integer |
duplicate()
Does the same as standard
clone() method but returns an instance of
BaseDataType and doesn't throw the CloneNotSupportedException. |
BaseDataType.Type |
getType()
Get the type
|
int |
hashCode()
Hash code implementation which is consistent with
BaseDataType.equals(java.lang.Object). |
BaseDataType |
instantiateDefault()
Creates a new instance of the same type that represents the default initialized value.
|
protected BaseDataType |
instantiateDefaultExtent()
Get the default initialization for an extent variable of this type.
|
BaseDataType |
instantiateUnknown()
Creates a new instance of the same type that represents the
unknown value. |
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
assign, assign, assign, buildDefaultFormat, buildExportFormat, compareTo, decrement, doubleValue, equals, getBitsWorker, getSize, getValue, increment, intValue, isIncompatibleTypesOnConversion, isUnknown, longValue, maximum, maximum, minimum, minimum, obtainDefaultFormat, setBitsWorker, setUnknown, setValue, setValue, setValue, setValue, setValue, toBigDecimal, toJavaIntegerType, toJavaLongType, toString, toString, toStringExport, toStringMessageassign, defaultFormatString, genCannotBeDisplayed, generateSimpleFormat, getBits, getBits, getBits, getBits, getDecimalSeparator, getDecimalSeparatorIndex, getDefaultFormat, getDigitsLeft, getDigitsRight, getEmbedIndex, getExportFormat, getGroupSeparator, getNumericDecimalPoint, getNumericFormat, getNumericSeparator, getNumGroupSeparators, getUserLeft, getUserRight, getValueTextLength, overrideDefaultSeparators, parseDecimal, parseDecimal, parseDecimal, parseDecimal, parseDecimal, parseDouble, parseDouble, parseDoubleTest, parseFormat, setBits, setBits, setBits, setBits, setBits, setBits, setBits, setNumericFormat, setNumericFormat, setNumericFormat, setNumericFormat, setNumericFormat, setNumericFormat, setNumericFormat, subscript, toString, toStringassign, assign, calcFormatLength, createProxy, createProxy, deepCopy, elementsOfType, fallback, formatLength, fromTypeName, generateDefault, generateUnknown, getAssigner, getTypeName, incompatibleTypesOnConversion, initialize, initializeDefaultExtent, invalidInitializer, isAllKnown, isAllKnown, isAssignDirect, isProxy, isUnknownValue, maximum, minimum, notUnknownValue, sameType, val, variablechanged, checkUndoable, checkUndoable, checkUndoable, getTransLevel, isGlobal, isUndoable, markUndoable, popBlock, rollback, setGlobalpublic integer()
unknown value.public integer(BaseDataType value)
int64.assign(BaseDataType)).value - The value to be used for this instance.public integer(object<? extends LegacyEnum> enm)
Integer.MAX_VALUE or smaller than Integer.MIN_VALUE (does not fit into the 32-bit
representation) it cannot be represented and a warning 15747 will be raised:
"Value too large to fit in INTEGER".
If the parameter is unknown value the resulting instance is the unknown value.
This constructor implements the INTEGER(enum) 4GL built-in function. Any failure will
generate a warning instead of an error.
enm - The enum whose value to be used for this instance.public integer(long value)
Integer.MAX_VALUE or smaller than
Integer.MIN_VALUE (does not fit into the 32-bit representation) it
cannot be represented and error 15747 will be raised: "Value too large to fit in INTEGER"
It is not possible to yield an unknown value from this constructor without
calling the method int64.setUnknown() separately.
value - The value to be used for this instance.public integer(int value)
It is not possible to yield an unknown value from this
constructor without calling the method int64.setUnknown() separate.
value - The value to be used for this instance.public integer(double value)
value - The value to be used for this instance.public integer(boolean value)
When the parameter is true the resulting integer value
will be 1. Otherwise the value is 0.
value - The value to be used for this instance.public integer(int64 value)
If the parameter represents the unknown value, this instance will also
represent the unknown value.
This constructor implements the INTEGER(int64) 4GL built-in function. Any failure will
generate a warning instead of an error.
value - The value to be used for this instance.public integer(integer value)
If the parameter represents the unknown value, this instance will also
represent the unknown value.
value - The value to be used for this instance.public integer(decimal value)
If the parameter represents the unknown value, this instance will also
represent the unknown value.
value - The value to be used for this instance.public integer(logical value)
If the parameter's represents the unknown value, this
instance will also represent the unknown value.
When the parameter is true the resulting integer value
will be 1. Otherwise the value is 0.
value - The value to be used for this instance.public integer(java.lang.String value)
value - The value to be used for this instance.public integer(character value)
If the parameter is unknown value the resulting integer is
the unknown value.
value - The value to be used for this instance.public integer(date value)
If the parameter's represents the unknown value, this
instance will also represent the unknown value.
value - The value to be used for this instance.public integer(java.lang.Number value)
If the parameter is null, this instance will represent
the unknown value.
value - The value to be used for this instance.public integer(java.lang.Boolean value)
If the parameter is null, this instance will represent
the unknown value.
value - The value to be used for this instance.public BaseDataType.Type getType()
public void assign(NumberType value)
Overrides the superclass' implementatoin to optimize for the most common use case of
copying an integer from another integer (vs. from a
non-integer NumberType). In bypassing the superclass' more general
implementation, we avoid a significantly slower implementation which performs unnecessarily
(for this case) a bounds check and BigDecimal instantiation.
In the event value is not an integer instance, delegate to the
superclass' implementation.
public int hashCode()
BaseDataType.equals(java.lang.Object).public BaseDataType instantiateUnknown()
unknown value.instantiateUnknown in class int64unknown value.public BaseDataType instantiateDefault()
instantiateDefault in class int64public integer duplicate()
clone() method but returns an instance of
BaseDataType and doesn't throw the CloneNotSupportedException.public void assign(Undoable value)
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class int64in - The input source from which fields will be restored.java.io.IOException - In case of I/O errors.java.lang.ClassNotFoundException - If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class int64out - The output destination to which fields will be saved.java.io.IOException - In case of I/O errors.protected BaseDataType instantiateDefaultExtent()
instantiateDefaultExtent in class int64protected boolean checkBounds(long value,
boolean warn)
throws ErrorConditionException
value can be assigned to this data type. This is important for
integer objects where the values must fit into 32 bit storage bounds.checkBounds in class int64value - The valuewarn - true if any generated error should actually be a warning (the
error-status:error set to false.true if value fits into 32 bit storage bounds.ErrorConditionException - Thrown if the value do not fit within this data-type.