Package org.vast.data
Class DataArrayImpl
- All Implemented Interfaces:
Serializable,HasCopy,AbstractSWE,AbstractSWEIdentifiable,BlockComponent,DataArray,DataComponent
- Direct Known Subclasses:
MatrixImpl
Array of identical components. Can be of variable size. In the case of a variable size array, size is actually given by another component: sizeComponent which should be a Count. There are two cases of variable size component: - The component is explicitely listed in the component tree (in this case, the count component has a parent) - The component is implicitely given before the array data (in this case, the count component has no parent) 08-2014: Updated to implement new API autogenerated from XML schema
- See Also:
-
Field Summary
FieldsFields inherited from class org.vast.data.AbstractArrayImpl
elementCount, elementType, ELT_COUNT_NAME, encoding, implicitElementCount, valuesFields inherited from class org.vast.data.AbstractDataComponentImpl
dataBlock, definition, encodingInfo, INDENT, MAX_ARRAY_ERRORS, optional, parent, scalarCount, updatableFields inherited from class org.vast.data.AbstractSWEIdentifiableImpl
description, identifier, labelFields inherited from class org.vast.data.AbstractSWEImpl
extensionList, id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(DataComponentVisitor visitor) protected voidcheckIndex(int index) Check that the integer index given is in range: 0 to size of array - 1voidClear the datablock used by this component.copy()Return a structural copy of this component The copy is done recursively, but only the structure is copied (not the data)protected voidcopyTo(DataArrayImpl other) Create the right data block to carry this array data It can be either a scalar array (DataBlockDouble, etc...) or a group of mixed types parallel arrays (DataBlockMixed)getComponent(int index) Get the sub-component located at the specified indexgetComponent(String name) Get the sub-component registered with the specified nameintReturns number of sub-components in this componentintgetComponentIndex(String name) Get the index of the sub-component registered with this nameprotected voidresizeDataBlock(int oldArraySize, int newArraySize) Do everything that is necessary to properly resize data blockvoidAssign a new datablock to this component.voidsetFixedSize(int newSize) Set the size of this array to a new FIXED valueReturns String representation of this DataContainerprotected voidupdateAtomCount(int childAtomCountDiff) Update this component's datablock atomCount (for resizable array support).voidDynamically update size of a VARIABLE SIZE array Note that elementCount component must carry the right value at this timevoidupdateSize(int newSize) Set the size of this VARIABLE SIZE array to a new value Automatically updates the sizeData component value.protected voidupdateSizeComponent(int newSize) Simply update value in size data component w/o resizing datablockprotected voidupdateStartIndex(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 DataBlockvoidvalidateData(List<ValidationException> errorList) Validates datablock against constraints if any.Methods inherited from class org.vast.data.AbstractArrayImpl
addComponent, copyTo, getArraySizeComponent, getElementCount, getElementCountProperty, getElementType, getElementTypeProperty, getEncoding, getValues, hasConstraints, isImplicitSize, isSetEncoding, isSetValues, isVariableSize, removeComponent, removeComponent, setElementCount, setElementType, setEncoding, setValues, setVariableSizeComponentMethods inherited from class org.vast.data.AbstractDataComponentImpl
assignNewDataBlock, clone, copyTo, getData, getDefinition, getEncodingInfo, getName, getOptional, getParent, getUpdatable, hasData, isSetDefinition, isSetOptional, isSetUpdatable, renewDataBlock, setDefinition, setEncodingInfo, setName, setOptional, setParent, setUpdatable, toString, unSetOptional, unSetUpdatableMethods inherited from class org.vast.data.AbstractSWEIdentifiableImpl
copyTo, getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabelMethods inherited from class org.vast.data.AbstractSWEImpl
addExtension, copyTo, getExtensionList, getId, getNumExtensions, isSetId, setIdMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.opengis.swe.v20.AbstractSWE
addExtension, getExtensionList, getId, getNumExtensions, isSetId, setIdMethods inherited from interface net.opengis.swe.v20.AbstractSWEIdentifiable
getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabelMethods inherited from interface net.opengis.swe.v20.DataComponent
assignNewDataBlock, clone, getData, getDefinition, getName, getOptional, getParent, getUpdatable, hasData, isSetDefinition, isSetOptional, isSetUpdatable, renewDataBlock, setDefinition, setName, setOptional, setUpdatable, unSetOptional, unSetUpdatable
-
Field Details
-
MIXED_BLOCK_ERROR_MSG
- See Also:
-
ARRAY_SIZE_FIELD
- See Also:
-
currentSize
protected int currentSize
-
-
Constructor Details
-
DataArrayImpl
public DataArrayImpl()Default constructor. The array will be variable size with implicit size until either setSize() is called or the elementType property is set to reference the ID of another component in the tree. -
DataArrayImpl
public DataArrayImpl(int arraySize)
-
-
Method Details
-
copy
Description copied from interface:DataComponentReturn a structural copy of this component The copy is done recursively, but only the structure is copied (not the data)- Specified by:
copyin interfaceDataArray- Specified by:
copyin interfaceDataComponent- Specified by:
copyin interfaceHasCopy- Specified by:
copyin classAbstractArrayImpl- Returns:
- copy of this component, including sub-components
-
copyTo
-
updateStartIndex
protected void updateStartIndex(int startIndex) Description copied from class:AbstractDataComponentImplUpdate 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:
updateStartIndexin classAbstractDataComponentImpl
-
updateAtomCount
protected void updateAtomCount(int childAtomCountDiff) Description copied from class:AbstractDataComponentImplUpdate 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:
updateAtomCountin classAbstractDataComponentImpl
-
getComponent
Description copied from interface:DataComponentGet the sub-component located at the specified index- Specified by:
getComponentin interfaceDataComponent- Specified by:
getComponentin 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:DataComponentGet the sub-component registered with the specified name- Specified by:
getComponentin interfaceDataComponent- Specified by:
getComponentin classAbstractDataComponentImpl- Parameters:
name- name of component to lookup- Returns:
- child component or null if none exists with the specified name
-
setData
Description copied from interface:DataComponentAssign a new datablock to this component. This will recursively assign the right datablocks to sub-components recursively.- Specified by:
setDatain interfaceDataComponent- Specified by:
setDatain classAbstractDataComponentImpl
-
clearData
public void clearData()Description copied from interface:DataComponentClear the datablock used by this component. This will also clear data from all the sub-components recursively.- Specified by:
clearDatain interfaceDataComponent- Specified by:
clearDatain classAbstractDataComponentImpl
-
validateData
Description copied from interface:DataComponentValidates datablock against constraints if any. No exceptions are thrown, rather they are appended to the provided list.- Specified by:
validateDatain interfaceDataComponent- Specified by:
validateDatain classAbstractDataComponentImpl- Parameters:
errorList- list to which validation exceptions will be appended
-
createDataBlock
Create the right data block to carry this array data It can be either a scalar array (DataBlockDouble, etc...) or a group of mixed types parallel arrays (DataBlockMixed)- Specified by:
createDataBlockin interfaceDataComponent- Specified by:
createDataBlockin classAbstractDataComponentImpl- Returns:
- new datablock object
-
checkIndex
protected void checkIndex(int index) Check that the integer index given is in range: 0 to size of array - 1- Parameters:
index- int- Throws:
IndexOutOfBoundsException
-
resizeDataBlock
protected void resizeDataBlock(int oldArraySize, int newArraySize) Do everything that is necessary to properly resize data block- Parameters:
oldArraySize-newArraySize-
-
updateSize
public void updateSize()Dynamically update size of a VARIABLE SIZE array Note that elementCount component must carry the right value at this time -
updateSize
public void updateSize(int newSize) Set the size of this VARIABLE SIZE array to a new value Automatically updates the sizeData component value.- Parameters:
newSize-
-
setFixedSize
public void setFixedSize(int newSize) Set the size of this array to a new FIXED value- Parameters:
newSize-
-
updateSizeComponent
protected void updateSizeComponent(int newSize) Simply update value in size data component w/o resizing datablock- Parameters:
newSize-
-
getComponentCount
public int getComponentCount()Description copied from interface:DataComponentReturns number of sub-components in this component- Specified by:
getComponentCountin interfaceDataComponent- Specified by:
getComponentCountin classAbstractDataComponentImpl- Returns:
- number of direct sub-components
-
getComponentIndex
Description copied from interface:DataComponentGet the index of the sub-component registered with this name- Specified by:
getComponentIndexin interfaceDataComponent- Specified by:
getComponentIndexin classAbstractDataComponentImpl- Parameters:
name- name of component to lookup- Returns:
- index of child component or -1 if none exists with the specified name
-
toString
Description copied from class:AbstractDataComponentImplReturns String representation of this DataContainer- Specified by:
toStringin classAbstractDataComponentImpl- Parameters:
indent- int- Returns:
- String
-
accept
-