org.apache.commons.lang
クラス CharRange

java.lang.Object
  拡張org.apache.commons.lang.CharRange
すべての実装インタフェース:
Serializable

public final class CharRange
extends Object
implements Serializable

隣接する文字の範囲(オプションとして範囲の除外)を表します。

A contiguous range of characters, optionally negated.

このクラスのインスタンスは不変(immutable)です。

Instances are immutable.

導入されたバージョン:
1.0
バージョン:
$Id: CharRange.java,v 1.1.1.1 2004/02/13 10:02:05 hioki Exp $
作成者:
Henri Yandell, Stephen Colebourne, Chris Feldhacker, Gary Gregory
関連項目:
直列化された形式
翻訳者:
日置 聡
翻訳状況:
初稿(校正者募集中)
翻訳更新日:
2003/09/04

コンストラクタの概要
CharRange(char ch)
          単一の文字を意味する CharRange を生成します。
CharRange(char ch, boolean negated)
          単一の文字(または単一文字の除外)を意味する CharRange を生成します。
CharRange(char start, char end)
          文字のセットを意味する CharRange を生成します。
CharRange(char start, char end, boolean negated)
          文字のセット(または文字のセットの除外)を意味する CharRange を生成します。
 
メソッドの概要
 boolean contains(char ch)
          指定された文字がこの文字範囲に含まれるかどうかを返します。
 boolean contains(CharRange range)
          指定された文字範囲が、全てこの文字範囲に含まれるかどうかを評価します。
 boolean equals(Object obj)
          2つの CharRange オブジェクトを比較し、同じ方法で同じ文字範囲を示している場合に true を返します。
 char getEnd()
          文字範囲の終了文字を返します。
 char getStart()
          文字範囲の開始文字を返します。
 int hashCode()
          equals メソッドと互換性のあるハッシュコードを取得します。
 boolean isNegated()
          この CharRange が除外条件かどうかを返します。
 String toString()
          この文字範囲の文字列表現を返します。
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

CharRange

public CharRange(char ch)

単一の文字を意味する CharRange を生成します。

Constructs a CharRange over a single character.

パラメータ:
ch - この文字範囲の示す唯一の文字
only character in this range

CharRange

public CharRange(char ch,
                 boolean negated)

単一の文字(または単一文字の除外)を意味する CharRange を生成します。

Constructs a CharRange over a single character, optionally negating the range.

除外が指定された文字範囲は指定された文字以外の全ての文字を表します。

A negated range includes everything except the specified char.

パラメータ:
ch - この文字範囲の示す唯一の文字
only character in this range
negated - true の場合指定された文字以外の全てを表す
true to express everything except the range

CharRange

public CharRange(char start,
                 char end)

文字のセットを意味する CharRange を生成します。

Constructs a CharRange over a set of characters.

パラメータ:
start - この文字範囲の最初の文字(この文字も含む)
first character, inclusive, in this range
end - この文字範囲の最後の文字(この文字も含む)
last character, inclusive, in this range

CharRange

public CharRange(char start,
                 char end,
                 boolean negated)

文字のセット(または文字のセットの除外)を意味する CharRange を生成します。

Constructs a CharRange over a set of characters, optionally negating the range.

除外が指定された文字範囲は開始と終了の文字で定義された文字の範囲以外の全ての文字を表します。

A negated range includes everything except that defined by the start and end characters.

開始と終了の文字の順番が正しくない場合、逆に置き換えられます。 従って a-e の指定は e-a と等しくなります。

If start and end are in the wrong order, they are reversed. Thus a-e is the same as e-a.

パラメータ:
start - この文字範囲の最初の文字(この文字も含む)
first character, inclusive, in this range
end - この文字範囲の最後の文字(この文字も含む)
last character, inclusive, in this range
negated - true の場合指定された文字以外の全てを表す
true to express everything except the range
メソッドの詳細

getStart

public char getStart()

文字範囲の開始文字を返します。

Gets the start character for this character range.

戻り値:
開始文字(この文字も含む)
the start char (inclusive)

getEnd

public char getEnd()

文字範囲の終了文字を返します。

Gets the end character for this character range.

戻り値:
終了文字(この文字も含む)
the end char (inclusive)

isNegated

public boolean isNegated()

この CharRange が除外条件かどうかを返します。

Is this CharRange negated.

除外が指定された文字範囲は開始と終了の文字で定義された文字の範囲以外の全ての文字を表します。

A negated range includes everything except that defined by the start and end characters.

戻り値:
true の場合、除外条件
true is negated

contains

public boolean contains(char ch)

指定された文字がこの文字範囲に含まれるかどうかを返します。

Is the character specified contained in this range.

パラメータ:
ch - チェック対象となる文字
the character to check
戻り値:
指定された文字が文字範囲内の場合、true
true if this range contains the input character

contains

public boolean contains(CharRange range)

指定された文字範囲が、全てこの文字範囲に含まれるかどうかを評価します。

Are all the characters of the passed in range contained in this range.

パラメータ:
range - チェック対象となる文字範囲
the range to check against
戻り値:
指定された文字範囲が全て文字範囲内におさまる場合、true
true if this range entirely contains the input range
例外:
IllegalArgumentException - null が入力された場合
if null input

equals

public boolean equals(Object obj)

2つの CharRange オブジェクトを比較し、同じ方法で同じ文字範囲を示している場合に true を返します。

Compares two CharRange objects, returning true if they represent exactly the same range of characters defined in the same way.

パラメータ:
obj - 比較対照となるオブジェクト
the object to compare to
戻り値:
true 等しい場合、true
true if equal

hashCode

public int hashCode()

equals メソッドと互換性のあるハッシュコードを取得します。

Gets a hashCode compatable with the equals method.

戻り値:
適切なハッシュコード
a suitable hashCode

toString

public String toString()

この文字範囲の文字列表現を返します。

Gets a string representation of the character range.

戻り値:
この文字範囲の文字列表現
string representation of this range


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation