Class FlowDatasetUtils

java.lang.Object
org.jfree.data.flow.FlowDatasetUtils

public class FlowDatasetUtils
extends Object
Utility methods related to FlowDataset.
Since:
1.5.3
  • Method Details

    • calculateInflow

      public static <K extends Comparable<K>> double calculateInflow​(FlowDataset<K> dataset, K node, int stage)
      Returns the total inflow for the specified node (a destination node for the specified stage).
      Type Parameters:
      K - the type for the flow identifiers.
      Parameters:
      dataset - the dataset (null not permitted).
      node - the node (null not permitted).
      stage - the stage.
      Returns:
      The total inflow volume.
    • calculateOutflow

      public static <K extends Comparable<K>> double calculateOutflow​(FlowDataset<K> dataset, K source, int stage)
      Returns the total outflow for the specified node (a source node for the specified stage).
      Type Parameters:
      K - the type for the flow identifiers.
      Parameters:
      dataset - the dataset (null not permitted).
      source - the source node (null not permitted).
      stage - the stage.
      Returns:
      The total outflow volume.
    • calculateTotalFlow

      public static <K extends Comparable<K>> double calculateTotalFlow​(FlowDataset<K> dataset, int stage)
      Returns the total flow from all sources to all destinations at the specified stage.
      Type Parameters:
      K - the type for the flow identifiers.
      Parameters:
      dataset - the dataset (null not permitted).
      stage - the stage.
      Returns:
      The total flow.
    • hasNodeSelections

      public static <K extends Comparable<K>> boolean hasNodeSelections​(FlowDataset<K> dataset)
      Returns true if any of the nodes in the dataset have a property 'selected' with the value Boolean.TRUE, and false otherwise.
      Type Parameters:
      K - the type for the node identifiers.
      Parameters:
      dataset - the dataset (null not permitted).
      Returns:
      A boolean.
    • selectedNodeCount

      public static <K extends Comparable<K>> int selectedNodeCount​(FlowDataset<K> dataset)
      Returns the number of selected nodes.
      Type Parameters:
      K - the type for the node keys.
      Parameters:
      dataset - the dataset (null not permitted).
      Returns:
      The number of selected nodes.
    • hasFlowSelections

      public static <K extends Comparable<K>> boolean hasFlowSelections​(FlowDataset<K> dataset)
      Returns true if any of the flows in the dataset have a property 'selected' with the value Boolean.TRUE, and false otherwise.
      Type Parameters:
      K - the type for the flow keys.
      Parameters:
      dataset - the dataset (null not permitted).
      Returns:
      A boolean.