Package org.jfree.base.modules
Class PackageSorter.SortModule
java.lang.Object
org.jfree.base.modules.PackageSorter.SortModule
- All Implemented Interfaces:
Comparable
- Enclosing class:
- PackageSorter
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 Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayList
A list of all directly dependent subsystems.private int
stores the relative position of the module in the global list.private final PackageState
The package state of the to be matched module. -
Constructor Summary
ConstructorsConstructorDescriptionSortModule
(PackageState state) Creates a new SortModule for the given package state. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares this module against an other sort module.Returns the list of all dependent subsystems.int
Returns the current position of this module in the global list.getState()
Returns the package state contained in this SortModule.void
setDependSubsystems
(ArrayList dependSubsystems) Defines a list of dependent subsystems for this module.void
setPosition
(int position) Defines the position of this module in the global list of all known modules.toString()
Returns a basic string representation of this SortModule.
-
Field Details
-
position
private int positionstores the relative position of the module in the global list. -
state
The package state of the to be matched module. -
dependSubsystems
A list of all directly dependent subsystems.
-
-
Constructor Details
-
SortModule
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
Returns the list of all dependent subsystems. The list gets defined when the sorting is started.- Returns:
- the list of all dependent subsystems.
-
setDependSubsystems
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
Returns the package state contained in this SortModule.- Returns:
- the package state of this module.
-
toString
Returns a basic string representation of this SortModule. This should be used for debugging purposes only. -
compareTo
Compares this module against an other sort module.- Specified by:
compareTo
in interfaceComparable
- 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:
-