|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.reasoner.rulesys.Functor
public class Functor
A functor comprises a functor name and a list of arguments. The arguments are Nodes of any type except functor nodes (there is no functor nesting). Functors play three roles in rules - in heads they represent actions (procedural attachement); in bodies they represent builtin predicates; in TriplePatterns they represent embedded structured literals that are used to cache matched subgraphs such as restriction specifications.
Nested Class Summary | |
---|---|
static class |
Functor.FunctorDatatype
Inner class. |
Field Summary | |
---|---|
static com.hp.hpl.jena.util.iterator.Filter<Triple> |
acceptFilter
A static Filter instance that detects triples with Functor objects |
Constructor Summary | |
---|---|
Functor(String name,
List<Node> args)
Constructor. |
|
Functor(String name,
List<Node> args,
BuiltinRegistry registry)
Constructor |
|
Functor(String name,
Node[] args)
Constructor. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Equality is based on structural comparison |
boolean |
evalAsBodyClause(RuleContext context)
Execute the given built in as a body clause. |
int |
getArgLength()
Return the length of the functor argument array. |
Node[] |
getArgs()
Return the functor aguments as an array of nodes |
Node[] |
getBoundArgs(BindingEnvironment env)
Return a new Node array containing the bound versions of this Functor's arguments |
Builtin |
getImplementor()
Return the Builtin that implements this functor |
String |
getName()
Return the functor name |
int |
hashCode()
hash function override |
static boolean |
isFunctor(Node n)
tests that a given Node represents a functor |
boolean |
isGround()
Returns true if the functor is fully ground, no variables |
boolean |
isGround(BindingEnvironment env)
Returns true if the functor is fully ground in the given environment |
static Node |
makeFunctorNode(Functor f)
Wrap a functor as a Literal node |
static Node |
makeFunctorNode(String name,
Node[] args)
Create a functor and wrap it up as a Literal node |
boolean |
safeEvalAsBodyClause(RuleContext context)
Execute the given built in as a body clause, only if it is side-effect-free. |
boolean |
sameAs(Object o)
Compare Functors, taking into account variable indices. |
void |
setImplementor(Builtin implementor)
Set the Builtin that implements this functor. |
String |
toString()
Printable string describing the functor |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final com.hp.hpl.jena.util.iterator.Filter<Triple> acceptFilter
Constructor Detail |
---|
public Functor(String name, List<Node> args)
name
- the name of the functorargs
- a list of nodes defining the argumentspublic Functor(String name, Node[] args)
name
- the name of the functorargs
- an array of nodes defining the arguments, this will not be copied so beware of
accidental structure sharingpublic Functor(String name, List<Node> args, BuiltinRegistry registry)
name
- the name of the functorargs
- a list of nodes defining the argumentsregistry
- a table of builtins to consult to check for
implementations of this functor when used as a rule clauseMethod Detail |
---|
public String getName()
public Node[] getArgs()
public int getArgLength()
public boolean isGround()
public boolean isGround(BindingEnvironment env)
public boolean evalAsBodyClause(RuleContext context)
context
- an execution context giving access to other relevant data
public boolean safeEvalAsBodyClause(RuleContext context)
context
- an execution context giving access to other relevant data
public Node[] getBoundArgs(BindingEnvironment env)
public Builtin getImplementor()
public void setImplementor(Builtin implementor)
public String toString()
toString
in class Object
public static boolean isFunctor(Node n)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public boolean sameAs(Object o)
sameAs
in interface ClauseEntry
public static Node makeFunctorNode(String name, Node[] args)
name
- the name of the functorargs
- an array of nodes defining the arguments, this will not be copied so beware of
accidental structure sharingpublic static Node makeFunctorNode(Functor f)
f
- the functor data structure to be wrapped in a node.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |