Package net.anotheria.anodoc.data
Class IntProperty
- java.lang.Object
-
- net.anotheria.anodoc.data.DataHolder
-
- net.anotheria.anodoc.data.Property
-
- net.anotheria.anodoc.data.IntProperty
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,IBasicStoreableObject,IPlainDataObject
public class IntProperty extends Property
This class represents an integer property (the mapping for int or integer attributes)- Since:
- 1.0
- Version:
- $Id: $Id
- Author:
- another
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntProperty(java.lang.String name, int value)Creates a new IntProperty with given name and value.IntProperty(java.lang.String name, java.lang.Integer value)Creates a new IntProperty with given name and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectcloneValue()cloneValue.intgetInt()Returns the value of this property as int.java.lang.IntegergetInteger()Returns the value of this property as Integer object.PropertyTypegetPropertyType()getPropertyType.longgetSizeInBytes()The 'size' of a DataHolder is needed for the quota calculation.
The size of an atomic DataHolder like a Property should be the real amount of bytes it uses, whether the size of complex objects should be cumulated.
The overhead for administration shouldn't be counted (i.e.voidsetInt(int aValue)Sets the value of this property to the given int value.voidsetInteger(java.lang.Integer aValue)Sets the value of this property to the given Integer value.voidsetValue(java.lang.Object o)Sets the value of this Property.-
Methods inherited from class net.anotheria.anodoc.data.Property
clone, cloneAs, equals, getName, getStorageId, getValue, toString, toXMLNode
-
Methods inherited from class net.anotheria.anodoc.data.DataHolder
getId, hashCode, setId
-
-
-
-
Constructor Detail
-
IntProperty
public IntProperty(java.lang.String name, int value)Creates a new IntProperty with given name and value.- Parameters:
name- aStringobject.value- a int.
-
IntProperty
public IntProperty(java.lang.String name, java.lang.Integer value)Creates a new IntProperty with given name and value.- Parameters:
name- aStringobject.value- aIntegerobject.
-
-
Method Detail
-
getInteger
public java.lang.Integer getInteger()
Returns the value of this property as Integer object.- Returns:
- a
Integerobject.
-
getInt
public int getInt()
Returns the value of this property as int.- Returns:
- a int.
-
setInt
public void setInt(int aValue)
Sets the value of this property to the given int value.- Parameters:
aValue- a int.
-
setInteger
public void setInteger(java.lang.Integer aValue)
Sets the value of this property to the given Integer value.- Parameters:
aValue- aIntegerobject.
-
setValue
public void setValue(java.lang.Object o)
Sets the value of this Property. Sets the value of this property to the value of the given object. o can be an Integer or a String representing an integer.
-
getSizeInBytes
public long getSizeInBytes()
The 'size' of a DataHolder is needed for the quota calculation.
The size of an atomic DataHolder like a Property should be the real amount of bytes it uses, whether the size of complex objects should be cumulated.
The overhead for administration shouldn't be counted (i.e. the size of an IntProperty is the amount of bytes needed to store the int value itself, not the amount of bytes needed to store the DataHolder object). Returns the amount of bytes needed to hold an integer value - 4.- Specified by:
getSizeInBytesin classDataHolder- Returns:
- a long.
-
cloneValue
protected java.lang.Object cloneValue()
cloneValue.
- Specified by:
cloneValuein classProperty- Returns:
- a
Objectobject.
-
getPropertyType
public PropertyType getPropertyType()
getPropertyType.
- Specified by:
getPropertyTypein classProperty- Returns:
- a
PropertyTypeobject.
-
-