org.grinvin.invariants

Class AbstractInvariant

Implemented Interfaces:
Expression, Invariant, InvariantExpressionNode, InvariantNode

public abstract class AbstractInvariant
extends java.lang.Object
implements InvariantExpressionNode

Abstract implementation of an Invariant.

Method Summary

abstract @Override
String toString()
Return the localized name of the invariant.
void
accept(Expression.Visitor visitor)
Accept a visitor on this node.
void
accept(InvariantNode.Visitor visitor)
@Override
boolean equals(Object obj)
Two invariants are equal if and only if their identifiers are the same.
abstract Class
extends InvariantValue> getType()
Returns the class to which all values of this invariant belong.
Iterable
getChildren()
Returns null.
abstract String
getId()
Universally unique identifier for this invariant.
abstract String
getName()
Returns the localized name of the invariant.
@Override
int hashCode()
The hash value of an invariant is the hash value of its identifier.

Method Details

String toString

public abstract @Override String toString()
Return the localized name of the invariant.

accept

public void accept(Expression.Visitor visitor)
Accept a visitor on this node.
Specified by:
accept in interface Expression

accept

public void accept(InvariantNode.Visitor visitor)
Specified by:
accept in interface InvariantNode

boolean equals

public @Override boolean equals(Object obj)
Two invariants are equal if and only if their identifiers are the same.

extends InvariantValue> getType

public abstract Class getType()
Specified by:
extends InvariantValue> getType in interface Invariant

getChildren

public Iterable getChildren()
Returns null. An invariant cannot have other invariant nodes as children.
Specified by:
getChildren in interface InvariantNode

getId

public abstract String getId()
Universally unique identifier for this invariant.
Specified by:
getId in interface Invariant

getName

public abstract String getName()
Returns the localized name of the invariant.
Specified by:
getName in interface Invariant
getName in interface InvariantNode

int hashCode

public @Override int hashCode()
The hash value of an invariant is the hash value of its identifier.