Package nz.org.riskscape.engine.types
Class GeomType
java.lang.Object
nz.org.riskscape.engine.types.SimpleType
nz.org.riskscape.engine.types.GeomType
- All Implemented Interfaces:
TypeIO
,TypeIOConstructor
,Type
,WrappingType
,TypeConstructor
- Direct Known Subclasses:
GeomType.Line
,GeomType.Point
,GeomType.Polygon
Base for a Type
that wraps Types.GEOMETRY
to make it a more specific geometry
sub-type.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Fields inherited from class nz.org.riskscape.engine.types.SimpleType
DEFAULT_MEMBER_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAttempt to convert the given value in to one represented by this type.<T extends Type>
booleanstatic boolean
isAllowNull
(Type toCheck) read
(ByteBuffer buffer) Read a value from the given byte buffer<T,
U> U visit
(TypeVisitor<T, U> tv, T data) Type specific visiting logic.void
write
(ByteBuffer buffer, Object value) Write a value out to the given byte bufferMethods inherited from class nz.org.riskscape.engine.types.SimpleType
asStruct, build, construct, equals, getInstance, getTypeInformation, getTypeInformationDescription, getTypeInformationId, hashCode, isSimpleType, toString, writesType
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.types.Type
checkForNull, find, findAllowNull, getUnwrappedType, internalType, isNumeric, isWrapped, toString, unwrap
Methods inherited from interface nz.org.riskscape.engine.typexp.TypeConstructor
construct
Methods inherited from interface nz.org.riskscape.engine.types.WrappingType
asStruct, estimateSize, fromBytes, isNullable, toBytes
-
Constructor Details
-
GeomType
public GeomType()
-
-
Method Details
-
isAllowNull
- Returns:
- true if toCheck is assignable to geometry, false otherwise
-
getUnderlyingType
- Specified by:
getUnderlyingType
in interfaceWrappingType
- Returns:
- the type that we immediately wrap. Used by
Type.getUnwrappedType()
to descend through all wrappedType
to find the first unwrapped one.
-
coerce
Description copied from interface:Type
Attempt to convert the given value in to one represented by this type.
- Specified by:
coerce
in interfaceType
- Parameters:
value
- The value to coerce- Returns:
- A value that conforms to this type
- Throws:
CoercionException
- if the given object can not be converted to something represented by this type
-
write
Description copied from interface:TypeIO
Write a value out to the given byte buffer
-
read
Description copied from interface:TypeIO
Read a value from the given byte buffer
-
isA
-
visit
Description copied from interface:Type
Type specific visiting logic. Types must decide whether they are atomic or compound and call the relevant method on
TypeVisitor
. It's up to each compound type to decide how they want to structure their children, e.g. order, metadata, and what's considered a child or not.- Specified by:
visit
in interfaceType
- Specified by:
visit
in interfaceWrappingType
- Overrides:
visit
in classSimpleType
-