jcommon.graph.impl
Class TopologicalSortInput<TVertex extends IVertex>

java.lang.Object
  extended by jcommon.graph.impl.TopologicalSortInput<TVertex>
All Implemented Interfaces:
ITopologicalSortInput<TVertex>

public class TopologicalSortInput<TVertex extends IVertex>
extends Object
implements ITopologicalSortInput<TVertex>

See Also:
ITopologicalSortInput

Constructor Summary
TopologicalSortInput(Map<TVertex,Object> inputs)
          Instantiates a new instance of TopologicalSortInput.
 
Method Summary
 boolean containsVertex(TVertex vertex)
          Returns a boolean indicating if the input contains a key for the provided vertex.
 Object get(TVertex vertex)
          Gets the output of an out neighbor vertex.
 Object[] getInputs()
          Generates an array of the in-degree neighbor outputs as inputs for a vertex being processed.
 Iterable<Object> inputs()
          Generates an instance of Iterable that allows traversing the contents of the input.
 boolean isEmpty()
          Determines if the input is empty.
 int size()
          The size of the ITopologicalSortInput.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TopologicalSortInput

public TopologicalSortInput(Map<TVertex,Object> inputs)
Instantiates a new instance of TopologicalSortInput.

Parameters:
inputs - An instance of a Map that maps between a IVertex and the output from processing it.
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: ITopologicalSortInput
Determines if the input is empty.

Specified by:
isEmpty in interface ITopologicalSortInput<TVertex extends IVertex>
Returns:
true if the input is empty; false otherwise.
See Also:
ITopologicalSortInput.isEmpty()

get

public Object get(TVertex vertex)
Description copied from interface: ITopologicalSortInput
Gets the output of an out neighbor vertex.

Specified by:
get in interface ITopologicalSortInput<TVertex extends IVertex>
Parameters:
vertex - The vertex whose output is desired.
See Also:
ITopologicalSortInput.get(IVertex)

size

public int size()
Description copied from interface: ITopologicalSortInput
The size of the ITopologicalSortInput. This is the same as the number of in-degree vertices in the IAdjacencyList.

Specified by:
size in interface ITopologicalSortInput<TVertex extends IVertex>
Returns:
An int representing the size of the ITopologicalSortInput.
See Also:
ITopologicalSortInput.size()

containsVertex

public boolean containsVertex(TVertex vertex)
Description copied from interface: ITopologicalSortInput
Returns a boolean indicating if the input contains a key for the provided vertex.

Specified by:
containsVertex in interface ITopologicalSortInput<TVertex extends IVertex>
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.
See Also:
ITopologicalSortInput.containsVertex(IVertex)

inputs

public Iterable<Object> inputs()
Description copied from interface: ITopologicalSortInput
Generates an instance of Iterable that allows traversing the contents of the input.

Specified by:
inputs in interface ITopologicalSortInput<TVertex extends IVertex>
Returns:
An instance of Iterable for traversing the contents of the input.
See Also:
ITopologicalSortInput.inputs()

getInputs

public Object[] getInputs()
Description copied from interface: ITopologicalSortInput
Generates an array of the in-degree neighbor outputs as inputs for a vertex being processed.

Specified by:
getInputs in interface ITopologicalSortInput<TVertex extends IVertex>
Returns:
An array of the in-degree neighbor outputs as inputs for a vertex being processed.
See Also:
ITopologicalSortInput.getInputs()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2013. All Rights Reserved.