jcommon.graph
Interface ITopologicalSortInput<TValue>

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

public interface ITopologicalSortInput<TValue>

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


Method Summary
 boolean containsVertex(IVertex vertex)
          Returns a boolean indicating if the input contains a key for the provided vertex.
 TValue first()
          Retrieves the value of the first provided input.
 TValue get(IVertex vertex)
          Gets the output of an out neighbor vertex.
 Iterable<TValue> 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<IVertex> vertices()
          Returns the set of vertices 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

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

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

first

TValue first()
Retrieves the value of the first provided input. If there is more than one input vertex, 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(IVertex) 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.

containsVertex

boolean containsVertex(IVertex vertex)
Returns a boolean indicating if the input contains a key for the provided vertex.

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

inputs

Iterable<TValue> 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.

vertices

Set<IVertex> vertices()
Returns the set of vertices that generated the input.

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


Copyright © 2012-2013. All Rights Reserved.