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

How to use
lastKey
method
in
java.util.TreeMap

Best Java code snippets using java.util.TreeMap.lastKey (Showing top 20 results out of 2,079)

origin: commons-collections/commons-collections

/**
 * Return the last (highest) key currently in this sorted map.
 * 
 * @return the last key in the map
 */
public Object lastKey() {
  if (fast) {
    return (map.lastKey());
  } else {
    synchronized (map) {
      return (map.lastKey());
    }
  }
}
origin: wildfly/wildfly

/**
 * Return the last (highest) key currently in this sorted map.
 * 
 * @return the last key in the map
 */
public Object lastKey() {
  if (fast) {
    return (map.lastKey());
  } else {
    synchronized (map) {
      return (map.lastKey());
    }
  }
}
origin: goldmansachs/gs-collections

public K lastKey()
{
  return this.treeMap.lastKey();
}
origin: eclipse/eclipse-collections

@Override
public K lastKey()
{
  return this.treeMap.lastKey();
}
origin: eclipse/eclipse-collections

@Override
public K lastKey()
{
  return this.treeMap.lastKey();
}
origin: apache/hive

public int removeBiggest() {
 Integer last = indexes.lastKey();
 indexes.remove(last);
 return last;
}
origin: apache/drill

public int removeBiggest() {
 Integer last = indexes.lastKey();
 indexes.remove(last);
 return last;
}
origin: org.apache.poi/poi-ooxml

/**
 * Gets the last row on the sheet
 *
 * @return last row contained n this sheet (0-based)
 */
@Override
public int getLastRowNum()
{
  return _rows.size() == 0 ? 0 : _rows.lastKey();
}
origin: apache/rocketmq

public long getMaxSpan() {
  try {
    this.lockTreeMap.readLock().lockInterruptibly();
    try {
      if (!this.msgTreeMap.isEmpty()) {
        return this.msgTreeMap.lastKey() - this.msgTreeMap.firstKey();
      }
    } finally {
      this.lockTreeMap.readLock().unlock();
    }
  } catch (InterruptedException e) {
    log.error("getMaxSpan exception", e);
  }
  return 0;
}
origin: kevin-wayne/algs4

/**
 * Returns the largest key in this symbol table.
 *
 * @return the largest key in this symbol table
 * @throws NoSuchElementException if this symbol table is empty
 */
public Key max() {
  if (isEmpty()) throw new NoSuchElementException("calls max() with empty symbol table");
  return st.lastKey();
}
origin: looly/hutool

/**
 * 下一个随机对象
 * 
 * @return 随机对象
 */
public T next() {
  if(MapUtil.isEmpty(this.weightMap)) {
    return null;
  }
  final double randomWeight = this.weightMap.lastKey() * random.nextDouble();
  final SortedMap<Double, T> tailMap = this.weightMap.tailMap(randomWeight, false);
  return this.weightMap.get(tailMap.firstKey());
}
origin: looly/hutool

/**
 * 下一个随机对象
 * 
 * @return 随机对象
 */
public T next() {
  if(MapUtil.isEmpty(this.weightMap)) {
    return null;
  }
  final double randomWeight = this.weightMap.lastKey() * random.nextDouble();
  final SortedMap<Double, T> tailMap = this.weightMap.tailMap(randomWeight, false);
  return this.weightMap.get(tailMap.firstKey());
}
origin: apache/kylin

void updateOnBufferChange() {
  if (aggBufMap.size() > aggregateBufferSizeLimit) {
    aggBufMap.pollLastEntry();
    Preconditions.checkState(aggBufMap.size() == aggregateBufferSizeLimit);
  }
  currentLastKey = aggBufMap.lastKey();
}
origin: apache/kylin

long getMaxKey() {
  return getKetamaNodes().lastKey();
}
origin: igniterealtime/Smack

public int loadCurrentOmemoSignedPreKeyId(OmemoDevice userDevice) {
  return loadOmemoSignedPreKeys(userDevice).lastKey();
}
origin: apache/rocketmq

public long commit() {
  try {
    this.lockTreeMap.writeLock().lockInterruptibly();
    try {
      Long offset = this.consumingMsgOrderlyTreeMap.lastKey();
      msgCount.addAndGet(0 - this.consumingMsgOrderlyTreeMap.size());
      for (MessageExt msg : this.consumingMsgOrderlyTreeMap.values()) {
        msgSize.addAndGet(0 - msg.getBody().length);
      }
      this.consumingMsgOrderlyTreeMap.clear();
      if (offset != null) {
        return offset + 1;
      }
    } finally {
      this.lockTreeMap.writeLock().unlock();
    }
  } catch (InterruptedException e) {
    log.error("commit exception", e);
  }
  return -1;
}
origin: pentaho/pentaho-kettle

