Package org.vast.data
Class AbstractDataComponentImpl
java.lang.Object
org.vast.data.AbstractSWEImpl
org.vast.data.AbstractSWEIdentifiableImpl
org.vast.data.AbstractDataComponentImpl
- All Implemented Interfaces:
Serializable
,HasCopy
,AbstractSWE
,AbstractSWEIdentifiable
,DataComponent
- Direct Known Subclasses:
AbstractArrayImpl
,AbstractRecordImpl
,AbstractSimpleComponentImpl
,DataChoiceImpl
public abstract class AbstractDataComponentImpl
extends AbstractSWEIdentifiableImpl
implements DataComponent
Abstract DataComponent base
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractDataBlock
protected String
protected BinaryMember
protected static final String
static final int
protected Boolean
protected AbstractDataComponentImpl
protected int
protected Boolean
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 TypeMethodDescriptionabstract void
addComponent
(String name, DataComponent component) Add a sub-component and registers a name for itvoid
Create and assign a new datablock structure to this component.abstract void
Clear the datablock used by this component.clone()
Get a full recursive copy of this component.abstract AbstractDataComponentImpl
copy()
Return a structural copy of this component The copy is done recursively, but only the structure is copied (not the data)protected void
copyTo
(AbstractDataComponentImpl other) abstract AbstractDataBlock
Create a new datablock for holding data of this componentabstract AbstractDataComponentImpl
getComponent
(int index) Get the sub-component located at the specified indexabstract AbstractDataComponentImpl
getComponent
(String name) Get the sub-component registered with the specified nameabstract int
Returns number of sub-components in this componentabstract int
getComponentIndex
(String name) Get the index of the sub-component registered with this namegetData()
Get the datablock associated to this componentGets the definition propertygetName()
boolean
Gets the optional propertyboolean
Gets the updatable propertyabstract boolean
Recursively checks if constraints are specified in this component or any of its sub-componentsboolean
hasData()
boolean
Checks if definition is setboolean
Checks if optional is setboolean
Checks if updatable is setvoid
Renew the datablock of this component.abstract void
Assign a new datablock to this component.void
setDefinition
(String definition) Sets the definition propertyvoid
setEncodingInfo
(BinaryMember encodingInfo) void
Sets the name of this componentvoid
setOptional
(boolean optional) Sets the optional propertyprotected final void
setParent
(AbstractDataComponentImpl parent) void
setUpdatable
(boolean updatable) Sets the updatable propertytoString()
abstract String
Returns String representation of this DataContainervoid
Unsets the optional propertyvoid
Unsets the updatable propertyprotected abstract void
updateAtomCount
(int childOffsetCount) Update this component's datablock atomCount (for resizable array support).protected abstract 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 DataBlockabstract void
validateData
(List<ValidationException> errorList) Validates datablock against constraints if any.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, removeComponent, removeComponent
-
Field Details
-
MAX_ARRAY_ERRORS
public static final int MAX_ARRAY_ERRORS- See Also:
-
INDENT
- See Also:
-
updatable
-
optional
-
definition
-
parent
-
dataBlock
-
scalarCount
protected int scalarCount -
encodingInfo
-
-
Constructor Details
-
AbstractDataComponentImpl
public AbstractDataComponentImpl()
-
-
Method Details
-
copy
Description copied from interface:DataComponent
Return a structural copy of this component The copy is done recursively, but only the structure is copied (not the data)- Specified by:
copy
in interfaceDataComponent
- Specified by:
copy
in interfaceHasCopy
- Returns:
- copy of this component, including sub-components
-
copyTo
-
clone
Description copied from interface:DataComponent
Get a full recursive copy of this component. Both structure and data are copied- Specified by:
clone
in interfaceDataComponent
- Overrides:
clone
in classObject
- Returns:
- clone of this component, including sub-components
-
getParent
- Specified by:
getParent
in interfaceDataComponent
- Returns:
- parent component of this component
-
setParent
-
addComponent
Description copied from interface:DataComponent
Add a sub-component and registers a name for it- Specified by:
addComponent
in interfaceDataComponent
- Parameters:
name
- name of component to usecomponent
- new sub-component to append to this component
-
getComponent
Description copied from interface:DataComponent
Get the sub-component located at the specified index- Specified by:
getComponent
in interfaceDataComponent
- Parameters:
index
- index of component to lookup- Returns:
- child component or null if none exists at the specified index
-
getComponentIndex
Description copied from interface:DataComponent
Get the index of the sub-component registered with this name- Specified by:
getComponentIndex
in interfaceDataComponent
- Parameters:
name
- name of component to lookup- Returns:
- index of child component or -1 if none exists with the specified name
-
getComponent
Description copied from interface:DataComponent
Get the sub-component registered with the specified name- Specified by:
getComponent
in interfaceDataComponent
- Parameters:
name
- name of component to lookup- Returns:
- child component or null if none exists with the specified name
-
getComponentCount
public abstract int getComponentCount()Description copied from interface:DataComponent
Returns number of sub-components in this component- Specified by:
getComponentCount
in interfaceDataComponent
- Returns:
- number of direct sub-components
-
createDataBlock
Description copied from interface:DataComponent
Create a new datablock for holding data of this component- Specified by:
createDataBlock
in interfaceDataComponent
- Returns:
- new datablock object
-
assignNewDataBlock
public void assignNewDataBlock()Description copied from interface:DataComponent
Create and assign a new datablock structure to this component. This will also assign the right datablocks to sub-components recursively.- Specified by:
assignNewDataBlock
in interfaceDataComponent
-
renewDataBlock
public void renewDataBlock()Description copied from interface:DataComponent
Renew the datablock of this component. This method is faster than recreating a datablock from scratch with createDataBlock().- Specified by:
renewDataBlock
in interfaceDataComponent
-
hasData
public boolean hasData()- Specified by:
hasData
in interfaceDataComponent
- Returns:
- true if a datablock is associated to this component
-
getData
Description copied from interface:DataComponent
Get the datablock associated to this component- Specified by:
getData
in interfaceDataComponent
- Returns:
- datablock object or null if none has been generated yet
-
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
-
clearData
public abstract 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
-
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
- Parameters:
errorList
- list to which validation exceptions will be appended
-
hasConstraints
public abstract 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
- Returns:
- true if at least one constraint is found, false otherwise
-
updateStartIndex
protected abstract 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 DataBlock- Parameters:
startIndex
-
-
updateAtomCount
protected abstract void updateAtomCount(int childOffsetCount) 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- Parameters:
startIndex
-
-
toString
Returns String representation of this DataContainer- Parameters:
indent
- int- Returns:
- String
-
toString
-
getUpdatable
public boolean getUpdatable()Gets the updatable property- Specified by:
getUpdatable
in interfaceDataComponent
- Returns:
- true if component can be updated dynamically
-
isSetUpdatable
public boolean isSetUpdatable()Checks if updatable is set- Specified by:
isSetUpdatable
in interfaceDataComponent
- Returns:
- true if the updatable attribute is set
-
setUpdatable
public void setUpdatable(boolean updatable) Sets the updatable property- Specified by:
setUpdatable
in interfaceDataComponent
-
unSetUpdatable
public void unSetUpdatable()Unsets the updatable property- Specified by:
unSetUpdatable
in interfaceDataComponent
-
getOptional
public boolean getOptional()Gets the optional property- Specified by:
getOptional
in interfaceDataComponent
- Returns:
- true if component value is optional in the stream
-
isSetOptional
public boolean isSetOptional()Checks if optional is set- Specified by:
isSetOptional
in interfaceDataComponent
- Returns:
- true if the optional attribute is set
-
setOptional
public void setOptional(boolean optional) Sets the optional property- Specified by:
setOptional
in interfaceDataComponent
-
unSetOptional
public void unSetOptional()Unsets the optional property- Specified by:
unSetOptional
in interfaceDataComponent
-
getDefinition
Gets the definition property- Specified by:
getDefinition
in interfaceDataComponent
- Returns:
- definition URI
-
isSetDefinition
public boolean isSetDefinition()Checks if definition is set- Specified by:
isSetDefinition
in interfaceDataComponent
- Returns:
- true if the definition attribute is set
-
setDefinition
Sets the definition property- Specified by:
setDefinition
in interfaceDataComponent
- Parameters:
definition
- definition URI
-
getName
- Specified by:
getName
in interfaceDataComponent
- Returns:
- name of sub-component
-
setName
Description copied from interface:DataComponent
Sets the name of this component- Specified by:
setName
in interfaceDataComponent
-
getEncodingInfo
-
setEncodingInfo
-