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

How to use
java.util.TreeMap
constructor

Best Java code snippets using java.util.TreeMap.<init> (Showing top 20 results out of 50,283)

Refine searchRefine arrow

  • Map.put
  • Map.get
  • PrintStream.println
  • Map.Entry.getKey
  • Map.Entry.getValue
  • TreeMap.put
  • Map.keySet
  • Map.entrySet
origin: skylot/jadx

private void attachSourceLine(int decompiledLine, int sourceLine) {
  if (lineMap.isEmpty()) {
    lineMap = new TreeMap<>();
  }
  lineMap.put(decompiledLine, sourceLine);
}
origin: bumptech/glide

private NavigableMap<Integer, Integer> getSizesForConfig(Bitmap.Config config) {
 NavigableMap<Integer, Integer> sizes = sortedSizes.get(config);
 if (sizes == null) {
  sizes = new TreeMap<>();
  sortedSizes.put(config, sizes);
 }
 return sizes;
}
origin: apache/storm

public static TreeMap<Integer, Integer> integerDivided(int sum, int numPieces) {
  int base = sum / numPieces;
  int numInc = sum % numPieces;
  int numBases = numPieces - numInc;
  TreeMap<Integer, Integer> ret = new TreeMap<Integer, Integer>();
  ret.put(base, numBases);
  if (numInc != 0) {
    ret.put(base + 1, numInc);
  }
  return ret;
}
origin: stackoverflow.com

 public static void main(String[] args) throws Exception {

  Map<String, Integer> lookup = 
    new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);

  lookup.put("One", 1);
  lookup.put("tWo", 2);
  lookup.put("thrEE", 3);

  System.out.println(lookup.get("Two"));
  System.out.println(lookup.get("three"));
}
origin: neo4j/neo4j

private Iterable<Map.Entry<Integer,String>> sortCreatedTokensById()
{
  Map<Integer,String> sorted = new TreeMap<>();
  for ( Map.Entry<String,Integer> entry : tokens.entrySet() )
  {
    sorted.put( entry.getValue(), entry.getKey() );
  }
  return sorted.entrySet();
}
origin: stackoverflow.com

SortedMap<String, Double> myMap = new TreeMap<String, Double>();
 myMap.put("a", 10.0);
 myMap.put("b", 9.0);
 myMap.put("c", 11.0);
 myMap.put("d", 2.0);
 sortedset.addAll(myMap.entrySet());
 System.out.println(sortedset);
origin: apache/ignite

/** {@inheritDoc} */
@Override public TreeMap<Integer, Double> computeDistributionFunction() {
  TreeMap<Integer, Double> res = new TreeMap<>();
  double accum = 0.0;
  for (Integer bucket : hist.keySet()) {
    accum += hist.get(bucket);
    res.put(bucket, accum);
  }
  return res;
}
origin: stackoverflow.com

