35 | * 区切り文字形式データの列見出し (ヘッダ) 行を使用しないとした場合、先頭行は列見出し (ヘッダ) 行ではなくデータ行として処理されます。 36 | * 37 | * @return 区切り文字形式データの列見出し (ヘッダ) 行を使用するかどうか 38 | */ 39 | boolean header() default true; 40 | 41 | } -------------------------------------------------------------------------------- /src/main/java/com/orangesignal/csv/annotation/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Java プログラム要素から区切り文字形式データを使用するための注釈を定義します。 19 | * 20 | *
21 | * 例: 22 | * 23 | * @CsvEntity(header = true) 24 | * public class Price { 25 | * 26 | * @CsvColumn(position = 0, name = "シンボル") 27 | * String symbol; 28 | * 29 | * @CsvColumn(position = 1, name = "名称") 30 | * String name; 31 | * 32 | * @CsvColumns({ 33 | * @CsvColumn(position = 7, name = "日付", format = "yyyy/MM/dd"), 34 | * @CsvColumn(position = 8, name = "時刻", format = "HH:mm:ss") 35 | * }) 36 | * Date date; 37 | * 38 | * @CsvColumn(position = 2, name = "始値") 39 | * Number open; 40 | * 41 | * @CsvColumn(position = 3, name = "高値") 42 | * Number high; 43 | * 44 | * @CsvColumn(position = 4, name = "安値") 45 | * Number low; 46 | * 47 | * @CsvColumn(position = 5, name = "終値") 48 | * Number close; 49 | * 50 | * @CsvColumn(position = 6, name = "出来高") 51 | * Number volume; 52 | * 53 | * } 54 | *55 | * 56 | * @author Koji Sugisawa 57 | */ 58 | package com.orangesignal.csv.annotation; -------------------------------------------------------------------------------- /src/main/java/com/orangesignal/csv/bean/CsvBeanOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.orangesignal.csv.bean; 18 | 19 | import com.orangesignal.csv.filters.CsvNamedValueFilter; 20 | 21 | /** 22 | * Java プログラム要素と区切り文字形式データアクセス操作のインタフェースを提供します。 23 | * 24 | * @param
28 | * 指定された文字列が {@code null} や空文字列の場合に、どのような値が返されるかは実装に依存します。
29 | *
30 | * @param str 変換する文字列
31 | * @param type 変換する型
32 | * @return 変換されたオブジェクト
33 | * @throws IllegalArgumentException 変換に失敗した場合
34 | */
35 | Object convert(String str, Class> type);
36 |
37 | /**
38 | * 指定されたオブジェクトを文字列へ変換して返します。
39 | *
40 | * @param value 変換するオブジェクト
41 | * @return 変換された文字列
42 | * @throws IllegalArgumentException 変換に失敗した場合
43 | */
44 | String convert(Object value);
45 |
46 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/bean/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Java プログラム要素と区切り文字形式データアクセスのためのヘルパークラスやユーティリティなどを提供します。
19 | *
20 | * @author Koji Sugisawa
21 | * @since 1.4.0
22 | */
23 | package com.orangesignal.csv.bean;
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/entryfilters/AbstractEntryFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.entryfilters;
18 |
19 | import java.io.Serializable;
20 |
21 | import com.orangesignal.csv.LhaEntryFilter;
22 | import com.orangesignal.csv.ZipEntryFilter;
23 |
24 | /**
25 | * エントリフィルタの基底クラスを提供します。
26 | *
27 | * @author Koji Sugisawa
28 | * @since 1.2.2
29 | */
30 | public abstract class AbstractEntryFilter implements ZipEntryFilter, LhaEntryFilter, Serializable {
31 |
32 | private static final long serialVersionUID = -1492900359515513779L;
33 |
34 | /**
35 | * デフォルトコンストラクタです。
36 | */
37 | protected AbstractEntryFilter() {
38 | }
39 |
40 | @Override
41 | public String toString() {
42 | final String name = getClass().getName();
43 | final int period = name.lastIndexOf('.');
44 | return period > 0 ? name.substring(period + 1) : name;
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/entryfilters/DirectoryEntryFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.entryfilters;
18 |
19 | import java.util.zip.ZipEntry;
20 |
21 | import com.orangesignal.jlha.LhaHeader;
22 |
23 | /**
24 | * ディレクトリエントリをフィルタするエントリフィルタの実装です。
25 | * ディレクトリエントリはエントリ名の後ろがスラッシュ「/」となっているエントリです。
26 | *
27 | * @author Koji Sugisawa
28 | */
29 | public class DirectoryEntryFilter extends AbstractEntryFilter {
30 |
31 | private static final long serialVersionUID = 7352823190771258451L;
32 |
33 | /**
34 | * デフォルトコンストラクタです。
35 | */
36 | public DirectoryEntryFilter() {
37 | }
38 |
39 | /**
40 | * 指定された ZIP エントリをテストし、エントリがディレクトリエントリの場合は {@code false} そうでない場合は {@code true} を返します。
41 | *
42 | * @param entry テストする ZIP エントリ
43 | * @return エントリがディレクトリエントリの場合は {@code false}、そうでない場合は {@code true}
44 | */
45 | @Override
46 | public boolean accept(final ZipEntry entry) {
47 | return !entry.isDirectory();
48 | }
49 |
50 | /**
51 | * 指定された LHA エントリをテストし、エントリがディレクトリエントリの場合は {@code false} そうでない場合は {@code true} を返します。
52 | *
53 | * @param entry テストする LHA エントリ
54 | * @return エントリがディレクトリエントリの場合は {@code false}、そうでない場合は {@code true}
55 | */
56 | @Override
57 | public boolean accept(final LhaHeader entry) {
58 | return !entry.getPath().endsWith("/");
59 | }
60 |
61 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/entryfilters/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * 圧縮形式データのエントリフィルタの実装クラスを提供します。
19 | *
20 | * @author Koji Sugisawa
21 | */
22 | package com.orangesignal.csv.entryfilters;
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanAndExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素フィルタ群の論理積でフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanAndExpression extends BeanLogicalExpression {
28 |
29 | /**
30 | * デフォルトコンストラクタです。
31 | */
32 | public BeanAndExpression() {
33 | super();
34 | }
35 |
36 | /**
37 | * コンストラクタです。
38 | *
39 | * @param filters Java プログラム要素フィルタ群
40 | * @throws IllegalArgumentException
19 | * jLHA の詳細やライセンスについては、jLHA の
20 | * 英語サイト または
21 | * 日本語サイト をご覧下さい。
22 | *
23 | * @author Koji Sugisawa
24 | * @since 2.0.0
25 | */
26 | package com.orangesignal.jlha;
--------------------------------------------------------------------------------
/src/main/javadoc/overview.html:
--------------------------------------------------------------------------------
1 |
2 | このドキュメントは、OrangeSignal CSV の API ドキュメントです。filters
が null
の場合
41 | */
42 | protected BeanAndExpression(final BeanFilter... filters) {
43 | super(filters);
44 | }
45 |
46 | @Override
47 | public boolean accept(final Object bean) throws IOException {
48 | if (filters.isEmpty()) {
49 | throw new IllegalArgumentException("Filters must not be empty");
50 | }
51 | for (final BeanFilter filter : filters) {
52 | if (!filter.accept(bean)) {
53 | return false;
54 | }
55 | }
56 | return true;
57 | }
58 |
59 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanEmptyExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が空かどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanEmptyExpression extends BeanExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name フィールド名
33 | * @throws IllegalArgumentException name
が null
の場合
34 | */
35 | protected BeanEmptyExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Object bean) throws IOException {
41 | return BeanExpressionUtils.isEmpty(bean, name);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanEqualExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が判定基準値と等しいかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanEqualExpression extends BeanCriteriaExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name フィールド名
33 | * @param criteria 判定基準値
34 | * @throws IllegalArgumentException パラメータが null
の場合
35 | */
36 | protected BeanEqualExpression(final String name, final Object criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param name フィールド名
44 | * @param criteria 判定基準値
45 | * @param ignoreCase 大文字と小文字を区別するかどうか
46 | * @throws IllegalArgumentException パラメータが null
の場合
47 | */
48 | protected BeanEqualExpression(final String name, final String criteria, final boolean ignoreCase) {
49 | super(name, criteria, ignoreCase);
50 | }
51 |
52 | @Override
53 | public boolean accept(final Object bean) throws IOException {
54 | return BeanExpressionUtils.eq(bean, name, criteria, ignoreCase);
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | /**
20 | * 指定された Java プログラム要素のフィールド値を判定してフィルタを適用する Java プログラム要素フィルタの基底クラスを提供します。
21 | *
22 | * @author Koji Sugisawa
23 | * @since 1.2.3
24 | */
25 | public abstract class BeanExpression implements BeanFilter {
26 |
27 | /**
28 | * フィールド名を保持します。
29 | */
30 | protected String name;
31 |
32 | /**
33 | * コンストラクタです。
34 | *
35 | * @param name フィールド名
36 | * @throws IllegalArgumentException name
が null
の場合
37 | */
38 | protected BeanExpression(final String name) {
39 | if (name == null) {
40 | throw new IllegalArgumentException("Field name must not be null");
41 | }
42 | this.name = name;
43 | }
44 |
45 | @Override
46 | public String toString() {
47 | final String className = getClass().getName();
48 | final int period = className.lastIndexOf('.');
49 | return period > 0 ? className.substring(period + 1) : className;
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Java プログラム要素フィルタのインタフェースです。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public interface BeanFilter {
28 |
29 | /**
30 | * 指定された Java プログラム要素が含まれる必要があるかどうかを判定します。
31 | *
32 | * @param bean Java プログラム要素
33 | * @return {@code bean} が含まれる必要がある場合は {@code true}
34 | * @throws IOException
35 | */
36 | boolean accept(Object bean) throws IOException;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanGreaterThanExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 | import java.util.Comparator;
21 |
22 | /**
23 | * 指定された Java プログラム要素のフィールド値が判定基準値より大きいかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
24 | *
25 | * @author Koji Sugisawa
26 | * @since 1.2.3
27 | */
28 | public class BeanGreaterThanExpression extends BeanCriteriaExpression {
29 |
30 | /**
31 | * コンストラクタです。
32 | *
33 | * @param name フィールド名
34 | * @param criteria 判定基準値
35 | * @throws IllegalArgumentException パラメータが null
の場合
36 | */
37 | protected BeanGreaterThanExpression(final String name, final Object criteria) {
38 | super(name, criteria);
39 | }
40 |
41 | /**
42 | * コンストラクタです。
43 | *
44 | * @param name フィールド名
45 | * @param criteria 判定基準値
46 | * @param comparator コンパレータ (オプション)
47 | * @throws IllegalArgumentException パラメータが null
の場合
48 | */
49 | protected BeanGreaterThanExpression(final String name, final Object criteria, @SuppressWarnings("rawtypes") final Comparator comparator) {
50 | super(name, criteria, comparator);
51 | }
52 |
53 | @Override
54 | public boolean accept(final Object bean) throws IOException {
55 | return BeanExpressionUtils.gt(bean, name, criteria, comparator);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanGreaterThanOrEqualExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 | import java.util.Comparator;
21 |
22 | /**
23 | * 指定された Java プログラム要素のフィールド値が判定基準値以上かどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
24 | *
25 | * @author Koji Sugisawa
26 | * @since 1.2.3
27 | */
28 | public class BeanGreaterThanOrEqualExpression extends BeanCriteriaExpression {
29 |
30 | /**
31 | * コンストラクタです。
32 | *
33 | * @param name フィールド名
34 | * @param criteria 判定基準値
35 | * @throws IllegalArgumentException パラメータが null
の場合
36 | */
37 | protected BeanGreaterThanOrEqualExpression(final String name, final Object criteria) {
38 | super(name, criteria);
39 | }
40 |
41 | /**
42 | * コンストラクタです。
43 | *
44 | * @param name フィールド名
45 | * @param criteria 判定基準値
46 | * @param comparator コンパレータ (オプション)
47 | * @throws IllegalArgumentException パラメータが null
の場合
48 | */
49 | protected BeanGreaterThanOrEqualExpression(final String name, final Object criteria, @SuppressWarnings("rawtypes") final Comparator comparator) {
50 | super(name, criteria, comparator);
51 | }
52 |
53 | @Override
54 | public boolean accept(final Object bean) throws IOException {
55 | return BeanExpressionUtils.ge(bean, name, criteria, comparator);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanInExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が判定基準値群のいずれかと等しいかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanInExpression extends BeanCriteriasExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name フィールド名
33 | * @param criterias 判定基準値群
34 | * @throws IllegalArgumentException パラメータが null
の場合
35 | */
36 | protected BeanInExpression(final String name, final Object... criterias) {
37 | super(name, criterias);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param name フィールド名
44 | * @param criterias 判定基準値群
45 | * @throws IllegalArgumentException パラメータが null
の場合
46 | */
47 | protected BeanInExpression(final String name, final String... criterias) {
48 | super(name, criterias);
49 | }
50 |
51 | /**
52 | * コンストラクタです。
53 | *
54 | * @param name フィールド名
55 | * @param criterias 判定基準値群
56 | * @param ignoreCase 大文字と小文字を区別するかどうか
57 | * @throws IllegalArgumentException パラメータが null
の場合
58 | */
59 | protected BeanInExpression(final String name, final String[] criterias, final boolean ignoreCase) {
60 | super(name, criterias, ignoreCase);
61 | }
62 |
63 | @Override
64 | public boolean accept(final Object bean) throws IOException {
65 | return BeanExpressionUtils.in(bean, name, criterias, ignoreCase);
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanLessThanExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 | import java.util.Comparator;
21 |
22 | /**
23 | * 指定された Java プログラム要素のフィールド値が判定基準値より小さいかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
24 | *
25 | * @author Koji Sugisawa
26 | * @since 1.2.3
27 | */
28 | public class BeanLessThanExpression extends BeanCriteriaExpression {
29 |
30 | /**
31 | * コンストラクタです。
32 | *
33 | * @param name フィールド名
34 | * @param criteria 判定基準値
35 | * @throws IllegalArgumentException パラメータが null
の場合
36 | */
37 | protected BeanLessThanExpression(final String name, final Object criteria) {
38 | super(name, criteria);
39 | }
40 |
41 | /**
42 | * コンストラクタです。
43 | *
44 | * @param name フィールド名
45 | * @param criteria 判定基準値
46 | * @param comparator コンパレータ (オプション)
47 | * @throws IllegalArgumentException パラメータが null
の場合
48 | */
49 | protected BeanLessThanExpression(final String name, final Object criteria, @SuppressWarnings("rawtypes") final Comparator comparator) {
50 | super(name, criteria, comparator);
51 | }
52 |
53 | @Override
54 | public boolean accept(final Object bean) throws IOException {
55 | return BeanExpressionUtils.lt(bean, name, criteria, comparator);
56 | }
57 |
58 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanLessThanOrEqualExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 | import java.util.Comparator;
21 |
22 | /**
23 | * 指定された Java プログラム要素のフィールド値がが判定基準値以下かどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
24 | *
25 | * @author Koji Sugisawa
26 | * @since 1.2.3
27 | */
28 | public class BeanLessThanOrEqualExpression extends BeanCriteriaExpression {
29 |
30 | /**
31 | * コンストラクタです。
32 | *
33 | * @param name フィールド名
34 | * @param criteria 判定基準値
35 | * @throws IllegalArgumentException パラメータが null
の場合
36 | */
37 | protected BeanLessThanOrEqualExpression(final String name, final Object criteria) {
38 | super(name, criteria);
39 | }
40 |
41 | /**
42 | * コンストラクタです。
43 | *
44 | * @param name フィールド名
45 | * @param criteria 判定基準値
46 | * @param comparator コンパレータ (オプション)
47 | * @throws IllegalArgumentException パラメータが null
の場合
48 | */
49 | protected BeanLessThanOrEqualExpression(final String name, final Object criteria, @SuppressWarnings("rawtypes") final Comparator comparator) {
50 | super(name, criteria, comparator);
51 | }
52 |
53 | @Override
54 | public boolean accept(final Object bean) throws IOException {
55 | return BeanExpressionUtils.le(bean, name, criteria, comparator);
56 | }
57 |
58 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanLogicalExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.util.ArrayList;
20 | import java.util.Arrays;
21 | import java.util.Collection;
22 |
23 | /**
24 | * Java プログラム要素フィルタを論理演算する Java プログラム要素フィルタの基底クラスを提供します。
25 | *
26 | * @author Koji Sugisawa
27 | * @since 1.2.3
28 | */
29 | public abstract class BeanLogicalExpression implements BeanFilter {
30 |
31 | /**
32 | * Java プログラム要素フィルタのコレクションを保持します。
33 | */
34 | protected final Collectionfilters
が null
の場合
48 | */
49 | protected BeanLogicalExpression(final BeanFilter... filters) {
50 | if (filters == null) {
51 | throw new IllegalArgumentException(String.format("%s must not be null", BeanFilter.class.getSimpleName()));
52 | }
53 | this.filters = Arrays.asList(filters);
54 | }
55 |
56 | /**
57 | * 指定された Java プログラム要素フィルタを追加します。
58 | *
59 | * @param filter Java プログラム要素フィルタ
60 | */
61 | public void add(final BeanFilter filter) {
62 | filters.add(filter);
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | final String name = getClass().getName();
68 | final int period = name.lastIndexOf('.');
69 | return period > 0 ? name.substring(period + 1) : name;
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanNotEmptyExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が空でないかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanNotEmptyExpression extends BeanExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name フィールド名
33 | * @throws IllegalArgumentException name
が null
の場合
34 | */
35 | protected BeanNotEmptyExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Object bean) throws IOException {
41 | return BeanExpressionUtils.isNotEmpty(bean, name);
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanNotEqualExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が判定基準値と等しくないかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanNotEqualExpression extends BeanCriteriaExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name フィールド名
33 | * @param criteria 判定基準値
34 | * @throws IllegalArgumentException パラメータが null
の場合
35 | */
36 | protected BeanNotEqualExpression(final String name, final Object criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param name フィールド名
44 | * @param criteria 判定基準値
45 | * @param ignoreCase 大文字と小文字を区別するかどうか
46 | * @throws IllegalArgumentException パラメータが null
の場合
47 | */
48 | protected BeanNotEqualExpression(final String name, final String criteria, final boolean ignoreCase) {
49 | super(name, criteria, ignoreCase);
50 | }
51 |
52 | @Override
53 | public boolean accept(final Object bean) throws IOException {
54 | return BeanExpressionUtils.ne(bean, name, criteria, ignoreCase);
55 | }
56 |
57 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanNotExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素フィルタの論理否定でフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanNotExpression implements BeanFilter {
28 |
29 | /**
30 | * Java プログラム要素フィルタを保持します。
31 | */
32 | private BeanFilter filter;
33 |
34 | /**
35 | * コンストラクタです。
36 | *
37 | * @param filter Java プログラム要素フィルタ
38 | * @throws IllegalArgumentException filter
が null
の場合
39 | */
40 | protected BeanNotExpression(final BeanFilter filter) {
41 | if (filter == null) {
42 | throw new IllegalArgumentException(String.format("%s must not be null", BeanFilter.class.getSimpleName()));
43 | }
44 | this.filter = filter;
45 | }
46 |
47 | @Override
48 | public boolean accept(final Object bean) throws IOException {
49 | return !filter.accept(bean);
50 | }
51 |
52 | @Override
53 | public String toString() {
54 | final String name = getClass().getName();
55 | final int period = name.lastIndexOf('.');
56 | return period > 0 ? name.substring(period + 1) : name;
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanNotInExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が判定基準値群のいずれとも等しくないかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanNotInExpression extends BeanCriteriasExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name フィールド名
33 | * @param criterias 判定基準値群
34 | * @throws IllegalArgumentException パラメータが null
の場合
35 | */
36 | protected BeanNotInExpression(final String name, final Object... criterias) {
37 | super(name, criterias);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param name フィールド名
44 | * @param criterias 判定基準値群
45 | * @throws IllegalArgumentException パラメータが null
の場合
46 | */
47 | protected BeanNotInExpression(final String name, final String... criterias) {
48 | super(name, criterias);
49 | }
50 |
51 | /**
52 | * コンストラクタです。
53 | *
54 | * @param name フィールド名
55 | * @param criterias 判定基準値群
56 | * @param ignoreCase 大文字と小文字を区別するかどうか
57 | * @throws IllegalArgumentException パラメータが null
の場合
58 | */
59 | protected BeanNotInExpression(final String name, final String[] criterias, final boolean ignoreCase) {
60 | super(name, criterias, ignoreCase);
61 | }
62 |
63 | @Override
64 | public boolean accept(final Object bean) throws IOException {
65 | return BeanExpressionUtils.notIn(bean, name, criterias, ignoreCase);
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanNotNullExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が null
でないかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanNotNullExpression extends BeanExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name 項目名
33 | * @throws IllegalArgumentException name
が null
の場合
34 | */
35 | protected BeanNotNullExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Object bean) throws IOException {
41 | return BeanExpressionUtils.isNotNull(bean, name);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanNullExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素のフィールド値が null
であるかどうかでフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanNullExpression extends BeanExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name フィールド名
33 | * @throws IllegalArgumentException name
が null
の場合
34 | */
35 | protected BeanNullExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Object bean) throws IOException {
41 | return BeanExpressionUtils.isNull(bean, name);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/BeanOrExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * 指定された Java プログラム要素フィルタ群の論理和でフィルタを適用する Java プログラム要素フィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class BeanOrExpression extends BeanLogicalExpression {
28 |
29 | /**
30 | * デフォルトコンストラクタです。
31 | */
32 | public BeanOrExpression() {
33 | super();
34 | }
35 |
36 | /**
37 | * コンストラクタです。
38 | *
39 | * @param filters Java プログラム要素フィルタ群
40 | * @throws IllegalArgumentException filters
が null
の場合
41 | */
42 | protected BeanOrExpression(final BeanFilter... filters) {
43 | super(filters);
44 | }
45 |
46 | @Override
47 | public boolean accept(final Object bean) throws IOException {
48 | if (filters.isEmpty()) {
49 | throw new IllegalArgumentException("Filters must not be empty");
50 | }
51 | for (final BeanFilter filter : filters) {
52 | if (filter.accept(bean)) {
53 | return true;
54 | }
55 | }
56 | return false;
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/ColumnNameBetweenExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * 指定された項目名に対応する区切り文字形式データの値が下限値から上限値の範囲かどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnNameBetweenExpression extends ColumnNameExpression {
28 |
29 | /**
30 | * 下限値を保持します。
31 | */
32 | private String low;
33 |
34 | /**
35 | * 上限値を保持します。
36 | */
37 | private String high;
38 |
39 | /**
40 | * コンストラクタです。
41 | *
42 | * @param name 項目名
43 | * @param low 下限値
44 | * @param high 上限値
45 | * @throws IllegalArgumentException パラメータが null
の場合
46 | */
47 | protected ColumnNameBetweenExpression(final String name, final String low, final String high) {
48 | super(name);
49 | if (low == null || high == null) {
50 | throw new IllegalArgumentException("Low or High must not be null");
51 | }
52 | this.low = low;
53 | this.high = high;
54 | }
55 |
56 | @Override
57 | public boolean accept(final Listnull
の場合
43 | */
44 | protected ColumnNameCriteriaExpression(final String name, final String criteria) {
45 | this(name, criteria, false);
46 | }
47 |
48 | /**
49 | * コンストラクタです。
50 | *
51 | * @param name 項目名
52 | * @param criteria 判定基準値
53 | * @param ignoreCase 大文字と小文字を区別するかどうか
54 | * @throws IllegalArgumentException パラメータが null
の場合
55 | */
56 | protected ColumnNameCriteriaExpression(final String name, final String criteria, final boolean ignoreCase) {
57 | super(name);
58 | if (criteria == null) {
59 | throw new IllegalArgumentException("Criteria must not be null");
60 | }
61 | this.criteria = criteria;
62 | this.ignoreCase = ignoreCase;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/ColumnNameEmptyExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * 指定された項目名に対応する区切り文字形式データの値が空かどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnNameEmptyExpression extends ColumnNameExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name 項目名
33 | * @throws IllegalArgumentException name
が null
の場合
34 | */
35 | protected ColumnNameEmptyExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Listnull
の場合
35 | */
36 | protected ColumnNameEqualExpression(final String name, final String criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param name 項目名
44 | * @param criteria 判定基準値
45 | * @param ignoreCase 大文字と小文字を区別するかどうか
46 | * @throws IllegalArgumentException パラメータが null
の場合
47 | */
48 | protected ColumnNameEqualExpression(final String name, final String criteria, final boolean ignoreCase) {
49 | super(name, criteria, ignoreCase);
50 | }
51 |
52 | @Override
53 | public boolean accept(final Listname
が null
の場合
37 | */
38 | protected ColumnNameExpression(final String name) {
39 | if (name == null) {
40 | throw new IllegalArgumentException("Column name must not be null");
41 | }
42 | this.name = name;
43 | }
44 |
45 | @Override
46 | public String toString() {
47 | final String className = getClass().getName();
48 | final int period = className.lastIndexOf('.');
49 | return period > 0 ? className.substring(period + 1) : className;
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/ColumnNameGreaterThanExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * 指定された項目名に対応する区切り文字形式データの値が判定基準値より大きいかどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnNameGreaterThanExpression extends ColumnNameCriteriaExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name 項目名
33 | * @param criteria 判定基準値
34 | * @throws IllegalArgumentException パラメータが null
の場合
35 | */
36 | protected ColumnNameGreaterThanExpression(final String name, final String criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listnull
の場合
35 | */
36 | protected ColumnNameGreaterThanOrEqualExpression(final String name, final String criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listnull
の場合
35 | */
36 | protected ColumnNameLessThanExpression(final String name, final String criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listnull
の場合
35 | */
36 | protected ColumnNameLessThanOrEqualExpression(final String name, final String criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listname
が null
の場合
34 | */
35 | protected ColumnNameNotEmptyExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Listnull
の場合
35 | */
36 | protected ColumnNameNotEqualExpression(final String name, final String criteria) {
37 | super(name, criteria);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param name 項目名
44 | * @param criteria 判定基準値
45 | * @param ignoreCase 大文字と小文字を区別するかどうか
46 | * @throws IllegalArgumentException パラメータが null
の場合
47 | */
48 | protected ColumnNameNotEqualExpression(final String name, final String criteria, final boolean ignoreCase) {
49 | super(name, criteria, ignoreCase);
50 | }
51 |
52 | @Override
53 | public boolean accept(final Listnull
でないかどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnNameNotNullExpression extends ColumnNameExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name 項目名
33 | * @throws IllegalArgumentException name
が null
の場合
34 | */
35 | protected ColumnNameNotNullExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Listnull
であるかどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnNameNullExpression extends ColumnNameExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param name 項目名
33 | * @throws IllegalArgumentException name
が null
の場合
34 | */
35 | protected ColumnNameNullExpression(final String name) {
36 | super(name);
37 | }
38 |
39 | @Override
40 | public boolean accept(final Listlow
または high
が null
の場合
46 | */
47 | protected ColumnPositionBetweenExpression(final int position, final String low, final String high) {
48 | super(position);
49 | if (low == null || high == null) {
50 | throw new IllegalArgumentException("Low or High must not be null");
51 | }
52 | this.low = low;
53 | this.high = high;
54 | }
55 |
56 | @Override
57 | public boolean accept(final Listcriteria
が null
の場合
43 | */
44 | protected ColumnPositionCriteriaExpression(final int position, final String criteria) {
45 | this(position, criteria, false);
46 | }
47 |
48 | /**
49 | * コンストラクタです。
50 | *
51 | * @param position 項目位置
52 | * @param criteria 判定基準値
53 | * @param ignoreCase 大文字と小文字を区別するかどうか
54 | * @throws IllegalArgumentException criteria
が null
の場合
55 | */
56 | protected ColumnPositionCriteriaExpression(final int position, final String criteria, final boolean ignoreCase) {
57 | super(position);
58 | if (criteria == null) {
59 | throw new IllegalArgumentException("Criteria must not be null");
60 | }
61 | this.criteria = criteria;
62 | this.ignoreCase = ignoreCase;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/ColumnPositionEmptyExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * 指定された項目位置に対応する区切り文字形式データの値が空かどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnPositionEmptyExpression extends ColumnPositionExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param position 項目位置
33 | */
34 | protected ColumnPositionEmptyExpression(final int position) {
35 | super(position);
36 | }
37 |
38 | @Override
39 | public boolean accept(final Listcriteria
が null
の場合
35 | */
36 | protected ColumnPositionEqualExpression(final int position, final String criteria) {
37 | super(position, criteria);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param position 項目位置
44 | * @param criteria 判定基準値
45 | * @param ignoreCase 大文字と小文字を区別するかどうか
46 | * @throws IllegalArgumentException criteria
が null
の場合
47 | */
48 | protected ColumnPositionEqualExpression(final int position, final String criteria, final boolean ignoreCase) {
49 | super(position, criteria, ignoreCase);
50 | }
51 |
52 | @Override
53 | public boolean accept(final Listcriteria
が null
の場合
35 | */
36 | protected ColumnPositionGreaterThanExpression(final int position, final String criteria) {
37 | super(position, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listcriteria
が null
の場合
35 | */
36 | protected ColumnPositionGreaterThanOrEqualExpression(final int position, final String criteria) {
37 | super(position, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listcriteria
が null
の場合
35 | */
36 | protected ColumnPositionLessThanExpression(final int position, final String criteria) {
37 | super(position, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listcriteria
が null
の場合
35 | */
36 | protected ColumnPositionLessThanOrEqualExpression(final int position, final String criteria) {
37 | super(position, criteria);
38 | }
39 |
40 | @Override
41 | public boolean accept(final Listcriteria
が null
の場合
35 | */
36 | protected ColumnPositionNotEqualExpression(final int position, final String criteria) {
37 | super(position, criteria);
38 | }
39 |
40 | /**
41 | * コンストラクタです。
42 | *
43 | * @param position 項目位置
44 | * @param criteria 判定基準値
45 | * @param ignoreCase 大文字と小文字を区別するかどうか
46 | * @throws IllegalArgumentException criteria
が null
の場合
47 | */
48 | protected ColumnPositionNotEqualExpression(final int position, final String criteria, final boolean ignoreCase) {
49 | super(position, criteria, ignoreCase);
50 | }
51 |
52 | @Override
53 | public boolean accept(final Listnull
でないかどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnPositionNotNullExpression extends ColumnPositionExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param position 項目位置
33 | */
34 | protected ColumnPositionNotNullExpression(final int position) {
35 | super(position);
36 | }
37 |
38 | @Override
39 | public boolean accept(final Listnull
であるかどうかでフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class ColumnPositionNullExpression extends ColumnPositionExpression {
28 |
29 | /**
30 | * コンストラクタです。
31 | *
32 | * @param position 項目位置
33 | */
34 | protected ColumnPositionNullExpression(final int position) {
35 | super(position);
36 | }
37 |
38 | @Override
39 | public boolean accept(final Listfilters
が null
の場合
41 | */
42 | protected CsvNamedValueAndExpression(final CsvNamedValueFilter... filters) {
43 | super(filters);
44 | }
45 |
46 | @Override
47 | public boolean accept(final Listfilters
が null
の場合
48 | */
49 | protected CsvNamedValueLogicalExpression(final CsvNamedValueFilter... filters) {
50 | if (filters == null) {
51 | throw new IllegalArgumentException(String.format("%s must not be null", CsvNamedValueFilter.class.getSimpleName()));
52 | }
53 | this.filters = Arrays.asList(filters);
54 | }
55 |
56 | /**
57 | * 指定された区切り文字形式データフィルタを追加します。
58 | *
59 | * @param filter 区切り文字形式データフィルタ
60 | */
61 | public void add(final CsvNamedValueFilter filter) {
62 | filters.add(filter);
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | final String name = getClass().getName();
68 | final int period = name.lastIndexOf('.');
69 | return period > 0 ? name.substring(period + 1) : name;
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/CsvNamedValueNotExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * 指定された区切り文字形式データの項目名リストと値リストでフィルタする区切り文字形式データフィルタの論理否定でフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class CsvNamedValueNotExpression implements CsvNamedValueFilter {
28 |
29 | /**
30 | * 区切り文字形式データフィルタを保持します。
31 | */
32 | private CsvNamedValueFilter filter;
33 |
34 | /**
35 | * コンストラクタです。
36 | *
37 | * @param filter 区切り文字形式データフィルタ
38 | * @throws IllegalArgumentException filter
が null
の場合
39 | */
40 | protected CsvNamedValueNotExpression(final CsvNamedValueFilter filter) {
41 | if (filter == null) {
42 | throw new IllegalArgumentException(String.format("%s must not be null", CsvNamedValueFilter.class.getSimpleName()));
43 | }
44 | this.filter = filter;
45 | }
46 |
47 | @Override
48 | public boolean accept(final Listfilters
が null
の場合
41 | */
42 | protected CsvNamedValueOrExpression(final CsvNamedValueFilter... filters) {
43 | super(filters);
44 | }
45 |
46 | @Override
47 | public boolean accept(final Listfilters
が null
の場合
41 | */
42 | protected CsvValueAndExpression(final CsvValueFilter... filters) {
43 | super(filters);
44 | }
45 |
46 | @Override
47 | public boolean accept(final Listfilters
が null
の場合
48 | */
49 | protected CsvValueLogicalExpression(final CsvValueFilter... filters) {
50 | if (filters == null) {
51 | throw new IllegalArgumentException(String.format("%s must not be null", CsvValueFilter.class.getSimpleName()));
52 | }
53 | this.filters = Arrays.asList(filters);
54 | }
55 |
56 | /**
57 | * 指定された区切り文字形式データフィルタを追加します。
58 | *
59 | * @param filter 区切り文字形式データフィルタ
60 | */
61 | public void add(final CsvValueFilter filter) {
62 | filters.add(filter);
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | final String name = getClass().getName();
68 | final int period = name.lastIndexOf('.');
69 | return period > 0 ? name.substring(period + 1) : name;
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/filters/CsvValueNotExpression.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orangesignal.csv.filters;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * 指定された区切り文字形式データの値リストでフィルタする区切り文字形式データフィルタの論理否定でフィルタを適用する区切り文字形式データフィルタの実装です。
23 | *
24 | * @author Koji Sugisawa
25 | * @since 1.2.3
26 | */
27 | public class CsvValueNotExpression implements CsvValueFilter {
28 |
29 | /**
30 | * 区切り文字形式データフィルタを保持します。
31 | */
32 | private CsvValueFilter filter;
33 |
34 | /**
35 | * コンストラクタです。
36 | *
37 | * @param filter 区切り文字形式データフィルタ
38 | * @throws IllegalArgumentException filter
が null
の場合
39 | */
40 | protected CsvValueNotExpression(final CsvValueFilter filter) {
41 | if (filter == null) {
42 | throw new IllegalArgumentException(String.format("%s must not be null", CsvValueFilter.class.getSimpleName()));
43 | }
44 | this.filter = filter;
45 | }
46 |
47 | @Override
48 | public boolean accept(final Listfilters
が null
の場合
41 | */
42 | protected CsvValueOrExpression(final CsvValueFilter... filters) {
43 | super(filters);
44 | }
45 |
46 | @Override
47 | public boolean accept(final List
39 | *
47 | *
48 | * @return {@link CsvManager} の新しいインスタンス
49 | */
50 | public static CsvManager newCsvManager() {
51 | for (final CsvManager manager : ServiceLoader.load(CsvManager.class)) {
52 | return manager;
53 | }
54 | return new CsvBeanManager();
55 | }
56 |
57 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/manager/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * 区切り文字形式データへの統合アクセスに関するインターフェースやクラスなどを提供します。
19 | *
20 | * @author Koji Sugisawa
21 | */
22 | package com.orangesignal.csv.manager;
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/csv/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * 区切り文字形式データアクセス全般に関するインターフェースやクラスなどを提供します。
19 | *
20 | * @author Koji Sugisawa
21 | */
22 | package com.orangesignal.csv;
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/jlha/BadHuffmanTableException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2001-2002 Michel Ishizuka All rights reserved.
3 | *
4 | * 以下の条件に同意するならばソースとバイナリ形式の再配布と使用を
5 | * 変更の有無にかかわらず許可する。
6 | *
7 | * 1.ソースコードの再配布において著作権表示と この条件のリスト
8 | * および下記の声明文を保持しなくてはならない。
9 | *
10 | * 2.バイナリ形式の再配布において著作権表示と この条件のリスト
11 | * および下記の声明文を使用説明書もしくは その他の配布物内に
12 | * 含む資料に記述しなければならない。
13 | *
14 | * このソフトウェアは石塚美珠瑠によって無保証で提供され、特定の目
15 | * 的を達成できるという保証、商品価値が有るという保証にとどまらず、
16 | * いかなる明示的および暗示的な保証もしない。
17 | * 石塚美珠瑠は このソフトウェアの使用による直接的、間接的、偶発
18 | * 的、特殊な、典型的な、あるいは必然的な損害(使用によるデータの
19 | * 損失、業務の中断や見込まれていた利益の遺失、代替製品もしくは
20 | * サービスの導入費等が考えられるが、決してそれだけに限定されない
21 | * 損害)に対して、いかなる事態の原因となったとしても、契約上の責
22 | * 任や無過失責任を含む いかなる責任があろうとも、たとえそれが不
23 | * 正行為のためであったとしても、またはそのような損害の可能性が報
24 | * 告されていたとしても一切の責任を負わないものとする。
25 | */
26 |
27 | package com.orangesignal.jlha;
28 |
29 | import java.io.IOException;
30 |
31 | /**
32 | * BlockHuffman.LenListToCodeList() 内で、 渡された LenList ( ハフマン符号長の表 )が不正なため、 ハフマン符号を生成できない事を示す。
33 | *
34 | * @author $Author: dangan $
35 | * @version $Revision: 1.0 $
36 | */
37 | @SuppressWarnings("serial")
38 | public class BadHuffmanTableException extends IOException {
39 |
40 | // ------------------------------------------------------------------
41 | // Constructor
42 |
43 | /**
44 | * 新しい BadHuffmanTableException を構築する。
45 | */
46 | public BadHuffmanTableException() {
47 | super();
48 | }
49 |
50 | /**
51 | * 新しい BadHuffmanTableException を構築する。
52 | *
53 | * @param message 詳細なメッセージ
54 | */
55 | public BadHuffmanTableException(final String message) {
56 | super(message);
57 | }
58 |
59 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/jlha/Bits.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2002 Michel Ishizuka All rights reserved.
3 | *
4 | * 以下の条件に同意するならばソースとバイナリ形式の再配布と使用を
5 | * 変更の有無にかかわらず許可する。
6 | *
7 | * 1.ソースコードの再配布において著作権表示と この条件のリスト
8 | * および下記の声明文を保持しなくてはならない。
9 | *
10 | * 2.バイナリ形式の再配布において著作権表示と この条件のリスト
11 | * および下記の声明文を使用説明書もしくは その他の配布物内に
12 | * 含む資料に記述しなければならない。
13 | *
14 | * このソフトウェアは石塚美珠瑠によって無保証で提供され、特定の目
15 | * 的を達成できるという保証、商品価値が有るという保証にとどまらず、
16 | * いかなる明示的および暗示的な保証もしない。
17 | * 石塚美珠瑠は このソフトウェアの使用による直接的、間接的、偶発
18 | * 的、特殊な、典型的な、あるいは必然的な損害(使用によるデータの
19 | * 損失、業務の中断や見込まれていた利益の遺失、代替製品もしくは
20 | * サービスの導入費等が考えられるが、決してそれだけに限定されない
21 | * 損害)に対して、いかなる事態の原因となったとしても、契約上の責
22 | * 任や無過失責任を含む いかなる責任があろうとも、たとえそれが不
23 | * 正行為のためであったとしても、またはそのような損害の可能性が報
24 | * 告されていたとしても一切の責任を負わないものとする。
25 | */
26 |
27 | package com.orangesignal.jlha;
28 |
29 | /**
30 | * ビット処理のためのユーティリティメソッド群。
31 | *
32 | * @author $Author: dangan $
33 | * @version $Revision: 1.0 $
34 | */
35 | public final class Bits {
36 |
37 | private Bits() {}
38 |
39 | /**
40 | * val のビット長を得る。 val は符号なし 32ビット整数とみなされる。 log2( (long)val & 0xFFFFFFFFL ) の戻り値の 小数点以下を切り捨てたものと同等。
41 | *
42 | * @param val 整数値
43 | *
44 | * @return val のビット長
45 | */
46 | public static int len(int val) {
47 | int len = 0;
48 | while (0 != val) {
49 | val >>>= 1;
50 | len++;
51 | }
52 | return len;
53 | }
54 |
55 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/jlha/Disconnectable.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2001-2002 Michel Ishizuka All rights reserved.
3 | *
4 | * 以下の条件に同意するならばソースとバイナリ形式の再配布と使用を
5 | * 変更の有無にかかわらず許可する。
6 | *
7 | * 1.ソースコードの再配布において著作権表示と この条件のリスト
8 | * および下記の声明文を保持しなくてはならない。
9 | *
10 | * 2.バイナリ形式の再配布において著作権表示と この条件のリスト
11 | * および下記の声明文を使用説明書もしくは その他の配布物内に
12 | * 含む資料に記述しなければならない。
13 | *
14 | * このソフトウェアは石塚美珠瑠によって無保証で提供され、特定の目
15 | * 的を達成できるという保証、商品価値が有るという保証にとどまらず、
16 | * いかなる明示的および暗示的な保証もしない。
17 | * 石塚美珠瑠は このソフトウェアの使用による直接的、間接的、偶発
18 | * 的、特殊な、典型的な、あるいは必然的な損害(使用によるデータの
19 | * 損失、業務の中断や見込まれていた利益の遺失、代替製品もしくは
20 | * サービスの導入費等が考えられるが、決してそれだけに限定されない
21 | * 損害)に対して、いかなる事態の原因となったとしても、契約上の責
22 | * 任や無過失責任を含む いかなる責任があろうとも、たとえそれが不
23 | * 正行為のためであったとしても、またはそのような損害の可能性が報
24 | * 告されていたとしても一切の責任を負わないものとする。
25 | */
26 |
27 | package com.orangesignal.jlha;
28 |
29 | import java.io.IOException;
30 |
31 | /**
32 | * 接続を解除できるストリームのための インターフェイス。
33 | * このインターフェイスを実装するストリームは close() は disconnect() を呼ぶべきである。
34 | *
35 | * @author $Author: dangan $
36 | * @version $Revision: 1.0 $
37 | */
38 | public interface Disconnectable {
39 |
40 | /**
41 | * 接続されていたストリームとの接続を解除する。
42 | *
43 | * @exception IOException 入出力エラーが発生した場合
44 | */
45 | void disconnect() throws IOException;
46 |
47 | }
--------------------------------------------------------------------------------
/src/main/java/com/orangesignal/jlha/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * OrangeSignal CSV 向けに内包させた jLHA (LHA Library for Java) のクラスやユーティリティなどを提供します。