- All Superinterfaces:
FrontsNode
,RDFNode
,Resource
- All Known Implementing Classes:
AltImpl
,BagImpl
,ContainerImpl
,SeqImpl
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
Modifier and TypeMethodDescriptionadd
(boolean o) Add a new value to a container.add
(char o) Add a new value to a container.add
(double o) Add a new value to a container.add
(float o) Add a new value to a container.add
(long o) Add a new value to a container.Add a new value to a container.Add a new value to a container.Add a new value to a container.Add a new value to a container.boolean
contains
(boolean o) Determine whether the container contains a valueboolean
contains
(char o) Determine whether the container contains a valueboolean
contains
(double o) Determine whether the container contains a valueboolean
contains
(float o) Determine whether the container contains a valueboolean
contains
(long o) Determine whether the container contains a valueboolean
Determine whether the container contains a valueboolean
Determine whether the container contains a valueboolean
Determine whether the container contains a valueboolean
Determine whether the container contains a valueboolean
isAlt()
Verify that the container is an Alt.boolean
isBag()
Verify that the container is a Bag.boolean
isSeq()
Verify that the container is a Seq.iterator()
Return an iterator over the values.Remove a value from the container.int
size()
return the number values in the container.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNode
Methods inherited from interface org.apache.jena.rdf.model.RDFNode
as, asLiteral, asResource, canAs, getModel, isAnon, isLiteral, isResource, isStmtResource, isURIResource, visitWith
Methods inherited from interface org.apache.jena.rdf.model.Resource
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toString
-
Method Details
-
isAlt
boolean isAlt()Verify that the container is an Alt. This method will return true if the object is in a model and that model contains the triple < this, RDF.type, RDF.Alt > otherwise returns false. -
isSeq
boolean isSeq()Verify that the container is a Seq. This method will return true if the object is in a model and that model contains the triple < this, RDF.type, RDF.Seq > otherwise returns false. -
isBag
boolean isBag()Verify that the container is a Bag. This method will return true if the object is in a model and that model contains the triple < this, RDF.type, RDF.Bag > otherwise returns false. -
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
add
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.
- 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.
-
add
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.
- Parameters:
o
- The value to be added.- Returns:
- this object so that calls may be cascaded.
-
contains
Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
contains
boolean contains(boolean o) Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
contains
boolean contains(long o) Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
contains
boolean contains(char o) Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
contains
boolean contains(float o) Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
contains
boolean contains(double o) Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
contains
Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
contains
Determine whether the container contains a value- Parameters:
o
- the value being tested forl
- the language of the string tested- Returns:
- true if and only if the container contains o
-
contains
Determine whether the container contains a value- Parameters:
o
- the value being tested for- Returns:
- true if and only if the container contains o
-
remove
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.- Parameters:
s
- The statement to be removed from the model.- Returns:
- this container to enable cascading calls.
-
iterator
NodeIterator iterator()Return an iterator over the values.Note the iterator 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.- Returns:
- Return an iterator over the values.
-
size
int size()return the number values in the container.- Returns:
- the number of values int the container.
-