<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>四季如風 &#187; j2se</title>
	<atom:link href="http://www.hjide.com/tag/j2se/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hjide.com</link>
	<description>每一天我們都在進步</description>
	<lastBuildDate>Fri, 03 Feb 2012 06:26:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>根据纯真IP库的IP地址转换</title>
		<link>http://www.hjide.com/article/479.htm</link>
		<comments>http://www.hjide.com/article/479.htm#comments</comments>
		<pubDate>Fri, 13 Jan 2012 20:01:42 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>
		<category><![CDATA[源码]]></category>

		<guid isPermaLink="false">http://www.hjide.com/?p=479</guid>
		<description><![CDATA[原创内容转载请注明来源 http://www.hjide.com/article/479.htm 从网上找的源代码，发现有很多问题。 首先是每次查找都是通过RandomAccessFile的文件指针的移动来定位，修改为增加一个MappedByteBuffer的内存映射文件试图提高查找效率， 接着发现在多线程环境下会出现问题，发现用来记录指针的变量是类的成员对象，多线程不能共用一个实例，增加一个同步锁就有违修改的初衷。 于是经过大量修改后有了现在这个版本，源代码请移步https://github.com/jockhuang/iplocation 下载。]]></description>
		<wfw:commentRss>http://www.hjide.com/article/479.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用String.split方法时要注意的问题</title>
		<link>http://www.hjide.com/article/205.htm</link>
		<comments>http://www.hjide.com/article/205.htm#comments</comments>
		<pubDate>Sun, 04 Mar 2007 04:34:56 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=205</guid>
		<description><![CDATA[在使用String.split方法分隔字符串时，分隔符如果用到一些特殊字符，可能会得不到我们预期的结果。我们看jdk doc中说明public String[] split(String regex) Splits this string around matches of the given regular expression. 参数regex是一个 regular-expression的匹配模式而不是一个简单的String，他对一些特殊的字符可能会出现你预想不到的结果，比如测试下面的代码：用竖线 &#124; 分隔字符串，你将得不到预期的结果 &#160; &#160;String[] aa = “aaa&#124;bbb&#124;ccc”.split(“&#124;”); &#160; &#160;//String[] aa = “aaa&#124;bbb&#124;ccc”.split(“&#92;&#92;&#124;”); 这样才能得到正确的结果 &#160; &#160;for (int i = 0 ; i]]></description>
		<wfw:commentRss>http://www.hjide.com/article/205.htm/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能 &#8211; Annotation</title>
		<link>http://www.hjide.com/article/81.htm</link>
		<comments>http://www.hjide.com/article/81.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 05:59:47 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=81</guid>
		<description><![CDATA[Annotation是J2SE提供的一种新语法，根据规范的说明，他的作用简单来说就是简化代码的维护。例如，EJB需要7个文件，一个XML文件来表示，通过Annotation，我们可以只需要维护源代码，其他工作都可以通过自动生成达到。这个做法跟Lomboz的效果比较一致，不过Lomboz是通过XDoclet来实现，而现在只要使用Annotation就可以了，但是Annotation只是一个必要条件，如果真要达到自动生成其他文件的目的，除了Annotation之外，还需要其他类，或者工具的支持。1. &#160; &#160; &#160;预定义AnnotationTiger为我们预定义了3个可以用的Annotation，分别是Override，Deprecated，SuppressWarnings。 i. &#160; &#160; &#160; &#160; &#160; &#160; &#160;Override1. &#160; &#160; &#160; &#160;作用：Override的作用就是，被生命为Override的方法，必须是对父类中方法的覆盖，如果父类中没有出现该方法，或者方法没有正确覆盖父类中的方法，则编译期就会出错。2. &#160; &#160; &#160; &#160;语法：@Override public void methodA(){…}3. &#160; &#160; &#160; &#160;例子：父类：/* * Created on 2005-1-4 * */package test;/** * * @author cenyongh@mails.gscas.ac.cn */public class Test { &#160; &#160;public Test() { &#160; &#160;} &#160; &#160;public void hello() { &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.hjide.com/article/81.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能 &#8211; 同步（Concurrent）</title>
		<link>http://www.hjide.com/article/80.htm</link>
		<comments>http://www.hjide.com/article/80.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 05:54:18 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=80</guid>
		<description><![CDATA[1. &#160; &#160; &#160;Executor接口 &#160; &#160; Executor接口提供了一个类似于线程池的管理工具。用于只需要往Executor中提交Runnable对象，剩下的启动线程等工作，都会有对应的实现类来完成。ScheduledExecutorService比ExecutorService增加了，时间上的控制，即用户可以在提交的时候额外的定义该任务的启动时机，以及随后的执行间隔和延迟等。 &#160; &#160; 例子： &#160; &#160; 任务： &#160; &#160; public class ETask implements Runnable{ &#160; &#160; &#160; &#160; &#160;private int id = 0; &#160; &#160; &#160; &#160; &#160;public ETask(int id){ &#160; &#160; &#160; &#160; &#160; &#160; &#160; this.id = id; &#160; &#160; &#160; &#160; &#160;} &#160; &#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.hjide.com/article/80.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能 &#8211; 同步集合－Queue,BlockingQueue</title>
		<link>http://www.hjide.com/article/79.htm</link>
		<comments>http://www.hjide.com/article/79.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 05:46:16 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=79</guid>
		<description><![CDATA[J2SE 5.0里面添加了新的用于提高同步性能的集合类&#8211;Queue。Queue是一个FIFO队列，她的作用主要是提高了并发访问性能，她与原来集合类当中的List的区别包括：1. &#160; &#160; &#160;她提供了一些新的方法，用于添加元素的offer()，用于删除元素的poll()，用于获取队首元素的peak()。这些操作与原来的add()，remove()的区别在于，原有的add()，remove()和element()当所需操作失败的时候会抛出异常，而新的offer()和poll()则不会，当队列不能容纳新元素时，offer()直接返回，当队列没有元素可取的时候，poll()操作，返回null。 &#160; &#160; 例子： &#160; &#160; public class Test{ &#160; &#160; &#160; &#160; &#160;private ArrayBlockingQueue list; &#160; &#160; &#160; &#160; &#160;public Test(int capacity){ &#160; &#160; &#160; &#160; &#160; &#160; &#160; list = new ArrayBlockingQueue(capacity); &#160; &#160; &#160; &#160; &#160;} &#160; &#160; &#160; &#160; &#160;public void add(int size){ &#160; &#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.hjide.com/article/79.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能 &#8211; Varargs</title>
		<link>http://www.hjide.com/article/78.htm</link>
		<comments>http://www.hjide.com/article/78.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 04:09:03 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=78</guid>
		<description><![CDATA[先看一个5.0当中的例子：public class Test{ &#160; &#160; &#160; &#160; &#160;public Test(){} &#160; &#160; &#160; &#160; &#160;public void out(String &#8230;args){ &#160; &#160; &#160; &#160; &#160; &#160; &#160;for(String s:args){ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; System.out.println(s); &#160; &#160; &#160; &#160; &#160; &#160; &#160;} &#160; &#160; &#160; &#160; &#160;} &#160; &#160; &#160; &#160; &#160;public static void main(String[] [...]]]></description>
		<wfw:commentRss>http://www.hjide.com/article/78.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能 &#8211; Formatted Output and Formatted Input</title>
		<link>http://www.hjide.com/article/77.htm</link>
		<comments>http://www.hjide.com/article/77.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 04:07:59 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=77</guid>
		<description><![CDATA[Formatted Output使得我们可以使用类C的printf方法中的格式化变量，对输出进行格式化，如 &#160; &#160; System.out.printf(“%s %5d %n”,user,total);]]></description>
		<wfw:commentRss>http://www.hjide.com/article/77.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能 &#8211; Static Import</title>
		<link>http://www.hjide.com/article/76.htm</link>
		<comments>http://www.hjide.com/article/76.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 04:07:32 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=76</guid>
		<description><![CDATA[以前，当我们要使用某个类当中的某个static变量，如BorderLayout.CENTER时，我们需要进行完整的书写，但通过使用Static Import，我们可以只书写CENTER即可，即：import static java.awt.BorderLayout.* &#160; &#160; &#160; &#160; &#160;// &#160; 导入getContentPane().add(new JPanel(),CENTER); &#160; &#160; // &#160; 使用Static Import的使用，使得我们在不引入类的情况下，能只引用某个类的static变量]]></description>
		<wfw:commentRss>http://www.hjide.com/article/76.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能 &#8211; Enumerated Types</title>
		<link>http://www.hjide.com/article/75.htm</link>
		<comments>http://www.hjide.com/article/75.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 04:06:57 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=75</guid>
		<description><![CDATA[从5.0开始，j2se支持枚举类型。简单的枚举使用如下： &#160; public enum Color{RED,BLUE,GREEN;}; &#160; &#160; public static void main(String[] args){ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; for(Color c:Color.values()){ &#160; &#160; &#160; &#160; &#160; &#160; &#160;System.out.println(c); &#160; &#160; &#160; &#160; } &#160; &#160; } &#160; &#160; 输出为 &#160; &#160; RED &#160; &#160; &#160; BLUE &#160; &#160; &#160; GREEN 稍微复杂一点的使用，可以增加对枚举类型的定义： &#160; &#160; public [...]]]></description>
		<wfw:commentRss>http://www.hjide.com/article/75.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 5.0新功能-Enhanced for Loop</title>
		<link>http://www.hjide.com/article/74.htm</link>
		<comments>http://www.hjide.com/article/74.htm#comments</comments>
		<pubDate>Mon, 20 Nov 2006 04:03:40 +0000</pubDate>
		<dc:creator>Jock</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[j2se]]></category>

		<guid isPermaLink="false">http://blog.tgb.net.cn/?p=74</guid>
		<description><![CDATA[一般来说，当我们需要对数组和集合进行遍历时，我们需要这样做： &#160; &#160; &#160; ArrayList list = new ArrayList(); &#160; &#160; &#160; &#160; &#160; list.add(0,1); &#160; &#160; &#160; &#160; &#160; list.add(1,2); &#160; &#160; &#160; &#160; &#160;for (Iterator i = list.iterator(); i.hasNext();) { &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Integer value=(Integer)i.next(); &#160; &#160; &#160; &#160; &#160;}但使用了5.0的Enhanced for Loop以后，我们的循环可以变得很简单： &#160; &#160; &#160;ArrayList list = [...]]]></description>
		<wfw:commentRss>http://www.hjide.com/article/74.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

