Package com.vividsolutions.jump.feature
Class AttributeType
- java.lang.Object
-
- com.vividsolutions.jump.feature.AttributeType
-
- All Implemented Interfaces:
Serializable
public class AttributeType extends Object implements Serializable
Types of attributes- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static AttributeTypeBIGDECIMALstatic AttributeTypeBIGINTstatic AttributeTypeBITstatic AttributeTypeBOOLEANstatic AttributeTypeCHARstatic AttributeTypeDATEstatic AttributeTypeDECIMALstatic AttributeTypeDOUBLEstatic AttributeTypeFLOATstatic AttributeTypeGEOMETRYstatic AttributeTypeINTEGERstatic AttributeTypeLONGstatic AttributeTypeLONGVARCHARstatic AttributeTypeNUMERICstatic AttributeTypeOBJECTstatic AttributeTypeREALstatic AttributeTypeSMALLINTstatic AttributeTypeSTRINGstatic AttributeTypeTEXTstatic AttributeTypeTIMEstatic AttributeTypeTIMESTAMPstatic AttributeTypeTINYINTstatic AttributeTypeVARCHAR
-
Constructor Summary
Constructors Modifier Constructor Description AttributeType(String name)Deprecated.protectedAttributeType(String name, Class<?> javaClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Collection<AttributeType>allTypes()static booleanareCompatibleTypes(AttributeType attrType1, AttributeType attrType2)Checks if two attribute types are compatible.static Collection<AttributeType>basicTypes()booleanequals(Object obj)StringgetName()static booleanisBoolean(AttributeType type)Checks if an attribute type is assignable to a booleanstatic booleanisDate(AttributeType type)Checks if an attribute type is a datestatic booleanisNumeric(AttributeType type)Checks if an attribute type is numericstatic booleanisNumericWithoutDecimal(AttributeType type)Checks if an attribute type is numeric without any decimalstatic booleanisString(AttributeType type)Checks if an attribute type is assignable to a Stringstatic AttributeTypetoAttributeType(Class<?> javaClass)Gets the first attribute type related with a given class.static AttributeTypetoAttributeType(String name)Converts a type name to an AttributeType.Class<?>toJavaClass()StringtoString()
-
-
-
Field Detail
-
STRING
public static final AttributeType STRING
-
CHAR
public static final AttributeType CHAR
-
VARCHAR
public static final AttributeType VARCHAR
-
LONGVARCHAR
public static final AttributeType LONGVARCHAR
-
TEXT
public static final AttributeType TEXT
-
BOOLEAN
public static final AttributeType BOOLEAN
-
BIT
public static final AttributeType BIT
-
SMALLINT
public static final AttributeType SMALLINT
-
TINYINT
public static final AttributeType TINYINT
-
INTEGER
public static final AttributeType INTEGER
-
LONG
public static final AttributeType LONG
-
BIGINT
public static final AttributeType BIGINT
-
DECIMAL
public static final AttributeType DECIMAL
-
NUMERIC
public static final AttributeType NUMERIC
-
BIGDECIMAL
public static final AttributeType BIGDECIMAL
-
FLOAT
public static final AttributeType FLOAT
-
DOUBLE
public static final AttributeType DOUBLE
-
REAL
public static final AttributeType REAL
-
DATE
public static final AttributeType DATE
-
TIME
public static final AttributeType TIME
-
TIMESTAMP
public static final AttributeType TIMESTAMP
-
GEOMETRY
public static final AttributeType GEOMETRY
-
OBJECT
public static final AttributeType OBJECT
-
-
Constructor Detail
-
AttributeType
protected AttributeType(String name, Class<?> javaClass)
- Parameters:
name- of the new AttributeTypejavaClass- java class used to store attributes of this type
-
AttributeType
@Deprecated public AttributeType(String name)
Deprecated.- Parameters:
name- of this new AttributeType
-
-
Method Detail
-
allTypes
public static Collection<AttributeType> allTypes()
- Returns:
- all AttributeTypes defined in that class.
-
basicTypes
public static Collection<AttributeType> basicTypes()
- Returns:
- AttributeTypes currently used through OpenJUMP user interface
-
toAttributeType
public static AttributeType toAttributeType(String name)
Converts a type name to an AttributeType.- Parameters:
name- the name of the AttributeType to retrieve- Returns:
- the corresponding AttributeType
-
toJavaClass
public Class<?> toJavaClass()
- Returns:
- the java class used to store attributes of this type.
-
toAttributeType
public static AttributeType toAttributeType(Class<?> javaClass)
Gets the first attribute type related with a given class. Tries the basic types first.- Parameters:
javaClass- the javaClass to retrieve- Returns:
- an AttributeType based on this java class
-
getName
public String getName()
- Returns:
- the name of this AtributeType.
-
areCompatibleTypes
public static boolean areCompatibleTypes(AttributeType attrType1, AttributeType attrType2)
Checks if two attribute types are compatible.
-
isNumeric
public static boolean isNumeric(AttributeType type)
Checks if an attribute type is numeric- Parameters:
type- the AttributeType- Returns:
- true if type uses a java class implementing Number to store attribute values.
-
isNumericWithoutDecimal
public static boolean isNumericWithoutDecimal(AttributeType type)
Checks if an attribute type is numeric without any decimal- Parameters:
type- the AttributeType- Returns:
- true if type uses an Integer or a Long to store attribute values
-
isDate
public static boolean isDate(AttributeType type)
Checks if an attribute type is a date- Parameters:
type- the AttributeType- Returns:
- true if type uses a java.util.Date to store attribute values
-
isString
public static boolean isString(AttributeType type)
Checks if an attribute type is assignable to a String- Parameters:
type- the AttributeType- Returns:
- true if type uses a java String to store attribute values
-
isBoolean
public static boolean isBoolean(AttributeType type)
Checks if an attribute type is assignable to a boolean- Parameters:
type- the AttributeType- Returns:
- true if type uses a java Boolean to store attribute values.
-
-