1 /* 2 * Conditions Of Use 3 * 4 * This software was developed by employees of the National Institute of 5 * Standards and Technology (NIST), an agency of the Federal Government. 6 * Pursuant to title 15 Untied States Code Section 105, works of NIST 7 * employees are not subject to copyright protection in the United States 8 * and are considered to be in the public domain. As a result, a formal 9 * license is not needed to use the software. 10 * 11 * This software is provided by NIST as a service and is expressly 12 * provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED 13 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF 14 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT 15 * AND DATA ACCURACY. NIST does not warrant or make any representations 16 * regarding the use of the software or the results thereof, including but 17 * not limited to the correctness, accuracy, reliability or usefulness of 18 * the software. 19 * 20 * Permission to use this software is contingent upon your acceptance 21 * of the terms of this agreement 22 * 23 * . 24 * 25 */ 26 /******************************************************************************* 27 * Product of NIST/ITL Advanced Networking Technologies Division (ANTD). * 28 *******************************************************************************/ 29 package gov.nist.javax.sip.address; 30 import gov.nist.core.*; 31 import java.util.ListIterator; 32 import java.util.LinkedList; 33 import java.util.Iterator; 34 import java.lang.reflect.*; 35 36 /** 37 * Root class for all the collection objects in this list: 38 * a wrapper class on the GenericObjectList class for lists of objects 39 * that can appear in NetObjects. 40 * IMPORTANT NOTE: NetObjectList cannot derive from NetObject as this 41 * will screw up the way in which we attach objects to headers. 42 * 43 *@version 1.2 $Revision: 1.8 $ $Date: 2009/07/17 18:57:22 $ 44 * 45 *@author M. Ranganathan <br/> 46 * 47 * 48 * 49 */ 50 public class NetObjectList extends GenericObjectList { 51 52 53 /** 54 * 55 */ 56 private static final long serialVersionUID = -1551780600806959023L; 57 58 /** 59 * Construct a NetObject List given a list name. 60 * @param lname String to set 61 */ NetObjectList(String lname)62 public NetObjectList(String lname) { 63 super(lname); 64 } 65 66 /** 67 * Construct a NetObject List given a list name and a class for 68 * the objects that go into the list. 69 * @param lname String to set 70 * @param cname Class to set 71 */ NetObjectList(String lname, Class<?> cname)72 public NetObjectList(String lname, Class<?> cname) { 73 super(lname, cname); 74 } 75 76 77 78 /** 79 * Construct an empty NetObjectList. 80 */ NetObjectList()81 public NetObjectList() { 82 super(); 83 } 84 85 /** 86 * Add a new object to the list. 87 * @param obj NetObject to set 88 */ add(NetObject obj)89 public void add(NetObject obj) { 90 super.add(obj); 91 } 92 93 /** concatenate the two Lists 94 * @param net_obj_list NetObjectList to set 95 */ concatenate(NetObjectList net_obj_list)96 public void concatenate(NetObjectList net_obj_list) { 97 super.concatenate(net_obj_list); 98 } 99 100 101 102 /** returns the first element 103 * @return GenericObject 104 */ first()105 public GenericObject first() { 106 return (NetObject) super.first(); 107 } 108 109 110 111 /** returns the next element 112 * @return GenericObject 113 */ next()114 public GenericObject next() { 115 return (NetObject) super.next(); 116 } 117 118 /** returns the next element 119 * @param li ListIterator to set 120 * @return GenericObject 121 */ next(ListIterator li)122 public GenericObject next(ListIterator li) { 123 return (NetObject) super.next(li); 124 } 125 126 127 128 /** set the class 129 * @param cl Class to set 130 */ setMyClass(Class cl)131 public void setMyClass(Class cl) { 132 super.setMyClass(cl); 133 } 134 135 /** 136 * Convert to a string given an indentation(for pretty printing). 137 * @param indent int to set 138 * @return String 139 */ debugDump(int indent)140 public String debugDump(int indent) { 141 return super.debugDump(indent); 142 } 143 144 /** 145 * Encode this to a string. 146 * 147 *@return a string representation for this object. 148 */ toString()149 public String toString() { 150 return this.encode(); 151 } 152 } 153