|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.named.NamedArray
Manage an array of any object implementing the Named interface. Using a AOSLookup, this class provides quick access to the array, with error protection.
Source code: NamedArray.java.
This object holds both the array of Named objects, as well as the AOSLookup. NamedArray also implements Named, therefore having a name itself. Because of this, you could have a NamedArray of NamedArrays. Pretty cool, eh? :' )
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
NamedArray(Named[] a_named)
Create a NamedArray. |
|
NamedArray(Named[] a_named,
boolean b_listNames)
Create a NamedArray. |
|
NamedArray(NamedArray named_array)
Create an as-deep-as-possible copy of the provided NamedArray. |
|
NamedArray(String s_name,
APNamed ap_named,
AOSLookup aos_lookup,
boolean b_validate)
Create a NamedArray manually. |
|
NamedArray(String s_name,
Named[] a_named)
Create a NamedArray. |
|
NamedArray(String s_name,
Named[] a_named,
AOSLookup aos_lookup)
|
|
NamedArray(String s_name,
Named[] a_named,
AOSLookup aos_lookup,
boolean b_validate)
Create a NamedArray manually. |
|
NamedArray(String s_name,
Named[] a_named,
boolean b_listNames)
Create a NamedArray. |
Method Summary | |
boolean |
doesExist(String s_name)
Does the provided name represent an actually-existing Named object? |
AOSLHashtable |
getAOSLHashtable()
Return the AOSLHashtable for direct manipulation. |
AOSLookup |
getAOSLookup()
Return the AOSLookup for direct manipulation. |
APNamed |
getAPNamed()
Get the APNamed for direct manipulation. |
int |
getArrIdx(String s_name)
Get the Named object at the requested array index. |
int |
getLength()
How many Named objects exist in this NamedArray? |
String |
getName()
What is the name of this object?. |
String |
getName(int i_dx)
Get the name of the Named object at the requested array index. |
Named |
getNamed(int i_dx)
Get the Named object at the requested array index. |
Named |
getNamed(String s_name)
Get the Named object at the requested array index. |
String |
getNameList()
Get a listing of every name. |
String |
getNameList(String s_divider)
Get a listing of every name. |
String |
getNameList(String s_prefix,
String s_postfix)
Get a listing of every name. |
String |
getNameList(String s_prefix,
String s_divider,
String s_postfix)
Get a listing of every name. |
protected void |
throwAXWithName(String s_callingFunc,
String s_errorMsg)
Throw an exception with getName() as part of the message. |
String |
toString()
Get some information about this NamedArray. |
String |
toString(boolean b_subTS)
Get some information about this NVArray object, and optionally about the Atomic levels herein. |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NamedArray(Named[] a_named)
Create a NamedArray.
Equal to NamedArray(a_named, true)
public NamedArray(Named[] a_named, boolean b_listNames)
Create a NamedArray.
Equal to NamedArray(null, a_named, true)
public NamedArray(String s_name, Named[] a_named)
Create a NamedArray.
Equal to NamedArray(s_name, a_named, true)
public NamedArray(String s_name, Named[] a_named, boolean b_listNames)
Create a NamedArray.
s_name
- The name of this NamedArray. See getName.a_named
- The array of Named objects. Must be non-null, at least one element in length, no elements may be null, and every element's name must be unique. Note that the array is cloned, but all Named elements are unaltered (in other words, the Named elements are not altered, but the array they are contained in, is). See UtilNamed.getShallowClone.b_listNames
- Passed directly to the UtilArray.getAOSLFromPA, which creates the internal AOSLookup for this class.public NamedArray(String s_name, Named[] a_named, AOSLookup aos_lookup)
public NamedArray(String s_name, Named[] a_named, AOSLookup aos_lookup, boolean b_validate)
Create a NamedArray manually.
public NamedArray(String s_name, APNamed ap_named, AOSLookup aos_lookup, boolean b_validate)
Create a NamedArray manually.
s_name
- The name of this NamedArray.a_named
- The array of Named objects. Must be non-null, and the names of these Named objects must map one-to-one with those existing in aos_lookup.aos_lookup
- The AOSLookup for a_named. Must be non-null, and the names contained in it must map one-to-one with those existing in a_named. This is only enforced when b_validate is true.b_validate
- If true, then verify that aos_lookup and a_named are legal for a NamedArray. If false, then you're on your own, as far as this object behaving as documented. If you are absolutely certain that things are okay, it will give you somewhat of a speed increase to make this false.public NamedArray(NamedArray named_array)
Create an as-deep-as-possible copy of the provided NamedArray. Everything down-to-but-not-including the Named objects are deeply cloned.
If you need a deep copy, you must manually do the copying yourself, and use the manual constructor. Since Named is just an interface, it is not possible to clone it here.
named_array
- The NamedArray to copy. May not be null.Method Detail |
public final AOSLookup getAOSLookup()
Return the AOSLookup for direct manipulation.
public final AOSLHashtable getAOSLHashtable()
Return the AOSLHashtable for direct manipulation.
public final APNamed getAPNamed()
Get the APNamed for direct manipulation.
public final String getNameList()
Get a listing of every name.
(new ListPA()).get(getAPNamed().getPASNamed())
public final String getNameList(String s_divider)
Get a listing of every name.
(new ListPA(s_divider)).get(getAPNamed().getPASNamed())
public final String getNameList(String s_prefix, String s_postfix)
Get a listing of every name.
(new ListPA(s_prefix, s_postfix)).get(getAPNamed().getPASNamed())
public final String getNameList(String s_prefix, String s_divider, String s_postfix)
Get a listing of every name.
(new ListPA(s_prefix, s_divider, s_postfix)).get(getAPNamed().getPASNamed())
public final int getLength()
How many Named objects exist in this NamedArray?
getAPNamed().getLength()
public final boolean doesExist(String s_name)
Does the provided name represent an actually-existing Named object?
getAOSLHashtable().containsKey(s_name)
public final int getArrIdx(String s_name)
Get the Named object at the requested array index.
i_dx
- Must be between 0 and (getCount - 1), inclusive.public final Named getNamed(String s_name)
Get the Named object at the requested array index.
i_dx
- Must be between 0 and (getCount - 1), inclusive.public final Named getNamed(int i_dx)
Get the Named object at the requested array index.
i_dx
- Must be between 0 and (getCount - 1), inclusive.public String getName(int i_dx)
Get the name of the Named object at the requested array index.
i_dx
- Must be valid.public 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 String toString()
Get some information about this NamedArray.
toString
in class Object
toString(true)
protected void throwAXWithName(String s_callingFunc, String s_errorMsg)
Throw an exception with getName() as part of the message.
Equal to throwAX(s_callingFunc +
[UtilString].getConditional(" [getName()=", getName(), "]") +
": " + s_errorMsg)
public String toString(boolean b_subTS)
Get some information about this NVArray object, and optionally about the Atomic levels herein.
b_subTS
- If true, then display all toStrings for the sub-Named objects. If false, then display the names of all internal Named objects.
|
|||||||||
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