class Header extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
Header.FieldKey
Field lookup key.
|
Modifier and Type | Field and Description |
---|---|
private static SimpleDateFormat |
dateFormat |
private Map |
fields |
Constructor and Description |
---|
Header()
Creates new header with no field entries.
|
Header(InputStream in)
Reads in new header from the given input stream.
|
Modifier and Type | Method and Description |
---|---|
private void |
addField(String name,
String value)
Associates additional value with named field.
|
(package private) boolean |
containsValue(String name,
String value,
boolean ignoreCase)
Returns true if named field's associated value either contains (as an
element of a comma-separated list) or is equal to the given value.
|
(package private) static String |
getDateString(long time)
Returns formatted date string for given time.
|
(package private) String |
getField(String name)
Returns value associated with named field, or null if field not present
in this header.
|
private static boolean |
isSpaceOrTab(char c) |
(package private) void |
merge(Header header)
If given header is non-null, adds its field entries to this header.
|
(package private) void |
setField(String name,
String value)
If given value is non-null, enters it as value of named field;
otherwise, removes field (if present) from this header.
|
(package private) int |
size()
Returns number of field entries in header.
|
(package private) void |
write(OutputStream out)
Writes header to given output stream.
|
private static final SimpleDateFormat dateFormat
private Map fields
Header()
Header(InputStream in) throws IOException
IOException
String getField(String name)
void setField(String name, String value)
boolean containsValue(String name, String value, boolean ignoreCase)
int size()
void merge(Header header)
void write(OutputStream out) throws IOException
IOException
static String getDateString(long time)
private static boolean isSpaceOrTab(char c)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.