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

How to use
filter
method
in
org.apache.drill.shaded.guava.com.google.common.collect.Sets

Best Java code snippets using org.apache.drill.shaded.guava.com.google.common.collect.Sets.filter (Showing top 15 results out of 315)

origin: org.apache.drill/drill-shaded-guava

@Override
protected Set<Entry<K, V>> createEntrySet() {
 return Sets.filter(unfiltered.entrySet(), predicate);
}
origin: org.apache.drill/drill-shaded-guava

@Override
Set<K> createKeySet() {
 return Sets.filter(unfiltered.keySet(), keyPredicate);
}
origin: org.apache.drill/drill-shaded-guava

FilteredEntryMap(Map<K, V> unfiltered, Predicate<? super Entry<K, V>> entryPredicate) {
 super(unfiltered, entryPredicate);
 filteredEntrySet = Sets.filter(unfiltered.entrySet(), predicate);
}
origin: org.apache.drill.exec/drill-java-exec

@Override
public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException {
 return super.list(location, packageName, Sets.filter(kinds, NO_SOURCES_KIND), recurse);
}
origin: org.apache.drill/drill-shaded-guava

@Override
Set<Entry<E>> createEntrySet() {
 return Sets.filter(
   unfiltered.entrySet(),
   new Predicate<Entry<E>>() {
    @Override
    public boolean apply(Entry<E> entry) {
     return predicate.apply(entry.getElement());
    }
   });
}
origin: org.apache.drill/drill-shaded-guava

static <E> Collection<E> filterCollection(
  Collection<E> collection, Predicate<? super E> predicate) {
 if (collection instanceof Set) {
  return Sets.filter((Set<E>) collection, predicate);
 } else {
  return Collections2.filter(collection, predicate);
 }
}
origin: org.apache.drill/drill-shaded-guava

@Override
Set<K> createKeySet() {
 return Sets.filter(unfiltered.keySet(), keyPredicate);
}
origin: org.apache.drill/drill-shaded-guava

@Override
Set<E> createElementSet() {
 return Sets.filter(unfiltered.elementSet(), predicate);
}
origin: org.apache.drill/drill-shaded-guava

@Override
public Set<E> edgesConnecting(N nodeU, N nodeV) {
 Set<E> outEdgesU = outEdges(nodeU);
 Set<E> inEdgesV = inEdges(nodeV);
 return outEdgesU.size() <= inEdgesV.size()
   ? unmodifiableSet(Sets.filter(outEdgesU, connectedPredicate(nodeU, nodeV)))
   : unmodifiableSet(Sets.filter(inEdgesV, connectedPredicate(nodeV, nodeU)));
}
origin: org.apache.drill/drill-shaded-guava

@Override
public NavigableSet<E> descendingSet() {
 return Sets.filter(unfiltered().descendingSet(), predicate);
}
origin: org.apache.drill/drill-shaded-guava

@Override
public NavigableSet<E> subSet(
  E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) {
 return filter(
   unfiltered().subSet(fromElement, fromInclusive, toElement, toInclusive), predicate);
}
origin: org.apache.drill/drill-shaded-guava

 @Override
 public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
  return filter(unfiltered().tailSet(fromElement, inclusive), predicate);
 }
}
origin: org.apache.drill/drill-shaded-guava

@Override
public NavigableSet<E> headSet(E toElement, boolean inclusive) {
 return filter(unfiltered().headSet(toElement, inclusive), predicate);
}
origin: org.apache.drill/drill-shaded-guava

@Override
Set<Entry<K, V>> createEntries() {
 return Sets.filter(unfiltered().entries(), entryPredicate());
}
origin: org.apache.drill/drill-shaded-guava

return filter((SortedSet<E>) unfiltered, predicate);
org.apache.drill.shaded.guava.com.google.common.collectSetsfilter

Javadoc

Returns the elements of a NavigableSet, unfiltered, that satisfy a predicate. The returned set is a live view of unfiltered; changes to one affect the other.

The resulting set's iterator does not support remove(), but all other set methods are supported. When given an element that doesn't satisfy the predicate, the set's add() and addAll() methods throw an IllegalArgumentException. When methods such as removeAll() and clear() are called on the filtered set, only elements that satisfy the filter will be removed from the underlying set.

The returned set isn't threadsafe or serializable, even if unfiltered is.

Many of the filtered set's methods, such as size(), iterate across every element in the underlying set and determine which elements satisfy the filter. When a live view is not needed, it may be faster to copy Iterables.filter(unfiltered, predicate) and use the copy.

Warning: predicate must be consistent with equals, as documented at Predicate#apply. Do not provide a predicate such as Predicates.instanceOf(ArrayList.class), which is inconsistent with equals. (See Iterables#filter(Iterable,Class) for related functionality.)

Popular methods of Sets

  • newHashSet
    Creates a mutable HashSet instance initially containing the given elements.Note: if elements are non
  • newLinkedHashSet
    Creates a mutable LinkedHashSet instance containing the given elements in order. Note: if mutability
  • newTreeSet
    Creates a mutable, empty TreeSet instance with the given comparator.Note: if mutability is not requi
  • union
    Returns an unmodifiable view of the union of two sets. The returned set contains all elements that a
  • intersection
    Returns an unmodifiable view of the intersection of two sets. The returned set contains all elements
  • newHashSetWithExpectedSize
    Returns a new hash set using the smallest initial table size that can hold expectedSizeelements with
  • newIdentityHashSet
    Creates an empty Set that uses identity to determine equality. It compares object references, instea
  • cartesianProduct
    Returns every possible list that can be formed by choosing one element from each of the given sets i
  • difference
    Returns an unmodifiable view of the difference of two sets. The returned set contains all elements t
  • equalsImpl
    An implementation for Set#equals(Object).
  • hashCodeImpl
    An implementation for Set#hashCode().
  • immutableEnumSet
    Returns an immutable set instance containing the given enum elements. Internally, the returned set w
  • hashCodeImpl,
  • immutableEnumSet,
  • makeComplementByHand,
  • newConcurrentHashSet,
  • newLinkedHashSetWithExpectedSize,
  • removeAllImpl,
  • unmodifiableNavigableSet

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • String (java.lang)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • CodeWhisperer 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