public abstract class AbstractClause extends Object implements PrologClause
PrologClause
interface.Modifier and Type | Field and Description |
---|---|
protected PrologProvider |
provider |
Modifier | Constructor and Description |
---|---|
protected |
AbstractClause(PrologProvider provider,
PrologTerm head,
boolean dynamic,
boolean multifile,
boolean discontiguous)
Create a new fact clause.
|
protected |
AbstractClause(PrologProvider provider,
PrologTerm head,
PrologTerm body,
boolean dynamic,
boolean multifile,
boolean discontiguous)
Create a new rule clause.
|
Modifier and Type | Method and Description |
---|---|
<T extends PrologClause> |
cast()
Casts the current PrologClause to the class or interface represented by this
Class object. |
boolean |
equals(Object obj) |
PrologTerm |
getArgument(int index)
Term located at some given index position in the clause head arguments.
|
PrologTerm[] |
getArguments()
Term arguments present in the clause head.
|
int |
getArity()
Integer number that represent the arguments number in the clause head.
|
String |
getAuthor()
Get the author tag in doc comment
|
PrologTerm |
getBody()
Prolog term that represent the clause body.
|
PrologTerm[] |
getBodyArray()
Get the clause body as terms array.
|
Iterator<PrologTerm> |
getBodyIterator()
Iterator to iterate over all body terms.
|
String |
getDescription()
Get the description tag in doc comment
|
String |
getFunctor()
String that represent the functor in the clause head.
|
PrologTerm |
getHead()
Prolog term that represent the clause head.
|
String |
getIndicator()
Clause family functor/arity based indicator.
|
PrologIndicator |
getPrologIndicator()
Clause family PrologIndicator based indicator.
|
String |
getSee()
Get the see tag in doc comment
|
String |
getSince()
Get the since tag in doc comment
|
PrologTerm |
getTerm()
Prolog term representation of the current clause.
|
String |
getVersion()
Get the version tag in doc comment
|
boolean |
hasAuthor()
Check if exist author tag in doc comment
|
boolean |
hasDescription()
Check if exist description tag in doc comment
|
boolean |
hasDocumentation()
Check if exist at least one tag like documentation comment
|
int |
hashCode() |
boolean |
hasIndicator(String functor,
int arity)
Check if the current clause have functor/arity based indicator specified by
arguments, false in otherwise.
|
boolean |
hasSee()
Check if exist see tag in doc comment
|
boolean |
hasSince()
Check if exist since tag in doc comment
|
boolean |
hasVersion()
Check if exist version tag in doc comment
|
boolean |
isClause()
True if this element is a clause
|
boolean |
isDirective()
True if this clause is a directive, false in other case.
|
boolean |
isDiscontiguous()
True if this clause is a discontiguos, false in other case
|
boolean |
isDynamic()
True if this clause is a dynamic, false in other case
|
boolean |
isFact()
True if this clause is a fact, false in other case.
|
boolean |
isFunction()
True if this clause is a function, false in other case.
|
boolean |
isMethod()
True if this clause is a rule, false in other case.
|
boolean |
isMultifile()
True if this clause is a multifile, false in other case
|
boolean |
isRule()
True if this clause is a rule, false in other case.
|
boolean |
isTerm()
True if this term is a term
|
void |
setAuthor(String author)
Set the author tag in doc comment
|
void |
setDescription(String description)
Set the description tag in doc comment
|
void |
setSee(String see)
Set the see tag in doc comment
|
void |
setSince(String since)
Set the since tag in doc comment
|
void |
setVersion(String version)
Set the version tag in doc comment
|
String |
toString() |
boolean |
unify(PrologClause clause)
Check that two clauses unify.
|
protected final PrologProvider provider
protected AbstractClause(PrologProvider provider, PrologTerm head, boolean dynamic, boolean multifile, boolean discontiguous)
provider
- prolog providerhead
- clause headdynamic
- true if clause is dynamic, false otherwisemultifile
- true if clause is multifile, false otherwisediscontiguous
- true if clause is discontiguous, false otherwiseprotected AbstractClause(PrologProvider provider, PrologTerm head, PrologTerm body, boolean dynamic, boolean multifile, boolean discontiguous)
provider
- prolog providerhead
- clause headbody
- clause bodydynamic
- true if clause is dynamic, false otherwisemultifile
- true if clause is multifile, false otherwisediscontiguous
- true if clause is discontiguous, false otherwisepublic PrologTerm getTerm()
PrologClause
getTerm
in interface PrologClause
public final PrologTerm getHead()
PrologClause
getHead
in interface PrologClause
public final PrologTerm getBody()
PrologClause
getBody
in interface PrologClause
public final PrologTerm[] getBodyArray()
PrologClause
getBodyArray
in interface PrologClause
public final Iterator<PrologTerm> getBodyIterator()
PrologClause
getBodyIterator
in interface PrologClause
public final String getFunctor()
PrologClause
getHead().getFunctor()
.getFunctor
in interface PrologClause
public final int getArity()
PrologClause
getHead().getArity()
.getArity
in interface PrologClause
public PrologTerm[] getArguments()
PrologClause
getArguments
in interface PrologClause
public PrologTerm getArgument(int index)
PrologClause
getArgument
in interface PrologClause
index
- position to retrieve the correspondent term.public final boolean hasIndicator(String functor, int arity)
PrologClause
hasIndicator
in interface PrologClause
functor
- clause functor to be checkedarity
- clause arity to be checkedpublic final String getIndicator()
PrologClause
getIndicator
in interface PrologClause
public final boolean isDirective()
PrologClause
getHead()==null && getBody()!=null
.isDirective
in interface PrologClause
public final boolean isFact()
PrologClause
getHead()!=null && getBody()==null
.isFact
in interface PrologClause
public final boolean isRule()
PrologClause
getHead()!=null && getBody()!=null
.isRule
in interface PrologClause
public boolean isMethod()
PrologClause
getHead()!=null && getBody()!=null
.isMethod
in interface PrologClause
public boolean isFunction()
PrologClause
getHead()!=null && getBody()!=null
.isFunction
in interface PrologClause
public final boolean isClause()
PrologElement
isClause
in interface PrologElement
public final boolean isTerm()
PrologElement
isTerm
in interface PrologElement
public final boolean unify(PrologClause clause)
PrologClause
unify
in interface PrologClause
clause
- the clause to unify with the current clausepublic final boolean isDynamic()
PrologClause
isDynamic
in interface PrologClause
public final boolean isMultifile()
PrologClause
isMultifile
in interface PrologClause
public final boolean isDiscontiguous()
PrologClause
isDiscontiguous
in interface PrologClause
public PrologIndicator getPrologIndicator()
PrologClause
getPrologIndicator
in interface PrologClause
public final <T extends PrologClause> T cast()
PrologClause
Class
object.cast
in interface PrologClause
public final String getSee()
PrologDocumentable
getSee
in interface PrologDocumentable
public final void setSee(String see)
PrologDocumentable
setSee
in interface PrologDocumentable
see
- see for this doc objectpublic final String getSince()
PrologDocumentable
getSince
in interface PrologDocumentable
public final void setSince(String since)
PrologDocumentable
setSince
in interface PrologDocumentable
since
- since for this doc objectpublic final String getAuthor()
PrologDocumentable
getAuthor
in interface PrologDocumentable
public final void setAuthor(String author)
PrologDocumentable
setAuthor
in interface PrologDocumentable
author
- author for this doc objectpublic final String getVersion()
PrologDocumentable
getVersion
in interface PrologDocumentable
public final void setVersion(String version)
PrologDocumentable
setVersion
in interface PrologDocumentable
version
- version for this doc objectpublic final String getDescription()
PrologDocumentable
getDescription
in interface PrologDocumentable
public final void setDescription(String description)
PrologDocumentable
setDescription
in interface PrologDocumentable
description
- description for this doc objectpublic final boolean hasDescription()
PrologDocumentable
hasDescription
in interface PrologDocumentable
public final boolean hasVersion()
PrologDocumentable
hasVersion
in interface PrologDocumentable
public final boolean hasAuthor()
PrologDocumentable
hasAuthor
in interface PrologDocumentable
public final boolean hasSince()
PrologDocumentable
hasSince
in interface PrologDocumentable
public final boolean hasSee()
PrologDocumentable
hasSee
in interface PrologDocumentable
public final boolean hasDocumentation()
PrologDocumentable
hasDocumentation
in interface PrologDocumentable
Copyright © 2020–2024 Prolobjectlink Project. All rights reserved.