public static Predicate of( XCriteriaBuilder criteriaBuilder, BooleanOperator operator, Predicate ... predicates) { XOrderedSet<Predicate> orderedSet = new LinkedHashSet<Predicate>((predicates.length * 4 + 2) / 3); int index = 0; for (Predicate predicate : predicates) { if (predicate != null) { mustUnderSameCriteriaBuilder( criteriaBuilder, "predicates[" + index + ']', predicate ); index++; orderedSet.add(predicate); } } if (orderedSet.isEmpty()) { return null; } if (orderedSet.size() == 1) { return orderedSet.iterator().next(); } return new CompoundPredicate( criteriaBuilder, operator, orderedSet.toArray(new Predicate[orderedSet.size()]) ); }
@Override public boolean hasNext() { this.checkForComodification(); this.parent.requiredEnabled(); return this.base.hasNext(); }
@Override public boolean isReadWriteLockSupported() { return this.base.isReadWriteLockSupported(); }
@Override public boolean isReadWriteLockSupported() { return this.getBase().isReadWriteLockSupported(); }
@Override public ViewInfo viewInfo() { return this.base.viewInfo(); }
@Override public UnifiedComparator<? super E> unifiedComparator() { return this.base.unifiedComparator(); }
@Override public UnifiedComparator<? super V> unifiedComparator() { return this.base.unifiedComparator(); }
@Override public void remove() { this.checkForComodification(); this.parent.enable(); this.base.remove(); }
@Override public void remove() { this.parent.enable(); this.getBase().remove(); }
@Override public boolean hasNext() { this.parent.requiredEnabled(); return this.getBase().hasNext(); }
@Override public boolean isReadWriteLockSupported() { return this.base.isReadWriteLockSupported(); }
@Override public ViewInfo viewInfo() { if (this.getRootData().getBase(true) == null) { return this.viewInfo; } return this.getBase().viewInfo(); }
@Override public V next() { this.parent.parentMap.requiredEnabled(); return this.getBase().next(); }
@Override public UnifiedComparator<? super K> unifiedComparator() { return this.getBase().unifiedComparator(); }
@Override public void remove() { this.parent.parentMap.enable(); this.getBase().remove(); }
@Override public boolean hasNext() { this.parent.parentMap.requiredEnabled(); return this.getBase().hasNext(); }
@Override public K next() { this.parent.requiredEnabled(); return this.getBase().next(); }
@Override public E next() { this.checkForComodification(); this.parent.requiredEnabled(); return this.base.next(); }