org.jrdf.graph
Interface Collection<ObjectNode>

All Superinterfaces:
Collection<ObjectNode>, Iterable<ObjectNode>, List<ObjectNode>, Queue<ObjectNode>

public interface Collection<ObjectNode>
extends List<ObjectNode>, Queue<ObjectNode>

A Collection holds all the statements of a particular group. A linked list is created by using pointer statements (REST) to the next item in the collection. The group is closed, where the last statement in the group points to a NIL entry.

See 4.1 RDF Collections.

Version:
$Revision: 1045 $
Author:
Andrew Newman

Method Summary
 void add(int index, ObjectNode element)
          Add an $ObjectNode to the collection at the given position.
 boolean add(ObjectNode element)
          Add an $ObjectNode to the collection.
 boolean addAll(Collection<? extends ObjectNode> c)
          Add a collection of $ObjectNodes to this one.
 boolean addAll(int index, Collection<? extends ObjectNode> c)
          Add a collection of $ObjectNodes to this one starting at the given index.
 void addFirst(ObjectNode element)
           
 void addLast(ObjectNode element)
           
 boolean contains(Object o)
          Search the collection and return if the object was found or not.
 boolean containsAll(Collection<?> c)
          Search the collection and return if all of the given objects were found.
 int indexOf(Object element)
           
 Iterator<ObjectNode> iterator()
           
 int lastIndexOf(Object element)
           
 boolean remove(Object element)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 ObjectNode set(int index, ObjectNode element)
           
 
Methods inherited from interface java.util.List
clear, equals, get, hashCode, isEmpty, listIterator, listIterator, remove, size, subList, toArray, toArray
 
Methods inherited from interface java.util.Queue
element, offer, peek, poll, remove
 

Method Detail

add

boolean add(ObjectNode element)
Add an $ObjectNode to the collection.

Specified by:
add in interface Collection<ObjectNode>
Specified by:
add in interface List<ObjectNode>
Parameters:
element - object to add.
Returns:
true if the object was added successfully.

add

void add(int index,
         ObjectNode element)
Add an $ObjectNode to the collection at the given position.

Specified by:
add in interface List<ObjectNode>
Parameters:
index - the index into the collection to add.
element - the object to add.

addAll

boolean addAll(Collection<? extends ObjectNode> c)
Add a collection of $ObjectNodes to this one.

Specified by:
addAll in interface Collection<ObjectNode>
Specified by:
addAll in interface List<ObjectNode>
Parameters:
c - the collection to add.
Returns:
true if the object was added successfully.

addAll

boolean addAll(int index,
               Collection<? extends ObjectNode> c)
Add a collection of $ObjectNodes to this one starting at the given index.

Specified by:
addAll in interface List<ObjectNode>
Parameters:
index - the index into the collection to start adding.
c - the collection to add.
Returns:
true if the object was added successfully.

addFirst

void addFirst(ObjectNode element)

addLast

void addLast(ObjectNode element)

contains

boolean contains(Object o)
                 throws IllegalArgumentException
Search the collection and return if the object was found or not.

Specified by:
contains in interface Collection<ObjectNode>
Specified by:
contains in interface List<ObjectNode>
Returns:
true of the object was found.
Throws:
IllegalArgumentException - if the given object is not the correct type, ObjectNode.

containsAll

boolean containsAll(Collection<?> c)
                    throws IllegalArgumentException
Search the collection and return if all of the given objects were found.

Specified by:
containsAll in interface Collection<ObjectNode>
Specified by:
containsAll in interface List<ObjectNode>
Parameters:
c - the collection containing the elements to search.
Returns:
true if all of the given objects were found.
Throws:
IllegalArgumentException - if the given object is not the correct type, Collection.

indexOf

int indexOf(Object element)
            throws IllegalArgumentException
Specified by:
indexOf in interface List<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, ObjectNode.

lastIndexOf

int lastIndexOf(Object element)
                throws IllegalArgumentException
Specified by:
lastIndexOf in interface List<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, ObjectNode.

iterator

Iterator<ObjectNode> iterator()
Specified by:
iterator in interface Collection<ObjectNode>
Specified by:
iterator in interface Iterable<ObjectNode>
Specified by:
iterator in interface List<ObjectNode>

remove

boolean remove(Object element)
               throws IllegalArgumentException
Specified by:
remove in interface Collection<ObjectNode>
Specified by:
remove in interface List<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, ObjectNode.

removeAll

boolean removeAll(Collection<?> c)
                  throws IllegalArgumentException
Specified by:
removeAll in interface Collection<ObjectNode>
Specified by:
removeAll in interface List<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, ObjectNode.

retainAll

boolean retainAll(Collection<?> c)
                  throws IllegalArgumentException
Specified by:
retainAll in interface Collection<ObjectNode>
Specified by:
retainAll in interface List<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, ObjectNode.

set

ObjectNode set(int index,
               ObjectNode element)
Specified by:
set in interface List<ObjectNode>