public final class DecimalType extends SimpleType
Decimal
.Modifier and Type | Field and Description |
---|---|
static java.math.RoundingMode |
DEFAULT_ROUNDING_MODE
Default rounding mode
|
static int |
DEFAULT_SCALE
Default scale
|
static int |
MAX_SCALE
Maximal possible scale
|
static int |
MIN_SCALE
Minimal possible scale
|
static java.lang.String |
NAME
Name of the type.
|
BINARY, BOOLEAN, DATE, DECIMAL, ENUMERATION, INTEGER, LOCAL_DATE, LOCAL_DATE_TIME, NULL, OBJECT, PROPERTY, PROPERTY_PATH, RECORD, STRING, VOID
Constructor and Description |
---|
DecimalType()
Creates new instance with default scale and rounding mode.
|
DecimalType(int scale)
Creates new instance with default rounding mode.
|
DecimalType(int scale,
java.math.RoundingMode roundingMode)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
<T,E extends java.lang.Throwable> |
accept(TypeVisitor<T,E> visitor)
Accepts type visitor.
|
java.math.RoundingMode |
getRoundingMode()
Returns the rounding mode.
|
int |
getScale()
Returns the scale.
|
Type |
getSupertype()
Returns a direct supertype to this type (or null for "Object" type).
|
java.lang.Object |
performConversion(java.lang.Object object)
Performs a type conversion that should be performed when an object is
assigned to a variable of this type (possibly none).
|
java.lang.String |
toString()
Returns the string representation of this type in the format
Decimal(#scale, #roundingMode) . |
static boolean |
validScale(int scale)
Returns true if given scale is valid.
|
equals, forJavaClass, forName, getJavaClass, getName, getSimpleTypes, hashCode, hasIntersectionType
assignableTo, findCommonSubtype, findCommonSupertype, getFreeTypes, hasFreeTypes, isCollection, matchesSubtype, matchesSupertype, substituteFreeTypes
public static final java.lang.String NAME
public static final int MIN_SCALE
public static final int MAX_SCALE
public static final int DEFAULT_SCALE
public static final java.math.RoundingMode DEFAULT_ROUNDING_MODE
public DecimalType()
public DecimalType(int scale)
public Type getSupertype()
Type
public int getScale()
public java.math.RoundingMode getRoundingMode()
public static boolean validScale(int scale)
scale
- public java.lang.String toString()
Decimal(#scale, #roundingMode)
.toString
in class SimpleType
SimpleType.toString()
public <T,E extends java.lang.Throwable> T accept(TypeVisitor<T,E> visitor) throws E extends java.lang.Throwable
Type
T
- visitor return typevisitor
- visitor to visitE
E extends java.lang.Throwable
public java.lang.Object performConversion(java.lang.Object object)
Type
performConversion
in interface Type
performConversion
in class AbstractType
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.