Package org.jfree.data.flow
Class FlowDatasetUtils
java.lang.Object
org.jfree.data.flow.FlowDatasetUtils
Utility methods related to
FlowDataset
.- Since:
- 1.5.3
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K extends 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 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 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 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 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 Comparable<K>>
intselectedNodeCount
(FlowDataset<K> dataset) Returns the number of selected nodes.
-
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
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
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
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.
-