public class HeaderCollection extends Object implements com.aspose.ms.System.Collections.ICollection<String>
Defines the collection of header fields
Constructor and Description |
---|
HeaderCollection()
Initializes a new instance of the
HeaderCollection class. |
HeaderCollection(HeaderCollection col)
Initializes a new instance of the
HeaderCollection class. |
Modifier and Type | Method and Description |
---|---|
void |
add_(String name,
String value)
Adds the header.
|
void |
add(HeaderCollection c)
Adds a header to collection.
|
void |
add(String item)
Adds the header without value
|
void |
add(String name,
String value)
Adds the header.
|
void |
clear()
Clears all headers.
|
boolean |
contains(String item)
Gets a value indicating whether the specified header is contained in the collection
|
void |
copyTo(com.aspose.ms.System.Array dest,
int index) |
void |
copyTo(String[] array,
int arrayIndex)
Copies all the elements of the current collection
to the specified string array starting at the specified destination index.
|
String |
get_Item(int index)
Gets a value from collection by the index.
|
String |
get_Item(String name)
Gets a value from collection by the name.
|
String |
get(int index)
Gets the value at the specified index.
|
String |
get(String name)
Gets the header value by a given header name.
|
String[] |
getAllKeys()
Gets an array of strings containing all header keys in collections
|
String |
getDecodedValue(String name)
Gets the header value.
|
String |
getKey(int index)
Gets the key at the specified index of the collection.
|
List<String> |
getKeys()
Gets a
System.Collections.ObjectModel.ReadOnlyCollection{string} containing all header keys in collections |
Object |
getSyncRoot() |
String[] |
getValues(String name)
Gets the header values.
|
boolean |
hasKeys()
Gets a value indicating whether the collection contains keys.
|
void |
insert(String name,
String value)
Inserts the header in collection.
|
boolean |
isReadOnly()
Is collection readonly
|
boolean |
isSynchronized() |
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<String> |
iterator()
Returns an enumerator that iterates through a collection.
|
boolean |
remove(String item)
Removes the header from collection by a given header name.
|
void |
set_Item(String name,
String value)
Gets a value from collection by the name.
|
void |
set(String name,
String value)
Sets the header.
|
int |
size()
Gets a count of headers
|
public HeaderCollection(HeaderCollection col)
Initializes a new instance of the HeaderCollection
class.
col
- The collection.public HeaderCollection()
Initializes a new instance of the HeaderCollection
class.
public String[] getAllKeys()
Gets an array of strings containing all header keys in collections
public List<String> getKeys()
Gets a System.Collections.ObjectModel.ReadOnlyCollection{string}
containing all header keys in collections
public final String get_Item(String name)
Gets a value from collection by the name.
name
- The name (key) in collection for an item.public final void set_Item(String name, String value)
Gets a value from collection by the name.
name
- The name (key) in collection for an item.public final String get_Item(int index)
Gets a value from collection by the index.
index
- The index in collection for an item.public String getKey(int index)
Gets the key at the specified index of the collection.
index
- The index of the key.public String get(int index)
Gets the value at the specified index.
index
- An integer that represents the position of the element to get.public final String get(String name)
Gets the header value by a given header name.
name
- The haeader name.public final String getDecodedValue(String name)
Gets the header value.
name
- The text header name.public final String[] getValues(String name)
Gets the header values.
name
- The header name.public void add_(String name, String value)
Adds the header.
name
- The header name.value
- The header value.public final void add(HeaderCollection c)
Adds a header to collection.
c
- HeaderCollection for adding.public final void add(String name, String value)
Adds the header.
name
- The header name.value
- The header value.public final void insert(String name, String value)
Inserts the header in collection. If collection contains headers with the same name this header will be inserted before other headers with the same name.
name
- The header name.value
- The header value.public final void set(String name, String value)
Sets the header.
name
- The header name.value
- The header value.public final boolean hasKeys()
Gets a value indicating whether the collection contains keys.
public int size()
Gets a count of headers
size
in interface com.aspose.ms.System.Collections.ICollection<String>
public final boolean isReadOnly()
Is collection readonly
public final void add(String item)
Adds the header without value
public void clear()
Clears all headers.
public final boolean contains(String item)
Gets a value indicating whether the specified header is contained in the collection
item
- A header to searchTrue
if collection contains specified item
; otherwise, false
public final void copyTo(String[] array, int arrayIndex)
Copies all the elements of the current collection to the specified string array starting at the specified destination index.
array
- The destination of the elements copied from the current collection.arrayIndex
- An integer that represents the index in array at which copying begins.public final boolean remove(String item)
Removes the header from collection by a given header name.
item
- The header name.public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<String> iterator()
Returns an enumerator that iterates through a collection.
public void copyTo(com.aspose.ms.System.Array dest, int index)
copyTo
in interface com.aspose.ms.System.Collections.ICollection<String>
public Object getSyncRoot()
getSyncRoot
in interface com.aspose.ms.System.Collections.ICollection<String>
public boolean isSynchronized()
isSynchronized
in interface com.aspose.ms.System.Collections.ICollection<String>