|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An RDF Container.
This interface defines methods for accessing RDF container resources. These methods operate on the RDF statements contained in a model. The container implementation may cache state from the underlying model, so objects should not be added to or removed from the container by directly manipulating its properties, whilst the container is being accessed through this interface.
When a member is deleted from a container using this interface, or an iterator returned through this interface, all the other members with higher ordinals are renumbered using an algorithm which may depend on the type of the container.
This interface provides methods supporting typed literals. This means
that methods are provided which will translate a built in type, or an
object to an RDF Literal. This translation is done by invoking the
toString()
method of the object, or its built in equivalent.
The reverse translation is also supported. This is built in for built
in types. Factory objects, provided by the application, are used
for application objects.
This interface provides methods for supporting enhanced resources. An enhanced resource is a resource to which the application has added behaviour. RDF containers are examples of enhanced resources built in to this package. Enhanced resources are supported by encapsulating a resource created by an implementation in another class which adds the extra behaviour. Factory objects are used to construct such enhanced resources.
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 o)
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 o)
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(Statement s)
Remove a value from the container. |
int |
size()
return the number values in the container. |
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 |
Method Detail |
public Container add(RDFNode o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic Container add(boolean o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic Container add(long o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic Container add(char o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic Container add(float o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic Container add(double o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic Container add(java.lang.String o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic Container add(java.lang.String o, java.lang.String l) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.l
- The language of the string to be addedRDFException
- Generic RDF expectionpublic Container add(java.lang.Object o) throws RDFException
The size of the container is extended by 1 and the new value is added as the last element of the container.
o
- The value to be added.RDFException
- Generic RDF expectionpublic boolean contains(RDFNode o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic boolean contains(boolean o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic boolean contains(long o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic boolean contains(char o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic boolean contains(float o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic boolean contains(double o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic boolean contains(java.lang.String o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic boolean contains(java.lang.String o, java.lang.String l) throws RDFException
o
- the value being tested forl
- the language of the string testedRDFException
- Generic RDF exceptionpublic boolean contains(java.lang.Object o) throws RDFException
o
- the value being tested forRDFException
- Generic RDF exceptionpublic Container remove(Statement s) throws RDFException
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.
s
- The statement to be removed from the model.RDFException
- Generic RDF Exceptionpublic NodeIterator iterator() throws RDFException
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.
RDFException
- Generic RDF exception.public int size() throws RDFException
RDFException
- Generic RDF exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |