public class MultipleHeader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
compact
whether to be rapresented with a comma-separated(compact) header line or multiple header lines
|
protected java.lang.String |
name
The header type
|
protected java.util.Vector |
values
Vector of header values (Vector of
String ) |
Modifier | Constructor and Description |
---|---|
protected |
MultipleHeader()
Creates a void new MultipleHeader.
|
|
MultipleHeader(Header hd)
Creates a new MultipleHeader.
|
|
MultipleHeader(MultipleHeader mhd)
Creates a new MultipleHeader.
|
|
MultipleHeader(java.lang.String hname)
Creates a new MultipleHeader.
|
|
MultipleHeader(java.lang.String hname,
java.util.Vector hvalues)
Creates a new MultipleHeader.
|
|
MultipleHeader(java.util.Vector headers)
Creates a new MultipleHeader.
|
Modifier and Type | Method and Description |
---|---|
void |
addBottom(Header hd)
Adds bottom.
|
void |
addBottom(MultipleHeader mhd)
Adds other MultipleHeader at bottom.
|
void |
addTop(Header hd)
Adds top.
|
java.lang.Object |
clone()
Creates and returns a copy of Header.
|
boolean |
equals(java.lang.Object obj)
Indicates whether an other Object is "equal to" this Header.
|
Header |
getBottom()
Gets bottom Header.
|
java.util.Vector |
getHeaders()
Gets a vector of headers.
|
java.lang.String |
getName()
Gets name of Header.
|
Header |
getTop()
Gets top Header
|
java.lang.String |
getValue(int i)
Gets the i-value.
|
java.util.Vector |
getValues()
Gets a vector of header values.
|
boolean |
isCommaSeparated()
Whether the MultipleHeader rappresentation is comma-separated or multiple headers.
|
static boolean |
isCommaSeparated(Header hd)
Checks if Header hd contains comma-separated multi-header.
|
boolean |
isEmpty()
Whether it is empty.
|
void |
removeBottom()
Removes bottom Header.
|
void |
removeTop()
Removes the top Header.
|
void |
setCommaSeparated(boolean comma_separated)
Sets the MultipleHeader rappresentation as comma-separated or multiple headers.
|
void |
setHeaders(java.util.Vector hdv)
Sets headers.
|
void |
setValues(java.util.Vector v)
Sets header values.
|
int |
size()
Gets the size of the MultipleHeader.
|
Header |
toHeader()
Gets an Header containing the comma-separated (compact) representation.
|
java.lang.String |
toString()
Gets comma-separated (compact) or multi-headers (extended) representation of this multi-header.
|
protected java.lang.String name
protected java.util.Vector values
String
)protected boolean compact
protected MultipleHeader()
public MultipleHeader(java.lang.String hname)
hname
- the header namepublic MultipleHeader(java.lang.String hname, java.util.Vector hvalues)
hname
- the header namehvalues
- vector of header values (Vector of String
)public MultipleHeader(java.util.Vector headers)
headers
- vector of headers (Vector of Header
). Each header can be a single header or a multiple-comma-separated headerpublic MultipleHeader(Header hd)
hd
- comma-separated headerpublic MultipleHeader(MultipleHeader mhd)
mhd
- multiple headerspublic static boolean isCommaSeparated(Header hd)
hd
- the header
return whether the header contains comma-separated multi-headerpublic void setCommaSeparated(boolean comma_separated)
comma_separated
- whether comma-separated or multiple headers.public boolean isCommaSeparated()
public int size()
public boolean isEmpty()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getName()
public java.util.Vector getValues()
String
)public void setValues(java.util.Vector v)
v
- the header values (Vector of String
)public java.util.Vector getHeaders()
Header
)public void setHeaders(java.util.Vector hdv)
hdv
- the headers (Vector of Header
)public java.lang.String getValue(int i)
public void addTop(Header hd)
hd
- the new top headerpublic Header getTop()
public void removeTop()
public void addBottom(Header hd)
hd
- the new bottom headerpublic void addBottom(MultipleHeader mhd)
mhd
- the new bottom headerspublic Header getBottom()
public void removeBottom()
public Header toHeader()
public java.lang.String toString()
toString
in class java.lang.Object