org.apache.commons.lang.builder
クラス ToStringBuilder

java.lang.Object
  拡張org.apache.commons.lang.builder.ToStringBuilder

public class ToStringBuilder
extends Object

ToString を生成する処理です。

ToString generation routine.

このクラスはより良い toString メソッドをクラスに実装する事を可能にします。 このクラスは以下の処理を単純化することを目的とします:

This class enables a good toString to be built for any class. This class aims to simplify the process by:

一般的な使用方法を以下に示します:

To use this class write code as follows:
 public class Person {
   String name;
   int age;
   boolean isSmoker;
 
   ...
 
   public String toString() {
     return new ToStringBuilder(this).
       append(name, "name").
       append(age, "age").
       append(smoker, "smoker").
       toString();
   }
 }
 
これは以下のフォーマットの toString 生成します:
This will produce a toString of the format:
Person@7f54[name=Stephen,age=29,smoker=false]

もう一つの方法として、対象とするフィールドを決定する際にリフレクションを使用するメソッドがあります。 普通、対象となるフィールドは private であるため、この reflectionToString メソッドは フィールドのアクセス制限を変更するために Field.setAccessible を使用します。 これは適切なパーミッションが設定されていない限り、セキュリティマネージャが稼動している状態では行うことができません。 また、この方法は明らかに低速です。

Alternatively, there is a method that uses reflection to determine the fields to test. Because these fields are usually private, the method, reflectionToString, uses Field.setAccessible to change the visibility of the fields. This will fail under a security manager, unless the appropriate permissions are set. It is also slower than testing explicitly.

このメソッドの一般的な使用方法は以下の様になります:

A typical invocation for this method would look like:
 public String toString() {
   return ToStringBuilder.reflectionToString(this);
 }
 

toString で使用される詳細なフォーマットはコンストラクタに渡される ToStringStyle によって決定されます。

The exact format of the toString is determined by the {@link ToStringStyle} passed into the constructor.

バージョン:
$Id: ToStringBuilder.java,v 1.1.1.1 2004/02/13 10:02:05 hioki Exp $
作成者:
Stephen Colebourne
翻訳者:
日置 聡
翻訳状況:
初稿(校正者募集中)
翻訳更新日:
2003/08/19

フィールドの概要
private  StringBuffer buffer
          現在の toString バッファ。
private static ToStringStyle defaultStyle
          出力の際に使用されるデフォルトのスタイル。
private  Object object
          出力を行う対象となるオブジェクト。
private  ToStringStyle style
          出力の際に使用されるスタイル。
 
コンストラクタの概要
ToStringBuilder(Object object)
          ToStringBuilder のコンストラクタです。
ToStringBuilder(Object object, ToStringStyle style)
          出力の際のスタイルを指定する ToStringBuilder のコンストラクタです。
ToStringBuilder(Object object, ToStringStyle style, StringBuffer buffer)
          ToStringBuilder のコンストラクタです。
 
