org.jrdf.graph
Interface Container<ObjectNode>

All Superinterfaces:
Collection<ObjectNode>, Iterable<ObjectNode>
All Known Subinterfaces:
Alternative<ObjectNode>, Bag<ObjectNode>, Sequence<ObjectNode>
All Known Implementing Classes:
AbstractUnorderedContainer, AlternativeImpl, BagImpl, SequenceImpl

public interface Container<ObjectNode>
extends Collection<ObjectNode>

A Container is a grouping of statements. A container can either be a Alternative, Bag, or Sequence.

See 4.1 RDF Containers.

Alternatives are unordered lists that do not allow duplicates. Bags are unordered lists that allow duplicates. Sequences are ordered lists that allows duplicates.

Currently, this is just an extension of java.util.Collection that throws exceptions when inappropriate objects are used, for example non-ObjectNodes are added.

Version:
$Revision: 1045 $
Author:
Andrew Newman

Method Summary
 boolean add(ObjectNode o)
          
 boolean addAll(Collection<? extends ObjectNode> c)
          
 boolean contains(Object o)
          
 boolean containsAll(Collection<?> c)
          
 Iterator<ObjectNode> iterator()
          
 boolean remove(Object o)
          
 boolean removeAll(Collection<?> c)
          
 boolean retainAll(Collection<?> c)
          
<ObjectNode>
ObjectNode[]
toArray(ObjectNode[] a)
          
 
Methods inherited from interface java.util.Collection
clear, equals, hashCode, isEmpty, size, toArray
 

Method Detail

add

boolean add(ObjectNode o)

Specified by:
add in interface Collection<ObjectNode>
Parameters:
o - Add an ObjectNode.
Returns:

addAll

boolean addAll(Collection<? extends ObjectNode> c)

Specified by:
addAll in interface Collection<ObjectNode>

contains

boolean contains(Object o)

Specified by:
contains in interface Collection<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, ObjectNode.

containsAll

boolean containsAll(Collection<?> c)
                    throws IllegalArgumentException

Specified by:
containsAll in interface Collection<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, Sequence.

iterator

Iterator<ObjectNode> iterator()

Specified by:
iterator in interface Collection<ObjectNode>
Specified by:
iterator in interface Iterable<ObjectNode>
Returns:

remove

boolean remove(Object o)
               throws IllegalArgumentException

Specified by:
remove in interface Collection<ObjectNode>
Parameters:
o -
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>
Throws:
IllegalArgumentException - if the given object is not the correct type, Sequence.

retainAll

boolean retainAll(Collection<?> c)
                  throws IllegalArgumentException

Specified by:
retainAll in interface Collection<ObjectNode>
Throws:
IllegalArgumentException - if the given object is not the correct type, Sequence.

toArray

<ObjectNode> ObjectNode[] toArray(ObjectNode[] a)

Specified by:
toArray in interface Collection<ObjectNode>
Returns: