org.eclipse.rdf4j.query.algebra.evaluation.limited.iterator

## Class LimitedSizeIteratorUtil

- java.lang.Object
- - org.eclipse.rdf4j.query.algebra.evaluation.limited.iterator.LimitedSizeIteratorUtil

-     public class LimitedSizeIteratorUtil
      extends Object

  Author:
    Jerven Bolleman, SIB Swiss Institute of Bioinformatics

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LimitedSizeIteratorUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <V> boolean` | `add(V object, Collection<V> excludeSet, AtomicLong used, long maxSize)`
    `static Set<BindingSet>` | `addAll(Iteration<? extends BindingSet,? extends QueryEvaluationException> arg2, Set<BindingSet> includeSet, AtomicLong used, long maxSize)`

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

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

- - ### Constructor Detail

    - #### LimitedSizeIteratorUtil

          public LimitedSizeIteratorUtil()

  - ### Method Detail

    - #### addAll

          public static Set<BindingSet> addAll(Iteration<? extends BindingSet,? extends QueryEvaluationException> arg2,
                                               Set<BindingSet> includeSet,
                                               AtomicLong used,
                                               long maxSize)
                                        throws QueryEvaluationException

      Parameters:
        `arg2` - the iteration with elements to add to the includeSet
        `includeSet` - the set that should have all unique elements of arg2
        `used` - the collection size counter of all collections used in answering a query
        `maxSize` - the point at which we throw a new query exception
      Returns:
        the includeSet
      Throws:
        `QueryEvaluationException` - trigerred when maxSize is smaller than the used value

    - #### add

          public static <V> boolean add(V object,
                                        Collection<V> excludeSet,
                                        AtomicLong used,
                                        long maxSize)
                                 throws QueryEvaluationException

      Parameters:
        `object` - object to put in set if not there already.
        `excludeSet` - set that we need to store object in.
        `used` - AtomicLong tracking how many elements we have in storage.
        `maxSize` -
      Throws:
        `QueryEvaluationException` - when the object is added to the set and the total elements in all limited size collections exceed the allowed maxSize.

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