cage
Class SingleElementRule

java.lang.Object
  extended by cage.SingleElementRule
All Implemented Interfaces:
ElementRule

public class SingleElementRule
extends java.lang.Object
implements ElementRule

An implementation of ElementRule that always returns the same element.


Constructor Summary
SingleElementRule(java.lang.String element)
          Create a new SingleElementRule object that always returns element.
 
Method Summary
 java.lang.String getElement(EmbeddableGraph graph, int vertex)
          Returns the chemical symbol of the chemical element of the atom which will always be the element set on construction of this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleElementRule

public SingleElementRule(java.lang.String element)
Create a new SingleElementRule object that always returns element.

Parameters:
element - The element which this rule should return.
Method Detail

getElement

public java.lang.String getElement(EmbeddableGraph graph,
                                   int vertex)
Returns the chemical symbol of the chemical element of the atom which will always be the element set on construction of this rule.

Specified by:
getElement in interface ElementRule
Parameters:
graph - The graph that contains the vertex
vertex - The vertex for which the element is requested
Returns:
The symbol of the element of vertex