メソッドの概要
 ToStringBuilder append(boolean value)
          boolean の値を toString に追加します。
 ToStringBuilder append(boolean[] array)
          boolean の配列を toString に追加します。
 ToStringBuilder append(byte value)
          byte の値を toString に追加します。
 ToStringBuilder append(byte[] array)
          byte の配列を toString に追加します。
 ToStringBuilder append(char value)
          char の値を toString に追加します。
 ToStringBuilder append(char[] array)
          char の配列を toString に追加します。
 ToStringBuilder append(double value)
          double の値を toString に追加します。
 ToStringBuilder append(double[] array)
          double の配列を toString に追加します。
 ToStringBuilder append(float value)
          float の値を toString に追加します。
 ToStringBuilder append(float[] array)
          float の配列を toString に追加します。
 ToStringBuilder append(int value)
          int の値を toString に追加します。
 ToStringBuilder append(int[] array)
          int の配列を toString に追加します。
 ToStringBuilder append(long value)
          long の値を toString に追加します。
 ToStringBuilder append(long[] array)
          long の配列を toString に追加します。
 ToStringBuilder append(Object object)
          Object の値を toString に追加します。
 ToStringBuilder append(Object[] array)
          Object の配列を toString に追加します。
 ToStringBuilder append(short value)
          short の値を toString に追加します。
 ToStringBuilder append(short[] array)
          short の配列を toString に追加します。
 ToStringBuilder append(String fieldName, boolean value)
          boolean の値を toString に追加します。
 ToStringBuilder append(String fieldName, boolean[] array)
          boolean の配列を toString に追加します。
 ToStringBuilder append(String fieldName, boolean[] array, boolean fullDetail)
          boolean の配列を toString に追加します。
 ToStringBuilder append(String fieldName, byte value)
          byte の値を toString に追加します。
 ToStringBuilder append(String fieldName, byte[] array)
          byte の配列を toString に追加します。
 ToStringBuilder append(String fieldName, byte[] array, boolean fullDetail)
          byte の配列を toString に追加します。
 ToStringBuilder append(String fieldName, char value)
          char の値を toString に追加します。
 ToStringBuilder append(String fieldName, char[] array)
          char の配列を toString に追加します。
 ToStringBuilder append(String fieldName, char[] array, boolean fullDetail)
          char の配列を toString に追加します。
 ToStringBuilder append(String fieldName, double value)
          double の値を toString に追加します。
 ToStringBuilder append(String fieldName, double[] array)
          double の配列を toString に追加します。
 ToStringBuilder append(String fieldName, double[] array, boolean fullDetail)
          double の配列を toString に追加します。
 ToStringBuilder append(String fieldName, float value)
          float の値を toString に追加します。
 ToStringBuilder append(String fieldName, float[] array)
          float の配列を toString に追加します。
 ToStringBuilder append(String fieldName, float[] array, boolean fullDetail)
          float の配列を toString に追加します。
 ToStringBuilder append(String fieldName, int value)
          int の値を toString に追加します。
 ToStringBuilder append(String fieldName, int[] array)
          int の配列を toString に追加します。
 ToStringBuilder append(String fieldName, int[] array, boolean fullDetail)
          int の配列を toString に追加します。
 ToStringBuilder append(String fieldName, long value)
          long の値を toString に追加します。
 ToStringBuilder append(String fieldName, long[] array)
          long の配列を toString に追加します。
 ToStringBuilder append(String fieldName, long[] array, boolean fullDetail)
          long の配列を toString に追加します。
 ToStringBuilder append(String fieldName, Object object)
          Object の値を toString に追加します。
 ToStringBuilder append(String fieldName, Object[] array)
          Object の配列を toString に追加します。
 ToStringBuilder append(String fieldName, Object[] array, boolean fullDetail)
          Object の配列を toString に追加します。
 ToStringBuilder append(String fieldName, Object object, boolean fullDetail)
          Object の値を toString に追加します。
 ToStringBuilder append(String fieldName, short value)
          short の値を toString に追加します。
 ToStringBuilder append(String fieldName, short[] array)
          short の配列を toString に追加します。
 ToStringBuilder append(String fieldName, short[] array, boolean fullDetail)
          short の配列を toString に追加します。
static ToStringStyle getDefaultStyle()
          デフォルトのスタイルを取得します。
 StringBuffer getStringBuffer()
          内部で使用されているバッファを取得します。
static String reflectionToString(Object object)
          このメソッドは一連の toString の生成にリフレクションを使用し、出力にデフォルトのスタイルを使用します。
static String reflectionToString(Object object, ToStringStyle style)
          このメソッドは一連の toString の生成にリフレクションを使用します。
static String reflectionToString(Object object, ToStringStyle style, boolean outputTransients)
          このメソッドは一連の toString の生成にリフレクションを使用します。
static void setDefaultStyle(ToStringStyle style)
          使用するデフォルトのスタイルを設定します。
 String toString()
          生成された toString の結果を返します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

defaultStyle

private static ToStringStyle defaultStyle
出力の際に使用されるデフォルトのスタイル。
The default style of output to use


buffer

private final StringBuffer buffer
現在の toString バッファ。
Current toString buffer


style

private final ToStringStyle style
出力の際に使用されるスタイル。
The style of output to use


object

private final Object object
出力を行う対象となるオブジェクト。
The object being output

コンストラクタの詳細

ToStringBuilder

public ToStringBuilder(Object object)
ToStringBuilder のコンストラクタです。 このコンストラクタは出力の際に setDefaultStyle で設定されたデフォルトのスタイルを使用します。
Constructor for ToStringBuilder. This constructor outputs using the default style set with setDefaultStyle.

パラメータ:
object - toString を生成する対象となるオブジェクト、null でない必要があります
the object to build a toString for, must not be null
例外:
IllegalArgumentException - 渡されたオブジェクトが null だった場合
if the object passed in is null

ToStringBuilder

public ToStringBuilder(Object object,
                       ToStringStyle style)
出力の際のスタイルを指定する ToStringBuilder のコンストラクタです。
Constructor for ToStringBuilder specifying the output style.

style が null だった場合にはデフォルトのスタイルが使用されます。

If the style is null, the default style is used.

パラメータ:
object - toString を生成する対象となるオブジェクト、null でない必要があります
the object to build a toString for, must not be null
style - toString を生成する際のスタイル、 null を許容します
the style of the toString to create, may be null
例外:
IllegalArgumentException - 渡されたオブジェクトが null だった場合
if the object passed in is null

ToStringBuilder

public ToStringBuilder(Object object,
                       ToStringStyle style,
                       StringBuffer buffer)
ToStringBuilder のコンストラクタです。
Constructor for ToStringBuilder.

style が null だった場合にはデフォルトのスタイルが使用されます。 buffer が null だった場合には新たなバッファを生成します。

If the style is null, the default style is used. If the buffer is null, a new one is created.

パラメータ:
object - toString を生成する対象となるオブジェクト、null でない必要があります
the object to build a toString for, must not be null
style - toString を生成する際のスタイル、 null を許容します
the style of the toString to create, may be null
buffer - 処理に使用される文字列バッファ、 null を許容します
the string buffer to populate, may be null
例外:
IllegalArgumentException - 渡されたオブジェクトが null だった場合
if the object passed in is null
メソッドの詳細

getDefaultStyle

public static ToStringStyle getDefaultStyle()
デフォルトのスタイルを取得します。
Gets the default style to use.

このメソッドはアプリケーション全体の toString スタイルを1度の呼び出しでコントロールすることを可能とします。 これによって開発中には詳細な toString の出力を行い、運用時には簡潔な出力を行うといった使用法が可能です。

This could allow the toString style to be controlled for an entire application with one call. This might be used to have a verbose toString during development and a compact toString in production.

戻り値:
デフォルトの toString スタイル
the default toString style

setDefaultStyle

public static void setDefaultStyle(ToStringStyle style)
使用するデフォルトのスタイルを設定します。
Sets the default style to use.

パラメータ:
style - デフォルトの toString スタイル
the default toString style
例外:
IllegalArgumentException - スタイルが null だった場合
if the style is null

reflectionToString

public static String reflectionToString(Object object)
このメソッドは一連の toString の生成にリフレクションを使用し、出力にデフォルトのスタイルを使用します。
This method uses reflection to build a suitable toString using the default style.

このメソッドは private フィールドの値を取得するために Field.setAccessible を使用します。 これはセキュリティマネージャが稼動していて、適切なパーミッションが設定されていない場合、 セキュリティ例外が投げられることを意味します。 このメソッドは明らかに非効率です。 transient メンバーは、おそらくフィールドの値から取得されたものでオブジェクトの値とはならないと考え、 処理の対象としません。 static フィールドは処理の対象にはなりません。

It uses Field.setAccessible to gain access to private fields. This means that it will throw a security exception if run under a security manger, if the permissions are not set up. It is also not as efficient as testing explicitly. Transient members will be not be included, as they are likely derived fields, and not part of the value of the object. Static fields will be not be included.

