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

eworks.RDF.model
Interface Tuples

All Superinterfaces:
Collection
All Known Subinterfaces:
Tuple
All Known Implementing Classes:
AbstractTuples, Statement, TupleImpl

public interface Tuples
extends Collection

Represents the interface of a set of tuples. Therefore this interface provided methods to manage instances that implement the Tuple interface.

Managed tuples may be grouped to tuple groups, therefore methods like getNumberOfGroups() and getTuplesByGroup(int) exist.

This class allows duplicate tuples.

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

Method Summary
 boolean add(Tuple t)
          Adds the Tuple t.
 boolean addAll(Collection c, boolean distinct)
          Adds all tuples that are contained inside the given collection c.
 Object clone()
          Clones this instance by creating a flat copy.
 int getNumberOfGroups()
          Returns the number of tuple groups.
 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 groups, that is specified by it's numerical index.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

add

public boolean add(Tuple t)
Adds the Tuple t. The tuples is added even if it is already contained, so it can be contained multiple times.

Parameters:
t - The tuple to add.
Returns:
true if and only if the set of tuples has changed.

getNumberOfGroups

public int getNumberOfGroups()
Returns the number of tuple groups. If there are no explicit tuple groups defined, derived classes should return the value 1.

Returns:
The number of tuple groups.

getTuplesByGroup

public Tuples getTuplesByGroup(int groupIndex)
Returns all tuples of a certain tuple groups, that is specified by it's numerical index. The returned tuples are returned using a class that implements the Tuples interface as well.

Parameters:
groupIndex - The group's index.
Returns:
The tuples of the tuple group index.
Throws:
ArrayIndexOutOfBoundsException - if this tuple group does not exist, see getNumberOfGroups().

addAll

public boolean addAll(Collection c,
                      boolean distinct)
Adds all tuples that are contained inside the given collection c.

Parameters:
c - The tuples to add.
distinct - If set to true, there will no duplicates be added.
Returns:
true if and only if at least one tuple was added.

getTuple

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

Parameters:
index - The numerical index of the tuple to return.
Returns:
The tuple with the given index.
Throws:
ArrayIndexOutOfBoundsException - if this tuple does not exist, see Collection.size().

clone

public Object clone()
Clones this instance by creating a flat copy. (So the encapsulated tuples are not cloned as well.)

Returns:
A flat copy of this instance implementing the Tuples interface again.

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