Module org.apache.jena.ontapi
Package org.apache.jena.ontapi.model
Interface RDFNodeList<E extends org.apache.jena.rdf.model.RDFNode>
- Type Parameters:
E
- the type of element-nodes in this []-list
- All Superinterfaces:
org.apache.jena.graph.FrontsNode
,org.apache.jena.rdf.model.RDFNode
,org.apache.jena.rdf.model.Resource
- All Known Subinterfaces:
OntList<E>
- All Known Implementing Classes:
OntListImpl
public interface RDFNodeList<E extends org.apache.jena.rdf.model.RDFNode>
extends org.apache.jena.rdf.model.Resource
A parameterized analogue of the
Jena RDF []-List
that provides read-only access to its items.- See Also:
-
RDFList
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Answerstrue
if the []-list contains the specifiedelement
.first()
Answers the first element of the typeE
.default boolean
isEmpty()
Answerstrue
if this list contains no elements of the typeE
.default boolean
isNil()
Answerstrue
if it is a nil []-list.last()
Answers the last element of the typeE
.members()
Lists all elements of the typeE
from this list.default long
size()
Answers the number ofrdf-node
s in the list.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
-
members
Lists all elements of the typeE
from this list. Note: a real RDF-list may contain nodes with an incompatible type, in this case they will not be included in the resultStream
. To get allRDF Node
s use the standard list representation: the expressionIter.asStream(this.as(RDFList.class).iterator())
will return aStream
of nodes.- Returns:
Stream
ofE
-elements- See Also:
-
RDFNode.as(Class)
Iterators.asStream(java.util.Iterator)
-
contains
Answerstrue
if the []-list contains the specifiedelement
. More formally, returnstrue
if and only if this RDF-list contains at least one elemente
of the typeE
such thatelement.equals(e)
.- Parameters:
element
-E
, notnull
- Returns:
- boolean
-
first
Answers the first element of the typeE
.- Returns:
Optional
around theE
-item
-
last
Answers the last element of the typeE
.- Returns:
Optional
around theE
-item
-
size
default long size()Answers the number ofrdf-node
s in the list. Note: in general, this operation is not equivalent to the expressionthis.members().count()
, since the list may contain items of an incompatible type.- Returns:
- the real size of the []-list as an integer
-
isNil
default boolean isNil()Answerstrue
if it is a nil []-list. Please note: a non-nil list may also not contain elements of the typeE
and, therefore, beisEmpty()
empty.- Returns:
- boolean
- See Also:
-
isEmpty
default boolean isEmpty()Answerstrue
if this list contains no elements of the typeE
. Anil
-list is always empty, but the reverse is not true.- Returns:
- boolean
- See Also:
-