Package org.jfree.data.flow
Interface FlowDataset<K extends Comparable<K>>
- Type Parameters:
K
- the type for the keys used to identify sources and destinations (instances should be immutable,String
is a good default choice).
- All Superinterfaces:
Dataset
- All Known Implementing Classes:
DefaultFlowDataset
A dataset representing value flows from a set of source nodes to a set of
destination nodes. The number of source nodes does not need to match the
number of destination nodes.
The dataset can represent flows in one or many stages. In the simple case, the flows are defined in one stage, going directly from a source node to the final destination node. In a multi-stage dataset there will be groups of intermediate nodes and the flows are defined stage-by-stage from the source to the destination.
The dataset can represent flows in one or many stages. In the simple case, the flows are defined in one stage, going directly from a source node to the final destination node. In a multi-stage dataset there will be groups of intermediate nodes and the flows are defined stage-by-stage from the source to the destination.
- Since:
- 1.5.3
-
Method Summary
Modifier and TypeMethodDescriptionReturns a set of keys for all the flows in the dataset.Returns the set of keys for all the nodes in the dataset.getDestinations
(int stage) Returns a list of the destinations at the specified stage.Returns the flow between a source node and a destination node at a specified stage.getFlowProperty
(FlowKey<K> flowKey, String propertyKey) Returns the value of a property, if specified, for the specified flow.getNodeProperty
(NodeKey<K> nodeKey, String propertyKey) Returns the value of a property, if specified, for the specified node.getSources
(int stage) Returns a list of the sources at the specified stage.int
Returns the number of flow stages (never less than one).Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Method Details
-
getStageCount
int getStageCount()Returns the number of flow stages (never less than one).- Returns:
- The number of flow stages.
-
getSources
Returns a list of the sources at the specified stage.- Parameters:
stage
- the stage index (0 togetStageCount()
- 1).- Returns:
- A list of the sources at the specified stage (never
null
).
-
getDestinations
Returns a list of the destinations at the specified stage. For a multi-stage dataset, the destinations at stage N are the same as the sources at stage N+1.- Parameters:
stage
- the stage index (0 togetStageCount()
- 1).- Returns:
- A list of the sources at the specified stage (never
null
).
-
getAllNodes
Set<NodeKey<K>> getAllNodes()Returns the set of keys for all the nodes in the dataset.- Returns:
- The set of keys for all the nodes in the dataset (possibly empty but never
null
).
-
getNodeProperty
Returns the value of a property, if specified, for the specified node.- Parameters:
nodeKey
- the node key (null
not permitted).propertyKey
- the node key (null
not permitted).- Returns:
- The property value, or
null
.
-
getFlow
Returns the flow between a source node and a destination node at a specified stage. This must be 0 or greater. The dataset can returnnull
to represent an unknown value.- Parameters:
stage
- the stage index (0 togetStageCount()
- 1).source
- the source (null
not permitted).destination
- the destination (null
not permitted).- Returns:
- The flow (zero or greater, possibly
null
).
-
getAllFlows
Set<FlowKey<K>> getAllFlows()Returns a set of keys for all the flows in the dataset.- Returns:
- A set.
-
getFlowProperty
Returns the value of a property, if specified, for the specified flow.- Parameters:
flowKey
- the flow key (null
not permitted).propertyKey
- the property key (null
not permitted).- Returns:
- The property value, or
null
.
-