Class AbstractCompoundTerm

java.lang.Object
com.parctechnologies.eclipse.AbstractCompoundTerm
All Implemented Interfaces:
CompoundTerm
Direct Known Subclasses:
Atom, CompoundTermImpl

public abstract class AbstractCompoundTerm extends Object implements CompoundTerm
A useful superclass for objects implementing the CompoundTerm interface.

Subclass AbstractCompoundTerm if you are creating a class which implements CompoundTerm. This abstract class provides some of the methods required.

See Also:
  • Constructor Details

    • AbstractCompoundTerm

      public AbstractCompoundTerm(String functor, int arity)
      Construct an AbstractCompoundTerm with a given functor and arity.
  • Method Details

    • functor

      public String functor()
      Returns the functor.
      Specified by:
      functor in interface CompoundTerm
    • arity

      public int arity()
      Return the arity.
      Specified by:
      arity in interface CompoundTerm
    • equals

      public boolean equals(Object obj)
      Overrides equals() in java.lang.Object. Returns true iff the parameter Object implements CompoundTerm and its functor and arity are equal to this object's and pairwise invocations of equals() return true between each of this object's arguments and the corresponding argument of the parameter object.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object