Package org.vast.data
Class DataChoiceImpl
java.lang.Object
org.vast.data.AbstractSWEImpl
org.vast.data.AbstractSWEIdentifiableImpl
org.vast.data.AbstractDataComponentImpl
org.vast.data.DataChoiceImpl
- All Implemented Interfaces:
 Serializable,HasCopy,AbstractSWE,AbstractSWEIdentifiable,DataChoice,DataComponent
- Direct Known Subclasses:
 GeometryDataImpl
Exclusive list of DataComponents (Choice) 08-2014: Updated to implement new API autogenerated from XML schema
- See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Categoryprotected DataComponentPropertyList<DataComponent>protected intprotected static intprotected static StringFields 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) voidaddComponent(String name, DataComponent component) Add a sub-component and registers a name for itvoidaddItem(String name, DataComponent item) Adds a new item propertyprotected voidcheckIndex(int index) Check that the integer index given is in range: 0 to item list sizevoidClear 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)Create a new datablock for holding data of this componentGets the choiceValue propertygetComponent(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 nameGets the item property with the given nameGets the list of item propertiesintReturns number of item propertiesintGets the selected item in this choicebooleanRecursively checks if constraints are specified in this component or any of its sub-componentsbooleanChecks if choiceValue is setremoveComponent(int index) Remove the sub-component at the specified indexremoveComponent(String name) Remove sub-component with the specified namevoidsetChoiceValue(Category choiceValue) Sets the choiceValue propertyvoidAssign a new datablock to this component.voidsetSelectedItem(int index) Sets the choice selection to the item with the given indexvoidsetSelectedItem(String name) Sets the choice selection to the item with the given nameReturns String representation of this DataContainervoidunselect()protected voidupdateAtomCount(int childAtomCountDiff) Update this component's datablock atomCount (for resizable array support).protected 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.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
- 
UNSELECTED
protected static int UNSELECTED - 
UNSELECTED_ERROR
 - 
selected
protected int selected - 
choiceValue
 - 
itemList
 
 - 
 - 
Constructor Details
- 
DataChoiceImpl
public DataChoiceImpl() - 
DataChoiceImpl
public DataChoiceImpl(int size)  
 - 
 - 
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 interfaceDataChoice- Specified by:
 copyin interfaceDataComponent- Specified by:
 copyin interfaceHasCopy- Specified by:
 copyin classAbstractDataComponentImpl- Returns:
 - copy of this component, including sub-components
 
 - 
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
 - 
addComponent
Description copied from interface:DataComponentAdd a sub-component and registers a name for it- Specified by:
 addComponentin interfaceDataComponent- Specified by:
 addComponentin classAbstractDataComponentImpl- Parameters:
 name- name of component to usecomponent- new sub-component to append to this component
 - 
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
 
 - 
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
 
 - 
removeComponent
Description copied from interface:DataComponentRemove the sub-component at the specified index- Specified by:
 removeComponentin interfaceDataComponent- Returns:
 - the component that was just removed
 
 - 
removeComponent
Description copied from interface:DataComponentRemove sub-component with the specified name- Specified by:
 removeComponentin interfaceDataComponent- Returns:
 - the component that was just removed
 
 - 
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
Description copied from interface:DataComponentCreate a new datablock for holding data of this component- 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 item list size- Parameters:
 index- int- Throws:
 IndexOutOfBoundsException
 - 
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
 
 - 
getSelected
public int getSelected() - 
getSelectedItem
Description copied from interface:DataChoiceGets the selected item in this choice- Specified by:
 getSelectedItemin interfaceDataChoice- Returns:
 - the selected component or null if non is selected
 
 - 
setSelectedItem
public void setSelectedItem(int index) Description copied from interface:DataChoiceSets the choice selection to the item with the given index- Specified by:
 setSelectedItemin interfaceDataChoice
 - 
setSelectedItem
Description copied from interface:DataChoiceSets the choice selection to the item with the given name- Specified by:
 setSelectedItemin interfaceDataChoice
 - 
unselect
public void unselect() - 
toString
Description copied from class:AbstractDataComponentImplReturns String representation of this DataContainer- Specified by:
 toStringin classAbstractDataComponentImpl- Parameters:
 indent- int- Returns:
 - String
 
 - 
hasConstraints
public boolean hasConstraints()Description copied from interface:DataComponentRecursively checks if constraints are specified in this component or any of its sub-components- Specified by:
 hasConstraintsin interfaceDataComponent- Specified by:
 hasConstraintsin classAbstractDataComponentImpl- Returns:
 - true if at least one constraint is found, false otherwise
 
 - 
getChoiceValue
Gets the choiceValue property- Specified by:
 getChoiceValuein interfaceDataChoice
 - 
isSetChoiceValue
public boolean isSetChoiceValue()Checks if choiceValue is set- Specified by:
 isSetChoiceValuein interfaceDataChoice
 - 
setChoiceValue
Sets the choiceValue property- Specified by:
 setChoiceValuein interfaceDataChoice
 - 
getItemList
Gets the list of item properties- Specified by:
 getItemListin interfaceDataChoice
 - 
getNumItems
public int getNumItems()Returns number of item properties- Specified by:
 getNumItemsin interfaceDataChoice
 - 
getItem
Gets the item property with the given name- Specified by:
 getItemin interfaceDataChoice
 - 
addItem
Adds a new item property- Specified by:
 addItemin interfaceDataChoice
 - 
accept
- Specified by:
 acceptin interfaceDataComponent
 
 -