br.usp.ime.klava.segmentit.util
Class HierarchyState

java.lang.Object
  extended by br.usp.ime.klava.segmentit.util.HierarchyState

public class HierarchyState
extends java.lang.Object

Stores the state of a BasinsHierarchy for undo/redo purposes.

Author:
Bruno Klava

Nested Class Summary
static class HierarchyState.Type
          Represents the type of a hierarchy state.
 
Constructor Summary
HierarchyState(HierarchyCriterion hierarchyCriterion)
          State representing a hierarchy constructed using the hierarchyCriterion and with the hierarchy root selected (only one ROI).
HierarchyState(int[] labels, HierarchyCriterion hierarchyCriterion)
          State representing a hierarchy constructed using the hierarchyCriterion and that contains the partition derived from labels.
HierarchyState(int threshold, HierarchyCriterion hierarchyCriterion)
          State representing a hierarchy constructed using the hierarchyCriterion and with a partition selected by the given threshold.
 
Method Summary
 HierarchyCriterion getHierarchyCriterion()
          Returns the criterion from with the hierarchy was derived.
 int[] getLabels()
          Returns a labeling function that determines the selected partition.
 int getThreshold()
          Returns the threshold used to select a partition from the hierarchy.
 HierarchyState.Type getType()
          Return the type of this state.
 java.lang.String toString()
          Returns a string representation of this state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HierarchyState

public HierarchyState(HierarchyCriterion hierarchyCriterion)
State representing a hierarchy constructed using the hierarchyCriterion and with the hierarchy root selected (only one ROI).

Parameters:
hierarchyCriterion - the criterion from with the hierarchy was derived

HierarchyState

public HierarchyState(int threshold,
                      HierarchyCriterion hierarchyCriterion)
State representing a hierarchy constructed using the hierarchyCriterion and with a partition selected by the given threshold.

Parameters:
threshold - the threshold used to select a partition from the hierarchy
hierarchyCriterion - the criterion from with the hierarchy was derived

HierarchyState

public HierarchyState(int[] labels,
                      HierarchyCriterion hierarchyCriterion)
State representing a hierarchy constructed using the hierarchyCriterion and that contains the partition derived from labels.

Parameters:
labels - a labeling function that determines a partition
hierarchyCriterion - the criterion from with the hierarchy was derived
Method Detail

getType

public HierarchyState.Type getType()
Return the type of this state.

Returns:
the type of this state

getHierarchyCriterion

public HierarchyCriterion getHierarchyCriterion()
Returns the criterion from with the hierarchy was derived.

Returns:
the criterion from with the hierarchy was derived

getThreshold

public int getThreshold()
Returns the threshold used to select a partition from the hierarchy.

Returns:
the threshold used to select a partition from the hierarchy

getLabels

public int[] getLabels()
Returns a labeling function that determines the selected partition.

Returns:
a labeling function that determines the selected partition

toString

public java.lang.String toString()
Returns a string representation of this state.

Overrides:
toString in class java.lang.Object