/** * Creates a Tuples object with the given collections. The results will be * n-tuples, where each element i of the resulting tuple is from the i'th * collection. */ public Tuples(List<Collection<T>> collections) { for (Collection<T> c : collections) { add(c); } }
@Override public Set<Key> extract(JsonDoc doc,Set<Key> set) { if(set==null) set=new HashSet<>(); Tuples<Key> tuples=new Tuples<>(); for(int i=0;i<keyFields.length;i++) { tuples.add(keyFields[i].extract(doc,null)); } for(Iterator<List<Key>> itr=tuples.tuples();itr.hasNext();) { List<Key> l=itr.next(); set.add(new ArrayKey(l.toArray(new Key[l.size()]))); } return set; } }
public Set<JsonDoc> find(LookupSpec spec) { Set<JsonDoc> results=new HashSet<>(); if(spec.multiValued()) { Tuples<Object> tuples=new Tuples<>(); spec.iterate(tuples); for(Iterator<List<Object>> itr=tuples.tuples();itr.hasNext();) { List<Object> tuple=itr.next(); LookupSpec singleValueSpec=spec.next(tuple.iterator()); findSingleValue(singleValueSpec,results); } } else { findSingleValue(spec,results); } return results; }
@Override public Stream<JoinTuple> stream() { Iterable<JoinTuple> itr = () -> new JoinTupleIterator(tuples.tuples(), parentIndex, parentReference); return StreamSupport.stream(itr.spliterator(), false); } }
@Override public Set<Key> extract(JsonDoc doc,Set<Key> set) { if(set==null) set=new HashSet<>(); Tuples<Key> tuples=new Tuples<>(); for(int i=0;i<keyFields.length;i++) { tuples.add(keyFields[i].extract(doc,null)); } for(Iterator<List<Key>> itr=tuples.tuples();itr.hasNext();) { List<Key> l=itr.next(); set.add(new ArrayKey(l.toArray(new Key[l.size()]))); } return set; } }
public Set<JsonDoc> find(LookupSpec spec) { Set<JsonDoc> results=new HashSet<>(); if(spec.multiValued()) { Tuples<Object> tuples=new Tuples<>(); spec.iterate(tuples); for(Iterator<List<Object>> itr=tuples.tuples();itr.hasNext();) { List<Object> tuple=itr.next(); LookupSpec singleValueSpec=spec.next(tuple.iterator()); findSingleValue(singleValueSpec,results); } } else { findSingleValue(spec,results); } return results; }
@Override public Stream<JoinTuple> stream() { Iterable<JoinTuple> itr = () -> new JoinTupleIterator(tuples.tuples(), parentIndex, parentReference); return StreamSupport.stream(itr.spliterator(), false); } }
/** * Creates a Tuples object with the given collections. The results will be * n-tuples, where each element i of the resulting tuple is from the i'th * collection. */ public Tuples(Collection<T>... coll) { for (Collection<T> c : coll) { add(c); } }
/** * Creates a Tuples object with the given collections. The results will be * n-tuples, where each element i of the resulting tuple is from the i'th * collection. */ public Tuples(Collection<T>... coll) { for (Collection<T> c : coll) { add(c); } }
List<BindQuery> ret = new ArrayList<>(); if (parentAq.getQuery() != null) { Tuples<Binder> binderTuple = new Tuples<>(); l.add(new Binder(bo, getValue(bo.getFieldInfo().getFieldMd(), cursor.getCurrentValue()))); binderTuple.add(l); } else { List<Binder> l = new ArrayList<>(1); l.add(new Binder(bo, getValue(bo.getFieldInfo().getFieldMd(), doc.get(field)))); binderTuple.add(l); for (Iterator<List<Binder>> itr = binderTuple.tuples(); itr.hasNext();) { ret.add(new BindQuery(itr.next()));
/** * Creates a Tuples object with the given collections. The results will be * n-tuples, where each element i of the resulting tuple is from the i'th * collection. */ public Tuples(Collection<T>... coll) { for (Collection<T> c : coll) { add(c); } }
Tuples<BindQuery> btuples = new Tuples<>(); if (tuple.getParentDocument() != null) { AssociationQuery aq = childBlock.getAssociationQueryForEdge(tuple.getParentDocument().getBlock()); List<BindQuery> l = new ArrayList<>(1); l.add(parentb); btuples.add(l); AssociationQuery aq = childBlock.getAssociationQueryForEdge(childDoc.getBlock()); List<BindQuery> binders = childDoc.getBindersForParent(aq); btuples.add(binders); ArrayList<QueryExpression> ret = new ArrayList<>(); if (query != null) { for (Iterator<List<BindQuery>> itr = btuples.tuples(); itr.hasNext();) { List<BindQuery> binders = itr.next(); BindQuery allBinders = BindQuery.combine(binders);
/** * Creates a Tuples object with the given collections. The results will be * n-tuples, where each element i of the resulting tuple is from the i'th * collection. */ public Tuples(List<Collection<T>> collections) { for (Collection<T> c : collections) { add(c); } }
/** * Creates a Tuples object with the given collections. The results will be * n-tuples, where each element i of the resulting tuple is from the i'th * collection. */ public Tuples(List<Collection<T>> collections) { for (Collection<T> c : collections) { add(c); } }
List<BindQuery> ret = new ArrayList<>(); if (parentAq.getQuery() != null) { Tuples<Binder> binderTuple = new Tuples<>(); l.add(new Binder(bo, getValue(bo.getFieldInfo().getFieldMd(), cursor.getCurrentValue()))); binderTuple.add(l); } else { List<Binder> l = new ArrayList<>(1); l.add(new Binder(bo, getValue(bo.getFieldInfo().getFieldMd(), doc.get(field)))); binderTuple.add(l); for (Iterator<List<Binder>> itr = binderTuple.tuples(); itr.hasNext();) { ret.add(new BindQuery(itr.next()));