de.derivo.sparqldlapi
Class QueryAtom

java.lang.Object
  extended by de.derivo.sparqldlapi.QueryAtom

public class QueryAtom
extends java.lang.Object

This class represents a query atom.

Author:
Mario Volke

Field Summary
protected  java.util.List<QueryArgument> args
           
protected  boolean bound
           
protected  QueryAtomType type
           
 
Constructor Summary
QueryAtom(QueryAtomType type, java.util.List<QueryArgument> args)
           
QueryAtom(QueryAtomType type, QueryArgument... args)
           
 
Method Summary
 QueryAtom bind(QueryBinding binding)
          A convenience method to clone the QueryAtom instance while inserting a new binding.
 boolean equals(java.lang.Object obj)
           
 java.util.List<QueryArgument> getArguments()
          Get the arguments of the atom.
 QueryAtomType getType()
          Get the exact type of the atom.
 int hashCode()
           
 boolean hasType(QueryAtomType type)
          Check whether this atom has a concrete type.
 boolean isBound()
          Check whether the atom contains any variables or not.
 java.lang.String toString()
          Get the atom as string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected final QueryAtomType type

args

protected final java.util.List<QueryArgument> args

bound

protected boolean bound
Constructor Detail

QueryAtom

public QueryAtom(QueryAtomType type,
                 QueryArgument... args)

QueryAtom

public QueryAtom(QueryAtomType type,
                 java.util.List<QueryArgument> args)
Method Detail

isBound

public boolean isBound()
Check whether the atom contains any variables or not.

Returns:
True if there are no variables left.

getType

public QueryAtomType getType()
Get the exact type of the atom.

Returns:
The query atom type.

hasType

public boolean hasType(QueryAtomType type)
Check whether this atom has a concrete type.

Parameters:
type -
Returns:
True if the atom has this type.

getArguments

public java.util.List<QueryArgument> getArguments()
Get the arguments of the atom.

Returns:

bind

public QueryAtom bind(QueryBinding binding)
A convenience method to clone the QueryAtom instance while inserting a new binding.

Parameters:
binding -
Returns:

toString

public java.lang.String toString()
Get the atom as string.

Overrides:
toString in class java.lang.Object
Returns:
String containing valid SPARQL-DL atom format.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object