テキストの各行をキーと値に分離し、複数テキストファイルを読み込み、キーを突き合わせ照合し、その結果を表示するGUIユーテリティです。
修订版 | 9c045045f3fa1a98c7098f56885ca94dbdc93c71 (tree) |
---|---|
时间 | 2011-10-12 02:05:44 |
作者 | seraphy <seraphy@192....> |
Commiter | seraphy |
ライブラリ追加、ソース修正
@@ -1,2 +1,3 @@ | ||
1 | 1 | /build/ |
2 | -/nbproject/private/ | |
\ No newline at end of file | ||
2 | +/nbproject/private/ | |
3 | +/dist/ | |
\ No newline at end of file |
@@ -0,0 +1,19 @@ | ||
1 | +libs.beans-binding.classpath=\ | |
2 | + ${base}/beans-binding/beansbinding-1.2.1.jar | |
3 | +libs.beans-binding.javadoc=\ | |
4 | + ${base}/beans-binding/beansbinding-1.2.1-doc.zip | |
5 | +libs.CopyLibs.classpath=\ | |
6 | + ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar | |
7 | +libs.JWSAntTasks.classpath=\ | |
8 | + ${base}/JWSAntTasks/org-netbeans-modules-javawebstart-anttasks.jar | |
9 | +libs.swing-app-framework.classpath=\ | |
10 | + ${base}/swing-app-framework/appframework-1.0.3.jar:\ | |
11 | + ${base}/swing-app-framework/swing-worker-1.1.jar | |
12 | +libs.swing-app-framework.javadoc=\ | |
13 | + ${base}/swing-app-framework/appframework-1.0.3-doc.zip | |
14 | +libs.swing-layout.classpath=\ | |
15 | + ${base}/swing-layout/swing-layout-1.0.4.jar | |
16 | +libs.swing-layout.javadoc=\ | |
17 | + ${base}/swing-layout/swing-layout-1.0.4-doc.zip | |
18 | +libs.swing-layout.src=\ | |
19 | + ${base}/swing-layout/swing-layout-1.0.4-src.zip!/swing-layout-1.0.4/src/java/ |
@@ -43,18 +43,43 @@ is divided into following sections: | ||
43 | 43 | <property file="nbproject/private/configs/${config}.properties"/> |
44 | 44 | <property file="nbproject/private/private.properties"/> |
45 | 45 | </target> |
46 | - <target depends="-pre-init,-init-private" name="-init-user"> | |
46 | + <target name="-pre-init-libraries"> | |
47 | + <property location="./lib/nblibraries.properties" name="libraries.path"/> | |
48 | + <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/> | |
49 | + <pathconvert dirsep="/" property="libraries.dir"> | |
50 | + <path path="${libraries.dir.nativedirsep}"/> | |
51 | + </pathconvert> | |
52 | + <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/> | |
53 | + <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/> | |
54 | + </target> | |
55 | + <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries"> | |
56 | + <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties"> | |
57 | + <filterchain> | |
58 | + <replacestring from="$${base}" to="${libraries.dir}"/> | |
59 | + <escapeunicode/> | |
60 | + </filterchain> | |
61 | + </loadproperties> | |
62 | + </target> | |
63 | + <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries"> | |
64 | + <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}"> | |
65 | + <filterchain> | |
66 | + <replacestring from="$${base}" to="${libraries.dir}"/> | |
67 | + <escapeunicode/> | |
68 | + </filterchain> | |
69 | + </loadproperties> | |
70 | + </target> | |
71 | + <target depends="-pre-init,-init-private,-init-libraries" name="-init-user"> | |
47 | 72 | <property file="${user.properties.file}"/> |
48 | 73 | <!-- The two properties below are usually overridden --> |
49 | 74 | <!-- by the active platform. Just a fallback. --> |
50 | 75 | <property name="default.javac.source" value="1.4"/> |
51 | 76 | <property name="default.javac.target" value="1.4"/> |
52 | 77 | </target> |
53 | - <target depends="-pre-init,-init-private,-init-user" name="-init-project"> | |
78 | + <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project"> | |
54 | 79 | <property file="nbproject/configs/${config}.properties"/> |
55 | 80 | <property file="nbproject/project.properties"/> |
56 | 81 | </target> |
57 | - <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init"> | |
82 | + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init"> | |
58 | 83 | <available file="${manifest.file}" property="manifest.available"/> |
59 | 84 | <condition property="splashscreen.available"> |
60 | 85 | <and> |
@@ -205,7 +230,7 @@ is divided into following sections: | ||
205 | 230 | <!-- Empty placeholder for easier customization. --> |
206 | 231 | <!-- You can override this target in the ../build.xml file. --> |
207 | 232 | </target> |
208 | - <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> | |
233 | + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check"> | |
209 | 234 | <fail unless="src.dir">Must set src.dir</fail> |
210 | 235 | <fail unless="test.src.dir">Must set test.src.dir</fail> |
211 | 236 | <fail unless="build.dir">Must set build.dir</fail> |
@@ -556,7 +581,7 @@ is divided into following sections: | ||
556 | 581 | <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline"> |
557 | 582 | <property name="ap.cmd.line.internal" value=""/> |
558 | 583 | </target> |
559 | - <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/> | |
584 | + <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/> | |
560 | 585 | <!-- |
561 | 586 | =================== |
562 | 587 | COMPILATION SECTION |
@@ -1,8 +1,8 @@ | ||
1 | -build.xml.data.CRC32=6bcbf639 | |
1 | +build.xml.data.CRC32=2c6ec66d | |
2 | 2 | build.xml.script.CRC32=269ca5bc |
3 | 3 | build.xml.stylesheet.CRC32=28e38971@1.44.1.45 |
4 | 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. |
5 | 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. |
6 | -nbproject/build-impl.xml.data.CRC32=6bcbf639 | |
7 | -nbproject/build-impl.xml.script.CRC32=a933e583 | |
6 | +nbproject/build-impl.xml.data.CRC32=2c6ec66d | |
7 | +nbproject/build-impl.xml.script.CRC32=550200f7 | |
8 | 8 | nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45 |
@@ -26,8 +26,8 @@ dist.jar=${dist.dir}/TextKeyMatcher.jar | ||
26 | 26 | dist.javadoc.dir=${dist.dir}/javadoc |
27 | 27 | endorsed.classpath= |
28 | 28 | excludes= |
29 | -file.reference.AppleJavaExtensions.jar=/Users/seraphy/Documents/workspace/CharacterManaJ/extlib/AppleJavaExtensions.jar | |
30 | -file.reference.commons-lang3-3.0.1.jar=/archives/Libs/commons-lang3-3.0.1/commons-lang3-3.0.1.jar | |
29 | +file.reference.AppleJavaExtensions.jar=lib/AppleJavaExtensions.jar | |
30 | +file.reference.commons-lang3-3.0.1.jar=lib/commons-lang3-3.0.1.jar | |
31 | 31 | file.reference.javaws.jar=/System/Library/Frameworks/JavaVM.framework/Resources/Deploy.bundle/Contents/Home/lib/javaws.jar |
32 | 32 | includes=** |
33 | 33 | jar.archive.disabled=${jnlp.enabled} |
@@ -40,8 +40,8 @@ javac.classpath=\ | ||
40 | 40 | ${libs.swing-layout.classpath}:\ |
41 | 41 | ${file.reference.commons-lang3-3.0.1.jar} |
42 | 42 | # Space-separated list of extra javac options |
43 | -javac.compilerargs= | |
44 | -javac.deprecation=false | |
43 | +javac.compilerargs=-Xlint:unchecked | |
44 | +javac.deprecation=true | |
45 | 45 | javac.processorpath=\ |
46 | 46 | ${javac.classpath} |
47 | 47 | javac.source=1.6 |
@@ -18,6 +18,9 @@ | ||
18 | 18 | <root id="test.src.dir"/> |
19 | 19 | </test-roots> |
20 | 20 | </data> |
21 | + <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> | |
22 | + <definitions>./lib/nblibraries.properties</definitions> | |
23 | + </libraries> | |
21 | 24 | <swingapp xmlns="http://www.netbeans.org/ns/form-swingapp/1"> |
22 | 25 | <application-class name="textkeymatcher.TextKeyMatcherApp"/> |
23 | 26 | </swingapp> |
@@ -90,7 +90,9 @@ public class KeyMatchedDataModel { | ||
90 | 90 | |
91 | 91 | } else if (datas[column] instanceof List) { |
92 | 92 | // すでに2要素以上ある場合 |
93 | - ((List<String>) datas[column]).add(value); | |
93 | + @SuppressWarnings("unchecked") | |
94 | + List<String> lst = (List<String>) datas[column]; | |
95 | + lst.add(value); | |
94 | 96 | |
95 | 97 | } else { |
96 | 98 | // すでに存在する場合はリストにつめ直す. |
@@ -122,7 +124,9 @@ public class KeyMatchedDataModel { | ||
122 | 124 | Object data = datas[column]; |
123 | 125 | if (data != null && data instanceof List) { |
124 | 126 | // リスト格納であれば、要素数を返す |
125 | - return ((List<String>) data).size(); | |
127 | + @SuppressWarnings("unchecked") | |
128 | + List<String> lst = (List<String>) datas[column]; | |
129 | + return lst.size(); | |
126 | 130 | } |
127 | 131 | // リストでなければ単一要素なので1を返す |
128 | 132 | return 1; |
@@ -137,6 +141,7 @@ public class KeyMatchedDataModel { | ||
137 | 141 | return ""; |
138 | 142 | } |
139 | 143 | if (data instanceof List) { |
144 | + @SuppressWarnings("unchecked") | |
140 | 145 | List<String> lst = ((List<String>) data); |
141 | 146 | if (rowIndex >= 0 && rowIndex < lst.size()) { |
142 | 147 | // 複数データならば存在する行分だけ |
@@ -5,14 +5,13 @@ | ||
5 | 5 | package textkeymatcher.service; |
6 | 6 | |
7 | 7 | import java.math.BigDecimal; |
8 | -import java.util.Comparator; | |
9 | 8 | import org.apache.commons.lang3.StringUtils; |
10 | 9 | |
11 | 10 | /** |
12 | 11 | * |
13 | 12 | * @author seraphy |
14 | 13 | */ |
15 | -public enum KeyMatcher implements Comparator<String> { | |
14 | +public enum KeyMatcher { | |
16 | 15 | |
17 | 16 | TEXT(){ |
18 | 17 | @Override |
@@ -120,7 +119,8 @@ public enum KeyMatcher implements Comparator<String> { | ||
120 | 119 | return val.hashCode(); |
121 | 120 | } |
122 | 121 | },; |
123 | - | |
122 | + | |
123 | + public abstract int compare(String k1, String k2); | |
124 | 124 | |
125 | 125 | public abstract String getNormalize(String org); |
126 | 126 |