HashMap<String, Double> map = new HashMap<String, Double>();
ValueComparator bvc = new ValueComparator(map);
TreeMap<String, Double> sorted_map = new TreeMap<String, Double>(bvc);
map.put("D", 67.3);
System.out.println("unsorted map: " + map);
sorted_map.putAll(map);
System.out.println("results: " + sorted_map);
if (base.get(a) >= base.get(b)) {
  return -1;
} else {
origin: apache/hive

private String propertiesToString(Map<String, String> props, List<String> exclude) {
 String prop_string = "";
 if (!props.isEmpty()) {
  Map<String, String> properties = new TreeMap<String, String>(props);
  List<String> realProps = new ArrayList<String>();
  for (String key : properties.keySet()) {
   if (properties.get(key) != null && (exclude == null || !exclude.contains(key))) {
    realProps.add("  '" + key + "'='" +
      HiveStringUtils.escapeHiveCommand(properties.get(key)) + "'");
   }
  }
  prop_string += StringUtils.join(realProps, ", \n");
 }
 return prop_string;
}
origin: Alluxio/alluxio

private Map<String, Capacity> getTierCapacityInternal() {
 SortedMap<String, Capacity> tierCapacity = new TreeMap<>(getTierAliasComparator());
 Map<String, Long> capacityBytesOnTiers = mStoreMeta.getCapacityBytesOnTiers();
 Map<String, Long> usedBytesOnTiers = mStoreMeta.getUsedBytesOnTiers();
 for (Map.Entry<String, Long> entry : capacityBytesOnTiers.entrySet()) {
  tierCapacity.put(entry.getKey(),
    new Capacity().setTotal(entry.getValue()).setUsed(usedBytesOnTiers.get(entry.getKey())));
 }
 return tierCapacity;
}
origin: apache/hbase

private void printRow(TRowResult rowResult) {
 // copy values into a TreeMap to get them in sorted order
 TreeMap<String, TCell> sorted = new TreeMap<>();
 for (Map.Entry<ByteBuffer, TCell> column : rowResult.columns.entrySet()) {
  sorted.put(utf8(column.getKey().array()), column.getValue());
 }
 StringBuilder rowStr = new StringBuilder();
 for (SortedMap.Entry<String, TCell> entry : sorted.entrySet()) {
  rowStr.append(entry.getKey());
  rowStr.append(" => ");
  rowStr.append(utf8(entry.getValue().value.array()));
  rowStr.append("; ");
 }
 System.out.println("row: " + utf8(rowResult.row.array()) + ", cols: " + rowStr);
}
origin: stackoverflow.com

 Map<String, Object> map = new TreeMap<String, Object>();
/* Add entries to the map in any order. */
...
/* Now, iterate over the map's contents, sorted by key. */
for (Map.Entry<String, ?> entry : map.entrySet()) {
 System.out.println(entry.getKey() + ": " + entry.getValue());
}
origin: stackoverflow.com

 Map<String, String> map = new HashMap<String, String>();        
Map<String, String> treeMap = new TreeMap<String, String>(map);
for (String str : treeMap.keySet()) {
  System.out.println(str);
}
origin: apache/storm

@Override
public void prepare(Map<String, Object> conf) {
  toleranceCount = ObjectReader.getInt(conf.get(DaemonConfig.BLACKLIST_SCHEDULER_TOLERANCE_COUNT),
                     DEFAULT_BLACKLIST_SCHEDULER_TOLERANCE_COUNT);
  resumeTime = ObjectReader.getInt(conf.get(DaemonConfig.BLACKLIST_SCHEDULER_RESUME_TIME), DEFAULT_BLACKLIST_SCHEDULER_RESUME_TIME);
  String reporterClassName = ObjectReader.getString(conf.get(DaemonConfig.BLACKLIST_SCHEDULER_REPORTER),
                           LogReporter.class.getName());
  reporter = (IReporter) initializeInstance(reporterClassName, "blacklist reporter");
  nimbusMonitorFreqSecs = ObjectReader.getInt(conf.get(DaemonConfig.NIMBUS_MONITOR_FREQ_SECS));
  blacklist = new TreeMap<>();
}
origin: redisson/redisson

@Override
protected Map<Integer, TypeDefinition> resolveInitializationTypes(ArgumentHandler argumentHandler) {
  SortedMap<Integer, TypeDefinition> namedTypes = new TreeMap<Integer, TypeDefinition>();
  for (Map.Entry<String, TypeDefinition> entry : this.namedTypes.entrySet()) {
    namedTypes.put(argumentHandler.named(entry.getKey()), entry.getValue());
  }
  return namedTypes;
}
origin: hankcs/HanLP

@Override
public Map<String, Double> computeScore(String outerSentence)
{
  TreeMap<String, Double> result = new TreeMap<String, Double>(Collections.reverseOrder());
  T keyOuter = generateKey(outerSentence);
  if (keyOuter == null) return result;
  for (Map.Entry<T, Set<String>> entry : storage.entrySet())
  {
    T key = entry.getKey();
    Double score = keyOuter.similarity(key);
    for (String sentence : entry.getValue())
    {
      result.put(sentence, score);
    }
  }
  return result;
}
origin: hankcs/HanLP

/**
 * 克隆一个状态<br>
 * Constructs an MDAGNode possessing the same accept state status and outgoing transitions as another.
 
 * @param node      the MDAGNode possessing the accept state status and 
 *                  outgoing transitions that the to-be-created MDAGNode is to take on
 */
private MDAGNode(MDAGNode node)
{
  isAcceptNode = node.isAcceptNode;
  outgoingTransitionTreeMap = new TreeMap<Character, MDAGNode>(node.outgoingTransitionTreeMap);
  
  //Loop through the nodes in this node's outgoing _transition set, incrementing the number of
  //incoming transitions of each by 1 (to account for this newly created node's outgoing transitions)
  for(Entry<Character, MDAGNode> transitionKeyValuePair : outgoingTransitionTreeMap.entrySet())
    transitionKeyValuePair.getValue().incomingTransitionCount++;
  /////
}

origin: stackoverflow.com

Map<Float,String> mySortedMap = new TreeMap<Float,MyObject>();
 // Put some values in it
 mySortedMap.put(1.0f,"One");
 mySortedMap.put(0.0f,"Zero");
 mySortedMap.put(3.0f,"Three");
 // Iterate through it and it'll be in order!
 for(Map.Entry<Float,String> entry : mySortedMap.entrySet()) {
   System.out.println(entry.getValue());
 } // outputs Zero One Three
origin: bumptech/glide

private NavigableMap<Integer, Integer> getSizesForAdapter(Class<?> arrayClass) {
 NavigableMap<Integer, Integer> sizes = sortedSizes.get(arrayClass);
 if (sizes == null) {
  sizes = new TreeMap<>();
  sortedSizes.put(arrayClass, sizes);
 }
 return sizes;
}
origin: hankcs/HanLP

  /**
   * 分割Map,其中旧map直接被改变
   * @param src
   * @param rate
   * @return
   */
  public static Map<String, String[]> splitMap(Map<String, String[]> src, double rate)
  {
    assert 0 <= rate && rate <= 1;
    Map<String, String[]> output = new TreeMap<String, String[]>();
    for (Map.Entry<String, String[]> entry : src.entrySet())
    {
      String[][] array = spiltArray(entry.getValue(), rate);
      output.put(entry.getKey(), array[0]);
      entry.setValue(array[1]);
    }

    return output;
  }
}
java.utilTreeMap<init>

Javadoc

Create a natural order, empty tree map whose keys must be mutually comparable and non-null.

Popular methods of TreeMap

  • 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
  • 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

  • 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)
  • From CI to AI: The AI layer in your organization
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