Class AbstractAtom

java.lang.Object
fr.lirmm.graphik.integraal.api.core.AbstractAtom
All Implemented Interfaces:
Atom, Comparable<Atom>, Iterable<Term>
Direct Known Subclasses:
DefaultAtom

public abstract class AbstractAtom extends Object implements Atom
Base implementation of Atom backed by a predicate and ordered terms.
Author:
Clément Sipieter (INRIA) clement@6pi.fr
  • Constructor Details

    • AbstractAtom

      protected AbstractAtom()
      Creates an abstract atom base implementation.
  • Method Details

    • getConstants

      public Set<Constant> getConstants()
      Description copied from interface: Atom
      Get all constants that appear is this atom.
      Specified by:
      getConstants in interface Atom
      Returns:
      all constants that appear is this atom.
    • getVariables

      public Set<Variable> getVariables()
      Description copied from interface: Atom
      Get all variables that appear is this atom.
      Specified by:
      getVariables in interface Atom
      Returns:
      all variables that appear is this atom.
    • getLiterals

      public Set<Literal> getLiterals()
      Description copied from interface: Atom
      Get all literals that appear is this atom.
      Specified by:
      getLiterals in interface Atom
      Returns:
      all literals that appear is this atom.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Verifies if two atoms are equivalent or not.
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Atom other)
      Specified by:
      compareTo in interface Comparable<Atom>
    • toString

      public String toString()
      Returns a string in the form p(t1,...,tk)
      Overrides:
      toString in class Object
    • appendTo

      public void appendTo(StringBuilder sb)
      Appends this atom to the provided StringBuilder.
      Parameters:
      sb - the builder that receives the atom representation
    • iterator

      public Iterator<Term> iterator()
      Description copied from interface: Atom
      Return an Iterator of Term.
      Specified by:
      iterator in interface Atom
      Specified by:
      iterator in interface Iterable<Term>
      Returns:
      an iterator over the atom terms