eRqlEngine API documentation - http://www.wleklinski.de/rdf/

eworks.RDF.model
Class TupleImpl

java.lang.Object
  extended byeworks.RDF.model.StaticCollection
      extended byeworks.RDF.model.TupleImpl
All Implemented Interfaces:
Collection, Tuple, Tuples

public class TupleImpl
extends StaticCollection
implements Tuple

Represents a tuple of instances of LiteralValue.

Version:
1.00 (2003-11-03)
Author:
Fabian Wleklinski (fabian@wleklinski.de)

Constructor Summary
TupleImpl()
          Creates a new and empty tuple.
TupleImpl(Collection values)
          Creates a new tuple and initializes it with some values.
TupleImpl(int size)
          Creates a new and empty tuple and initializes it with a certain size.
TupleImpl(LiteralValue[] values)
          Creates a new tuple and initializes it with some values.
 
Method Summary
 boolean add(Tuple t)
          Do not call this method, because it raises an UnsupportedOperationException.
 boolean addAll(Collection c, boolean distinct)
          Do not call this method, because it raises an UnsupportedOperationException.
 Object clone()
          Clones this tuple and returns a new instance containing the same values.
 boolean equals(Object o)
          Checks the tuple for equality with a given object o.
 Value get(int index)
          Returns the tuple's component with the given index.
 int getNumberOfGroups()
          Returns the number of tuple goups, always 1 in this implementation.
 int getSize()
          Returns the tupel's number of components.
 Tuple getTuple(int index)
          Returns a certain tuple specified by it's numerical index.
 Tuples getTuplesByGroup(int groupIndex)
          Returns all tuples of a certain tuple group.
 void set(int index, LiteralValue value)
          Sets the tuple's component with the given index to value.
 
Methods inherited from class eworks.RDF.model.StaticCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

TupleImpl

public TupleImpl()
Creates a new and empty tuple.


TupleImpl

public TupleImpl(LiteralValue[] values)
Creates a new tuple and initializes it with some values.

Parameters:
values - The values to initialize the tuple.

TupleImpl

public TupleImpl(Collection values)
Creates a new tuple and initializes it with some values.

Parameters:
values - The values to initialize the tuple.

TupleImpl

public TupleImpl(int size)
Creates a new and empty tuple and initializes it with a certain size.

Parameters:
size - The initial size of the tuple.
Method Detail

clone

public Object clone()
Clones this tuple and returns a new instance containing the same values.

Specified by:
clone in interface Tuples
Returns:
A clone of this tuple.

add

public boolean add(Tuple t)
Do not call this method, because it raises an UnsupportedOperationException. This method is specified by Tuples.add(eworks.RDF.model.Tuple) in interface Tuples, but cannot be used on this class.

Specified by:
add in interface Tuples
Parameters:
t - The tuple to add.
Returns:
Nothing because an exception is thrown in every case.
Throws:
UnsupportedOperationException - always.

getNumberOfGroups

public int getNumberOfGroups()
Returns the number of tuple goups, always 1 in this implementation.

Specified by:
getNumberOfGroups in interface Tuples
Returns:
The number of tuple groups, always 1.

getTuplesByGroup

public Tuples getTuplesByGroup(int groupIndex)
Returns all tuples of a certain tuple group.

Specified by:
getTuplesByGroup in interface Tuples
Parameters:
groupIndex - The group's numerical index, has to be the value 1 in this implementation.
Returns:
All tuples of the tuple group, that are all tuples that are enclosed.
Throws:
ArrayIndexOutOfBoundsException - if the groupIndex is unequal to 1.

addAll

public boolean addAll(Collection c,
                      boolean distinct)
Do not call this method, because it raises an UnsupportedOperationException. This method is specified by Tuples.addAll(java.util.Collection, boolean) in interface Tuples, but cannot be used on this class.

Specified by:
addAll in interface Tuples
Parameters:
c - The tuples to add.
distinct - If set to true, there will no duplicates be added.
Returns:
Nothing because an exception is thrown in every case.
Throws:
UnsupportedOperationException - always.

getTuple

public Tuple getTuple(int index)
Returns a certain tuple specified by it's numerical index.

Specified by:
getTuple in interface Tuples
Parameters:
index - The numerical index of the tuple to return, must be 0 in this implementation.
Returns:
This tuple.
Throws:
ArrayIndexOutOfBoundsException - if index is unequal to 0.

get

public Value get(int index)
Returns the tuple's component with the given index.

Specified by:
get in interface Tuple
Parameters:
index - The index of the component to return.
Returns:
The tuple's component with the given index.

set

public void set(int index,
                LiteralValue value)
Sets the tuple's component with the given index to value.

Specified by:
set in interface Tuple
Parameters:
index - The index of the component to set.
value - The component's new value.

getSize

public int getSize()
Returns the tupel's number of components.

Specified by:
getSize in interface Tuple
Returns:
The tupel's number of components.

equals

public boolean equals(Object o)
Checks the tuple for equality with a given object o. That is done by checking if o implements the interface Tuple. If not, false is returned. Otherwise the lengths of both tuples are compared, if they are unequal, false is returned. If they are equal, every component's (each one an instance of LiteralValue) LiteralValue.equals(java.lang.Object) method is called. If one of the values does not match, false is returned, true otherwise.

Specified by:
equals in interface Tuple
Parameters:
o - The object the tuple to compare to.

eRqlEngine API documentation - http://www.wleklinski.de/rdf/