Class AbstractImmutableAtomSet

java.lang.Object
fr.lirmm.graphik.integraal.core.atomset.AbstractAtomSet
fr.lirmm.graphik.integraal.core.atomset.AbstractImmutableAtomSet
All Implemented Interfaces:
AtomSet, CloseableIterable<Atom>

public abstract class AbstractImmutableAtomSet extends AbstractAtomSet
Base implementation for immutable atom sets.
Author:
Clément Sipieter (INRIA) <clement@6pi.fr>
  • Constructor Details

    • AbstractImmutableAtomSet

      protected AbstractImmutableAtomSet()
      Creates an abstract immutable atom set base implementation.
  • Method Details

    • add

      public boolean add(Atom atom) throws AtomSetException
      Description copied from interface: AtomSet
      Add the specified atom to this atom set if is not already present.
      Parameters:
      atom - the atom to be added to this atom set
      Returns:
      true if this atom set did not already contain the specified atom
      Throws:
      AtomSetException - if the atom cannot be added
    • addAll

      public boolean addAll(CloseableIterator<? extends Atom> atoms) throws AtomSetException
      Description copied from interface: AtomSet
      Add the specified atom stream to this atom set.
      Specified by:
      addAll in interface AtomSet
      Overrides:
      addAll in class AbstractAtomSet
      Parameters:
      atoms - the atom stream to add
      Returns:
      true if this atomset changed as a result of the call.
      Throws:
      AtomSetException - if the atoms cannot be added
    • addAll

      public boolean addAll(AtomSet atoms) throws AtomSetException
      Description copied from interface: AtomSet
      Adds all atoms from the specified atom set.
      Specified by:
      addAll in interface AtomSet
      Overrides:
      addAll in class AbstractAtomSet
      Parameters:
      atoms - the atom set to add
      Returns:
      true if this atomset changed as a result of the call.
      Throws:
      AtomSetException - if the atoms cannot be added
    • remove

      public boolean remove(Atom atom) throws AtomSetException
      Description copied from interface: AtomSet
      Remove the specified atom from this this atom set.
      Specified by:
      remove in interface AtomSet
      Overrides:
      remove in class AbstractAtomSet
      Parameters:
      atom - the atom to be removed
      Returns:
      true if this atom set contained the specified atom.
      Throws:
      AtomSetException - if the atom cannot be removed
    • removeAll

      public boolean removeAll(CloseableIterator<? extends Atom> atoms) throws AtomSetException
      Description copied from interface: AtomSet
      Remove the specified atom stream from this atom set.
      Specified by:
      removeAll in interface AtomSet
      Overrides:
      removeAll in class AbstractAtomSet
      Parameters:
      atoms - the atom stream to be removed
      Returns:
      true if this atomset changed as a result of the call. In many implementations, the return value is only true since it's time consuming to test the effective modification of the store (e.g. RDBMS, RDF4J...)
      Throws:
      AtomSetException - if the atoms cannot be removed
    • removeAll

      public boolean removeAll(AtomSet atoms) throws AtomSetException
      Description copied from interface: AtomSet
      Removes all atoms contained in the specified atom set.
      Specified by:
      removeAll in interface AtomSet
      Overrides:
      removeAll in class AbstractAtomSet
      Parameters:
      atoms - the atoms to remove
      Returns:
      true if this atom set changed as a result of the call
      Throws:
      AtomSetException - if the atoms cannot be removed
    • clear

      public void clear() throws AtomSetException
      Description copied from interface: AtomSet
      Removes all atoms from this atom set.
      Throws:
      AtomSetException - if the set cannot be cleared