|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.core.GenericObject | +--gov.nist.javax.sip.header.SIPObject | +--gov.nist.javax.sip.header.SIPHeader | +--gov.nist.javax.sip.header.SIPHeaderList
This is the root class for all lists of SIP headers. It imbeds a SIPObjectList object and extends SIPHeader Lists of ContactSIPObjects etc. derive from this class. This supports homogeneous lists (all elements in the list are of the same class). We use this for building type homogeneous lists of SIPObjects that appear in SIPHeaders
Field Summary |
Fields inherited from interface gov.nist.javax.sip.header.SIPHeaderNames |
ACCEPT, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALERT_INFO, ALLOW, ALLOW_EVENTS, AUTHENTICATION_INFO, AUTHORIZATION, CALL_ID, CALL_INFO, CONTACT, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_TYPE, CSEQ, DATE, ERROR_INFO, EVENT, EXPIRES, FROM, IN_REPLY_TO, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE |
Constructor Summary | |
SIPHeaderList(Class objclass,
String hname)
Constructor |
|
SIPHeaderList(SIPObjectList hl,
String hname)
Constructor |
|
SIPHeaderList(String hName)
Constructor |
|
SIPHeaderList(String classname,
String hname)
Constructor |
Method Summary | |
void |
add(int position,
Object headerToAdd)
Add an element at a specified position. |
void |
add(int index,
SIPHeader sipHeader)
insert at a location. |
boolean |
add(Object objectToAdd)
Concatenate the list of stuff that we are keeping around and also the text corresponding to these structures (that we parsed). |
void |
add(SIPHeader sipheader,
boolean top)
Add to this list. |
boolean |
addAll(Collection collection)
Add a collection of headers. |
boolean |
addAll(int index,
Collection collection)
Add all the elements of this collection. |
void |
addFirst(Object obj)
Concatenate the list of stuff that we are keeping around and also the text corresponding to these structures (that we parsed). |
void |
clear()
|
Object |
clone()
make a clone of this header list. |
void |
concatenate(SIPHeaderList other)
Concatenate two compatible lists. |
void |
concatenate(SIPHeaderList other,
boolean top)
Concatenate two compatible lists. |
boolean |
contains(Object header)
|
boolean |
containsAll(Collection collection)
Check if the list contains all the headers in this collection. |
String |
debugDump()
convert to a string representation |
String |
debugDump(int indentation)
convert to a string representation (for printing). |
String |
encode()
Encode a list of sip headers. |
boolean |
equals(Object other)
Equality comparison operator. |
SIPObject |
first()
Initialize the iterator for a loop |
Object |
get(int index)
Get the object at the specified location. |
SIPHeader |
getFirst()
Get the first element of this list. |
SIPObjectList |
getHeaderList()
Get the imbedded linked list. |
LinkedList |
getHeadersAsEncodedStrings()
Return a list of encoded strings (one for each sipheader). |
SIPHeader |
getLast()
Get the last element of this list. |
Class |
getMyClass()
Get the class for the headers of this list. |
int |
indexOf(GenericObject gobj)
index of an element. |
int |
indexOf(Object obj)
Return the index of a given object. |
boolean |
isEmpty()
Empty check |
boolean |
isHeaderList()
Return true if this is a header list (overrides the base class method which returns false). |
Iterator |
iterator()
Return the iterator to the imbedded list. |
int |
lastIndexOf(Object obj)
Get the last index of the given object. |
ListIterator |
listIterator()
Get an initialized iterator for my imbedded list |
ListIterator |
listIterator(int position)
Get the list iterator for a given position. |
boolean |
match(Object template)
Template match against a template. |
void |
merge(Object mergeObject)
Merge this with a given template. |
SIPObject |
next()
Get the next element in the list . |
SIPObject |
next(ListIterator iterator)
Get the next item for an iterative scan of the list |
Object |
remove(int index)
Remove the object at a given index. |
boolean |
remove(Object obj)
Remove the given object. |
boolean |
remove(SIPHeader obj)
Remove a sip header from this list of sip headers. |
void |
removeAll(Class cl)
Remove all occurances of a given class of SIPObject from the SIP object list. |
boolean |
removeAll(Collection collection)
Remove all the elements. |
void |
removeFirst()
Remove the first element of this list. |
void |
removeLast()
Remove the last element of this list. |
boolean |
retainAll(Collection collection)
|
Object |
set(int index,
Object obj)
|
int |
size()
Get the number of headers in the list. |
List |
subList(int index1,
int index2)
|
Object[] |
toArray()
Array conversion. |
Object[] |
toArray(Object[] obj)
|
String |
toString()
Encode this to a string representation. |
Methods inherited from class gov.nist.javax.sip.header.SIPHeader |
getHeaderName, getHeaderValue, getName, getValue, setHeaderName |
Methods inherited from class gov.nist.javax.sip.header.SIPObject |
dbgPrint, replace, replace, replace, replace |
Methods inherited from class gov.nist.core.GenericObject |
getClassFromName, getMatcher, isMySubclass, setMatcher |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
hashCode |
Constructor Detail |
public SIPHeaderList(SIPObjectList hl, String hname)
hl
- SIPObjectList to sethname
- String to setpublic SIPHeaderList(String hName)
hName
- String to setpublic SIPHeaderList(Class objclass, String hname)
objclass
- Class to sethname
- String to setpublic SIPHeaderList(String classname, String hname)
classname
- String to sethname
- String to setMethod Detail |
public boolean add(Object objectToAdd)
add
in interface List
public void addFirst(Object obj)
obj
- Genericobject to setpublic void add(SIPHeader sipheader, boolean top)
top
- is true if we want to add to the top of the list.public void concatenate(SIPHeaderList other, boolean top) throws IllegalArgumentException
other
- SIPHeaderList to settop
- boolean to set
IllegalArgumentException
- if the two lists are not compatiblepublic void concatenate(SIPHeaderList other) throws IllegalArgumentException
other
- SIPHeaderList
IllegalArgumentException
- if the two lists are not compatiblepublic String encode()
encode
in class SIPHeader
public LinkedList getHeadersAsEncodedStrings()
public SIPObject first()
public SIPHeader getFirst()
public SIPHeader getLast()
public Class getMyClass()
public boolean isEmpty()
isEmpty
in interface List
public ListIterator listIterator()
listIterator
in interface List
public SIPObjectList getHeaderList()
public ListIterator listIterator(int position)
listIterator
in interface List
position
- position for the list iterator to return
public SIPObject next()
public SIPObject next(ListIterator iterator)
iterator
- ListIterator
public void removeAll(Class cl)
cl
- Class to setpublic void removeFirst()
public void removeLast()
public boolean remove(SIPHeader obj)
obj
- SIPHeader to set
public String debugDump(int indentation)
debugDump
in class SIPObject
indentation
- int to set
public String debugDump()
debugDump
in class SIPObject
public Object[] toArray()
toArray
in interface List
public int indexOf(GenericObject gobj)
public void add(int index, SIPHeader sipHeader) throws IndexOutOfBoundsException
index
- location where to add the sipHeader.sipHeader
- SIPHeader structure to add.
IndexOutOfBoundsException
public boolean equals(Object other)
equals
in interface List
equals
in class SIPObject
other
- the other object to compare with. true is returned
iff the classes match and list of headers herein is equal to
the list of headers in the target (order of the headers is
not important).
true
if obj
is an instance of this class
representing the same SIP Header as this, false
otherwise.public boolean match(Object template)
match
in class SIPObject
template
- the match pattern to test against. The match object
has to be of the same type (class). Primitive types
and non-sip fields that are non null are matched for equality.
Null in any field matches anything. Some book-keeping fields
are ignored when making the comparison.public void merge(Object mergeObject)
merge
in class SIPObject
mergeObject
- the template to merge with.public Object clone()
clone
in interface Header
clone
in class SIPObject
public int size()
size
in interface List
public boolean isHeaderList()
isHeaderList
in class SIPHeader
public String toString()
toString
in interface Header
toString
in class SIPObject
public void add(int position, Object headerToAdd)
add
in interface List
headerToAdd
- -- the header to add.public boolean addAll(Collection collection)
addAll
in interface List
collection
- -- a collection containing the headers to add.public boolean addAll(int index, Collection collection)
addAll
in interface List
public void clear()
clear
in interface List
public boolean contains(Object header)
contains
in interface List
public boolean containsAll(Collection collection)
containsAll
in interface List
collection
- -- the collection of headers to test against.public Object get(int index)
get
in interface List
index
- -- location from which to get the object.public int indexOf(Object obj)
indexOf
in interface List
obj
- -- object whose index to compute.public Iterator iterator()
iterator
in interface List
public int lastIndexOf(Object obj)
lastIndexOf
in interface List
obj
- -- object whose index to find.public boolean remove(Object obj)
remove
in interface List
obj
- -- object to remove.public Object remove(int index)
remove
in interface List
index
- -- index at which to remove the objectpublic boolean removeAll(Collection collection)
removeAll
in interface List
public boolean retainAll(Collection collection)
retainAll
in interface List
public Object set(int index, Object obj)
set
in interface List
public List subList(int index1, int index2)
subList
in interface List
public Object[] toArray(Object[] obj)
toArray
in interface List
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |