de.derivo.sparqldlapi
Class QueryArgument

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

public class QueryArgument
extends java.lang.Object

This class represents a query argument (e.g. an URI or a variable).

Author:
Mario Volke

Constructor Summary
QueryArgument(QueryArgumentType type, java.lang.String value)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 QueryArgumentType getType()
          Get the type of the query argument.
 java.lang.String getValue()
          Get the value of the query argument.
 int hashCode()
           
 boolean hasType(QueryArgumentType type)
          Check whether the query argument has a special type.
 boolean isBnode()
          Check whether the query argument is a bnode.
 boolean isLiteral()
          Check whether the query argument is a literal.
 boolean isURI()
          Check whether the query argument is an URI.
 boolean isVar()
          Check whether the query argument is a variable.
static QueryArgument newBnode(java.lang.String value)
          Factory method to create a QueryArgument instance with type BNODE by string.
static QueryArgument newLiteral(java.lang.String value)
          Factory method to create a QueryArgument instance with type LITERAL by string.
static QueryArgument newURI(IRI value)
          Factory method to create a QueryArgument instance with type URI by IRI.
static QueryArgument newVar(java.lang.String value)
          Factory method to create a QueryArgument instance with type VAR by string.
 java.lang.String toString()
          Print the query argument as string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryArgument

public QueryArgument(QueryArgumentType type,
                     java.lang.String value)
Method Detail

newURI

public static QueryArgument newURI(IRI value)
Factory method to create a QueryArgument instance with type URI by IRI.

Parameters:
value -
Returns:

newVar

public static QueryArgument newVar(java.lang.String value)
Factory method to create a QueryArgument instance with type VAR by string.

Parameters:
value -
Returns:

newBnode

public static QueryArgument newBnode(java.lang.String value)
Factory method to create a QueryArgument instance with type BNODE by string.

Parameters:
value -
Returns:

newLiteral

public static QueryArgument newLiteral(java.lang.String value)
Factory method to create a QueryArgument instance with type LITERAL by string.

Parameters:
value -
Returns:

getValue

public java.lang.String getValue()
Get the value of the query argument.

Returns:

getType

public QueryArgumentType getType()
Get the type of the query argument.

Returns:

hasType

public boolean hasType(QueryArgumentType type)
Check whether the query argument has a special type.

Parameters:
type -
Returns:
True if the query argument has this type.

isURI

public boolean isURI()
Check whether the query argument is an URI.

Returns:
True if the query argument is an URI.

isVar

public boolean isVar()
Check whether the query argument is a variable.

Returns:
True if the query argument is a variable.

isLiteral

public boolean isLiteral()
Check whether the query argument is a literal.

Returns:
True if the query argument is a literal.

isBnode

public boolean isBnode()
Check whether the query argument is a bnode.

Returns:
True if the query argument is a bnode.

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

toString

public java.lang.String toString()
Print the query argument as string. Output depends on the type of the argument.

Overrides:
toString in class java.lang.Object