Class FlowDatasetUtils


  • public class FlowDatasetUtils
    extends java.lang.Object
    Utility methods related to FlowDataset.
    Since:
    1.5.3
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FlowDatasetUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K extends java.lang.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).
      static <K extends java.lang.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).
      static <K extends java.lang.Comparable<K>>
      double
      calculateTotalFlow​(FlowDataset<K> dataset, int stage)
      Returns the total flow from all sources to all destinations at the specified stage.
      static <K extends java.lang.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.
      static <K extends java.lang.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.
      static <K extends java.lang.Comparable<K>>
      int
      selectedNodeCount​(FlowDataset<K> dataset)
      Returns the number of selected nodes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlowDatasetUtils

        private FlowDatasetUtils()
    • Method Detail

      • calculateInflow

        public static <K extends java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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.