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

eworks.RDF.model
Class AbstractTuples

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byeworks.RDF.model.AbstractTuples
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable, Tuples
Direct Known Subclasses:
GroupedTuples, SingleGroupedTuples, Statements, UngroupedTuples

public abstract class AbstractTuples
extends ArrayList
implements Tuples

An abstract base class for implementations of the Tuples interface. Represents a set of tuples and provides methods to manage instances that implement the Tuple interface.

This implementation does not support the grouping of tuples as defined by the methods Tuples.getNumberOfGroups() and Tuples.getTuplesByGroup(int), derive classes should overwrite this methods, if they need real tuple grouping.

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

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AbstractTuples()
          Creates a new and empty set of tuples.
AbstractTuples(Collection c)
          Creates a new set of tuples and initializes it with a given set of tuples.
AbstractTuples(int initialCapacity)
          Creates a new and empty set of tuples with a given initial capacity.
 
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.
 int getNumberOfGroups()
          Returns the number of tuple goups, always 1 in this implementation.
 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.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eworks.RDF.model.Tuples
clone
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

AbstractTuples

public AbstractTuples()
Creates a new and empty set of tuples.


AbstractTuples

public AbstractTuples(int initialCapacity)
Creates a new and empty set of tuples with a given initial capacity.

Parameters:
initialCapacity - The initial capacity.

AbstractTuples

public AbstractTuples(Collection c)
Creates a new set of tuples and initializes it with a given set of tuples.

Parameters:
c - The set of tuples to initialize the new tuple set.
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.

Specified by:
add in interface Tuples
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 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)
Adds all tuples that are contained inside the given collection c.

Specified by:
addAll in interface Tuples
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.

Specified by:
getTuple in interface Tuples
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 ArrayList.size().

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