org.grinvin.invariants

Interface InvariantComputer

Known Implementing Classes:
AbstractInvariantCComputer, AbstractInvariantComputer, AbstractInvariantComputerFactory.Computer<T,extends,InvariantValue>

public interface InvariantComputer

Implemented by all invariant computers. Every invariant computer provides a means of computing the value of one specific invariant for any graph we care to hand it.

Invariant computers are uniquely idenitified by a string identifier and a version string.

Method Summary

InvariantValue
compute(GraphBundleView bundle)
Compute the value of the associated invariant for the given graph.
String
getId()
Return the universally unique identifier for this object.
String
getInvariantId()
Returns the identifier for the invariant computed by this object.
String
getVersion()
Return the version of this computer.

Method Details

compute

public InvariantValue compute(GraphBundleView bundle)
            throws Exception
Compute the value of the associated invariant for the given graph. Multiple parallel calls of this method for different graphs might occur and must not return incorrect results.
Parameters:
bundle - represents the graph for which the invariant must be computed.
Returns:
the value of the invariant encapsulated in an invariant value of the correct type, i.e., the type associated with the invariant.

getId

public String getId()
Return the universally unique identifier for this object. For most invariant computers this is the fully qualified class name of the implementation class.
Returns:
the unique string that identifies this InvariantComputer

getInvariantId

public String getInvariantId()
Returns the identifier for the invariant computed by this object.

getVersion

public String getVersion()
Return the version of this computer.
Returns:
the version of this InvariantComputer