|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.array.ArrayProtector | +--xbn.array.APString
An ArrayProtector for an array of strings.
Source code: APString.java
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
APString(String[] a_string)
Create an APString. |
|
APString(String[] a_string,
boolean b_shallowCloneAOS)
Create an APString. |
Method Summary | |
void |
addToVWString(VWString ac_string)
Add the string-array-being-protected to the provided VWString. |
protected Object |
clone()
Get a full (deep) copy of this APString as an Object. |
String[] |
getAOSShallowClone()
Get a copy of the string-array-being-wrapped, with references to the original string elements. |
APString |
getAPSClone()
Get a full (deep) copy of this APString. |
int |
getLength()
How many elements exist in the array-being-protected? |
PASString |
getPASString()
Get a new PASString wrapping around the string-array-being-protected. |
PASString |
getPASString(PARString par_string)
Get a new PASString wrapping around the string-array-being-protected. |
String |
getString(int i_dx)
Get the string at the requested array index. |
boolean |
isNull()
As a whole, is the array-being-protected null? |
boolean |
isNull(int i_dx)
Is the string at the provided array index null? |
String |
toString()
Get some information about this ArrayProtector. |
Methods inherited from class xbn.array.ArrayProtector |
getList, getList, getList, getList, getPASArrayProtector |
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, wait, wait, wait |
Constructor Detail |
public APString(String[] a_string)
Create an APString.
Equal to APString(a_string, false)
public APString(String[] a_string, boolean b_shallowCloneAOS)
Create an APString.
a_string
- The array of strings to protect.b_shallowCloneAOS
- Should a_string be (shallow-ly) cloned to start off--here in this constructor? This recreates a_string as a shallow clone of itself, to prevent external code from altering it.Method Detail |
public final boolean isNull()
ArrayProtector
As a whole, is the array-being-protected null?
isNull
in class ArrayProtector
(a_string == null)
Where a_string is exactly as provided to the constructor.public final boolean isNull(int i_dx)
Is the string at the provided array index null?
isNull
in class ArrayProtector
(as[i_dx] == null)
public final int getLength()
ArrayProtector
How many elements exist in the array-being-protected?
getLength
in class ArrayProtector
a_string.length
Where a_string is exactly as provided to the constructor.AssertException
- If isNull is true.public final String getString(int i_dx)
Get the string at the requested array index.
getString
in class ArrayProtector
i_dx
- The array index. Must range 0..[getLength() - 1]
, inclusive.a_string[i_dx]
Where a_string is exactly as provided to the constructor.AssertException
- If isNull is true.public final void addToVWString(VWString ac_string)
Add the string-array-being-protected to the provided VWString.
If isNull equals true, nothing is done. If false, then ac_string.addArray([INTERNAL STRING ARRAY])
is called.
ac_string
- The VWString to add to. May not be null.public final String[] getAOSShallowClone()
Get a copy of the string-array-being-wrapped, with references to the original string elements.
(new UtilArray()).getAOOShallowClone(a_string)
Where a_string is exactly as provided to the constructor. Note that this function only creates the clone once. Once created, the copy is then internally stored, and returned for all subsequent calls.public final PASString getPASString()
Get a new PASString wrapping around the string-array-being-protected.
getPASString(new PARString())
public final PASString getPASString(PARString par_string)
Get a new PASString wrapping around the string-array-being-protected.
(new PASString(getAOSShallowClone(), par_string, true))
public String toString()
ArrayProtector
Get some information about this ArrayProtector.
toString
in class ArrayProtector
public final APString getAPSClone()
Get a full (deep) copy of this APString.
(APString)clone()
protected final Object clone() throws CloneNotSupportedException
Get a full (deep) copy of this APString as an Object.
I know this uses a "shallow" clone of the string array. Does it matter? Is it no different than manually creating new string copies?
clone
in class Object
(new APString(getAOSShallowClone()))
|
|||||||||
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