Package org.vast.data

Class AbstractRecordImpl<ComponentType extends DataComponent>

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 Details

  • 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 class AbstractDataComponentImpl
    • 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 class AbstractDataComponentImpl
    • getComponent

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

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

      public 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
      Specified by:
      getComponentIndex in class AbstractDataComponentImpl
      Parameters:
      name - name of component to lookup
      Returns:
      index of child component or -1 if none exists with the specified name
    • removeComponent

      public AbstractDataComponentImpl removeComponent(int index)
      Description copied from interface: DataComponent
      Remove the sub-component at the specified index
      Returns:
      the component that was just removed
    • removeComponent

      public AbstractDataComponentImpl removeComponent(String name)
      Description copied from interface: DataComponent
      Remove sub-component with the specified name
      Returns:
      the component that was just removed
    • setData

      public 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
      Specified by:
      setData in class AbstractDataComponentImpl
    • 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 interface DataComponent
      Specified by:
      clearData in class AbstractDataComponentImpl
    • validateData

      public 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
      Specified by:
      validateData in class AbstractDataComponentImpl
      Parameters:
      errorList - list to which validation exceptions will be appended
    • createDataBlock

      public AbstractDataBlock 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 interface DataComponent
      Specified by:
      createDataBlock in class AbstractDataComponentImpl
      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 interface DataComponent
      Specified by:
      getComponentCount in class AbstractDataComponentImpl
      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 interface DataComponent
      Specified by:
      hasConstraints in class AbstractDataComponentImpl
      Returns:
      true if at least one constraint is found, false otherwise