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 booleanAnswerstrueif the []-list contains the specifiedelement.first()Answers the first element of the typeE.default booleanisEmpty()Answerstrueif this list contains no elements of the typeE.default booleanisNil()Answerstrueif it is a nil []-list.last()Answers the last element of the typeE.members()Lists all elements of the typeEfrom this list.default longsize()Answers the number ofrdf-nodes in the list.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods inherited from interface org.apache.jena.rdf.model.RDFNode
as, asLiteral, asResource, asStatementTerm, canAs, getModel, isAnon, isLiteral, isResource, isStatementTerm, isURIResource, visitWithMethods 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, 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 typeEfrom 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 Nodes use the standard list representation: the expressionIter.asStream(this.as(RDFList.class).iterator())will return aStreamof nodes.- Returns:
StreamofE-elements- See Also:
-
RDFNode.as(Class)Iterators.asStream(java.util.Iterator)
-
contains
Answerstrueif the []-list contains the specifiedelement. More formally, returnstrueif and only if this RDF-list contains at least one elementeof the typeEsuch thatelement.equals(e).- Parameters:
element-E, notnull- Returns:
- boolean
-
first
Answers the first element of the typeE.- Returns:
Optionalaround theE-item
-
last
Answers the last element of the typeE.- Returns:
Optionalaround theE-item
-
size
default long size()Answers the number ofrdf-nodes 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()Answerstrueif it is a nil []-list. Please note: a non-nil list may also not contain elements of the typeEand, therefore, beisEmpty()empty.- Returns:
- boolean
- See Also:
-
isEmpty
default boolean isEmpty()Answerstrueif this list contains no elements of the typeE. Anil-list is always empty, but the reverse is not true.- Returns:
- boolean
- See Also:
-