|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.mime4j.message.AbstractHeader
public abstract class AbstractHeader
Abstract MIME header.
Constructor Summary | |
---|---|
AbstractHeader()
Creates a new empty Header . |
|
AbstractHeader(Header other)
Creates a new Header from the specified
Header . |
Method Summary | |
---|---|
void |
addField(Field field)
Adds a field to the end of the list of fields. |
Field |
getField(java.lang.String name)
Gets a Field given a field name. |
java.util.List<Field> |
getFields()
Gets the fields of this header. |
java.util.List<Field> |
getFields(java.lang.String name)
Gets all Field s having the specified field name. |
java.util.Iterator<Field> |
iterator()
Returns an iterator over the list of fields of this header. |
int |
removeFields(java.lang.String name)
Removes all Field s having the specified field name. |
void |
setField(Field field)
Sets or replaces a field. |
java.lang.String |
toString()
Return Header Object as String representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractHeader()
Header
.
public AbstractHeader(Header other)
Header
from the specified
Header
. The Header
instance is initialized
with a copy of the list of Field
s of the specified
Header
. The Field
objects are not copied
because they are immutable and can safely be shared between headers.
other
- header to copy.Method Detail |
---|
public void addField(Field field)
addField
in interface Header
field
- the field to add.public java.util.List<Field> getFields()
getFields
in interface Header
Field
objects.public Field getField(java.lang.String name)
Field
given a field name. If there are multiple
such fields defined in this header the first one will be returned.
getField
in interface Header
name
- the field name (e.g. From, Subject).
null
if none found.public java.util.List<Field> getFields(java.lang.String name)
Field
s having the specified field name.
getFields
in interface Header
name
- the field name (e.g. From, Subject).
public java.util.Iterator<Field> iterator()
iterator
in interface java.lang.Iterable<Field>
iterator
in interface Header
public int removeFields(java.lang.String name)
Field
s having the specified field name.
removeFields
in interface Header
name
- the field name (e.g. From, Subject).
public void setField(Field field)
Header
does not already contain a header field of
the same name as the given field then it is added to the end of the list
of fields (same behavior as addField(Field)
). Otherwise the
first occurrence of a field with the same name is replaced by the given
field and all further occurrences are removed.
setField
in interface Header
field
- the field to set.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 |