com.hp.hpl.jena.graph.query
Class Expression.Base

java.lang.Object
  extended by com.hp.hpl.jena.graph.query.Expression.Base
All Implemented Interfaces:
Expression
Direct Known Subclasses:
Expression.Application, Expression.BoolConstant, Expression.Constant, Expression.Variable
Enclosing interface:
Expression

public abstract static class Expression.Base
extends Object
implements Expression

An abstract base class for Expressions; over-ride as appropriate. The sub-classes may be more useful.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.hp.hpl.jena.graph.query.Expression
Expression.Application, Expression.Base, Expression.BoolConstant, Expression.Constant, Expression.Fixed, Expression.Util, Expression.Valof, Expression.Variable
 
Field Summary
 
Fields inherited from interface com.hp.hpl.jena.graph.query.Expression
FALSE, TRUE
 
Constructor Summary
Expression.Base()
           
 
Method Summary
 int argCount()
          If this Expression is an application, answer the number of arguments that it has.
 boolean equals(Object other)
           
 Expression getArg(int i)
          If this Expression is an application, and 0 <= i < argCount(), answer the ith argument.
 String getFun()
          If this Expression is an application, return the string identifying the function, which should be a URI.
 String getName()
          If this Expression is a variable, answer a [non-null] String which is its name.
 Object getValue()
          If this Expression is a literal, answer the value of that literal.
 boolean isApply()
          Answer true iff this Expression represents the application of some function [or operator] to some arguments [or operands].
 boolean isConstant()
          Answer true iff this Expression represents a literal [Java object] value.
 boolean isVariable()
          Answer true iff this Expression represents a variable.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.graph.query.Expression
prepare
 

Constructor Detail

Expression.Base

public Expression.Base()
Method Detail

isVariable

public boolean isVariable()
Description copied from interface: Expression
Answer true iff this Expression represents a variable.

Specified by:
isVariable in interface Expression

isApply

public boolean isApply()
Description copied from interface: Expression
Answer true iff this Expression represents the application of some function [or operator] to some arguments [or operands].

Specified by:
isApply in interface Expression

isConstant

public boolean isConstant()
Description copied from interface: Expression
Answer true iff this Expression represents a literal [Java object] value.

Specified by:
isConstant in interface Expression

getName

public String getName()
Description copied from interface: Expression
If this Expression is a variable, answer a [non-null] String which is its name. Otherwise the behaviour is unspecified.

Specified by:
getName in interface Expression

getValue

public Object getValue()
Description copied from interface: Expression
If this Expression is a literal, answer the value of that literal. Otherwise the behaviour is unspecified.

Specified by:
getValue in interface Expression

argCount

public int argCount()
Description copied from interface: Expression
If this Expression is an application, answer the number of arguments that it has. Otherwise the behaviour is unspecified.

Specified by:
argCount in interface Expression

getFun

public String getFun()
Description copied from interface: Expression
If this Expression is an application, return the string identifying the function, which should be a URI. Otherwise the behaviour is unspecified.

Specified by:
getFun in interface Expression

getArg

public Expression getArg(int i)
Description copied from interface: Expression
If this Expression is an application, and 0 <= i < argCount(), answer the ith argument. Otherwise the behaviour is unspecified.

Specified by:
getArg in interface Expression

equals

public boolean equals(Object other)
Overrides:
equals in class Object


Licenced under the Apache License, Version 2.0