com.hp.hpl.mesa.rdf.jena.common
Class ContainerImpl

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
        |
        +--com.hp.hpl.mesa.rdf.jena.common.ContainerImpl
All Implemented Interfaces:
Container, com.hp.hpl.mesa.rdf.jena.common.ContainerI, RDFNode, Resource, ResourceI
Direct Known Subclasses:
AltImpl, BagImpl, SeqImpl

public class ContainerImpl
extends ResourceImpl
implements Container, com.hp.hpl.mesa.rdf.jena.common.ContainerI

An internal class not normally of interest to application developers. A base class on which the other containers are built.

Version:
Release='$Name: $' Revision='$Revision: 1.2 $' Date='$Date: 2002/01/05 11:11:28 $'
Author:
bwm

Constructor Summary
ContainerImpl(Model model)
          Creates new ContainerImpl
ContainerImpl(Resource r, Model model)
           
ContainerImpl(java.lang.String uri, Model model)
           
 
Method Summary
 Container add(boolean o)
          Add a new value to a container.
 Container add(char o)
          Add a new value to a container.
 Container add(double o)
          Add a new value to a container.
 Container add(float o)
          Add a new value to a container.
 Container add(long o)
          Add a new value to a container.
 Container add(java.lang.Object o)
          Add a new value to a container.
 Container add(RDFNode n)
          Add a new value to a container.
 Container add(java.lang.String o)
          Add a new value to a container.
 Container add(java.lang.String o, java.lang.String l)
          Add a new value to a container.
 boolean contains(boolean o)
          Determine whether the container contains a value
 boolean contains(char o)
          Determine whether the container contains a value
 boolean contains(double o)
          Determine whether the container contains a value
 boolean contains(float o)
          Determine whether the container contains a value
 boolean contains(long o)
          Determine whether the container contains a value
 boolean contains(java.lang.Object o)
          Determine whether the container contains a value
 boolean contains(RDFNode n)
          Determine whether the container contains a value
 boolean contains(java.lang.String o)
          Determine whether the container contains a value
 boolean contains(java.lang.String o, java.lang.String l)
          Determine whether the container contains a value
 NodeIterator iterator()
          Return an iterator over the values.
 Container remove(int index, RDFNode object)
          Remove the given value at the given index.
 Container remove(Statement s)
          Remove a value from the container.
 int size()
          return the number values in the container.
 
Methods inherited from class com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getEmbeddedResource, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hashCode, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, port, removeProperties, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Resource
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, removeProperties, toString
 

Constructor Detail

ContainerImpl

public ContainerImpl(Model model)
Creates new ContainerImpl

ContainerImpl

public ContainerImpl(java.lang.String uri,
                     Model model)

ContainerImpl

public ContainerImpl(Resource r,
                     Model model)
Method Detail

add

public Container add(RDFNode n)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(boolean o)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(long o)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(char o)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(float o)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(double o)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(java.lang.String o)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(java.lang.String o,
                     java.lang.String l)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
l - The language of the string to be added
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

add

public Container add(java.lang.Object o)
              throws RDFException
Description copied from interface: Container
Add a new value to a container.

The size of the container is extended by 1 and the new value is added as the last element of the container.

Specified by:
add in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - The value to be added.
Returns:
this object so that calls may be cascaded.
Throws:
RDFException - Generic RDF expection

contains

public boolean contains(RDFNode n)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(boolean o)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(long o)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(char o)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(float o)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(double o)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(java.lang.String o)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(java.lang.String o,
                        java.lang.String l)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
l - the language of the string tested
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

contains

public boolean contains(java.lang.Object o)
                 throws RDFException
Description copied from interface: Container
Determine whether the container contains a value
Specified by:
contains in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
o - the value being tested for
Returns:
true if and only if the container contains o
Throws:
RDFException - Generic RDF exception

iterator

public NodeIterator iterator()
                      throws RDFException
Description copied from interface: Container
Return an iterator over the values.

Note the interator returned is not a standard java.util.iterator. It has a close method which SHOULD be called if the application has not completed the iteration, but no longer requires the iterator. This will enable the freeing of resources in, for example, implementations which store their models in a database.

Specified by:
iterator in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Returns:
Return an iterator over the values.
Throws:
RDFException - Generic RDF exception.

size

public int size()
         throws RDFException
Description copied from interface: Container
return the number values in the container.
Specified by:
size in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Returns:
the number of values int the container.
Throws:
RDFException - Generic RDF exception

remove

public Container remove(Statement s)
                 throws RDFException
Description copied from interface: Container
Remove a value from the container.

The predicate of the statement s identifies the ordinal of the value to be removed. Once removed, the values in the container with a higher ordinal value are renumbered. The renumbering algorithm depends on the type of container.

Specified by:
remove in interface Container
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Container
Parameters:
s - The statement to be removed from the model.
Returns:
this container to enable cascading calls.
Throws:
RDFException - Generic RDF Exception

remove

public Container remove(int index,
                        RDFNode object)
                 throws RDFException
Description copied from interface: com.hp.hpl.mesa.rdf.jena.common.ContainerI
Remove the given value at the given index.
Specified by:
remove in interface com.hp.hpl.mesa.rdf.jena.common.ContainerI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ContainerI
Parameters:
index - The index at which the value should be removed.
object - The object at that index to be removed
Returns:
this object
Throws:
RDFException - Generic RDF exception


Copyright 2001 Hewlett-Packard. All Rights Reserved.