NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.address
Class NetObjectList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.AbstractSequentialList
                    |
                    +--java.util.LinkedList
                          |
                          +--gov.nist.core.GenericObjectList
                                |
                                +--gov.nist.javax.sip.address.NetObjectList
All Implemented Interfaces:
Cloneable, Collection, List, Serializable

public class NetObjectList
extends GenericObjectList

Root class for all the collection objects in this list: a wrapper class on the GenericObjectList class for lists of objects that can appear in NetObjects. IMPORTANT NOTE: NetObjectList cannot derive from NetObject as this will screw up the way in which we attach objects to headers.

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
This code is in the public domain.
See Also:
Serialized Form

Constructor Summary
NetObjectList()
          Construct an empty NetObjectList.
NetObjectList(String lname)
          Construct a NetObject List given a list name.
NetObjectList(String lname, Class cname)
          Construct a NetObject List given a list name and a class for the objects that go into the list.
NetObjectList(String lname, String cname)
          Construct a NetObject List given a list name and a class for the objects that go into the list.
 
Method Summary
 void add(NetObject obj)
          Add a new object to the list.
 Object clone()
          Make a clone of this header list and return it.
 void concatenate(NetObjectList net_obj_list)
          concatenate the two Lists
 String debugDump(int indent)
          Convert to a string given an indentation(for pretty printing).
 GenericObject first()
          returns the first element
 Class getMyClass()
          Get the class for all objects in my list.
 void mergeObjects(GenericObjectList mergeList)
          Do a merge of the GenericObjects contained in this list with the GenericObjects in the mergeList.
 GenericObject next()
          returns the next element
 GenericObject next(ListIterator li)
          returns the next element
 void replace(String objectText, GenericObject replacementObject, boolean matchSubstring)
          Do a recursive find and replace of objects.
 void replace(String objectText, GenericObjectList replacementObject, boolean matchSubstring)
          Do a recursive find and replace of objects in this list.
 void setMyClass(Class cl)
          set the class
 String toString()
          Encode this to a string.
 
Methods inherited from class gov.nist.core.GenericObjectList
add, addFirst, debugDump, encode, equals, getIterator, isMySubclass, match, replace, replace, setSeparator
 
Methods inherited from class java.util.LinkedList
add, addAll, addAll, addLast, clear, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
hashCode, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

NetObjectList

public NetObjectList(String lname)
Construct a NetObject List given a list name.

Parameters:
lname - String to set

NetObjectList

public NetObjectList(String lname,
                     Class cname)
Construct a NetObject List given a list name and a class for the objects that go into the list.

Parameters:
lname - String to set
cname - Class to set

NetObjectList

public NetObjectList(String lname,
                     String cname)
Construct a NetObject List given a list name and a class for the objects that go into the list.

Parameters:
lname - String to set
cname - String to set

NetObjectList

public NetObjectList()
Construct an empty NetObjectList.

Method Detail

add

public void add(NetObject obj)
Add a new object to the list.

Parameters:
obj - NetObject to set

concatenate

public void concatenate(NetObjectList net_obj_list)
concatenate the two Lists

Parameters:
net_obj_list - NetObjectList to set

clone

public Object clone()
Make a clone of this header list and return it. For any object in the list (like SIPHeaders) that inherits from GenericObject or GenericObjectList, clone the object and add it to the returned List. For objects that do not, this just copies the reference over. WARNING.. NO CIRCULAR REFERENCES that are accessible are tolerated (will throw this method into an infinite loop). However, we dont (shouldnt) have such worries because the parser generates tree sturctures.

Overrides:
clone in class GenericObjectList
Returns:
Object
Since:
1.0

mergeObjects

public void mergeObjects(GenericObjectList mergeList)
Do a merge of the GenericObjects contained in this list with the GenericObjects in the mergeList. Note that this does an inplace modification of the given list. This does an object by object merge of the given objects.

Overrides:
mergeObjects in class GenericObjectList
Parameters:
mergeList - is the list of Generic objects that we want to do an object by object merge with. Note that no new objects are added to this list.

first

public GenericObject first()
returns the first element

Overrides:
first in class GenericObjectList
Returns:
GenericObject

getMyClass

public Class getMyClass()
Get the class for all objects in my list.

Overrides:
getMyClass in class GenericObjectList
Returns:
Class

next

public GenericObject next()
returns the next element

Overrides:
next in class GenericObjectList
Returns:
GenericObject

next

public GenericObject next(ListIterator li)
returns the next element

Overrides:
next in class GenericObjectList
Parameters:
li - ListIterator to set
Returns:
GenericObject

replace

public void replace(String objectText,
                    GenericObject replacementObject,
                    boolean matchSubstring)
             throws IllegalArgumentException
Do a recursive find and replace of objects.

Overrides:
replace in class GenericObjectList
Parameters:
objectText - text of the object to find.
replacementObject - object to replace the target with ( in case a target is found).
matchSubstring - boolean that indicates whether to flag a match when objectText is a substring of a candidate object's encoded text.
Throws:
IllegalArgumentException - on null args and if replacementObject does not derive from GenericObject or GenericObjectList

replace

public void replace(String objectText,
                    GenericObjectList replacementObject,
                    boolean matchSubstring)
             throws IllegalArgumentException
Do a recursive find and replace of objects in this list.

Overrides:
replace in class GenericObjectList
Parameters:
objectText - text of the object to find.
replacementObject - object to replace the target with (in case a target is found).
matchSubstring - boolean that indicates whether to flag a match when objectText is a substring of a candidate object's encoded text.
Throws:
IllegalArgumentException - on null args and if replacementObject does not derive from GenericObject or GenericObjectList
Since:
v1.0

setMyClass

public void setMyClass(Class cl)
set the class

Overrides:
setMyClass in class GenericObjectList
Parameters:
cl - Class to set

debugDump

public String debugDump(int indent)
Convert to a string given an indentation(for pretty printing).

Overrides:
debugDump in class GenericObjectList
Parameters:
indent - int to set
Returns:
String

toString

public String toString()
Encode this to a string.

Overrides:
toString in class GenericObjectList
Returns:
a string representation for this object.

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.