|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jplate.foundation.node.attribute.impl.defaults.DefaultAttribute<N,V>
N
- The name type of the attribute.V
- The value type of the attribute.public final class DefaultAttribute<N,V>
Default implementation of AttributeIfc
. It represents an attribute
which is a name/value pair. As name uniquely identifies an attribute,
its name is immutable through this interface. Values, however, are mutable.
Please note: Manipulation of the value is not thread safe.
Modifications: $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $ $Revision: 479 $ $Author: sfloess $ $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/node/attribute/impl/defaults/DefaultAttribute.java $
Field Summary | |
---|---|
private org.apache.commons.logging.Log |
_log
Used for logging. |
private N |
_name
The name of the attribute. |
private V |
_value
The value of the attribute. |
private static java.lang.String |
NAME_IS_NULL_MSG
Denotes the name is null... |
Constructor Summary | |
---|---|
private |
DefaultAttribute()
Default constructor not allowed. |
|
DefaultAttribute(N name)
This constructor sets the name the attribute. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object toCompare)
Returns true if self is equal to toCompare or false if not. |
N |
getName()
Returns the name of the attribute. |
V |
getValue()
Returns the value of the attribute. |
int |
hashCode()
Returns the hash code representation of self. |
void |
setValue(V value)
Sets the value of the attribute. |
java.lang.String |
toString()
Returns a string representation of self. |
java.lang.String |
toString(java.lang.String prepend)
Returns a string representation of self prepending prepend to
each line. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String NAME_IS_NULL_MSG
private final transient org.apache.commons.logging.Log _log
private final N _name
private V _value
Constructor Detail |
---|
public DefaultAttribute(N name)
name
- The name of the attribute.
java.lang.IllegalArgumentException
- if name is null.private DefaultAttribute()
java.lang.UnsupportedOperationException
- If this constructor is called.Method Detail |
---|
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object toCompare)
toCompare
or false if not.
equals
in class java.lang.Object
toCompare
- The object to compare self for equality.
toCompare
or false if not.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String prepend)
prepend
to
each line.
toString
in interface FormattableIfc
prepend
- The text to prepend to each line as defined in the return
value.
prepend
prepended to each line.public N getName()
getName
in interface AttributeIfc<N,V>
public V getValue()
getValue
in interface AttributeIfc<N,V>
public void setValue(V value)
setValue
in interface AttributeIfc<N,V>
value
- represents the new value of the attribute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |