Module platform

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

public interface FlowDataset<K extends 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 Details

    • getStageCount

      int getStageCount()
      Returns the number of flow stages (never less than one).
      Returns:
      The number of flow stages.
    • getSources

      List<K> getSources(int stage)
      Returns a list of the sources at the specified stage.
      Parameters:
      stage - the stage index (0 to getStageCount() - 1).
      Returns:
      A list of the sources at the specified stage (never null).
    • getDestinations

      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 to getStageCount() - 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

      Object getNodeProperty(NodeKey<K> nodeKey, 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

      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 return null to represent an unknown value.
      Parameters:
      stage - the stage index (0 to getStageCount() - 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

      Object getFlowProperty(FlowKey<K> flowKey, 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.