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

How to use
remove
method
in
java.util.TreeMap

Best Java code snippets using java.util.TreeMap.remove (Showing top 20 results out of 4,509)

Refine searchRefine arrow

  • TreeMap.get
  • TreeMap.put
origin: org.osgi/org.osgi.compendium

private static void setPrincipalPermission(TreeMap principalPermissions, String principal, int perm) {
  if (perm == 0)
    principalPermissions.remove(principal);
  else
    principalPermissions.put(principal, new Integer(perm));
}
origin: apache/hive

private static boolean removeFromRunningTaskMap(TreeMap<Integer, TreeSet<TaskInfo>> runningTasks,
  Object task, TaskInfo taskInfo) {
 int priority = taskInfo.priority.getPriority();
 Set<TaskInfo> tasksAtPriority = runningTasks.get(priority);
 if (tasksAtPriority == null) return false;
 boolean result = tasksAtPriority.remove(taskInfo);
 if (tasksAtPriority.isEmpty()) {
  runningTasks.remove(priority);
 }
 return result;
}
origin: stackoverflow.com

if (valueMap.containsKey(k)){
  remove(k);
map.put("a", 5);
map.put("b", 1);
map.put("c", 3);
assertEquals("b",map.firstKey());
assertEquals("a",map.lastKey());
map.put("e", 2);
assertEquals(5, map.size());
assertEquals(2, (int) map.get("e"));
assertEquals(2, (int) map.get("d"));
origin: opentripplanner/OpenTripPlanner

  this.shortLengths.put(i, edge);
} else {
  this.lengths.put(i, edge);
  this.lengths.remove(e.getId());
} else  {
  Edge e0 = triangle.getEdges().get(0);
      && e1.getOV().isBorder() && e1.getEV().isBorder()) {
    this.shortLengths.put(e.getId(), e);
    this.lengths.remove(e.getId());
  } else {
        this.lengths.put(eC.getId(), eC);
      this.lengths.remove(eA.getId());
    } else if (eB.isBorder()) {
      this.edges.remove(eB.getId());
        this.lengths.put(eC.getId(), eC);
      this.lengths.remove(eB.getId());
    } else {
      this.edges.remove(eC.getId());
        this.lengths.put(eB.getId(), eB);
      this.lengths.remove(eC.getId());
origin: prestodb/presto

  if (name.split("\\.").length == size && name.startsWith(prefix)) {
    Optional<String> columnName = Optional.of(name.substring(name.lastIndexOf('.') + 1));
    Type columnType = fieldsMap.get(name);
    Field column = new Field(columnName, columnType);
    fieldsBuilder.add(column);
fieldsMap.put(prefix, RowType.from(fieldsBuilder.build()));
  columns.add(new ElasticsearchColumn(field, type, field, type.getDisplayName(), arrays.contains(field), -1));
fieldsMap.remove(field);
origin: kevin-wayne/algs4

/**
 * Inserts the specified key-value pair into the symbol table, overwriting the old 
 * value with the new value if the symbol table already contains the specified key.
 * Deletes the specified key (and its associated value) from this symbol table
 * if the specified value is {@code null}.
 *
 * @param  key the key
 * @param  val the value
 * @throws IllegalArgumentException if {@code key} is {@code null}
 */
public void put(Key key, Value val) {
  if (key == null) throw new IllegalArgumentException("calls put() with null key");
  if (val == null) st.remove(key);
  else             st.put(key, val);
}
origin: FudanNLP/fnlp

private void deleteSortMap(int a, int b, double oridata) {
  Set<String> set = sortmap.get(oridata);
  if (set == null)
    return;
  if (set.size() == 1)
    sortmap.remove(oridata);
  else
    set.remove(id2String(a, b));
}
origin: apache/incubator-gobblin

   return false;
  tmpSize -= this.workUnitsMap.get(existingFileSet).size();
  partitionsToDelete.add(existingFileSet);
  if (tmpSize + workUnits.size() <= this.strictMaxSize) {
  List<WorkUnit> workUnitsRemoved = this.workUnitsMap.remove(fileSetToRemove);
  this.currentSize -= workUnitsRemoved.size();
 this.workUnitsMap.put(fileSet, workUnits);
} else {
 this.workUnitsMap.get(fileSet).addAll(workUnits);
origin: apache/storm

@Override
public void resumeFromBlacklist() {
  Set<String> readyToRemove = new HashSet<>();
  for (Map.Entry<String, Integer> entry : blacklist.entrySet()) {
    String key = entry.getKey();
    int value = entry.getValue() - 1;
    if (value == 0) {
      readyToRemove.add(key);
    } else {
      blacklist.put(key, value);
    }
  }
  for (String key : readyToRemove) {
    blacklist.remove(key);
    LOG.info("Supervisor {} has been blacklisted more than resume period. Removed from blacklist.", key);
  }
}
origin: apache/ignite

/** */
private synchronized void onQueryDone(UUID nodeId, Long ver) {
  TreeMap<Long, AtomicInteger> nodeMap = activeQueries.get(nodeId);
  if (nodeMap == null)
    return;
  assert minQry != null;
  AtomicInteger cntr = nodeMap.get(ver);
  assert cntr != null && cntr.get() > 0 : "onQueryDone ver=" + ver;
  if (cntr.decrementAndGet() == 0) {
    nodeMap.remove(ver);
    if (nodeMap.isEmpty())
      activeQueries.remove(nodeId);
    if (ver.equals(minQry))
      minQry = activeMinimal();
  }
}
origin: apache/incubator-pinot

ImmutablePair<String, Object> groupKeyResultPair = new ImmutablePair<>(groupKey, result);
List<ImmutablePair<String, Object>> groupKeyResultPairs = _treeMap.get(newKey);
if (_numValuesAdded >= _trimSize) {
   _treeMap.put(newKey, groupKeyResultPairs);
   _treeMap.remove(maxKey);
  _treeMap.put(newKey, groupKeyResultPairs);
origin: apache/rocketmq

public void makeMessageToCosumeAgain(List<MessageExt> msgs) {
  try {
    this.lockTreeMap.writeLock().lockInterruptibly();
    try {
      for (MessageExt msg : msgs) {
        this.consumingMsgOrderlyTreeMap.remove(msg.getQueueOffset());
        this.msgTreeMap.put(msg.getQueueOffset(), msg);
      }
    } finally {
      this.lockTreeMap.writeLock().unlock();
    }
  } catch (InterruptedException e) {
    log.error("makeMessageToCosumeAgain exception", e);
  }
}
origin: org.apache.poi/poi-ooxml

/**
 * Remove a relationship by its ID.
 *
 * @param id
 *            The relationship ID to remove.
 */
public void removeRelationship(String id) {
  PackageRelationship rel = relationshipsByID.get(id);
  if (rel != null) {
    relationshipsByID.remove(rel.getId());
    relationshipsByType.values().remove(rel);
    internalRelationshipsByTargetName.values().remove(rel);
  }
}
origin: h2oai/h2o-2

assert(prob >= 0 && prob <= 1) : "prob is not inside [0,1]: " + prob;
if (prob_idx.containsKey(prob)) {
 prob_idx.get(prob).add(label); //add all ties
} else {
  List<Integer> li = new LinkedList<Integer>();
  li.add(label);
  prob_idx.put(prob, li);
  prob_idx.remove(prob_idx.lastKey());
prob_idx.remove(prob);
origin: apache/storm

    LOG.debug("supervisorsWithFailures : {}", supervisorsWithFailures);
    reporter.reportBlacklist(supervisor, supervisorsWithFailures);
    blacklist.put(supervisor, resumeTime / nimbusMonitorFreqSecs);
LOG.debug("Releasing {} nodes because of low resources", toRelease.size());
for (String key: toRelease) {
  blacklist.remove(key);
origin: graphhopper/graphhopper

void remove(int key, int value) {
  GHIntHashSet set = map.get(value);
  if (set == null || !set.remove(key)) {
    throw new IllegalStateException("cannot remove key " + key + " with value " + value
        + " - did you insert " + key + "," + value + " before?");
  }
  size--;
  if (set.isEmpty()) {
    map.remove(value);
  }
}
origin: apache/nifi

List<FileStatus> entitiesForTimestamp = orderedEntries.get(status.getModificationTime());
if (entitiesForTimestamp == null) {
  entitiesForTimestamp = new ArrayList<FileStatus>();
  orderedEntries.put(status.getModificationTime(), entitiesForTimestamp);
orderedEntries.remove(latestListingTimestamp);
origin: com.h2database/h2

@Override
public void moveTo(FilePath newName, boolean atomicReplace) {
  synchronized (MEMORY_FILES) {
    if (!atomicReplace && !name.equals(newName.name) &&
        MEMORY_FILES.containsKey(newName.name)) {
      throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2, name, newName + " (exists)");
    }
    FileNioMemData f = getMemoryFile();
    f.setName(newName.name);
    MEMORY_FILES.remove(name);
    MEMORY_FILES.put(newName.name, f);
  }
}
origin: org.apache.poi/poi-ooxml

private void flushOneRow() throws IOException
{
  Integer firstRowNum = _rows.firstKey();
  if (firstRowNum!=null) {
    int rowIndex = firstRowNum.intValue();
    SXSSFRow row = _rows.get(firstRowNum);
    // Update the best fit column widths for auto-sizing just before the rows are flushed
    _autoSizeColumnTracker.updateColumnWidths(row);
    _writer.writeRow(rowIndex, row);
    _rows.remove(firstRowNum);
    lastFlushedRowNumber = rowIndex;
  }
}
public void changeRowNum(SXSSFRow row, int newRowNum)
origin: spotbugs/spotbugs

  if (matchOld.match(bug)) {
    LinkedList<BugInstance> q = set.get(bug);
    if (q == null) {
      q = new LinkedList<>();
      set.put(bug, q);
if (!mapFromNewToOldBug.containsKey(bug)) {
  LinkedList<BugInstance> q = set.get(bug);
  if (q == null) {
    continue;
    i.remove();
    if (q.isEmpty()) {
      set.remove(bug);
java.utilTreeMapremove

Javadoc

Removes the mapping for this key from this TreeMap if present.

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
  • 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
  • putAll
    Copies all of the mappings from the specified map to this map. These mappings replace any mappings t
  • firstKey,
  • putAll,
  • lastKey,
  • firstEntry,
  • tailMap,
  • lastEntry,
  • floorEntry,
  • headMap,
  • subMap

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • findViewById (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • String (java.lang)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • BoxLayout (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