org.apache.struts.util
クラス LabelValueBean

java.lang.Object
  拡張org.apache.struts.util.LabelValueBean
すべての実装インタフェース:
java.lang.Comparable, java.io.Serializable

public class LabelValueBean
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

A simple JavaBean to represent label-value pairs. This is most commonly used when constructing user interface elements which have a label to be displayed to the user, and a corresponding value to be returned to the server. One example is the <html:options> tag.

Note: this class has a natural ordering that is inconsistent with equals.

バージョン:
$Revision: 1.1 $ $Date: 2004/10/20 03:26:41 $
関連項目:
直列化された形式

フィールドの概要
static java.util.Comparator CASE_INSENSITIVE_ORDER
          Comparator that can be used for a case insensitive sort of LabelValueBean objects.
private  java.lang.String label
          The property which supplies the option label visible to the end user.
private  java.lang.String value
          The property which supplies the value returned to the server.
 
コンストラクタの概要
LabelValueBean()
          Default constructor.
LabelValueBean(java.lang.String label, java.lang.String value)
          Construct an instance with the supplied property values.
 
メソッドの概要
 int compareTo(java.lang.Object o)
          Compare LabelValueBeans based on the label, because that's the human viewable part of the object.
 boolean equals(java.lang.Object obj)
          LabelValueBeans are equal if their values are both null or equal.
 java.lang.String getLabel()
           
 java.lang.String getValue()
           
 int hashCode()
          The hash code is based on the object's value.
 void setLabel(java.lang.String label)
           
 void setValue(java.lang.String value)
           
 java.lang.String toString()
          Return a string representation of this object.
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

CASE_INSENSITIVE_ORDER

public static final java.util.Comparator CASE_INSENSITIVE_ORDER
Comparator that can be used for a case insensitive sort of LabelValueBean objects.


label

private java.lang.String label
The property which supplies the option label visible to the end user.


value

private java.lang.String value
The property which supplies the value returned to the server.

コンストラクタの詳細

LabelValueBean

public LabelValueBean()
Default constructor.


LabelValueBean

public LabelValueBean(java.lang.String label,
                      java.lang.String value)
Construct an instance with the supplied property values.

パラメータ:
label - The label to be displayed to the user.
value - The value to be returned to the server.
メソッドの詳細

getLabel

public java.lang.String getLabel()

setLabel

public void setLabel(java.lang.String label)

getValue

public java.lang.String getValue()

setValue

public void setValue(java.lang.String value)

compareTo

public int compareTo(java.lang.Object o)
Compare LabelValueBeans based on the label, because that's the human viewable part of the object.

定義:
インタフェース java.lang.Comparable 内の compareTo
関連項目:
Comparable

toString

public java.lang.String toString()
Return a string representation of this object.


equals

public boolean equals(java.lang.Object obj)
LabelValueBeans are equal if their values are both null or equal.

関連項目:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
The hash code is based on the object's value.

関連項目:
Object.hashCode()


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation