|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nist.core.GenericObject
gov.nist.javax.sip.header.SIPObject
gov.nist.javax.sip.header.SIPHeader
gov.nist.javax.sip.header.SIPHeaderList<HDR>
public abstract class SIPHeaderList<HDR extends SIPHeader>
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, JOIN, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, MIN_SE, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REFERRED_BY, REPLACES, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SESSION_EXPIRES, SIP_ETAG, SIP_IF_MATCH, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE |
Method Summary | ||
---|---|---|
boolean |
add(HDR objectToAdd)
Concatenate the list of stuff that we are keeping around and also the text corresponding to these structures (that we parsed). |
|
void |
add(HDR sipheader,
boolean top)
Add to this list. |
|
void |
add(int index,
HDR sipHeader)
insert at a location. |
|
boolean |
addAll(Collection<? extends HDR> collection)
|
|
boolean |
addAll(int index,
Collection<? extends HDR> collection)
|
|
void |
addFirst(HDR 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<HDR> other,
boolean topFlag)
Concatenate two compatible lists. |
|
boolean |
contains(Object header)
|
|
boolean |
containsAll(Collection<?> 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. |
|
StringBuffer |
encode(StringBuffer buffer)
Encode the header into the given StringBuffer. |
|
boolean |
equals(Object other)
Equality comparison operator. |
|
HDR |
get(int index)
Get the object at the specified location. |
|
Header |
getFirst()
Get the first element of this list. |
|
List<HDR> |
getHeaderList()
Get the imbedded linked list. |
|
List<String> |
getHeadersAsEncodedStrings()
Return a list of encoded strings (one for each sipheader). |
|
Header |
getLast()
Get the last element of this list. |
|
Class<HDR> |
getMyClass()
Get the class for the headers of this list. |
|
String |
getName()
Alias for getHaderName above. |
|
int |
hashCode()
This is a pretty simple hashCode but satisfies requirements. |
|
int |
indexOf(gov.nist.core.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<HDR> |
iterator()
Return the iterator to the imbedded list. |
|
int |
lastIndexOf(Object obj)
Get the last index of the given object. |
|
ListIterator<HDR> |
listIterator()
Get an initialized iterator for my imbedded list |
|
ListIterator<HDR> |
listIterator(int position)
Get the list iterator for a given position. |
|
boolean |
match(SIPHeaderList<?> template)
Template match against a template. null field in template indicates wild card match. |
|
boolean |
remove(HDR obj)
Remove a sip header from this list of sip headers. |
|
HDR |
remove(int index)
Remove the object at a given index. |
|
boolean |
remove(Object obj)
Remove the given object. |
|
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)
|
|
HDR |
set(int position,
HDR sipHeader)
Set a SIPHeader at a particular position in the list. |
|
static void |
setPrettyEncode(boolean flag)
|
|
int |
size()
Get the number of headers in the list. |
|
List<HDR> |
subList(int index1,
int index2)
Get a sublist of the list. |
|
Object[] |
toArray()
Array conversion. |
|
|
toArray(T[] array)
|
Methods inherited from class gov.nist.javax.sip.header.SIPHeader |
---|
getHeaderName, getHeaderValue, getValue, setHeaderName, toString |
Methods inherited from class gov.nist.javax.sip.header.SIPObject |
---|
dbgPrint, match |
Methods inherited from class gov.nist.core.GenericObject |
---|
getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.sip.header.Header |
---|
toString |
Method Detail |
---|
public String getName()
SIPHeader
getName
in interface Header
getName
in class SIPHeader
public boolean add(HDR objectToAdd)
add
in interface Collection<HDR extends SIPHeader>
add
in interface List<HDR extends SIPHeader>
objectToAdd
- public void addFirst(HDR obj)
obj
- Genericobject to setpublic void add(HDR sipheader, boolean top)
sipheader
- SIPHeader to add.top
- is true if we want to add to the top of the list.public void concatenate(SIPHeaderList<HDR> other, boolean topFlag) throws IllegalArgumentException
other
- SIPHeaderList to settopFlag
- flag which indicates which end to concatenate
the lists.
IllegalArgumentException
- if the two lists are not compatiblepublic String encode()
encode
in class SIPHeader
public StringBuffer encode(StringBuffer buffer)
SIPObject
encode
in class SIPHeader
public List<String> getHeadersAsEncodedStrings()
public Header getFirst()
public Header getLast()
public Class<HDR> getMyClass()
public boolean isEmpty()
isEmpty
in interface Collection<HDR extends SIPHeader>
isEmpty
in interface List<HDR extends SIPHeader>
public ListIterator<HDR> listIterator()
listIterator
in interface List<HDR extends SIPHeader>
public List<HDR> getHeaderList()
public ListIterator<HDR> listIterator(int position)
listIterator
in interface List<HDR extends SIPHeader>
position
- position for the list iterator to return
public void removeFirst()
public void removeLast()
public boolean remove(HDR obj)
obj
- SIPHeader to remove
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 Collection<HDR extends SIPHeader>
toArray
in interface List<HDR extends SIPHeader>
public int indexOf(gov.nist.core.GenericObject gobj)
public void add(int index, HDR sipHeader) throws IndexOutOfBoundsException
add
in interface List<HDR extends SIPHeader>
index
- location where to add the sipHeader.sipHeader
- SIPHeader structure to add.
IndexOutOfBoundsException
public boolean equals(Object other)
equals
in interface Collection<HDR extends SIPHeader>
equals
in interface List<HDR extends SIPHeader>
equals
in interface Header
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).
public boolean match(SIPHeaderList<?> template)
public Object clone()
clone
in interface Header
clone
in class gov.nist.core.GenericObject
public int size()
size
in interface Collection<HDR extends SIPHeader>
size
in interface List<HDR extends SIPHeader>
public boolean isHeaderList()
isHeaderList
in class SIPHeader
public boolean addAll(Collection<? extends HDR> collection)
addAll
in interface Collection<HDR extends SIPHeader>
addAll
in interface List<HDR extends SIPHeader>
public boolean addAll(int index, Collection<? extends HDR> collection)
addAll
in interface List<HDR extends SIPHeader>
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<HDR extends SIPHeader>
containsAll
in interface List<HDR extends SIPHeader>
public void clear()
clear
in interface Collection<HDR extends SIPHeader>
clear
in interface List<HDR extends SIPHeader>
public boolean contains(Object header)
contains
in interface Collection<HDR extends SIPHeader>
contains
in interface List<HDR extends SIPHeader>
public HDR get(int index)
get
in interface List<HDR extends SIPHeader>
index
- --
location from which to get the object.public int indexOf(Object obj)
indexOf
in interface List<HDR extends SIPHeader>
obj
- --
object whose index to compute.public Iterator<HDR> iterator()
iterator
in interface Iterable<HDR extends SIPHeader>
iterator
in interface Collection<HDR extends SIPHeader>
iterator
in interface List<HDR extends SIPHeader>
public int lastIndexOf(Object obj)
lastIndexOf
in interface List<HDR extends SIPHeader>
obj
- --
object whose index to find.public boolean remove(Object obj)
remove
in interface Collection<HDR extends SIPHeader>
remove
in interface List<HDR extends SIPHeader>
obj
- --
object to remove.public HDR remove(int index)
remove
in interface List<HDR extends SIPHeader>
index
- --
index at which to remove the objectpublic boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<HDR extends SIPHeader>
removeAll
in interface List<HDR extends SIPHeader>
List.removeAll(java.util.Collection)
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<HDR extends SIPHeader>
retainAll
in interface List<HDR extends SIPHeader>
collection
- List.retainAll(java.util.Collection)
public List<HDR> subList(int index1, int index2)
subList
in interface List<HDR extends SIPHeader>
List.subList(int, int)
public int hashCode()
SIPHeader
hashCode
in interface Collection<HDR extends SIPHeader>
hashCode
in interface List<HDR extends SIPHeader>
hashCode
in interface Header
hashCode
in class SIPHeader
Object.hashCode()
public HDR set(int position, HDR sipHeader)
set
in interface List<HDR extends SIPHeader>
List.set(int, java.lang.Object)
public static void setPrettyEncode(boolean flag)
public <T> T[] toArray(T[] array)
toArray
in interface Collection<HDR extends SIPHeader>
toArray
in interface List<HDR extends SIPHeader>
|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |