public class Functor extends Object implements ClauseEntry
Modifier and Type | Class and Description |
---|---|
static class |
Functor.FunctorDatatype
Inner class.
|
Modifier and Type | Field and Description |
---|---|
static com.hp.hpl.jena.util.iterator.Filter<Triple> |
acceptFilter
A static Filter instance that detects triples with Functor objects
|
Constructor and Description |
---|
Functor(String name,
List<Node> args)
Constructor.
|
Functor(String name,
List<Node> args,
BuiltinRegistry registry)
Constructor
|
Functor(String name,
Node[] args)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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
|
public static final com.hp.hpl.jena.util.iterator.Filter<Triple> acceptFilter
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 clausepublic 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 datapublic boolean safeEvalAsBodyClause(RuleContext context)
context
- an execution context giving access to other relevant datapublic Node[] getBoundArgs(BindingEnvironment env)
public Builtin getImplementor()
public void setImplementor(Builtin implementor)
public String toString()
public static boolean isFunctor(Node n)
public boolean equals(Object obj)
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 sharingLicenced under the Apache License, Version 2.0