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) Returnstrueif any of the flows in the dataset have a property 'selected' with the valueBoolean.TRUE, andfalseotherwise.static <K extends Comparable<K>>
booleanhasNodeSelections(FlowDataset<K> dataset) Returnstrueif any of the nodes in the dataset have a property 'selected' with the valueBoolean.TRUE, andfalseotherwise.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 (nullnot permitted).node- the node (nullnot 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 (nullnot permitted).source- the source node (nullnot 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 (nullnot permitted).stage- the stage.- Returns:
- The total flow.
-
hasNodeSelections
Returnstrueif any of the nodes in the dataset have a property 'selected' with the valueBoolean.TRUE, andfalseotherwise.- Type Parameters:
K- the type for the node identifiers.- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- A boolean.
-
selectedNodeCount
Returns the number of selected nodes.- Type Parameters:
K- the type for the node keys.- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- The number of selected nodes.
-
hasFlowSelections
Returnstrueif any of the flows in the dataset have a property 'selected' with the valueBoolean.TRUE, andfalseotherwise.- Type Parameters:
K- the type for the flow keys.- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- A boolean.
-