Interface Atom
- All Superinterfaces:
Comparable<Atom>, Iterable<Term>
- All Known Implementing Classes:
AbstractAtom, DefaultAtom
This interface represents a logical atom. An atom is of the form p(e1…ek)
where p is a predicate, k >= 1 the arity of p, and each ei is a term.
- Author:
- Clément Sipieter (INRIA/CNRS) <clement@6pi.fr>
-
Method Summary
Modifier and TypeMethodDescriptionvoidAppends this object representation to the provided builder.booleanReturns true if the term list contains the specified term.Get all constants that appear is this atom.Get all literals that appear is this atom.Get the Predicate of this Atom.getTerm(int index) Get the nth term of this Atom.getTerms()Get an ordered List that represents the terms of this Atom.Deprecated.Get all variables that appear is this atom.int[]Returns the indexes of a given term in the atom.intReturns the index of the first occurrence of the specified term in the term list of this atom, or -1 if this atom does not contain the term.iterator()Return an Iterator of Term.voidsetPredicate(Predicate predicate) Set the Predicate of this Atom.voidSet the nth term of this Atom.Methods inherited from interface Comparable
compareToMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
setPredicate
Set the Predicate of this Atom.- Parameters:
predicate- the predicate to assign
-
getPredicate
-
setTerm
Set the nth term of this Atom. The first index is 0.- Parameters:
index- the position to updateterm- the term to store at the given position
-
getTerm
Get the nth term of this Atom. The first index is 0.- Parameters:
index- the position to read- Returns:
- the nth term of this Atom.
-
indexOf
Returns the index of the first occurrence of the specified term in the term list of this atom, or -1 if this atom does not contain the term.- Parameters:
t- term to search for- Returns:
- the index of the first occurrence of the specified term.
-
indexesOf
Returns the indexes of a given term in the atom.- Parameters:
term- the term to search for- Returns:
- the indexes at which the term occurs
-
contains
Returns true if the term list contains the specified term.- Parameters:
t- the term to search for- Returns:
- true if the term list contains the specified term, false otherwise.
-
getTerms
-
getTerms
Deprecated.This method is deprecated since 1.3, usegetConstants()andgetVariables()instead.
Get all Term of the specified type.- Parameters:
type- the term type to filter on- Returns:
- all Term of the specified type.
-
getVariables
-
getConstants
-
getLiterals
-
iterator
-
appendTo
Appends this object representation to the provided builder.- Parameters:
sb- the target builder
-