public abstract class SIPHeaderList<HDR extends SIPHeader> extends SIPHeader implements List<HDR>, Header
Modifier and Type | Field and Description |
---|---|
protected List<HDR> |
hlist
hlist field.
|
headerName
AND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentation
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
Modifier | Constructor and Description |
---|---|
protected |
SIPHeaderList(Class<HDR> objclass,
String hname)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected SIPHeaderList<HDR> |
clonehlist(List<HDR> hlistToClone) |
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.
|
StringBuilder |
encode(StringBuilder buffer)
Encode the header into the given StringBuilder.
|
protected String |
encodeBody()
Encode the body of this header (the stuff that follows headerName).
|
protected StringBuilder |
encodeBody(StringBuilder buffer)
Encode the body of this header (the stuff that follows headerName).
|
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(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.
|
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.
|
protected void |
setMyClass(Class<HDR> cl)
Set the root class for all objects inserted into my list (for assertion
check)
|
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.
|
<T> T[] |
toArray(T[] array) |
getHeaderName, getHeaderValue, getValue, setHeaderName, toString
dbgPrint, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, merge, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint
public String getName()
SIPHeader
public boolean add(HDR 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()
public StringBuilder encode(StringBuilder buffer)
SIPObject
public List<String> getHeadersAsEncodedStrings()
public Header getFirst()
public Header getLast()
public Class<HDR> getMyClass()
public boolean isEmpty()
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 returnpublic void removeFirst()
public void removeLast()
public boolean remove(HDR obj)
obj
- SIPHeader to removeprotected void setMyClass(Class<HDR> cl)
cl
- class to setpublic String debugDump(int indentation)
public String debugDump()
public Object[] toArray()
public int indexOf(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 Header
equals
in interface Collection<HDR extends SIPHeader>
equals
in interface List<HDR extends SIPHeader>
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 GenericObject
protected final SIPHeaderList<HDR> clonehlist(List<HDR> hlistToClone)
public int size()
public boolean isHeaderList()
isHeaderList
in class SIPHeader
protected String encodeBody()
protected StringBuilder encodeBody(StringBuilder buffer)
SIPHeader
encodeBody
in class SIPHeader
public boolean addAll(Collection<? extends HDR> collection)
public boolean addAll(int index, Collection<? extends HDR> collection)
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<HDR extends SIPHeader>
containsAll
in interface List<HDR extends SIPHeader>
public void clear()
public boolean contains(Object header)
public HDR get(int index)
public int indexOf(Object obj)
public int lastIndexOf(Object obj)
lastIndexOf
in interface List<HDR extends SIPHeader>
obj
- --
object whose index to find.public boolean remove(Object obj)
public HDR remove(int index)
public 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
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)
Copyright © 2015. All Rights Reserved.