|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.util.Headers
public class Headers
Open addressing based implementation of a hashmap (not supporting the Map interface though) for message headers. The keys are shorts (IDs) and the values Headers, and they're stored in 2 arrays: an ID array and a headers array. The indices of the IDs array corespond with the headers array, e.g.
IDs: id-1 | id-2 | id-3 | ... | id-n | Headers: hdr-1 | hdr-2 | hdr-3 | ... | hdr-n |The arrays are populated from left to right, and any 0 slots in 'ids' can terminate an interation, or signal empty slots.
Constructor Summary | |
---|---|
Headers(Headers other)
|
|
Headers(int capacity)
|
Method Summary | |
---|---|
int |
capacity()
|
Headers |
copy()
|
Header |
getHeader(short id)
Returns the header associated with an ID |
java.util.Map<java.lang.Short,Header> |
getHeaders()
|
Header[] |
getRawHeaders()
|
short[] |
getRawIDs()
|
int |
marshalledSize()
|
java.lang.String |
printHeaders()
|
java.lang.String |
printObjectHeaders()
|
void |
putHeader(short id,
Header hdr)
Puts a header given a key into the hashmap. |
Header |
putHeaderIfAbsent(short id,
Header hdr)
Puts a header given a key into the map, only if the key doesn't exist yet |
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Headers(int capacity)
public Headers(Headers other)
Method Detail |
---|
public short[] getRawIDs()
public Header[] getRawHeaders()
public Header getHeader(short id)
id
- The ID
public java.util.Map<java.lang.Short,Header> getHeaders()
public java.lang.String printHeaders()
public void putHeader(short id, Header hdr)
public Header putHeaderIfAbsent(short id, Header hdr)
id
- hdr
-
public Headers copy()
public int marshalledSize()
public int size()
public int capacity()
public java.lang.String printObjectHeaders()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |