单线程情况下的缓存模拟 package com.test;import java.util.HashMap;import java.util.Map;public class CachDemo { private Map cache = new HashMap(); public Obj...
分类:
编程语言 时间:
2015-02-08 19:19:24
阅读次数:
220
可以根据应用名称和安装时间进行排序,工程具体代码可以在我的GitHub上查看,链接见文末,效果图:核心代码:package com.zms.launcher;import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;import android.app.Activity;
import android.ap...
分类:
移动开发 时间:
2015-02-08 10:23:18
阅读次数:
367
一 table本质
Lua中table本质实际上是个类似HashMap东西。
其元素是很多的Key-Value对,类似iOS中的字典NSDictionary。
如果尝试访问了一个表中并不存在的元素时,就会触发Lua的一套查找机制。
lua“面向对象”就是凭借这个机制实现的。
示例:
local tab = {}
print(tab.key)
输出:nil
...
分类:
其他好文 时间:
2015-02-07 20:23:58
阅读次数:
170
基于哈希表的 Map 接口的实现。此实现提供所有可选的映射操作,并允许使用 null 值和 null 键。(除了非同步和允许使用 null 之外,HashMap 类与 Hashtable 大致相同。)此类不保证映射的顺序,特别是它不保证该顺序恒久不变。 此实现假定哈希函数将元素适当地分布在各桶之.....
分类:
其他好文 时间:
2015-02-07 17:07:09
阅读次数:
116
packagecom.boventech.learning.controller;
importjava.util.HashMap;
importjava.util.Map;
importorg.springframework.stereotype.Controller;
importorg.springframework.ui.Model;
importorg.springframework.web.bind.annotation.RequestMapping;
importorg.springfram..
分类:
编程语言 时间:
2015-02-06 19:04:38
阅读次数:
226
此文版权属于作者所有,任何人、媒体或者网站转载、借用都必须征得作者本人同意!
android.media.MediaMetadataRetriever mmr = new android.media.MediaMetadataRetriever();
try {
if (mUri != null) {
HashMap headers = mHeaders;
...
分类:
移动开发 时间:
2015-02-06 18:54:40
阅读次数:
911
List list = new ArrayList();Map map = null; while (rs.next()) { map = new HashMap(); map.put("fromIP", rs.get...
分类:
编程语言 时间:
2015-02-06 16:25:40
阅读次数:
151
public static void main(String[] args) { HashMap map = new HashMap(); map.put("张三", "四川"); map.put("李四", "四川"); map.put("王五", "广东"); map.put("...
分类:
编程语言 时间:
2015-02-06 14:33:31
阅读次数:
214
我希望要一个ArrayList,类似C++中的pair,可是Map.Entry是个接口,不能实例化,能够像以下这样写HashMap G = new HashMap();G.put(1, 9); G.put(4, 6); G.put(2, 8);G.put(3, 7); ArrayList> a...
分类:
编程语言 时间:
2015-02-05 20:21:03
阅读次数:
229
/**
?????*?Associates?the?specified?value?with?the?specified?key?in?this?map.
?????*?If?the?map?previously?contained?a?mapping?for?the?key,?the?old
????...
分类:
其他好文 时间:
2015-02-05 18:53:24
阅读次数:
419