Class AbstractModel

    • Constructor Detail

      • AbstractModel

        public AbstractModel()
    • Method Detail

      • unmodifiable

        public Model unmodifiable()
        Description copied from interface: Model
        Returns an unmodifiable view of this model. This method provides "read-only" access to this model. Query operations on the returned model "read through" to this model, and attempts to modify the returned model, whether direct or via its iterator, result in an UnsupportedOperationException.

        Specified by:
        unmodifiable in interface Model
        Returns:
        an unmodifiable view of the specified set.
      • clear

        public boolean clear​(Resource... contexts)
        Description copied from interface: Model
        Removes statements with the specified context exist in this model.
        Specified by:
        clear in interface Model
        Parameters:
        contexts - The context of the statements to remove.
        Returns:
        true if one or more statements have been removed.
      • subjects

        public Set<Resource> subjects()
        Description copied from interface: Model
        Returns a Set view of the subjects contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is a subject value, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations if the parameters pred or obj are null.
        Specified by:
        subjects in interface Model
        Returns:
        a set view of the subjects contained in this model
      • predicates

        public Set<IRI> predicates()
        Description copied from interface: Model
        Returns a Set view of the predicates contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is a predicate value, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations if the parameters subj or obj are null.
        Specified by:
        predicates in interface Model
        Returns:
        a set view of the predicates contained in this model
      • objects

        public Set<Value> objects()
        Description copied from interface: Model
        Returns a Set view of the objects contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is an object value, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations if the parameters subj or pred are null.
        Specified by:
        objects in interface Model
        Returns:
        a set view of the objects contained in this model
      • contexts

        public Set<Resource> contexts()
        Description copied from interface: Model
        Returns a Set view of the contexts contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is a context value, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations if the parameters subj , pred or obj are null.
        Specified by:
        contexts in interface Model
        Returns:
        a set view of the contexts contained in this model
      • removeTermIteration

        public abstract void removeTermIteration​(Iterator<Statement> iter,
                                                 Resource subj,
                                                 IRI pred,
                                                 Value obj,
                                                 Resource... contexts)
        Called by aggregate sets when a term has been removed from a term iterator. Exactly one of the last four terms will be non-empty.
        Parameters:
        iter - The iterator used to navigate the live set (never null)
        subj - the subject term to be removed or null
        pred - the predicate term to be removed or null
        obj - the object term to be removed or null
        contexts - an array of one context term to be removed or an empty array
      • closeIterator

        protected void closeIterator​(Iterator<?> iter)
        Cleans up any resources used by this iterator. After this call the given iterator should not be used.
        Parameters:
        iter - Iterator to clean up