|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.util.XBNLocked | +--xbn.array.UniqueString
Metadata for a unique string contained in an array. This object populates the "value" side of the AOSLookup's (internal) Hashtable. Also see AOSLCreator.
Source code: UniqueString.java
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
UniqueString(String s_tr,
int i_unqArrIdx)
Create a UniqueString. |
Method Summary | |
protected Object |
clone()
Get a full (deep) copy of this UniqueString as an Object. |
int |
getInstanceCount()
How many absolute instances (duplicates) of this unique string exist in the array? |
String |
getName()
What is the name of this object?. |
String |
getString()
Get the unique string. |
int |
getUnqArrIdx()
Get the unique array index of the string. |
UniqueString |
getUSClone()
Get a full (deep) copy of this UniqueString. |
void |
incInstanceCount()
Declare that another copy of this unique string was found in the array. |
boolean |
isLocked()
Is the value locked? |
boolean |
isMultiple()
Are there more than one instance of this unique string? |
boolean |
isSingular()
Is there exactly one instance of this unique string? |
void |
lock()
Lock the value, forbidding further sets. |
Methods inherited from class xbn.util.XBNLocked |
throwLX, throwLX, throwLXIfLocked, throwLXIfLocked, throwLXIfLocked, throwLXIfUnlocked |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UniqueString(String s_tr, int i_unqArrIdx)
Create a UniqueString.
s_tr
- The unique string. May not be null.i_unqArrIdx
- The unique array index of the s_tr. May not be less than zero.Method Detail |
public final String getString()
Get the unique string.
public final int getUnqArrIdx()
Get the unique array index of the string.
public final int getInstanceCount()
How many absolute instances (duplicates) of this unique string exist in the array?
[1 + the number of times incInstanceCount() was called]
public boolean isSingular()
Is there exactly one instance of this unique string?
(getInstanceCount() == 1)
public boolean isMultiple()
Are there more than one instance of this unique string?
!isSingular()
public final void incInstanceCount()
Declare that another copy of this unique string was found in the array.
After this class is created, but before this function is called, the instance count is set to one. The first call to this function sets the instance count to two.
LockedException
- If isLocked equals true.public final UniqueString getUSClone()
Get a full (deep) copy of this UniqueString.
protected final Object clone() throws CloneNotSupportedException
Get a full (deep) copy of this UniqueString as an Object.
clone
in class Object
public final String getName()
Named
What is the name of this object?. This identifier is used throughout the xbn.named package, particularly in NamedArray.
getName
in interface Named
public final void lock()
LockOneWay
Lock the value, forbidding further sets. There is no way to unlock the value, so consider this function a "one way ticket".
It is recommended to crash if the value is already locked (isLocked is true). You must crash in your class' "set" functions when isLocked is true.
lock
in interface LockOneWay
xbn.util.LockOneWay
AssertException
- If isLocked is true.public final boolean isLocked()
LockOneWay
Is the value locked?
isLocked
in interface LockOneWay
xbn.util.LockOneWay
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava