09 2011 档案
-
Qt中的跨线程调用
摘要:public class MainThread{ private void corssThreadInvoke(final String arg) { QApplication.invokeLater(new Runnable() { String arg_ = arg; public void run() { //TODO //如果需要调用全局变量, //就必须用方法来... 阅读全文
-
ForceInstance 与 non-ForceInstance
摘要:private List<Connection> cloneConnectionsForceInstance() { List<Connection> newList = new ArrayList<Connection>(); if (connections != null) newList.addAll(connections); return newList;}private List<Connection> cloneConnections() { if (connections == null) return null; List< 阅读全文
-
Java中List中remove的实质
摘要:A.如果List的泛型类型为引用类型(Object), 那么,remove只针对List实例所在的栈数据,堆数据的移除不由remove完成(是gc完成)。 B.List移除功能的核心,在Java内部的实现为: /* * Private remove method that skips bounds checking and does not * return the value removed. */ private void fastRemove(int index) { modCount++; int numMoved = size - index - 1; if (numMoved &g 阅读全文
-
数据处理的原子性(clone数据副本,再对数据副本做处理)
摘要:private synchronized void addConnection(Object receiver, Method slot,int connectionType) { ... ... List<Connection> newList = cloneConnectionsForceInstance(); newList.add(new Connection(receiver, slot, returnSig,(byte) connectionType)); connecti... 阅读全文
-
编码学习总结
摘要:一、ANSI二、Unicode三、UTF-8四、UTF-16五、ISO 8859-1六、JAVA中的编码格式Keywork: ANSI, GBK, UTF-8, Unicode, UTF-16, UTF-16LE, UTF-16BE, ASCII, ISO 8859-1, BOM, JAVA一、ANSI码(American National Standards Institute),美国国家标准学会的标准码。http://baike.baidu.com/view/1273097.htm在简体中文系统下,ANSI 编码代表 GB2312 编码,在日文操作系统下,ANSI 编码代表 JIS 编码。 阅读全文