Index: sample/hadoop-0.16/test.java
===================================================================
--- sample/hadoop-0.16/test.java	(revision 31)
+++ sample/hadoop-0.16/test.java	(revision 42)
@@ -7,5 +7,8 @@
 import java.io.IOException;
 import java.io.RandomAccessFile;
+import java.io.Writer;
 import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.hadoop.fs.FileStatus;
@@ -14,5 +17,4 @@
 import org.apache.hadoop.mapred.JobConf;
 
-
 // this example is testing for static valiable value
 // it will show the value of static valiable is related to Class, not object
@@ -25,8 +27,58 @@
 }
 
+class Fu<T> {
+	T go;
+
+	void setFu(T go) {
+		this.go = go;
+	}
+
+	T getFu() {
+		return go;
+	}
+}
+
+class animal {
+	String head = "head";
+
+	String feet = "feet";
+
+	String body = "body";
+
+	String hand = "head";
+
+	String mind = "mind";
+
+	int id = 1234567;
+}
+
+class bird extends animal {
+	String feather = "feather";
+
+	bird() {
+		hand = "wing";
+		id = 1234568;
+		System.out.println(head + hand + body + feet + "id=" + id);
+		System.out.println("super = " + super.hand + "this = " + this.hand);
+	}
+}
+
+class dog extends animal {
+	dog(animal a) {
+		System.out.println(a.head + hand + body + feet + "id=" + id);
+	}
+
+	void setbird(bird b) {
+		System.out.println(b.head + hand + body + feet + "id=" + id);
+	}
+}
+
 public class test {
 	int na;
+
 	static int sna;
+
 	static String str;
+
 	public test() {
 	}
@@ -113,4 +165,27 @@
 	}
 
+	void Inherbit() {
+		animal a = new animal();
+		bird b = new bird();
+		dog d = new dog(b);
+		animal aaa = new bird();
+		// dog ddd = new animal(); -> error
+
+		animal aa = (animal) b;
+		System.out.println(aa.hand);
+		System.out.println(aa.mind);
+		// bird bb = (bird) a; -> error
+		// d.setbird(aa); -> error
+		// System.out.println(aa.feather); -> error
+
+		// Fu <T>
+		Fu<? extends String> ak;
+		ak = new Fu<String>();
+		ak.getFu();
+		Fu<?> in = ak;
+		// in.setFu("ss"); -> error
+		in.getFu();
+	}
+
 	void ttt() throws IOException {
 		Path pi;
@@ -124,67 +199,66 @@
 	}
 
+	void parseN() throws IOException {
+		BufferedReader br = new BufferedReader(new FileReader(new File(
+				"/home/waue/Desktop/a")));
+		// BufferedWriter bw = new BufferedWriter(new FileWriter(new
+		// File("/home/waue/Desktop/b")));
+		String line = br.readLine();
+		// char n = '\n';
+		int Count = 0;
+		do {
+			if (line.isEmpty()) {
+				System.out.println("empty !");
+			} else {
+				System.out.println(line);
+			}
+			line = br.readLine();
+			Count++;
+		} while (line != null);
+
+	}
+
+	void regular() {
+		Pattern patten_line;
+		Matcher matcher;
+		String logData = new String();
+		String line = "[**] [1:2003:8] MS-SQL Worm propagation attempt [**]";
+		// String line = "[**] [1:2189:3] BAD-TRAFFIC IP Proto 103 PIM [**]";
+		patten_line = Pattern
+				.compile("^\\[\\**\\] \\[([0-9]*):([0-9]*):([0-9]*)\\] ([^\\[]*)\\[\\**\\]$");
+		matcher = patten_line.matcher(line);
+		System.out.println("go");
+		if (matcher.matches()) {
+			int number = matcher.groupCount();
+			String[] data = new String[number];
+			for (int j = 0; j < number; j++) {
+				data[j] = matcher.group(j + 1);
+				logData += (data[j] + ";");
+			}
+
+			System.out.println(logData);
+		}
+		System.out.println("end");
+	}
+
 	public static void main(String[] args) throws IOException {
-		// test a = new test();
-		// a.strToken();
+
+		test t = new test();
+
+		// 測試 strToken函數
+		// t.strToken();
+		// 測試 檔案io 與 解析
 		// System.out.println(a.parseFirstLine("/home/waue/test.txt",
 		// "/home/waue/out.tmp.txt"));
-		// ttt();
-		
-		
-		animal a = new animal();
-		bird b = new bird();
-		dog d = new dog(b);
-		animal aaa = new bird();
-//		dog ddd = new animal();  -> error 
-		
-		animal aa = (animal) b;
-		System.out.println(aa.hand);
-		System.out.println(aa.mind);		
-//		bird bb = (bird) a; -> error
-//		d.setbird(aa); -> error
-//		System.out.println(aa.feather); -> error
-
-		// Fu <T>
-		Fu<? extends String> ak;
-		ak = new Fu<String>();
-		ak.getFu();
-		Fu<?> in = ak;
-//		in.setFu("ss"); -> error
-		in.getFu();
-	}
-}
-class Fu <T>{
-	T go;
-	void setFu(T go){
-		this.go = go;
-	}
-	T getFu(){
-		return go;
-	}
-}
-
-class animal{
-	String head = "head";
-	String feet = "feet";
-	String body = "body";
-	String hand = "head";
-	String mind = "mind";
-	int id = 1234567;
-}
-class bird extends animal{
-	String feather = "feather";
-	bird(){
-		hand = "wing";
-		id = 1234568;
-		System.out.println(head + hand + body + feet + "id="+id);
-		System.out.println("super = " + super.hand +"this = " + this.hand);
-	}
-}
-class dog extends animal{
-	dog(animal a){
-		System.out.println(a.head + hand + body + feet + "id="+id);
-	}
-	void setbird(bird b){
-		System.out.println(b.head + hand + body + feet + "id="+id);
-	}
-}
+		// 測試 listStatus
+		// t.ttt();
+		// 測試 繼承 與 汎型
+		// t.Inherbit()
+		// 測試 "換行" 是否為 "\n"
+		// t.parseN();
+		// 測試 正規表示法
+		// t.regular();
+
+	}
+
+}