@Override
public void add( String fileName, FileStream fileWriterOutputStream ) {
 long index = 0;
 if ( size() > 0 ) {
  index = indexMap.lastKey() + 1;
 }
 FileStreamsCollectionEntry newEntry = new FileStreamsCollectionEntry( fileName, index, fileWriterOutputStream );
 fileNameMap.put( fileName, newEntry );
 indexMap.put( index, newEntry );
 if ( fileWriterOutputStream.isOpen() ) {
  numOpenFiles++;
 }
}
origin: looly/hutool

/**
 * 增加对象权重
 * 
 * @param weightObj 权重对象
 * @return this
 */
public WeightRandom<T> add(WeightObj<T> weightObj) {
  if(null != weightObj) {
    final double weight = weightObj.getWeight();
    if(weightObj.getWeight() > 0) {
      double lastWeight = (this.weightMap.size() == 0) ? 0 : this.weightMap.lastKey();
      this.weightMap.put(weight + lastWeight, weightObj.getObj());// 权重累加
    }
  }
  return this;
}
origin: looly/hutool

/**
 * 增加对象权重
 * 
 * @param weightObj 权重对象
 * @return this
 */
public WeightRandom<T> add(WeightObj<T> weightObj) {
  if(null != weightObj) {
    final double weight = weightObj.getWeight();
    if(weightObj.getWeight() > 0) {
      double lastWeight = (this.weightMap.size() == 0) ? 0 : this.weightMap.lastKey();
      this.weightMap.put(weight + lastWeight, weightObj.getObj());// 权重累加
    }
  }
  return this;
}
origin: apache/rocketmq

public void fillProcessQueueInfo(final ProcessQueueInfo info) {
  try {
    this.lockTreeMap.readLock().lockInterruptibly();
    if (!this.msgTreeMap.isEmpty()) {
      info.setCachedMsgMinOffset(this.msgTreeMap.firstKey());
      info.setCachedMsgMaxOffset(this.msgTreeMap.lastKey());
      info.setCachedMsgCount(this.msgTreeMap.size());
      info.setCachedMsgSizeInMiB((int) (this.msgSize.get() / (1024 * 1024)));
    }
    if (!this.consumingMsgOrderlyTreeMap.isEmpty()) {
      info.setTransactionMsgMinOffset(this.consumingMsgOrderlyTreeMap.firstKey());
      info.setTransactionMsgMaxOffset(this.consumingMsgOrderlyTreeMap.lastKey());
      info.setTransactionMsgCount(this.consumingMsgOrderlyTreeMap.size());
    }
    info.setLocked(this.locked);
    info.setTryUnlockTimes(this.tryUnlockTimes.get());
    info.setLastLockTimestamp(this.lastLockTimestamp);
    info.setDroped(this.dropped);
    info.setLastPullTimestamp(this.lastPullTimestamp);
    info.setLastConsumeTimestamp(this.lastConsumeTimestamp);
  } catch (Exception e) {
  } finally {
    this.lockTreeMap.readLock().unlock();
  }
}
java.utilTreeMaplastKey

Popular methods of TreeMap

  • <init>
    Constructs a new tree map containing the same mappings and using the same ordering as the specified
  • put
    Associates the specified value with the specified key in this map. If the map previously contained a
  • get
    Returns the value to which the specified key is mapped, or null if this map contains no mapping for
  • entrySet
    Returns a Set view of the mappings contained in this map. The set's iterator returns the entries in
  • values
    Returns a Collection view of the values contained in this map. The collection's iterator returns the
  • size
    Returns the number of key-value mappings in this map.
  • keySet
    Returns a Set view of the keys contained in this map. The set's iterator returns the keys in ascendi
  • remove
    Removes the mapping for this key from this TreeMap if present.
  • containsKey
    Returns true if this map contains a mapping for the specified key.
  • isEmpty
  • clear
    Removes all of the mappings from this map. The map will be empty after this call returns.
  • firstKey
  • clear,
  • firstKey,
  • putAll,
  • firstEntry,
  • tailMap,
  • lastEntry,
  • floorEntry,
  • headMap,
  • subMap

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • 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
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JCheckBox (javax.swing)
  • Top PhpStorm plugins
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