org.eclipse.rdf4j.model.impl

## Class GraphImpl

- java.lang.Object
- - java.util.AbstractCollection<Statement>
  - - org.eclipse.rdf4j.model.impl.GraphImpl

- All Implemented Interfaces:
    Serializable, Iterable<Statement>, Collection<Statement>, Graph

  Deprecated.
  since 2.0. Use a `Model` implementation (e.g. `TreeModel` or `LinkedHashModel` instead.

      @Deprecated
      public class GraphImpl
      extends AbstractCollection<Statement>
      implements Graph

  Basic implementation of Graph.
  Author:
    Arjohn Kampman
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected LinkedList<Statement>` | `statements` Deprecated.
    `protected ValueFactory` | `valueFactory` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GraphImpl()` Deprecated.
    `GraphImpl(Collection<? extends Statement> statements)` Deprecated.
    `GraphImpl(ValueFactory valueFactory)` Deprecated.
    `GraphImpl(ValueFactory valueFactory, Collection<? extends Statement> statements)` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(Resource subj, IRI pred, Value obj, Resource... contexts)` Deprecated. Adds one or more statements to the graph.
    `boolean` | `add(Statement st)` Deprecated.
    `ValueFactory` | `getValueFactory()` Deprecated. Gets the value factory for this graph.
    `Iterator<Statement>` | `iterator()` Deprecated.
    `Iterator<Statement>` | `match(Resource subj, IRI pred, Value obj, Resource... contexts)` Deprecated. Gets the statements with the specified subject, predicate, object and (optionally) context.
    `void` | `setValueFactory(ValueFactory valueFactory)` Deprecated.
    `int` | `size()` Deprecated.

    - ### Methods inherited from class java.util.AbstractCollection

      `addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Collection

      `addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Field Detail

    - #### statements

          protected LinkedList<Statement> statements

      Deprecated.

    - #### valueFactory

          protected transient ValueFactory valueFactory

      Deprecated.

  - ### Constructor Detail

    - #### GraphImpl

          public GraphImpl(ValueFactory valueFactory)

      Deprecated.

    - #### GraphImpl

          public GraphImpl()

      Deprecated.

    - #### GraphImpl

          public GraphImpl(ValueFactory valueFactory,
                           Collection<? extends Statement> statements)

      Deprecated.

    - #### GraphImpl

          public GraphImpl(Collection<? extends Statement> statements)

      Deprecated.

  - ### Method Detail

    - #### getValueFactory

          public ValueFactory getValueFactory()

      Deprecated.
      Description copied from interface: `Graph`
      Gets the value factory for this graph.
      Specified by:
        `getValueFactory` in interface `Graph`

    - #### setValueFactory

          public void setValueFactory(ValueFactory valueFactory)

      Deprecated.

    - #### iterator

          public Iterator<Statement> iterator()

      Deprecated.
      Specified by:
        `iterator` in interface `Iterable<Statement>`
      Specified by:
        `iterator` in interface `Collection<Statement>`
      Specified by:
        `iterator` in class `AbstractCollection<Statement>`

    - #### size

          public int size()

      Deprecated.
      Specified by:
        `size` in interface `Collection<Statement>`
      Specified by:
        `size` in class `AbstractCollection<Statement>`

    - #### add

          public boolean add(Statement st)

      Deprecated.
      Specified by:
        `add` in interface `Collection<Statement>`
      Overrides:
        `add` in class `AbstractCollection<Statement>`

    - #### add

          public boolean add(Resource subj,
                             IRI pred,
                             Value obj,
                             Resource... contexts)

      Deprecated.
      Description copied from interface: `Graph`
      Adds one or more statements to the graph. This method creates a statement for each specified context and adds those to the graph. If no contexts are specified, a single statement with no associated context is added.
      Specified by:
        `add` in interface `Graph`
      Parameters:
        `subj` - The statement's subject, must not be `null`.
        `pred` - The statement's predicate, must not be `null`.
        `obj` - The statement's object, must not be `null`.
        `contexts` - The contexts to add statements to.

    - #### match

          public Iterator<Statement> match(Resource subj,
                                           IRI pred,
                                           Value obj,
                                           Resource... contexts)

      Deprecated.
      Description copied from interface: `Graph`
      Gets the statements with the specified subject, predicate, object and (optionally) context. The `subject`, `predicate` and `object` parameters can be `null` to indicate wildcards. The `contexts` parameter is a wildcard and accepts zero or more values. If no contexts are specified, statements will match disregarding their context. If one or more contexts are specified, statements with a context matching one of these will match. Note: to match statements without an associated context, specify the value `null` and explicitly cast it to type `Resource`.

      Examples: `graph.match(s1, null, null)` matches all statements that have subject `s1`,
      `graph.match(null, null, null, c1)` matches all statements that have context `c1`,
      `graph.match(null, null, null, (Resource)null)` matches all statements that have no associated context,
      `graph.match(null, null, null, c1, c2, c3)` matches all statements that have context `c1` , `c2` or `c3`.

      Specified by:
        `match` in interface `Graph`
      Parameters:
        `subj` - The subject of the statements to match, `null` to match statements with any subject.
        `pred` - The predicate of the statements to match, `null` to match statements with any predicate.
        `obj` - The object of the statements to match, `null` to match statements with any object.
        `contexts` - The contexts of the statements to match. If no contexts are specified, statements will match disregarding their context. If one or more contexts are specified, statements with a context matching one of these will match.
      Returns:
        The statements that match the specified pattern.

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.