uk.ed.inf.graph.colour
Interface IEdgeColourHandler<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>

Type Parameters:
N - the graph node, which must implement the interface IBasicNode.
E - the graph edge, which must implement the interface IBasicEdge.

public interface IEdgeColourHandler<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>

Implementers of this interface will provide a handler class for an object that provides the colour to a edge. The colour being one or more properties that are associated with the graph edge. The handler facilitates the storage of the colour and can be copied and perform the copying of the colour object itself. The handler is required because a colour can be of any type and each edge in a graph can potentially have a different colour type. Implementers of this interface provides a mechanism handle diverse colour object types. Another important issue handles here is the copy of a edge's colour when the edge is copied. Depending of the usage of the graph or edge, the colour value may or may not be copied. The decision to copy can be application dependent and so the supplier of the implementation of this interface can use the copyObject(newNode) method to control this behaviour. The newNode parameter provides the method with information about the edge to be copied to and as a consequence the graph it belongs to and it;s topology. Any of these may be important in deciding if or how to copy the colour value.

Author:
smoodie

Method Summary
 java.lang.Object copyColour(E newEdge)
          Copy the colour object.
 IEdgeColourHandler<N,E> createCopy()
          Create a copy of this colour handler.
 java.lang.Object getColour()
          Get the colour value.
 E getEdge()
          Gets the edge that ones this colour handler.
 void setColour(java.lang.Object colour)
          Set the colour value.
 void setEdge(E edge)
          Sets the edge that will own this handler and the associated colour value.
 

Method Detail

setColour

void setColour(java.lang.Object colour)
Set the colour value.

Parameters:
colour - The colour value to set.

getColour

java.lang.Object getColour()
Get the colour value.

Returns:
the colour instance.

createCopy

IEdgeColourHandler<N,E> createCopy()
Create a copy of this colour handler. This should not copy the object value, which should be left as null or the default value.

Returns:
a new instance of the copy handler.

copyColour

java.lang.Object copyColour(E newEdge)
Copy the colour object. The new edge to copied to is provided to enable the copy method to decide how to copy the object based on the newNode. For example if the newNode belongs to another Graph then the a deep copy of the object may be performed.

Parameters:
newNode - The new edge the colour will be copied to.
Returns:
The copied object.

getEdge

E getEdge()
Gets the edge that ones this colour handler.

Returns:
the owning edge. Can be null.

setEdge

void setEdge(E edge)
Sets the edge that will own this handler and the associated colour value.

Parameters:
edge - The edge that will own this instance. Can be null.