?? attr.java
字號:
//package a;
/**
*An <code>Attr</code> object defines an attribute as a
*name /value pair ,where the name is a <code> String </code>
*and the value an arbitrary <code> Object </code>.
*
*@since < @ 2.0 >
*
*/
public class Attr{
/** The attribute name. */
private final String name;
/** The attribute value.*/
private Object value=null;
/**
*Creates a new attribute with the given name and an
*initial value of <code>null</code>.
*@see Attr#Attr(String,Object)
*/
public Attr(String name){
this.name=name;
}
/**
*Creates a new attribute with the given name and
*initial value.
*@see Attr#Attr(String)
*/
public Attr(String name,Object value){
this.name=name;
this.value=value;
}
/**Returns this attribute's name.*/
public String getName(){
return name;
}
/**Returns this attribute's value.*/
public Object getValue(){
return value;
}
/**
*Set the value of this attribute. Changes the
*value returned by calls to {@link #getValue}.
*@param newValue The new value for the attribute.
*@return The original value.
*@see #getValue
*/
public Object setValue(Object newValue){
Object oldVal=value;
value=newValue;
return oldVal;
}
/**
*Returns a String of the from <code>name=value</code>.
*/
public String toString(){
return name+"='"+value+"'";
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -