jcommon.graph
Interface ITopologicalSortInput<TValue,TProcessedValue>

Type Parameters:
TValue - An instance of an Object that can be retrieved.
All Known Implementing Classes:
TopologicalSortInput

public interface ITopologicalSortInput<TValue,TProcessedValue>

Aggregates the output of out neighbor vertices as input to a vertex being processed.


Method Summary
 boolean contains(TValue value)
          Returns a boolean indicating if the input contains a key for the provided vertex value.
 TProcessedValue first()
          Retrieves the value of the first provided input.
 TProcessedValue get(TValue value)
          Gets the output of an out neighbor vertex value.
 Iterable<TProcessedValue> inputs()
          Generates an instance of Iterable that allows traversing the contents of the input.
 boolean isEmpty()
          Determines if the input is empty.
 boolean isStart()
          Indicates if this is a starting vertex (one with an in-degree of zero) we're processing.
 int size()
          The size of the ITopologicalSortInput.
 Set<TValue> values()
          Returns the set of vertex values that generated the input.
 

Method Detail

isStart

boolean isStart()
Indicates if this is a starting vertex (one with an in-degree of zero) we're processing.

Returns:
true if this represents a starting vertex (one with an in-degree of zero).

isEmpty

boolean isEmpty()
Determines if the input is empty.

Returns:
true if the input is empty; false otherwise.

get

TProcessedValue get(TValue value)
Gets the output of an out neighbor vertex value.

Parameters:
value - The value whose output is desired.
Returns:
The output of an out neighbor vertex.

first

TProcessedValue first()
Retrieves the value of the first provided input. If there is more than one input, this method is not guaranteed to provide the same answer with every invocation. If there is more than one result, you should use the get(Object) method.

Returns:
The value of the first provided input. null if there are no values in the input list.

size

int size()
The size of the ITopologicalSortInput. This is the same as the number of in-degree vertices in the IAdjacencyList.

Returns:
An int representing the size of the ITopologicalSortInput.

contains

boolean contains(TValue value)
Returns a boolean indicating if the input contains a key for the provided vertex value.

Parameters:
value - The vertex value for whom membership will be tested.
Returns:
true if the provided vertex instance is a member of the input; false otherwise.

inputs

Iterable<TProcessedValue> inputs()
Generates an instance of Iterable that allows traversing the contents of the input.

Returns:
An instance of Iterable for traversing the contents of the input.

values

Set<TValue> values()
Returns the set of vertex values that generated the input.

Returns:
A Set containing the set of vertex values that generated the input.


Copyright © 2012-2013. All Rights Reserved.