public class RdfList extends AbstractList<RDFTerm>
java.util.List backed by an RDF
collection (rdf:List). The list allows modification that are reflected
to the underlying Graph. It reads the data from the
Graph when it is first needed, so changes to the
Graph affecting the rdf:List may or may not have an effect on the
values returned by instances of this class. For that reason only one
instance of this class should be used for accessing an rdf:List of sublists
thereof when the lists are being modified, having multiple lists exclusively
for read operations (such as for immutable Graphs) is
not problematic.modCount| Constructor and Description |
|---|
RdfList(BlankNodeOrIRI listRDFTerm,
Graph tc)
Get a list for the specified resource.
|
RdfList(GraphNode listNode)
Get a list for the specified resource node.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
RDFTerm element) |
static RdfList |
createEmptyList(BlankNodeOrIRI listRDFTerm,
Graph tc)
Creates an empty RdfList by writing a triple
"
listRDFTerm owl:sameAs rdf.nil ." to tc. |
boolean |
equals(Object obj) |
static Set<GraphNode> |
findContainingListNodes(GraphNode element)
Returns a set of
GraphNodeS which are the first list nodes (meaning
they are not the beginning of a sublist) of the list containing the specified
GraphNode as an element. |
static Set<RdfList> |
findContainingLists(GraphNode element)
Returns the rdf lists of which the specified
GraphNode is
an element of. |
RDFTerm |
get(int index) |
BlankNodeOrIRI |
getListRDFTerm() |
int |
hashCode() |
RDFTerm |
remove(int index) |
int |
size() |
add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic RdfList(BlankNodeOrIRI listRDFTerm, Graph tc)
If the list is modified using the created instance
listRDFTerm will always be the first list.
listRDFTerm - tc - public RdfList(GraphNode listNode)
listNode - public static RdfList createEmptyList(BlankNodeOrIRI listRDFTerm, Graph tc) throws IllegalArgumentException
listRDFTerm owl:sameAs rdf.nil ." to tc.listRDFTerm - tc - IllegalArgumentException - if the provided listRDFTerm is a non-empty rdf:List.public RDFTerm get(int index)
public int size()
size in interface Collection<RDFTerm>size in interface List<RDFTerm>size in class AbstractCollection<RDFTerm>public void add(int index,
RDFTerm element)
public RDFTerm remove(int index)
public BlankNodeOrIRI getListRDFTerm()
public boolean equals(Object obj)
equals in interface Collection<RDFTerm>equals in interface List<RDFTerm>equals in class AbstractList<RDFTerm>public int hashCode()
hashCode in interface Collection<RDFTerm>hashCode in interface List<RDFTerm>hashCode in class AbstractList<RDFTerm>public static Set<RdfList> findContainingLists(GraphNode element)
GraphNode is
an element of. Sublists of other lists are not returned.element - Copyright © 2015–2022 The Apache Software Foundation. All rights reserved.