Package com.luciad.datamodels
Class DataType
java.lang.Object
com.luciad.datamodels.DataType
- All Implemented Interfaces:
AutoCloseable
A representation of the type of a data object.
A type describes the structure of a data object as a list of properties. Each of these properties is itself of a certain type.
A type is either a primitive type or a data object type. Primitive types are types which have no internal structure (no properties) and typically represent simple object such as strings, numbers etc. All primitive types are accessible from this class (see e.g. getIntType()
, getStringType()
...).
Application-specific metadata can be attached to a type in the form of a DataAnnotation
.
New types can be defined using a DataType.Builder
(see newBuilder()
).
Instances of this class are thread safe. Once an instance has been created, there is no public API to modify it.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
protected void
finalize()
findDataProperty
(String name) Searches for a data property by name.List
<@NotNull DataAnnotation> Returns the list of annotations attached to this data type.static DataType
Returns the type that corresponds tobool
values.List
<@NotNull DataProperty> Returns the list of properties of this data type.static DataType
Returns the type that corresponds todouble
values.static DataType
Returns the type that corresponds tofloat
values.static DataType
Returns the type that corresponds toGeometry
values.static DataType
Returns the type that corresponds toint32_t
values.static DataType
Returns the type that corresponds toint64_t
values.getName()
Returns the name of this data type.static DataType
Returns the type that corresponds tostd::string
values.boolean
hasDataProperty
(DataProperty property) Returns if the given property is declared in this data type.int
hashCode()
Returns the hash code.boolean
Returns whether this is a primitive type, i.e.static DataType.Builder
Creates a newDataType
builder.toString()
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
newBuilder
Creates a newDataType
builder.- Returns:
- a new
DataType
builder.
-
getGeometryType
Returns the type that corresponds toGeometry
values.- Returns:
- the type that corresponds to
Geometry
values.
-
getIntType
Returns the type that corresponds toint32_t
values.- Returns:
- the type that corresponds to
int32_t
values.
-
getLongType
Returns the type that corresponds toint64_t
values.- Returns:
- the type that corresponds to
int64_t
values.
-
getFloatType
Returns the type that corresponds tofloat
values.- Returns:
- the type that corresponds to
float
values.
-
getDoubleType
Returns the type that corresponds todouble
values.- Returns:
- the type that corresponds to
double
values.
-
getStringType
Returns the type that corresponds tostd::string
values.- Returns:
- the type that corresponds to
std::string
values.
-
getBooleanType
Returns the type that corresponds tobool
values.- Returns:
- the type that corresponds to
bool
values.
-
getAnnotations
Returns the list of annotations attached to this data type.- Returns:
- the list of annotations attached to this data type.
-
getName
Returns the name of this data type.- Returns:
- the name of this data type.
-
getDataProperties
Returns the list of properties of this data type.- Returns:
- the list of properties of this data type.
-
findDataProperty
Searches for a data property by name.- Parameters:
name
- the name of a property- Returns:
- the data property with the given name, if available
- See Also:
-
hasDataProperty
Returns if the given property is declared in this data type.- Parameters:
property
- Data property.- Returns:
- if the given property is declared in this data type.
- See Also:
-
isPrimitive
public boolean isPrimitive()Returns whether this is a primitive type, i.e.a type without any properties.
- Returns:
- whether this is a primitive type, i.e. a type without any properties.
-
toString
-
hashCode
public int hashCode()Returns the hash code. -
equals
-