org.dbe.eve.simulator
Class Attribute

java.lang.Object
  extended by org.dbe.eve.simulator.Attribute
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
DemandedAttribute

public class Attribute
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable

Represents an attribute

Author:
Roman

Field Summary
protected  int iD
           
(package private) static org.apache.log4j.Logger logger
           
protected  int value
           
 
Constructor Summary
Attribute(int ID, int value)
          Constructs an Attribute with an ID and a value.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this Attribute.
 int compareTo(java.lang.Object o)
           
 int getID()
          Returns the ID of this attribute.
 int getValue()
          Returns the value of this attribute.
 void increaseValue(int plus)
          This method increase the value of the attribute by the value delivered through parameter value.
 boolean isEqual(java.lang.Object o)
           
 void setValue(int newValue)
          This method set the value of the attribute to value which is delivered through parameter value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iD

protected int iD

value

protected int value

logger

static org.apache.log4j.Logger logger
Constructor Detail

Attribute

public Attribute(int ID,
                 int value)
Constructs an Attribute with an ID and a value.

Parameters:
ID - the ID of the new Attibute
value - the Attribtues value (int)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of this Attribute. The copy will not contain any reference to the attribute from which the attribute was cloned.

Overrides:
clone in class java.lang.Object
Returns:
a clone of the Attribute
Throws:
java.lang.CloneNotSupportedException

getID

public int getID()
Returns the ID of this attribute.

Returns:
the Attributes ID

getValue

public int getValue()
Returns the value of this attribute.

Returns:
the int-value of this attribute

setValue

public void setValue(int newValue)
This method set the value of the attribute to value which is delivered through parameter value.

Parameters:
newValue - is the new value of the attribute.

increaseValue

public void increaseValue(int plus)
This method increase the value of the attribute by the value delivered through parameter value.

Parameters:
plus - is the value which is added to the current value of the attribute

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o -
Returns:
0 if equal ID, -x if o < this, +x if o > this

isEqual

public boolean isEqual(java.lang.Object o)
Parameters:
o -
Returns:
true if equal ID and Value