Class ContainerUnit

All Implemented Interfaces:
IUnitCreator, IUserDataSupport, IUnit, IEventSource
Direct Known Subclasses:
DataContainerUnit, FileContainerUnit, LazyDataContainerUnit

@Ser public class ContainerUnit extends AbstractUnit
Container units are non-binary units used to represent tree structures.

Children can be attached to container units; it is recommended that clients handle container units as if they were file system folders (eg, displaying children should take priority over displaying container unit details).

  • Field Details

    • CONTAINERS_FIRST

      public static final Comparator<IUnit> CONTAINERS_FIRST
  • Constructor Details

  • Method Details

    • process

      public boolean process()
      Description copied from class: AbstractUnit
      The default implementation calls AbstractUnit.processInternal(), and makes sure that a status string is set on error, or nullified on success. processInternal() is never called is AbstractUnit.isProcessed() returns true.

      Plugins may decide to override this method, if they need finer control over processing (we recommend overriding processInternal(); in that case, processInternal() should be ignored.

      Specified by:
      process in interface IUnit
      Overrides:
      process in class AbstractUnit
      Returns:
      true if processing is or was successful (in the latter case, process() should do nothing but return true), or false is processing failed. The unit should also notify clients by issuing a J.UnitProcessed event. If processing succeeded, subsequent calls to IUnit.isProcessed() should return true.
    • process

      public boolean process(boolean processLeaves)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getRootContainer

      public ContainerUnit getRootContainer()
      Get the top-level container unit, within a hierarchy of containers.
      Returns:
      the first non-container parent
    • getChildren

      public List<? extends IUnit> getChildren()
      Description copied from class: AbstractUnit
      Sub-classes overriding this method must override related methods consistently.
      Specified by:
      getChildren in interface IUnit
      Overrides:
      getChildren in class AbstractUnit
      Returns:
      the children or an empty list, never null