Package org.jfree.data.flow
Interface FlowDataset<K extends java.lang.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
public interface FlowDataset<K extends java.lang.Comparable<K>> extends Dataset
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.- Since:
- 1.5.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<FlowKey<K>>
getAllFlows()
Returns a set of keys for all the flows in the dataset.java.util.Set<NodeKey<K>>
getAllNodes()
Returns the set of keys for all the nodes in the dataset.java.util.List<K>
getDestinations(int stage)
Returns a list of the destinations at the specified stage.java.lang.Number
getFlow(int stage, K source, K destination)
Returns the flow between a source node and a destination node at a specified stage.java.lang.Object
getFlowProperty(FlowKey<K> flowKey, java.lang.String propertyKey)
Returns the value of a property, if specified, for the specified flow.java.lang.Object
getNodeProperty(NodeKey<K> nodeKey, java.lang.String propertyKey)
Returns the value of a property, if specified, for the specified node.java.util.List<K>
getSources(int stage)
Returns a list of the sources at the specified stage.int
getStageCount()
Returns the number of flow stages (never less than one).-
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
-
-
-
Method Detail
-
getStageCount
int getStageCount()
Returns the number of flow stages (never less than one).- Returns:
- The number of flow stages.
-
getSources
java.util.List<K> getSources(int stage)
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
java.util.List<K> getDestinations(int stage)
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
java.util.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
java.lang.Object getNodeProperty(NodeKey<K> nodeKey, java.lang.String propertyKey)
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
java.lang.Number getFlow(int stage, K source, K destination)
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
java.util.Set<FlowKey<K>> getAllFlows()
Returns a set of keys for all the flows in the dataset.- Returns:
- A set.
-
getFlowProperty
java.lang.Object getFlowProperty(FlowKey<K> flowKey, java.lang.String propertyKey)
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
.
-
-