Package org.jfree.data.flow
Class FlowDatasetUtils
- java.lang.Object
-
- org.jfree.data.flow.FlowDatasetUtils
-
public class FlowDatasetUtils extends java.lang.Object
Utility methods related toFlowDataset
.- 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>>
doublecalculateInflow(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>>
doublecalculateOutflow(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>>
doublecalculateTotalFlow(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>>
booleanhasFlowSelections(FlowDataset<K> dataset)
Returnstrue
if any of the flows in the dataset have a property 'selected' with the valueBoolean.TRUE
, andfalse
otherwise.static <K extends java.lang.Comparable<K>>
booleanhasNodeSelections(FlowDataset<K> dataset)
Returnstrue
if any of the nodes in the dataset have a property 'selected' with the valueBoolean.TRUE
, andfalse
otherwise.static <K extends java.lang.Comparable<K>>
intselectedNodeCount(FlowDataset<K> dataset)
Returns the number of selected nodes.
-
-
-
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)
Returnstrue
if any of the nodes in the dataset have a property 'selected' with the valueBoolean.TRUE
, andfalse
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)
Returnstrue
if any of the flows in the dataset have a property 'selected' with the valueBoolean.TRUE
, andfalse
otherwise.- Type Parameters:
K
- the type for the flow keys.- Parameters:
dataset
- the dataset (null
not permitted).- Returns:
- A boolean.
-
-