congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Iterators.concat
Code IndexAdd Tabnine to your IDE (free)

How to use
concat
method
in
org.apache.jena.ext.com.google.common.collect.Iterators

Best Java code snippets using org.apache.jena.ext.com.google.common.collect.Iterators.concat (Showing top 4 results out of 315)

origin: apache/jena

/** Substitute into triple patterns */
public static Iterator<Triple> calcTriples(final List<Triple> triples, Iterator<Binding> bindings) {
  return Iterators.concat(Iter.map(bindings, new Function<Binding, Iterator<Triple>>() {
    Map<Node, Node> bNodeMap = new HashMap<>();
    @Override
    public Iterator<Triple> apply(final Binding b) {
      // Iteration is a new mapping of bnodes.
      bNodeMap.clear();
      List<Triple> tripleList = new ArrayList<>(triples.size());
      for ( Triple triple : triples ) {
        Triple q = subst(triple, b, bNodeMap);
        if ( !q.isConcrete() || !ModelUtils.isValidAsStatement(q.getSubject(), q.getPredicate(), q.getObject()) ) {
          // Log.warn(TemplateLib.class, "Unbound quad:
          // "+FmtUtils.stringForQuad(quad)) ;
          continue;
        }
        tripleList.add(q);
      }
      return tripleList.iterator();
    }
  }));
}
origin: apache/jena

/** Substitute into quad patterns */
public static Iterator<Quad> calcQuads(final List<Quad> quads, Iterator<Binding> bindings) {
  return Iterators.concat(Iter.map(bindings, new Function<Binding, Iterator<Quad>>() {
    Map<Node, Node> bNodeMap = new HashMap<>();
    @Override
    public Iterator<Quad> apply(final Binding b) {
      // Iteration is a new mapping of bnodes.
      bNodeMap.clear();
      List<Quad> quadList = new ArrayList<>(quads.size());
      for ( Quad quad : quads ) {
        Quad q = subst(quad, b, bNodeMap);
        if ( !q.isConcrete() ) {
          // Log.warn(TemplateLib.class, "Unbound quad:
          // "+FmtUtils.stringForQuad(quad)) ;
          continue;
        }
        quadList.add(q);
      }
      return quadList.iterator();
    }
  }));
}
origin: apache/jena

@Override
public Iterator<Quad> find(Node g, Node s, Node p, Node o) {
  return g.isConcrete()
      ? findInOneGraph(g, s, p, o)
      : concat(findNG(ANY, s, p, o), findInOneGraph(defaultGraphIRI, s, p, o));
}
origin: apache/jena

@Override
public Iterator<Quad> findNG(Node g, Node s, Node p, Node o) {
  return g.isConcrete()
      ? findInOneGraph(g, s, p, o)
      : concat(map(listGraphNodes(), gn -> findInOneGraph(gn, s, p, o)));
}
org.apache.jena.ext.com.google.common.collectIteratorsconcat

Popular methods of Iterators

  • forArray
  • size
  • toArray
  • transform

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JTextField (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now