Package net.anotheria.anodoc.data
Class IDHolder
- java.lang.Object
-
- net.anotheria.anodoc.data.DataHolder
-
- net.anotheria.anodoc.data.Document
-
- net.anotheria.anodoc.data.IDHolder
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,IBasicStoreableObject,ICompositeDataObject
public class IDHolder extends Document
Utility class to for unique document ids.- Version:
- $Id: $Id
- Author:
- lrosenberg
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATT_LAST_IDAttribute name of the last id storage.static java.lang.StringDOC_ID_HOLDER_PREPrefix for the document name.static java.lang.StringTYPE_IDENTIFIERConstant for type identifier.-
Fields inherited from class net.anotheria.anodoc.data.Document
PROP_AUTHOR, PROP_LAST_UPDATE, PROP_TYPE_IDENTIFIER
-
-
Constructor Summary
Constructors Constructor Description IDHolder(java.lang.String id)Creates a new idholder object with given id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadjustTill(int value)adjustTill.voidadjustTill(java.lang.String value)adjustTill.intgetNextIdInt()Returns the next id.java.lang.StringgetNextIdString()getNextIdString.intgetNextIdToGive()Returns the next id without increasing it.-
Methods inherited from class net.anotheria.anodoc.data.Document
addDataHolder, clone, copyFromBooleanList, copyFromDoubleList, copyFromFloatList, copyFromIntegerList, copyFromLongList, copyFromStringList, copyToBooleanList, copyToDoubleList, copyToFloatList, copyToIntegerList, copyToLongList, copyToStringList, createDocument, createDocumentList, createListProperty, getAuthor, getBoolean, getBooleanProperty, getDataHolder, getDocument, getDocumentAnyCase, getDocumentList, getDocumentListAnyCase, getDouble, getDoubleProperty, getEmptyBoolean, getEmptyDouble, getEmptyFloat, getEmptyInt, getEmptyList, getEmptyLong, getEmptyString, getFloat, getFloatProperty, getInt, getIntProperty, getKeys, getLastUpdateTimestamp, getList, getListProperty, getListPropertyAnyCase, getLong, getLongProperty, getObject, getProperties, getProperty, getPropertyValue, getSizeInBytes, getStorageId, getString, getStringProperty, getTypeIdentifier, putBooleanProperty, putDocument, putDoubleProperty, putFloatProperty, putIntProperty, putList, putListProperty, putLongProperty, putProperty, putStringProperty, removeDataHolder, removeDataHolder, removeProperty, removeProperty, renameTo, setBoolean, setCallContextAuthor, setDouble, setFloat, setInt, setLastUpdateNow, setList, setLong, setString, setTypeIdentifier, toString, toXMLNode
-
Methods inherited from class net.anotheria.anodoc.data.DataHolder
getId, hashCode, setId
-
-
-
-
Field Detail
-
DOC_ID_HOLDER_PRE
public static final java.lang.String DOC_ID_HOLDER_PRE
Prefix for the document name.- See Also:
- Constant Field Values
-
ATT_LAST_ID
public static final java.lang.String ATT_LAST_ID
Attribute name of the last id storage.- See Also:
- Constant Field Values
-
TYPE_IDENTIFIER
public static final java.lang.String TYPE_IDENTIFIER
Constant for type identifier.- See Also:
- Constant Field Values
-
-
Method Detail
-
getNextIdString
public java.lang.String getNextIdString()
getNextIdString.
- Returns:
- next id as string. The id is unique
-
getNextIdInt
public int getNextIdInt()
Returns the next id. Increased and saves the internal value.- Returns:
- a int.
-
getNextIdToGive
public int getNextIdToGive()
Returns the next id without increasing it.- Returns:
- a int.
-
adjustTill
public void adjustTill(int value)
adjustTill.
- Parameters:
value- a int.
-
adjustTill
public void adjustTill(java.lang.String value)
adjustTill.
- Parameters:
value- aStringobject.
-
-