Package org.vast.data

Class 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 Details

  • Constructor Details

    • AbstractDataComponentImpl

      public AbstractDataComponentImpl()
  • Method Details

    • copy

      public abstract AbstractDataComponentImpl 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 interface DataComponent
      Specified by:
      copy in interface HasCopy
      Returns:
      copy of this component, including sub-components
    • copyTo

      protected void copyTo(AbstractDataComponentImpl other)
    • clone

      public AbstractDataComponentImpl clone()
      Description copied from interface: DataComponent
      Get a full recursive copy of this component. Both structure and data are copied
      Specified by:
      clone in interface DataComponent
      Overrides:
      clone in class Object
      Returns:
      clone of this component, including sub-components
    • getParent

      public final AbstractDataComponentImpl getParent()
      Specified by:
      getParent in interface DataComponent
      Returns:
      parent component of this component
    • setParent

      protected final void setParent(AbstractDataComponentImpl parent)
    • addComponent

      public abstract void addComponent(String name, DataComponent component)
      Description copied from interface: DataComponent
      Add a sub-component and registers a name for it
      Specified by:
      addComponent in interface DataComponent
      Parameters:
      name - name of component to use
      component - new sub-component to append to this component
    • getComponent

      public abstract AbstractDataComponentImpl getComponent(int index)
      Description copied from interface: DataComponent
      Get the sub-component located at the specified index
      Specified by:
      getComponent in interface DataComponent
      Parameters:
      index - index of component to lookup
      Returns:
      child component or null if none exists at the specified index
    • getComponentIndex

      public abstract int getComponentIndex(String name)
      Description copied from interface: DataComponent
      Get the index of the sub-component registered with this name
      Specified by:
      getComponentIndex in interface DataComponent
      Parameters:
      name - name of component to lookup
      Returns:
      index of child component or -1 if none exists with the specified name
    • getComponent

      public abstract AbstractDataComponentImpl getComponent(String name)
      Description copied from interface: DataComponent
      Get the sub-component registered with the specified name
      Specified by:
      getComponent in interface DataComponent
      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 interface DataComponent
      Returns:
      number of direct sub-components
    • createDataBlock

      public abstract AbstractDataBlock createDataBlock()
      Description copied from interface: DataComponent
      Create a new datablock for holding data of this component
      Specified by:
      createDataBlock in interface DataComponent
      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 interface DataComponent
    • 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 interface DataComponent
    • hasData

      public boolean hasData()
      Specified by:
      hasData in interface DataComponent
      Returns:
      true if a datablock is associated to this component
    • getData

      public DataBlock getData()
      Description copied from interface: DataComponent
      Get the datablock associated to this component
      Specified by:
      getData in interface DataComponent
      Returns:
      datablock object or null if none has been generated yet
    • setData

      public abstract void setData(DataBlock dataBlock)
      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 interface DataComponent
    • 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 interface DataComponent
    • validateData

      public abstract void validateData(List<ValidationException> errorList)
      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 interface DataComponent
      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 interface DataComponent
      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

      public abstract String toString(String indent)
      Returns String representation of this DataContainer
      Parameters:
      indent - int
      Returns:
      String
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getUpdatable

      public boolean getUpdatable()
      Gets the updatable property
      Specified by:
      getUpdatable in interface DataComponent
      Returns:
      true if component can be updated dynamically
    • isSetUpdatable

      public boolean isSetUpdatable()
      Checks if updatable is set
      Specified by:
      isSetUpdatable in interface DataComponent
      Returns:
      true if the updatable attribute is set
    • setUpdatable

      public void setUpdatable(boolean updatable)
      Sets the updatable property
      Specified by:
      setUpdatable in interface DataComponent
    • unSetUpdatable

      public void unSetUpdatable()
      Unsets the updatable property
      Specified by:
      unSetUpdatable in interface DataComponent
    • getOptional

      public boolean getOptional()
      Gets the optional property
      Specified by:
      getOptional in interface DataComponent
      Returns:
      true if component value is optional in the stream
    • isSetOptional

      public boolean isSetOptional()
      Checks if optional is set
      Specified by:
      isSetOptional in interface DataComponent
      Returns:
      true if the optional attribute is set
    • setOptional

      public void setOptional(boolean optional)
      Sets the optional property
      Specified by:
      setOptional in interface DataComponent
    • unSetOptional

      public void unSetOptional()
      Unsets the optional property
      Specified by:
      unSetOptional in interface DataComponent
    • getDefinition

      public String getDefinition()
      Gets the definition property
      Specified by:
      getDefinition in interface DataComponent
      Returns:
      definition URI
    • isSetDefinition

      public boolean isSetDefinition()
      Checks if definition is set
      Specified by:
      isSetDefinition in interface DataComponent
      Returns:
      true if the definition attribute is set
    • setDefinition

      public void setDefinition(String definition)
      Sets the definition property
      Specified by:
      setDefinition in interface DataComponent
      Parameters:
      definition - definition URI
    • getName

      public String getName()
      Specified by:
      getName in interface DataComponent
      Returns:
      name of sub-component
    • setName

      public void setName(String name)
      Description copied from interface: DataComponent
      Sets the name of this component
      Specified by:
      setName in interface DataComponent
    • getEncodingInfo

      public BinaryMember getEncodingInfo()
    • setEncodingInfo

      public void setEncodingInfo(BinaryMember encodingInfo)