public abstract class MaxType
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
ALN
Alpha-numeric
|
static int |
AMOUNT
Currency
|
static int |
BIGINT
Big integer
|
static int |
BLOB
Binary large object (BLOB).
|
static int |
CLOB
Character long object (CLOB).
|
static int |
CRYPTO
Encrypted raw (CRYPTO).
|
static int |
CRYPTOX
Encrypted raw, undecryptable (CRYPTOX).
|
static int |
DATE
Date
|
static int |
DATETIME
Date amd Time
|
static int |
DECIMAL
Fixed decimal point
|
static int |
DEFAULMAXLENGTH
Default maxlength if not specified during construction of the datatype.
|
static int |
DEFAULTSCALE
Default scale for decimal and amount data type.
|
static int |
DURATION
Duration type
|
static int |
FLOAT
Floating point value
|
static int |
GL
GL Type
|
static int |
INTEGER
Integer value
|
static int |
LONGALN
Long String (ALN).
|
static int |
LOWER
Lower case only
|
static int |
SMALLINT
Small Integer value
|
static int |
TIME
Time only
|
static int |
UDTYPE
User defined types start at this number
|
static int |
UPPER
Upper case only
|
static int |
YORN
Boolean (Yes or No)
|
Modifier and Type | Method and Description |
---|---|
boolean |
asBoolean()
Return as boolean
Throws Exception if value is null or cannot be returned as this type.
|
byte[] |
asBytes()
Return as byte array.
|
java.util.Date |
asDate()
Return as a Date object
Returns null if value is null.
|
double |
asDouble()
Return as double.
|
float |
asFloat()
Return the value as a float
|
int |
asInt()
Return as an int.
|
abstract java.lang.String |
asLocaleString()
Return as a locale sensitive string using the default timeZone and locale
Returns "" if value is null.
|
abstract java.lang.String |
asLocaleString(java.util.Locale l)
Return as a locale sensitive string using the default TimeZone and the specified Locale
Returns "" if value is null.
|
abstract java.lang.String |
asLocaleString(java.util.Locale l,
java.util.TimeZone tz)
Return as a locale sensitive string using the specified TimeZone and Locale
Returns "" if value is null.
|
long |
asLong()
Return as a long.
|
abstract java.lang.String |
asString()
Return as a string.
|
abstract java.lang.Object |
clone() |
static MaxType |
createMaxType(java.util.Locale l,
java.util.TimeZone tz,
int type)
Instantiate a MaxType object based on the type, locale and timezone.
|
static MaxType |
createMaxType(java.util.Locale l,
java.util.TimeZone tz,
int type,
int length,
int scale)
Instantiate a MaxType object based on the locale, timezone, type, length and scale.
|
int |
getMaxLength()
Return maximum length.
|
int |
getScale()
Return the scale used by decimal and amount types.
|
abstract int |
getType()
Get the current type
|
boolean |
isNull()
Is the current value null ??
|
void |
overrideStringData(java.lang.String newValue)
This should be called only in very special circumstances related to conversion of
a value between locales (for example, maxattributecfg.defaultvalue).
|
void |
setAftercheckLengthAndScale(java.lang.String val)
Check length and scale agaist the current length and scale and then set the
value if it is alright.
|
void |
setMaxLength(int l)
Set maximum length.
|
void |
setScale(int s)
Set the scale for DECIMAL and AMOUNT MaxType.
|
void |
setValue(boolean value)
Set the value to the specified value.
|
void |
setValue(byte[] value)
Set the value to the specified value.
|
void |
setValue(java.util.Date value)
Set the value to the specified value.
|
void |
setValue(double value)
Set the value to the specified value.
|
void |
setValue(float value)
Set the value to the specified value.
|
void |
setValue(int value)
Set the value to the specified value.
|
void |
setValue(long value)
Set the value to the specified value.
|
abstract void |
setValue(MaxType value) |
abstract void |
setValue(java.lang.String value)
Set the value to the specified value.
|
void |
setValueNull()
Set the current value to be null
|
java.lang.String |
toString()
Override object.toString() to give some debug info.
|
public static final int ALN
public static final int UPPER
public static final int LOWER
public static final int DATE
public static final int DATETIME
public static final int TIME
public static final int INTEGER
public static final int SMALLINT
public static final int FLOAT
public static final int DECIMAL
public static final int DURATION
public static final int AMOUNT
public static final int YORN
public static final int GL
public static final int LONGALN
public static final int CRYPTO
public static final int CRYPTOX
public static final int CLOB
public static final int BLOB
public static final int BIGINT
public static final int UDTYPE
public static final int DEFAULMAXLENGTH
public static final int DEFAULTSCALE
public void setMaxLength(int l)
public int getMaxLength()
public int getScale()
public void setScale(int s) throws MXException
MXException
public abstract void setValue(java.lang.String value) throws MXException
MXException
public void setValue(java.util.Date value) throws MXException
MXException
public void setValue(byte[] value) throws MXException
MXException
public void setValue(double value) throws MXException
MXException
public void setValue(float value) throws MXException
MXException
public void setValue(int value) throws MXException
MXException
public void setValue(long value) throws MXException
MXException
public void setValue(boolean value) throws MXException
MXException
public abstract java.lang.String asString()
public abstract java.lang.String asLocaleString(java.util.Locale l)
public abstract java.lang.String asLocaleString(java.util.Locale l, java.util.TimeZone tz)
public abstract java.lang.String asLocaleString()
public java.util.Date asDate() throws MXException
MXException
public double asDouble() throws MXException
MXException
public float asFloat() throws MXException
MXException
public int asInt() throws MXException
MXException
public long asLong() throws MXException
MXException
public boolean asBoolean() throws MXException
MXException
public byte[] asBytes() throws MXException
MXException
public boolean isNull()
public void setValueNull()
public abstract int getType()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract java.lang.Object clone()
clone
in class java.lang.Object
public abstract void setValue(MaxType value) throws MXException
MXException
public void setAftercheckLengthAndScale(java.lang.String val) throws MXException
value
- MXException
public void overrideStringData(java.lang.String newValue)
newValue
- public static MaxType createMaxType(java.util.Locale l, java.util.TimeZone tz, int type) throws MXException
l
- locale, null if not applicable.tz
- timezone, null if not applicabletype
- MXException
public static MaxType createMaxType(java.util.Locale l, java.util.TimeZone tz, int type, int length, int scale) throws MXException
l
- locale, null if not applicable.tz
- timezone, null if not applicabletype
- The datatypelength
- max length, use MaxType.DEFAULTMAXLENGTH as default or
if not applicable to the data typescale
- scale, use MaxTupe.DEFAULTSCALE is not applicable to the datatypeMXException