Class PackageSorter.SortModule

java.lang.Object
org.jfree.base.modules.PackageSorter.SortModule
All Implemented Interfaces:
Comparable
Enclosing class:
PackageSorter

private static class PackageSorter.SortModule extends Object implements Comparable
An Internal wrapper class which collects additional information on the given module. Every module has a position, which is heigher than the position of all dependent modules.
  • Field Details

    • position

      private int position
      stores the relative position of the module in the global list.
    • state

      private final PackageState state
      The package state of the to be matched module.
    • dependSubsystems

      private ArrayList dependSubsystems
      A list of all directly dependent subsystems.
  • Constructor Details

    • SortModule

      public SortModule(PackageState state)
      Creates a new SortModule for the given package state.
      Parameters:
      state - the package state object, that should be wrapped up by this class.
  • Method Details

    • getDependSubsystems

      public ArrayList getDependSubsystems()
      Returns the list of all dependent subsystems. The list gets defined when the sorting is started.
      Returns:
      the list of all dependent subsystems.
    • setDependSubsystems

      public void setDependSubsystems(ArrayList dependSubsystems)
      Defines a list of dependent subsystems for this module. The list contains the names of the dependent subsystems as strings.
      Parameters:
      dependSubsystems - a list of all dependent subsystems.
    • getPosition

      public int getPosition()
      Returns the current position of this module in the global list. The position is computed by comparing all positions of all dependent subsystem modules.
      Returns:
      the current module position.
    • setPosition

      public void setPosition(int position)
      Defines the position of this module in the global list of all known modules.
      Parameters:
      position - the position.
    • getState

      public PackageState getState()
      Returns the package state contained in this SortModule.
      Returns:
      the package state of this module.
    • toString

      public String toString()
      Returns a basic string representation of this SortModule. This should be used for debugging purposes only.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this module.
      See Also:
    • compareTo

      public int compareTo(Object o)
      Compares this module against an other sort module.
      Specified by:
      compareTo in interface Comparable
      Parameters:
      o - the other sort module instance.
      Returns:
      -1 if the other's module position is less than this modules position, +1 if this module is less than the other module or 0 if both modules have an equal position in the list.
      See Also: