PageRenderTime 1397ms queryFilters 1ms Sphinxql 167ms app.CodeModel.GetByIds 264ms findMatchingLines 42ms GetByIds 306ms meta 0ms repositoryFilters 19ms languageFilters 1ms sourceFilters 4ms

51,809 results for 'java TreeMap' (1397 ms)

Source

Language

Repository

Java常用数据结构.md https://bitbucket.org/fushenghua/learningnotes.git | Markdown | 668 lines
1# Java常用数据结构
2
43
44[Java中的queue和deque](http://blog.csdn.net/shf4715/article/details/47052385)
45
73
74![TreeMap继承关系](images/treemap_structure.png)
75
161
162TreeMap,以二叉查找树的方式存储数据,除了具备Map集合的特点外,TreeMap还对存储的数据进行排序
163
376> 
377> [Java提高篇(二七)-----TreeMap](http://blog.csdn.net/chenssy/article/details/26668941)
378
476
477> [树的深度优先遍历和广度优先遍历的原理和java实现代码](http://outofmemory.cn/code-snippet/4189/biinary-tree-java)
478> 
Java常用数据结构.md https://bitbucket.org/fushenghua/interview-java.git | Markdown | 668 lines
1# Java常用数据结构
2
43
44[Java中的queue和deque](http://blog.csdn.net/shf4715/article/details/47052385)
45
73
74![TreeMap继承关系](http://7xrk8u.com1.z0.glb.clouddn.com/treemap_structure.png)
75
161
162TreeMap,以二叉查找树的方式存储数据,除了具备Map集合的特点外,TreeMap还对存储的数据进行排序
163
376> 
377> [Java提高篇(二七)-----TreeMap](http://blog.csdn.net/chenssy/article/details/26668941)
378
476
477> [树的深度优先遍历和广度优先遍历的原理和java实现代码](http://outofmemory.cn/code-snippet/4189/biinary-tree-java)
478> 
chapter19_集合_4Map.md https://bitbucket.org/wintercold/wintercold.bitbucket.org.git | Markdown | 90 lines
58`Entry`是map的内部接口,所以用`Map.Entry`调用  
59[两种方式遍历map](https://github.com/EasterFan/JavaExercise/blob/master/MapProj/src/map/MapFunc.java)
60
67同 HashSet 一样, HashMap的存储是无序的, 通过重写 `Hashcode + equals`判断集合元素的唯一性.  
68[HashMap - 对学生的无序存取](https://github.com/EasterFan/JavaExercise/blob/master/MapProj/src/hashmap/MapTest.java)
69
77
78[TreeMap - 对学生的有序存取](https://github.com/EasterFan/JavaExercise/blob/master/MapProj/src/treemap/TreeMapTest.java)  
79[TreeMap练习 -- 数字母数](https://github.com/EasterFan/JavaExercise/blob/master/MapProj/src/treemap/TreeMapCountNum.java)
87一个学校, 对应多个班级, 一个班级,对应多个学生, 每个学生学号对应一个姓名
88[Map 扩展 - Map 存 Map](https://github.com/EasterFan/JavaExercise/blob/master/MapProj/src/map/MapInMap.java)  
89一个学校, 对应多个班级, 一个班级,对应多个学生对象, 每个学生对象里有学号和姓名属性    
89一个学校, 对应多个班级, 一个班级,对应多个学生对象, 每个学生对象里有学号和姓名属性    
90[Map 扩展 - Map 存 set](https://github.com/EasterFan/JavaExercise/blob/master/MapProj/src/map/ListInMap.java)
91
SimpleTreeMapTestor.java https://gitlab.com/jamesmarkchan/jPractice.git | Java | 217 lines
8import java.util.Random;
9import java.util.TreeMap;
10import java.util.TreeSet;
54		
55		// Setup SimpleTreeMap and the java TreeMap with random ints to compare against
56		final int NUMBER = 10000;
118	public void testRemoveLeaf() {
119		SimpleTreeMap tree = new SimpleTreeMap();
120		TreeMap<Object, Object> jTree = new TreeMap<>();
137		// setup initial map
138		SimpleTreeMap tree = new SimpleTreeMap();
139		TreeMap<Object, Object> jTree = new TreeMap<>();
185		SimpleTreeMap tree = new SimpleTreeMap();
186		TreeMap<Object, Object> jTree = new TreeMap<>();
187		tree.put(1, 2);
RouteTable.java https://github.com/zootella/learning.git | Java | 876 lines
5
6import java.util.HashMap;
7import java.util.Iterator;
8import java.util.Map;
9import java.util.TreeMap;
10
172     * 
173     * The maps are Java TreeMap objects that keep their contents in sorted order.
174     * The constructor takes our GUID.GUIDByteComparator.compare(Object a, Object b) method and uses it to see which of two GUIDs should be placed first.
177    /** A map of message GUIDs and the ReplyHandler objects that represent the remote computers that sent us packets with them. */
178    private Map _newMap = new TreeMap(new GUID.GUIDByteComparator());
179
180    /** We'll move all the listings from _newMap here before throwing them away, keeping the listings this RouteTable keeps current. */
181    private Map _oldMap = new TreeMap(new GUID.GUIDByteComparator());
182
FeatureVector.java https://github.com/dcrankshaw/cs475-machine_learning.git | Java | 199 lines
2
3import java.io.Serializable;
4import java.util.*;
5
6// Sparse vector implented as a Java TreeMap
7// NOTE All indices are 1-indexed
10	private static final long serialVersionUID = 1L;
11    private TreeMap<Integer, Feature> vector;
12    private int maxIndex_;
14    public FeatureVector() {
15        vector = new TreeMap<Integer, Feature>();
16        maxIndex_ = 0;
BEncoder.java https://github.com/zootella/learning-bittorrent.git | Java | 156 lines
5
6import java.io.IOException;
7import java.io.OutputStream;
11import java.util.SortedMap;
12import java.util.TreeMap;
13
75     * Bencodes the given List to the given OutputStream.
76     * Pass any Java object that extends java.util.List for the list parameter.
77     * 
92     * Bencodes the given Map to the given OutputStream.
93     * Pass any Java object that extends java.util.Map for the map parameter.
94     * 
113    	// The BitTorrent specification requires that dictionary keys are sorted in alphanumeric order
114    	SortedMap sorted = new TreeMap(); // A Java TreeMap will automatically sort the items we add to it
115    	for (Iterator iter = map.keySet().iterator(); iter.hasNext(); ) { // Loop for each key and value pair in the given Map
RichJTreeMap.scala https://github.com/devakidikshit90/sirius.git | Scala | 108 lines
18import collection.JavaConversions.asScalaIterator
19import java.util.{TreeMap => JTreeMap}
20import scala.util.control.Breaks._
24  /**
25   * Create a RichJTreeMap and populate with provided
26   * elements
31  def apply[K, V](kvs: (K, V)*): RichJTreeMap[K, V] = {
32    val map = new RichJTreeMap[K, V]
33    kvs.foreach(kv => map.put(kv._1, kv._2))
46/**
47 * A Java TreeMap with some functional style helpers
48 * for mutating the underling collection (contradictory eh?)
52 */
53class RichJTreeMap[K, V] private extends JTreeMap[K, V] {
54
RichJTreeMap.scala https://github.com/edwardt/sirius.git | Scala | 108 lines
18import collection.JavaConversions.asScalaIterator
19import java.util.{TreeMap => JTreeMap}
20import scala.util.control.Breaks._
24  /**
25   * Create a RichJTreeMap and populate with provided
26   * elements
31  def apply[K, V](kvs: (K, V)*): RichJTreeMap[K, V] = {
32    val map = new RichJTreeMap[K, V]
33    kvs.foreach(kv => map.put(kv._1, kv._2))
46/**
47 * A Java TreeMap with some functional style helpers
48 * for mutating the underling collection (contradictory eh?)
52 */
53class RichJTreeMap[K, V] private extends JTreeMap[K, V] {
54
RichJTreeMap.scala https://github.com/eliq/sirius.git | Scala | 108 lines
18import collection.JavaConversions.asScalaIterator
19import java.util.{TreeMap => JTreeMap}
20import scala.util.control.Breaks._
24  /**
25   * Create a RichJTreeMap and populate with provided
26   * elements
31  def apply[K, V](kvs: (K, V)*): RichJTreeMap[K, V] = {
32    val map = new RichJTreeMap[K, V]
33    kvs.foreach(kv => map.put(kv._1, kv._2))
46/**
47 * A Java TreeMap with some functional style helpers
48 * for mutating the underling collection (contradictory eh?)
52 */
53class RichJTreeMap[K, V] private extends JTreeMap[K, V] {
54
Concordance.java https://github.com/antiboredom/shiffman.github.io.git | Java | 89 lines
4/* This is a simplified version  */
5/* Using a Java TreeMap          */
6
6
7import java.io.*;
8import java.util.*;
10import a2z.*;
11import java.util.regex.*;
12
38      // Step 2, create an empty Tree
39      // TreeMap words = new TreeMap();  // We used to say this!
40      // Now we use "generics" to specify what will be in the Collection
40      // Now we use "generics" to specify what will be in the Collection
41      TreeMap words = new TreeMap();
42
Concordance.java https://github.com/brannondorsey/shiffman.github.io.git | Java | 89 lines
4/* This is a simplified version  */
5/* Using a Java TreeMap          */
6
6
7import java.io.*;
8import java.util.*;
10import a2z.*;
11import java.util.regex.*;
12
38      // Step 2, create an empty Tree
39      // TreeMap words = new TreeMap();  // We used to say this!
40      // Now we use "generics" to specify what will be in the Collection
40      // Now we use "generics" to specify what will be in the Collection
41      TreeMap words = new TreeMap();
42
Concordance.java https://github.com/corajr/shiffman.github.io.git | Java | 89 lines
4/* This is a simplified version  */
5/* Using a Java TreeMap          */
6
6
7import java.io.*;
8import java.util.*;
10import a2z.*;
11import java.util.regex.*;
12
38      // Step 2, create an empty Tree
39      // TreeMap words = new TreeMap();  // We used to say this!
40      // Now we use "generics" to specify what will be in the Collection
40      // Now we use "generics" to specify what will be in the Collection
41      TreeMap words = new TreeMap();
42
index.html http://opensource.apple.com/release/mac-os-x-1074/ | HTML | 180 lines
79<table><tr><th><img src="/icons/blank.gif" alt="[ICO]" height="25"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=S;O=A">Size</a></th></tr><tr><th colspan="3"><hr></th></tr>
80<tr><td valign="top"><a href="/source/gcc_40/gcc_40-4061/libjava/java/"><img src="/icons/back.gif" alt="[DIR]" height="25"></a></td><td><a href="/source/gcc_40/gcc_40-4061/libjava/java/">Parent Directory</a></td><td align="right">  - </td></tr>
81<tr><td valign="top"><a href="AbstractCollection.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="AbstractCollection.java">AbstractCollection.java</a></td><td align="right"> 17K</td></tr>
88<tr><td valign="top"><a href="BitSet.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="BitSet.java">BitSet.java</a></td><td align="right"> 20K</td></tr>
89<tr><td valign="top"><a href="Calendar.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="Calendar.java">Calendar.java</a></td><td align="right"> 33K</td></tr>
90<tr><td valign="top"><a href="Collection.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="Collection.java">Collection.java</a></td><td align="right"> 12K</td></tr>
134<tr><td valign="top"><a href="Timer.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="Timer.java">Timer.java</a></td><td align="right"> 17K</td></tr>
135<tr><td valign="top"><a href="TimerTask.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="TimerTask.java">TimerTask.java</a></td><td align="right">5.1K</td></tr>
136<tr><td valign="top"><a href="TooManyListenersException.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="TooManyListenersException.java">TooManyListenersException.java</a></td><td align="right">2.7K</td></tr>
136<tr><td valign="top"><a href="TooManyListenersException.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="TooManyListenersException.java">TooManyListenersException.java</a></td><td align="right">2.7K</td></tr>
137<tr><td valign="top"><a href="TreeMap.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="TreeMap.java">TreeMap.java</a></td><td align="right"> 51K</td></tr>
138<tr><td valign="top"><a href="TreeSet.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="TreeSet.java">TreeSet.java</a></td><td align="right"> 13K</td></tr>
138<tr><td valign="top"><a href="TreeSet.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="TreeSet.java">TreeSet.java</a></td><td align="right"> 13K</td></tr>
139<tr><td valign="top"><a href="VMTimeZone.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="VMTimeZone.java">VMTimeZone.java</a></td><td align="right"> 10K</td></tr>
140<tr><td valign="top"><a href="Vector.java"><img src="/icons/text.gif" alt="[TXT]" height="25"></a></td><td><a href="Vector.java">Vector.java</a></td><td align="right"> 28K</td></tr>
InteroperandoComJava.scala https://github.com/celioeduardo/scala-impatient.git | Scala | 36 lines
8 * Para converter Java Map para Scala Map é preciso importar
9 * scala.collection.JavaConversions.mapAsScalaMap
10 * Assim é possível trabalhar com a agradável API do Scala.
14
15import java.awt.font.TextAttribute._
16
19
20	test("assim é possível implementar um Map Scala com um Java TreeMap"){
21	  import scala.collection.JavaConversions.mapAsScalaMap
21	  import scala.collection.JavaConversions.mapAsScalaMap
22	  val scores: scala.collection.mutable.Map[String, Int] = new java.util.TreeMap[String,Int]
23	}  
31	  val attrs = Map(FAMILY -> "Serif", SIZE -> 12) //um Scala Map
32	  import scala.collection.JavaConversions.mapAsJavaMap
33	  val font = new java.awt.Font(attrs)
SlickRecordingMetadataAccess.scala https://github.com/codedx/codepulse.git | Scala | 99 lines
76		import collection.JavaConverters._
77		// because scala apparently has no mutable sorted map, we'll use a java TreeMap with a Scala wrapper
78		val recordings = new java.util.TreeMap[Int, RecordingMetadata].asScala
2014-08-30-http-get-post.md https://github.com/anaer/anaer.github.io.git | Markdown | 57 lines
4description: ""
5category: Java
6tags: [Java]
34
35```java
36
36
37    TreeMap<String, String[]> params = new TreeMap(map);
38
54  * [web Form 表单method="get" method="post" 区别](http://www.cnblogs.com/yzc19838458/p/3946180.html)
55  * [get/post发送HTTP请求3](http://www.cnblogs.com/java-pan/archive/2012/05/05/HTTP-POST-byte.html)
56  * [java如何得到GET和POST请求URL和参数列表 ](http://blog.csdn.net/yaerfeng/article/details/18942739)
LeaderHelper.scala https://github.com/devakidikshit90/sirius.git | Scala | 61 lines
19import collection.immutable.SortedMap
20import com.comcast.xfinity.sirius.util.RichJTreeMap
21
34   *
35   * @param x a RichJTreeMap which is modified in place, being overlayed with all values
36   *          from y
39   */
40  def update[T](x: RichJTreeMap[Long, T], y: RichJTreeMap[Long, T]): RichJTreeMap[Long, T] = {
41    x.putAll(y)
45  /**
46   * Takes a Set of PValues and produces a java TreeMap from slot (Long) to Command, retaining the Command
47   * associated with the highest Ballot for each slot.
51   */
52  def pmax(pvals: Set[PValue]): RichJTreeMap[Long, Command] = {
53    val maxPValBySlot = pvals.groupBy(_.slotNum).mapValues(
LeaderHelper.scala https://github.com/edwardt/sirius.git | Scala | 61 lines
19import collection.immutable.SortedMap
20import com.comcast.xfinity.sirius.util.RichJTreeMap
21
34   *
35   * @param x a RichJTreeMap which is modified in place, being overlayed with all values
36   *          from y
39   */
40  def update[T](x: RichJTreeMap[Long, T], y: RichJTreeMap[Long, T]): RichJTreeMap[Long, T] = {
41    x.putAll(y)
45  /**
46   * Takes a Set of PValues and produces a java TreeMap from slot (Long) to Command, retaining the Command
47   * associated with the highest Ballot for each slot.
51   */
52  def pmax(pvals: Set[PValue]): RichJTreeMap[Long, Command] = {
53    val maxPValBySlot = pvals.groupBy(_.slotNum).mapValues(
LeaderHelper.scala https://github.com/eliq/sirius.git | Scala | 61 lines
19import collection.immutable.SortedMap
20import com.comcast.xfinity.sirius.util.RichJTreeMap
21
34   *
35   * @param x a RichJTreeMap which is modified in place, being overlayed with all values
36   *          from y
39   */
40  def update[T](x: RichJTreeMap[Long, T], y: RichJTreeMap[Long, T]): RichJTreeMap[Long, T] = {
41    x.putAll(y)
45  /**
46   * Takes a Set of PValues and produces a java TreeMap from slot (Long) to Command, retaining the Command
47   * associated with the highest Ballot for each slot.
51   */
52  def pmax(pvals: Set[PValue]): RichJTreeMap[Long, Command] = {
53    val maxPValBySlot = pvals.groupBy(_.slotNum).mapValues(
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21