Package nz.org.riskscape.engine.types
Class RSList
java.lang.Object
nz.org.riskscape.engine.types.RSList
- All Implemented Interfaces:
ContainingType
,Type
Basic list type that can convert various arrays and list types to the required type
-
Field Summary
Modifier and TypeFieldDescriptionstatic final RSList
static final ComplexTypeConstructor
static final TypeInformation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasStruct()
Attempt to convert the given value in to one represented by this type.static RSList
boolean
int
estimateSize
(Object entry) Estimate the number of bytes used to serialize the given value to an output stream.int
hashCode()
Class<?>
The underlying java class used to represent this type.void
toBytes
(DataOutputStream os, Object toWrite) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.types.ContainingType
visit
Methods inherited from interface nz.org.riskscape.engine.types.Type
checkForNull, find, findAllowNull, getUnwrappedType, isA, isNullable, isNumeric, isWrapped, toString, unwrap
-
Field Details
-
LIST_ANYTHING
-
TYPE_CONSTRUCTOR
-
TYPE_INFORMATION
-
-
Constructor Details
-
RSList
Deprecated.usecreate(Type)
instead - reduces the amount of identical types being allocated All Riskscape code has been ported to use create, but there may be functions etc out there that are using this old constructor. We might want to log a stack trace when this is used if it becomes functionally important that the new static constructor be used. -
RSList
Internal, non-deprecated constructor - ignored flag is here just to provide a non-deprecated alternative
-
-
Method Details
-
create
-
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
-
internalType
Description copied from interface:Type
The underlying java class used to represent this type.
- Specified by:
internalType
in interfaceType
-
asStruct
-
getMemberType
-
estimateSize
Description copied from interface:Type
Estimate the number of bytes used to serialize the given value to an output stream.
- Specified by:
estimateSize
in interfaceType
- Parameters:
entry
- the value of this type to measure. Must be ofType.internalType()
or aClassCastException
is going to happen- Returns:
- the estimated number of bytes, or zero if no estimation was possible.
-
toBytes
- Specified by:
toBytes
in interfaceType
- Throws:
IOException
-
fromBytes
- Specified by:
fromBytes
in interfaceType
- Throws:
IOException
-
toString
-
hashCode
public int hashCode() -
equals
-
getContainedType
- Specified by:
getContainedType
in interfaceContainingType
- Returns:
- The type that this
ContainingType
contains.
-
create(Type)
instead - reduces the amount of identical types being allocated All Riskscape code has been ported to use create, but there may be functions etc out there that are using this old constructor.