Skip to content
Permalink
Browse files
Filled some javadocs, no functional modifications
  • Loading branch information
marcosperanza committed Jul 12, 2012
1 parent 4be2106 commit 4593a24d7cb0d17c2cac9ebd24d56f90ae45f8f9
Showing 8 changed files with 114 additions and 4 deletions.
@@ -21,10 +21,21 @@

import java.io.Serializable;

/**
* TODO Fill the java doc
*
* @param <I> the input type
* @param <O> the output type
*/
public interface Mapper<I, O>
extends Serializable
{

/**
* TODO Fill the java doc
* @param input
* @return
*/
O map( I input );

}
@@ -21,12 +21,21 @@

import static org.apache.commons.graph.utils.Assertions.checkState;

/**
* TODO fill me!!
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
*/
public abstract class AbstractGraphConnection<V, E>
implements GraphConnection<V, E>
{

private GraphConnector<V, E> connector;

/**
* {@inheritDoc}
*/
public final void connect( GraphConnector<V, E> connector )
{
checkState( this.connector == null, "Re-entry not allowed!" );
@@ -42,16 +51,31 @@ public final void connect( GraphConnector<V, E> connector )
}
}

/**
* Adds a new vertex to graph connector.
*
* @param node the vertex to add
* @return the vertex added
*/
protected final <N extends V> N addVertex( N node )
{
return connector.addVertex( node );
}

/**
* Adds a new edge to graph connector.
*
* @param arc the edge to add.
* @return the {@link HeadVertexConnector}
*/
protected final <A extends E> HeadVertexConnector<V, E> addEdge( A arc )
{
return connector.addEdge( arc );
}

/**
* Connets the graph
*/
public abstract void connect();

}
@@ -23,17 +23,32 @@

import org.apache.commons.graph.MutableGraph;

/**
* TODO Fillme!!
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
* @param <G> the Graph type
*/
public final class DefaultLinkedConnectionBuilder<V, E, G extends MutableGraph<V, E>>
implements LinkedConnectionBuilder<V, E, G>
{

private final G graph;

/**
* Creates a new {@link DefaultLinkedConnectionBuilder} for the graph.
*
* @param graph the graph
*/
public DefaultLinkedConnectionBuilder( G graph )
{
this.graph = graph;
}

/**
* {@inheritDoc}
*/
public G withConnections( GraphConnection<V, E> graphConnection )
{
graphConnection = checkNotNull( graphConnection, "Input graph cannot be configured with null connections" );
@@ -19,10 +19,19 @@
* under the License.
*/


/**
* TODO Fillme!!!
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
*/
public interface GraphConnection<V, E>
{

/**
* TODO Fillme!!
* @param grapher
*/
void connect( GraphConnector<V, E> grapher );

}
@@ -19,12 +19,29 @@
* under the License.
*/


/**
* TODO Fillme!!
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
*/
public interface GraphConnector<V, E>
{

/**
* Adds a new vertex to graph.
*
* @param node the vertex to add
* @return the vertex added
*/
<N extends V> N addVertex( N node );

/**
* Adds a new edge to graph.
*
* @param arc the edge to add.
* @return the {@link HeadVertexConnector}
*/
<A extends E> HeadVertexConnector<V, E> addEdge( A arc );

}
@@ -20,9 +20,21 @@
*/


/**
* TODO Fillme!!!
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
*/
public interface HeadVertexConnector<V, E>
{

/**
* Specifies the head vertex for the edge
*
* @param head the head vertex
* @return {@link TailVertexConnector} builded from the head
*/
<H extends V> TailVertexConnector<V, E> from( H head );

}
@@ -21,9 +21,22 @@

import org.apache.commons.graph.MutableGraph;

/**
* TODO Fillme!!!
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
* @param <G> the Graph type
*/
public interface LinkedConnectionBuilder<V, E, G extends MutableGraph<V, E>>
{

/**
* Connects the graph.
*
* @param graphConnection the {@link GraphConnection}
* @return the {@link org.apache.commons.graph.Graph} built from the connections.
*/
G withConnections( GraphConnection<V, E> graphConnection );

}
@@ -19,10 +19,19 @@
* under the License.
*/


/**
* TODO Fillme!!!
*
* @param <V> the Graph vertices type
* @param <E> the Graph edges type
*/
public interface TailVertexConnector<V, E>
{


/**
* Specifies the tail vertex for the edge
* @param tail the tail vertex
*/
<T extends V> void to( T tail );

}

0 comments on commit 4593a24

Please sign in to comment.