パラメータ:
object - 出力対象となるオブジェクト
the object to be output
戻り値:
処理結果の文字列
the String result
例外:
IllegalArgumentException - object が null だった場合
if the object is null

reflectionToString

public static String reflectionToString(Object object,
                                        ToStringStyle style)
このメソッドは一連の toString の生成にリフレクションを使用します。
This method uses reflection to build a suitable toString.

このメソッドは private フィールドの値を取得するために Field.setAccessible を使用します。 これはセキュリティマネージャが稼動していて、適切なパーミッションが設定されていない場合、 セキュリティ例外が投げられることを意味します。 このメソッドは明らかに非効率です。 transient メンバーは、おそらくフィールドの値から取得されたものでオブジェクトの値とはならないと考え、 処理の対象としません。 static フィールドは処理の対象にはなりません。

It uses Field.setAccessible to gain access to private fields. This means that it will throw a security exception if run under a security manger, if the permissions are not set up. It is also not as efficient as testing explicitly. Transient members will be not be included, as they are likely derived fields, and not part of the value of the object. Static fields will be not be included.

style が null だった場合にはデフォルトのスタイルが使用されます。

If the style is null, the default style is used.

パラメータ:
object - 出力対象となるオブジェクト
the object to be output
style - toString を生成する際のスタイル、 null を許容します
the style of the toString to create, may be null
戻り値:
処理結果の文字列
the String result
例外:
IllegalArgumentException - objectが null だった場合
if the object or style is null

reflectionToString

public static String reflectionToString(Object object,
                                        ToStringStyle style,
                                        boolean outputTransients)
このメソッドは一連の toString の生成にリフレクションを使用します。
This method uses reflection to build a suitable toString.

このメソッドは private フィールドの値を取得するために Field.setAccessible を使用します。 これはセキュリティマネージャが稼動していて、適切なパーミッションが設定されていない場合、 セキュリティ例外が投げられることを意味します。 このメソッドは明らかに非効率です。 testTransients 引数に true が設定された場合 transient メンバーを処理の対象とし、 false が設定された場合にはフィールドの値から取得されたものでオブジェクトの値とはならないとみなし、 transient メンバーを無視します。 static フィールドは処理の対象にはなりません。

It uses Field.setAccessible to gain access to private fields. This means that it will throw a security exception if run under a security manger, if the permissions are not set up. It is also not as efficient as testing explicitly. If the outputTransients parameter is set to true, transient members will be output, otherwise they are ignored, as they are likely derived fields, and not part of the value of the object. Static fields will not be tested.

style が null だった場合にはデフォルトのスタイルが使用されます。

If the style is null, the default style is used.

パラメータ:
object - 出力対象となるオブジェクト
the object to be output
style - toString を生成する際のスタイル、 null を許容します
the style of the toString to create, may be null
outputTransients - transient フィールドを含めるかどうか
whether to include transient fields
戻り値:
処理結果の文字列
the String result
例外:
IllegalArgumentException - object が null だった場合
if the object is null

append

public ToStringBuilder append(Object object)
Object の値を toString に追加します。
Append to the toString an Object value.

パラメータ:
object - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              Object object)
Object の値を toString に追加します。
Append to the toString an Object value.

パラメータ:
object - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              Object object,
                              boolean fullDetail)
Object の値を toString に追加します。
Append to the toString an Object value.

パラメータ:
object - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(long value)
long の値を toString に追加します。
Append to the toString a long value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              long value)
long の値を toString に追加します。
Append to the toString a long value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(int value)
int の値を toString に追加します。
Append to the toString an int value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              int value)
int の値を toString に追加します。
Append to the toString an int value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(short value)
short の値を toString に追加します。
Append to the toString a short value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              short value)
short の値を toString に追加します。
Append to the toString a short value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(char value)
char の値を toString に追加します。
Append to the toString a char value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              char value)
char の値を toString に追加します。
Append to the toString a char value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(byte value)
byte の値を toString に追加します。
Append to the toString a byte value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              byte value)
byte の値を toString に追加します。
Append to the toString a byte value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(double value)
double の値を toString に追加します。
Append to the toString a double value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              double value)
double の値を toString に追加します。
Append to the toString a double value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(float value)
float の値を toString に追加します。
Append to the toString a float value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              float value)
float の値を toString に追加します。
Append to the toString a float value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(boolean value)
boolean の値を toString に追加します。
Append to the toString a boolean value.

パラメータ:
value - toString に加える値
the value to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              boolean value)
boolean の値を toString に追加します。
Append to the toString a boolean value.

パラメータ:
value - toString に加える値
the value to add to the toString
fieldName - フィールド名
the field name
戻り値:
this

append

public ToStringBuilder append(Object[] array)
Object の配列を toString に追加します。
Append to the toString an Object array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              Object[] array)
Object の配列を toString に追加します。
Append to the toString an Object array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              Object[] array,
                              boolean fullDetail)
Object の配列を toString に追加します。
Append to the toString an Object array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(long[] array)
long の配列を toString に追加します。
Append to the toString a long array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              long[] array)
long の配列を toString に追加します。
Append to the toString a long array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              long[] array,
                              boolean fullDetail)
long の配列を toString に追加します。
Append to the toString a long array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(int[] array)
int の配列を toString に追加します。
Append to the toString an int array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              int[] array)
int の配列を toString に追加します。
Append to the toString an int array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              int[] array,
                              boolean fullDetail)
int の配列を toString に追加します。
Append to the toString an int array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(short[] array)
short の配列を toString に追加します。
Append to the toString a short array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              short[] array)
short の配列を toString に追加します。
Append to the toString a short array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              short[] array,
                              boolean fullDetail)
short の配列を toString に追加します。
Append to the toString a short array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(char[] array)
char の配列を toString に追加します。
Append to the toString a char array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              char[] array)
char の配列を toString に追加します。
Append to the toString a char array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              char[] array,
                              boolean fullDetail)
char の配列を toString に追加します。
Append to the toString a char array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(byte[] array)
byte の配列を toString に追加します。
Append to the toString a byte array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              byte[] array)
byte の配列を toString に追加します。
Append to the toString a byte array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              byte[] array,
                              boolean fullDetail)
byte の配列を toString に追加します。
Append to the toString a byte array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(double[] array)
double の配列を toString に追加します。
Append to the toString a double array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              double[] array)
double の配列を toString に追加します。
Append to the toString a double array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              double[] array,
                              boolean fullDetail)
double の配列を toString に追加します。
Append to the toString a double array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(float[] array)
float の配列を toString に追加します。
Append to the toString a float array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              float[] array)
float の配列を toString に追加します。
Append to the toString a float array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              float[] array,
                              boolean fullDetail)
float の配列を toString に追加します。
Append to the toString a float array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

append

public ToStringBuilder append(boolean[] array)
boolean の配列を toString に追加します。
Append to the toString a boolean array.

パラメータ:
array - toString に加える配列
the array to add to the toString
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              boolean[] array)
boolean の配列を toString に追加します。
Append to the toString a boolean array.

パラメータ:
fieldName - フィールド名
the field name
array - the array to add to the hashCode
戻り値:
this

append

public ToStringBuilder append(String fieldName,
                              boolean[] array,
                              boolean fullDetail)
boolean の配列を toString に追加します。
Append to the toString a boolean array.

boolean の引数は詳細情報の表示の程度をコントロールします。 true が設定された場合には配列内の全ての情報を出力し、 false が設定された場合には概要(一般的に配列のサイズ)を出力します。

A boolean parameter controls the level of detail to show. Setting true will output the array in full. Setting false will output a summary, typically the size of the array.

パラメータ:
fieldName - フィールド名
the field name
array - toString に加える配列
the array to add to the toString
fullDetail - true for detail, false for summary info
戻り値:
this

getStringBuffer

public StringBuffer getStringBuffer()
内部で使用されているバッファを取得します。
Gets the buffer being populated

戻り値:
使用されている StringBuffer
the StringBuffer being populated

toString

public String toString()
生成された toString の結果を返します。
Returns the built toString

戻り値:
toString の文字列
the String toString


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