Example usage for java.util NavigableSet tailSet

List of usage examples for java.util NavigableSet tailSet

Introduction

In this page you can find the example usage for java.util NavigableSet tailSet.

Prototype

SortedSet<E> tailSet(E fromElement);

Source Link

Document

Equivalent to tailSet(fromElement, true) .

Usage

From source file:org.apache.hadoop.hbase.regionserver.Memcache.java

private boolean remove(final NavigableSet<KeyValue> set, final KeyValue kv) {
    SortedSet<KeyValue> s = set.tailSet(kv);
    if (s.isEmpty()) {
        return false;
    }/*from  w w w  .  j  ava2  s  .  c om*/
    boolean removed = false;
    for (KeyValue k : s) {
        if (this.comparatorIgnoreType.compare(k, kv) == 0) {
            // Same r/c/ts.  Remove it.
            s.remove(k);
            removed = true;
            continue;
        }
        break;
    }
    return removed;
}