DtpSplitString オブジェクトの前のエレメントを戻します。
構文
String prevElement()
戻り値
前のエレメントを含む String を戻します。
例外
DtpNoElementAtPositionException - 前のエレメントがない場合です。
注記
prevElement() と nextElement() を使用して、DtpSplitString オブジェクト内のエレメント (トークン) をナビゲートすることもできます。初めて nextElement() を呼び出したとき、エレメントの位置はゼロです。以降の nextElement() の呼び出しにより、位置が 1 つずつ増分されます。prevElement() メソッドは、前のエレメントを戻し、エレメントの位置を 1 つずつ減少させます。
例
// Create a DtpSplitString object DtpSplitString MyString = new DtpSplitString("This,is a test",", "); // This call returns element 0 containing "This" String firstElement = MyString.nextElement() // This call returns element 1 containing "is" String secondElement = MyString.nextElement() // This call returns element 0 containing "This" String anotherElement = MyString.prevElement()
参照項目