/* XBN Java: Generically useful, non-GUI Java code. http://sourceforge.net/projects/xbnjava Copyright (C) 1997-2003, Jeff Epstein All rights reserved. Modifications: No Redistribution in binary form, with or without modifications, are permitted provided that the following conditions are met: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * If modifications are made to source code then this license should indicate that fact in the "Modifications" section above. * Neither the author, nor the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [NOTE: This license contains NO advertising clause.] */ package xbn.placeholder; import xbn.XBNObject; import xbn.AssertException; /**

Functions to cast an Object to an xbn.placeholder object.

Source code:  UtilPHFromObj.java

It is required that the provided object be both non-null, and of the expected type an AssertException is thrown..

@version 0.9b @author Jeff Epstein, http://sourceforge.net/projects/xbnjava. **/ public class UtilPHFromObj extends XBNObject { private static final String sBRK_IS_NULL = "] is null."; /**

Create a UtilPHFromObj. This constructor does nothing.

**/ public UtilPHFromObj() { } /**

Cast the provided Object to an i_i.

@param o_ii The i_i, in the form of an Object. May not be null, and must be an i_i. @exception NullPointerException If o_ii is null. @exception ClassCastException If o_ii is not a valid i_i. **/ public final i_i geti_i(Object o_ii) { if(o_ii == null) { throwAX("ERROR IN geti_i: o_ii is null."); } return (i_i)o_ii; } /**

Cast the provided Object to an i_i_i.

@param o_iii The i_i_i, in the form of an Object. May not be null, and must be an i_i_i. @exception NullPointerException If o_iii is null. @exception ClassCastException If o_iii is not a valid i_i_i. **/ public final i_i_i geti_i_i(Object o_iii) { if(o_iii == null) { throwAX("ERROR IN geti_i_i: o_iii is null."); } return (i_i_i)o_iii; } /**

Cast the provided Object to an i_i_i_i.

@param o_iiii The i_i_i_i, in the form of an Object. May not be null, and must be an i_i_i_i. @exception NullPointerException If o_iiii is null. @exception ClassCastException If o_iiii is not a valid i_i_i_i. **/ public final i_i_i_i geti_i_i_i(Object o_iiii) { if(o_iiii == null) { throwAX("ERROR IN geti_i_i_i: o_iiii is null."); } return (i_i_i_i)o_iiii; } /**

Cast the provided Object to an s_s.

@param o_ss The s_s, in the form of an Object. May not be null, and must be an s_s. @exception NullPointerException If o_ss is null. @exception ClassCastException If o_ss is not a valid s_s. **/ public final s_s gets_s(Object o_ss) { if(o_ss == null) { throwAX("ERROR IN gets_s: o_ss is null."); } return (s_s)o_ss; } /**

Cast the provided Object to an sb_sb_c.

@param o_sbsbc The sb_sb_c, in the form of an Object. May not be null, and must be an sb_sb_c. @exception NullPointerException If o_sbsbc is null. @exception ClassCastException If o_sbsbc is not a valid sb_sb_c. **/ public final sb_sb_c getsb_sb_c(Object o_sbsbc) { if(o_sbsbc == null) { throwAX("ERROR IN getsb_sb_c: o_sbsbc is null."); } return (sb_sb_c)o_sbsbc; } /**

Cast the provided Object array to an array of i_i-s.

@param ao_ii The i_i array, in the form of an Object array. May not be null or zero elements in length. Each object must be non-null, and a valid i_i. @exception NullPointerException If ao_ii or any element within is null. @exception ClassCastException If any element within ao_ii is not a valid i_i. **/ public final i_i[] getAOi_i(Object[] ao_ii) { i_i[] aii = null; try { aii = new i_i[ao_ii.length]; } catch(NullPointerException npx) { throwAX("ERROR IN getAOi_i: ao_ii is null."); } for(int i = 0; i < ao_ii.length; i++) { try { aii[i] = geti_i(ao_ii[i]); } catch(AssertException ax) { throwAX("ERROR IN getAOi_i: ao_ii[" + i + sBRK_IS_NULL); } } return aii; } /**

Cast the provided Object array to an array of i_i_i-s.

@param ao_iii The i_i_i array, in the form of an Object array. May not be null or zero elements in length. Each object must be non-null, and a valid i_i_i. @exception NullPointerException If ao_iii or any element within is null. @exception ClassCastException If any element within ao_iii is not a valid i_i_i. **/ public final i_i_i[] getAOi_i_i(Object[] ao_iii) { i_i_i[] aiii = null; try { aiii = new i_i_i[ao_iii.length]; } catch(NullPointerException npx) { throwAX("ERROR IN getAOi_i_i: ao_iii is null."); } for(int i = 0; i < ao_iii.length; i++) { try { aiii[i] = geti_i_i(ao_iii[i]); } catch(AssertException ax) { throwAX("ERROR IN getAOi_i_i: ao_iii[" + i + sBRK_IS_NULL); } } return aiii; } /**

Cast the provided Object array to an array of i_i_i_i-s.

@param ao_iiii The i_i_i_i array, in the form of an Object array. May not be null or zero elements in length. Each object must be non-null, and a valid i_i_i_i. @exception NullPointerException If ao_iiii or any element within is null. @exception ClassCastException If any element within ao_iiii is not a valid i_i_i_i. **/ public final i_i_i_i[] getAOi_i_i_i(Object[] ao_iiii) { i_i_i_i[] aiiii = null; try { aiiii = new i_i_i_i[ao_iiii.length]; } catch(NullPointerException npx) { throwAX("ERROR IN getAOi_i_i_i: ao_iiii is null."); } for(int i = 0; i < ao_iiii.length; i++) { try { aiiii[i] = geti_i_i_i(ao_iiii[i]); } catch(AssertException ax) { throwAX("ERROR IN getAOi_i_i_i: ao_iiii[" + i + sBRK_IS_NULL); } } return aiiii; } /**

Cast the provided Object array to an array of s_s-s.

@param ao_ss The s_s array, in the form of an Object array. May not be null or zero elements in length. Each object must be non-null, and a valid s_s. @exception NullPointerException If ao_ss or any element within is null. @exception ClassCastException If any element within ao_ss is not a valid s_s. **/ public final s_s[] getAOs_s(Object[] ao_ss) { s_s[] ass = null; try { ass = new s_s[ao_ss.length]; } catch(NullPointerException npx) { throwAX("ERROR IN getAOs_s: ao_ss is null."); } for(int i = 0; i < ao_ss.length; i++) { try { ass[i] = gets_s(ao_ss[i]); } catch(AssertException ax) { throwAX("ERROR IN getAOs_s: ao_ss[" + i + sBRK_IS_NULL); } } return ass; } /**

Cast the provided Object array to an array of sb_sb_c-s.

@param ao_sbsbc The sb_sb_c array, in the form of an Object array. May not be null or zero elements in length. Each object must be non-null, and a valid sb_sb_c. @exception NullPointerException If ao_sbsbc or any element within is null. @exception ClassCastException If any element within ao_sbsbc is not a valid sb_sb_c. **/ public final sb_sb_c[] getAOsb_sb_c(Object[] ao_sbsbc) { sb_sb_c[] asbsbc = null; try { asbsbc = new sb_sb_c[ao_sbsbc.length]; } catch(NullPointerException npx) { throwAX("ERROR IN getAOsb_sb_c: ao_sbsbc is null."); } for(int i = 0; i < ao_sbsbc.length; i++) { try { asbsbc[i] = getsb_sb_c(ao_sbsbc[i]); } catch(AssertException ax) { throwAX("ERROR IN getAOsb_sb_c: ao_sbsbc[" + i + sBRK_IS_NULL); } } return asbsbc; } }