Package org.vast.data
Class AbstractRecordImpl<ComponentType extends DataComponent>
java.lang.Object
org.vast.data.AbstractSWEImpl
org.vast.data.AbstractSWEIdentifiableImpl
org.vast.data.AbstractDataComponentImpl
org.vast.data.AbstractRecordImpl<ComponentType>
- All Implemented Interfaces:
Serializable
,HasCopy
,AbstractSWE
,AbstractSWEIdentifiable
,DataComponent
- Direct Known Subclasses:
DataRecordImpl
,VectorImpl
public abstract class AbstractRecordImpl<ComponentType extends DataComponent>
extends AbstractDataComponentImpl
Implementation of an heterogeneous list of data components This is the base type for DataRecord and Vector
- See Also:
-
Field Summary
FieldsFields inherited from class org.vast.data.AbstractDataComponentImpl
dataBlock, definition, encodingInfo, INDENT, MAX_ARRAY_ERRORS, optional, parent, scalarCount, updatable
Fields inherited from class org.vast.data.AbstractSWEIdentifiableImpl
description, identifier, label
Fields inherited from class org.vast.data.AbstractSWEImpl
extensionList, id
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the datablock used by this component.void
Specific to DataRecord and used by ProcessChain Allows to combine child blocks into one mixed block when blocks are coming from different independent sourcesCreate object adapted to carry data for this container TODO could save the calculated structure and do a shallow copy for the nexts...getComponent
(int index) Get the sub-component located at the specified indexgetComponent
(String name) Get the sub-component registered with the specified nameint
Returns number of sub-components in this componentint
getComponentIndex
(String name) Get the index of the sub-component registered with this nameboolean
Recursively checks if constraints are specified in this component or any of its sub-componentsremoveComponent
(int index) Remove the sub-component at the specified indexremoveComponent
(String name) Remove sub-component with the specified namevoid
Assign a new datablock to this component.protected void
updateAtomCount
(int childAtomCountDiff) Update this component's datablock atomCount (for resizable array support).void
Call this when some child component data is re-assigned (e.g.protected void
updateStartIndex
(int startIndex) Update datablock start index (for array support) Needed when data is selected by DataArray getComponent(int) and the DataArray is using a parallel or primitive DataBlockvoid
validateData
(List<ValidationException> errorList) Validates datablock against constraints if any.Methods inherited from class org.vast.data.AbstractDataComponentImpl
addComponent, assignNewDataBlock, clone, copy, copyTo, getData, getDefinition, getEncodingInfo, getName, getOptional, getParent, getUpdatable, hasData, isSetDefinition, isSetOptional, isSetUpdatable, renewDataBlock, setDefinition, setEncodingInfo, setName, setOptional, setParent, setUpdatable, toString, toString, unSetOptional, unSetUpdatable
Methods inherited from class org.vast.data.AbstractSWEIdentifiableImpl
copyTo, getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabel
Methods inherited from class org.vast.data.AbstractSWEImpl
addExtension, copyTo, getExtensionList, getId, getNumExtensions, isSetId, setId
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.opengis.swe.v20.AbstractSWE
addExtension, getExtensionList, getId, getNumExtensions, isSetId, setId
Methods inherited from interface net.opengis.swe.v20.AbstractSWEIdentifiable
getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabel
Methods inherited from interface net.opengis.swe.v20.DataComponent
accept
-
Field Details
-
fieldList
-
-
Constructor Details
-
AbstractRecordImpl
public AbstractRecordImpl() -
AbstractRecordImpl
public AbstractRecordImpl(int size)
-
-
Method Details
-
updateStartIndex
protected void updateStartIndex(int startIndex) Description copied from class:AbstractDataComponentImpl
Update datablock start index (for array support) Needed when data is selected by DataArray getComponent(int) and the DataArray is using a parallel or primitive DataBlock- Specified by:
updateStartIndex
in classAbstractDataComponentImpl
-
updateAtomCount
protected void updateAtomCount(int childAtomCountDiff) Description copied from class:AbstractDataComponentImpl
Update this component's datablock atomCount (for resizable array support). This is called by child components to notify parents that a variable size DataArray has been resized- Specified by:
updateAtomCount
in classAbstractDataComponentImpl
-
getComponent
Description copied from interface:DataComponent
Get the sub-component located at the specified index- Specified by:
getComponent
in interfaceDataComponent
- Specified by:
getComponent
in classAbstractDataComponentImpl
- Parameters:
index
- index of component to lookup- Returns:
- child component or null if none exists at the specified index
-
getComponent
Description copied from interface:DataComponent
Get the sub-component registered with the specified name- Specified by:
getComponent
in interfaceDataComponent
- Specified by:
getComponent
in classAbstractDataComponentImpl
- Parameters:
name
- name of component to lookup- Returns:
- child component or null if none exists with the specified name
-
getComponentIndex
Description copied from interface:DataComponent
Get the index of the sub-component registered with this name- Specified by:
getComponentIndex
in interfaceDataComponent
- Specified by:
getComponentIndex
in classAbstractDataComponentImpl
- Parameters:
name
- name of component to lookup- Returns:
- index of child component or -1 if none exists with the specified name
-
removeComponent
Description copied from interface:DataComponent
Remove the sub-component at the specified index- Returns:
- the component that was just removed
-
removeComponent
Description copied from interface:DataComponent
Remove sub-component with the specified name- Returns:
- the component that was just removed
-
setData
Description copied from interface:DataComponent
Assign a new datablock to this component. This will recursively assign the right datablocks to sub-components recursively.- Specified by:
setData
in interfaceDataComponent
- Specified by:
setData
in classAbstractDataComponentImpl
-
clearData
public void clearData()Description copied from interface:DataComponent
Clear the datablock used by this component. This will also clear data from all the sub-components recursively.- Specified by:
clearData
in interfaceDataComponent
- Specified by:
clearData
in classAbstractDataComponentImpl
-
validateData
Description copied from interface:DataComponent
Validates datablock against constraints if any. No exceptions are thrown, rather they are appended to the provided list.- Specified by:
validateData
in interfaceDataComponent
- Specified by:
validateData
in classAbstractDataComponentImpl
- Parameters:
errorList
- list to which validation exceptions will be appended
-
createDataBlock
Create object adapted to carry data for this container TODO could save the calculated structure and do a shallow copy for the nexts... Saved copy would be discarded every time the structure changes- Specified by:
createDataBlock
in interfaceDataComponent
- Specified by:
createDataBlock
in classAbstractDataComponentImpl
- Returns:
- new datablock object
-
updateDataBlock
public void updateDataBlock()Call this when some child component data is re-assigned (e.g. variable size array data) -
combineDataBlocks
public void combineDataBlocks()Specific to DataRecord and used by ProcessChain Allows to combine child blocks into one mixed block when blocks are coming from different independent sources -
getComponentCount
public int getComponentCount()Description copied from interface:DataComponent
Returns number of sub-components in this component- Specified by:
getComponentCount
in interfaceDataComponent
- Specified by:
getComponentCount
in classAbstractDataComponentImpl
- Returns:
- number of direct sub-components
-
hasConstraints
public boolean hasConstraints()Description copied from interface:DataComponent
Recursively checks if constraints are specified in this component or any of its sub-components- Specified by:
hasConstraints
in interfaceDataComponent
- Specified by:
hasConstraints
in classAbstractDataComponentImpl
- Returns:
- true if at least one constraint is found, false otherwise
-