xbn.array
Class APObject

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.array.ArrayProtector
              |
              +--xbn.array.APObject
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
APNamed, UniqueStringAP

public class APObject
extends ArrayProtector

An ArrayProtector for Objects.

Source code:  APObject.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
APObject(Object[] a_object)
          Create an APObject.
APObject(Object[] a_object, boolean b_shallowCloneAOO)
          Create an APObject.
 
Method Summary
 void addToVWObject(VWObject ac_object)
          Add the array-being-protected to the provided VWObject.
 void appendTSList(StringOrBuffer str_orBfr, String s_prefix, String s_divider, String s_postfix, String s_ifNull, String s_ifEmpty, String s_ifLmntNull)
          Get a new PASString representing the toStrings() of the internally-held array of Objects.
protected  Object clone()
          Get a full (deep) copy of this APObject as an Object.
 Object[] getAOOShallowClone()
          Get a copy of the object-array-being-wrapped, with references to the original object elements.
 APObject getAPOClone()
          Get a full (deep) copy of this APObject.
 int getLength()
          How many elements exist in the array-being-protected?
 Object getObject(int i_dx)
          Get the object at the requested array index.
 PASAOObject getPASAOObject()
          Get a new PASString representing the toStrings() of the internally-held array of Objects.
 String getString(int i_dx)
           
 boolean isNull()
          As a whole, is the array-being-protected null?
 boolean isNull(int i_dx)
          Is the object 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

APObject

public APObject(Object[] a_object)

Create an APObject.

Equal to APObject(a_object, false)


APObject

public APObject(Object[] a_object,
                boolean b_shallowCloneAOO)

Create an APObject.

Parameters:
a_object - The array of objects to protect.
b_shallowCloneAOO - Should a_object be (shallow-ly) cloned to start off--here in this constructor? This recreates a_object as a shallow clone of itself, to prevent external code from altering it.
Method Detail

isNull

public final boolean isNull()
Description copied from class: ArrayProtector

As a whole, is the array-being-protected null?

Overrides:
isNull in class ArrayProtector
Returns:
(a_object == null) Where a_object is exactly as provided to the constructor.

isNull

public final boolean isNull(int i_dx)

Is the object at the provided array index null?

Overrides:
isNull in class ArrayProtector
Returns:
(ao[i_dx] == null)

getLength

public final int getLength()
Description copied from class: ArrayProtector

How many elements exist in the array-being-protected?

Overrides:
getLength in class ArrayProtector
Returns:
a_object.length Where a_object is exactly as provided to the constructor.
Throws:
AssertException - If isNull is true.

getObject

public final Object getObject(int i_dx)

Get the object at the requested array index.

Returns:
a_object[i_dx] Where a_object is exactly as provided to the constructor.

getPASAOObject

public final PASAOObject getPASAOObject()

Get a new PASString representing the toStrings() of the internally-held array of Objects.

Returns:
(new PASAOObject([the internally-held array of Objects], true))

appendTSList

public final void appendTSList(StringOrBuffer str_orBfr,
                               String s_prefix,
                               String s_divider,
                               String s_postfix,
                               String s_ifNull,
                               String s_ifEmpty,
                               String s_ifLmntNull)

Get a new PASString representing the toStrings() of the internally-held array of Objects.

Equal to getPASAOObject().appendTSList(str_orBfr, s_prefix, s_divider, s_postfix, s_ifNull, s_ifEmpty, s_ifLmntNull);


addToVWObject

public final void addToVWObject(VWObject ac_object)

Add the array-being-protected to the provided VWObject.

If isNull equals true, nothing is done. If false, then ac_object.addArray([INTERNAL ARRAY]) is called.

Parameters:
ac_object - The VWObject to add to. May not be null.

getAOOShallowClone

public final Object[] getAOOShallowClone()

Get a copy of the object-array-being-wrapped, with references to the original object elements.

Returns:
(new UtilArray()).getAOOShallowClone(a_object) Where a_object 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.

toString

public String toString()
Description copied from class: ArrayProtector

Get some information about this ArrayProtector.

Overrides:
toString in class ArrayProtector

getString

public final String getString(int i_dx)
Overrides:
getString in class ArrayProtector

getAPOClone

public final APObject getAPOClone()

Get a full (deep) copy of this APObject.

Returns:
(APObject)clone()

clone

protected Object clone()
                throws CloneNotSupportedException

Get a full (deep) copy of this APObject as an Object.

Overrides:
clone in class Object



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo