|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractValue
stella.parameter.IntegerId
public class IntegerId
An ID describable as an integer. Preserves its state. Has the capability
to be increased and returned by a single command getNextId().
Used as an counter for TPL command.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static int |
DEFMAXID
Maximum value, defaults to Integer.MAX_VALUE |
private static int |
DEFSTARTID
Start value, defaults to 1. |
private int |
id
The current value. |
static String |
KEY_MAXID
Maximum value, defaults to Integer.MAX_VALUE |
static String |
KEY_STARTID
Start value, defaults to 1. |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
IntegerId()
Defaults all. |
|
IntegerId(Map<String,String> prop)
Constructs a new IntegerId. |
|
| Method Summary | |
|---|---|
int |
getNextId()
Returns the next id readily as an integer. |
Number |
getValue()
Gets the current unique name identifier. |
void |
init()
We scout for a file that hold the last unique value. |
boolean |
preserve()
On exit, we save our current state if the serialize property is set. |
boolean |
restore()
We restore our old value by reading the last date and target count from a serialization file. |
Number |
setValue(Number val)
Setting the unique number is only allowed vai a call to next, therefore this method throws an UnsupportedOperationException. |
| Methods inherited from class stella.parameter.AbstractValue |
|---|
get, set |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, rescanned, setName, toString |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Parameter |
|---|
get, getFormatted, getName, getString, set |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.ExitCleaning |
|---|
exit |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_STARTID
public static final String KEY_MAXID
private static final int DEFSTARTID
private static final int DEFMAXID
private int id
| Constructor Detail |
|---|
public IntegerId()
public IntegerId(Map<String,String> prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class AbstractParameterpublic boolean restore()
restore in interface Preservingpublic boolean preserve()
preserve in interface Preservingpublic Number getValue()
getValue in interface Value
public Number setValue(Number val)
throws UnsupportedOperationException
setValue in interface ValueUnsupportedOperationExceptionpublic int getNextId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||