HeaderCollection

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.Collections.ICollection

public class HeaderCollection implements System.Collections.ICollection<String>

Defines the collection of header fields

Constructors

Constructor Description
HeaderCollection(HeaderCollection col) Initializes a new instance of the HeaderCollection class.
HeaderCollection() Initializes a new instance of the HeaderCollection class.

Methods

Method Description
getAllKeys() Gets an array of strings containing all header keys in collections
getKeys() Gets a ``` System.Collections.ObjectModel.ReadOnlyCollection{string} ``` containing all header keys in collections
get_Item(String name) Gets a value from collection by the name.
set_Item(String name, String value) Gets a value from collection by the name.
get_Item(int index) Gets a value from collection by the index.
getKey(int index) Gets the key at the specified index of the collection.
get(int index) Gets the value at the specified index.
get(String name) Gets the header value by a given header name.
getDecodedValue(String name) Gets the header value.
getValues(String name) Gets the header values.
add_(String name, String value) Adds the header.
add(HeaderCollection c) Adds a header to collection.
add(String name, String value) Adds the header.
insert(String name, String value) Inserts the header in collection.
set(String name, String value) Sets the header.
hasKeys() Gets a value indicating whether the collection contains keys.
size() Gets a count of headers
isReadOnly() Is collection readonly
add(String item) Adds the header without value
clear() Clears all headers.
contains(String item) Gets a value indicating whether the specified header is contained in the collection
copyTo(String[] array, int arrayIndex) Copies all the elements of the current collection to the specified string array starting at the specified destination index.
remove(String item) Removes the header from collection by a given header name.
iterator() Returns an enumerator that iterates through a collection.
copyTo(System.Array dest, int index)
getSyncRoot()
isSynchronized()

HeaderCollection(HeaderCollection col)

public HeaderCollection(HeaderCollection col)

Initializes a new instance of the HeaderCollection class.

Parameters:

Parameter Type Description
col HeaderCollection The collection.

HeaderCollection()

public HeaderCollection()

Initializes a new instance of the HeaderCollection class.

getAllKeys()

public String[] getAllKeys()

Gets an array of strings containing all header keys in collections

Returns: java.lang.String[]

getKeys()

public List<String> getKeys()

Gets a ``` System.Collections.ObjectModel.ReadOnlyCollection{string} ``` containing all header keys in collections

Returns: java.util.List<java.lang.String>

get_Item(String name)

public final String get_Item(String name)

Gets a value from collection by the name.

Parameters:

Parameter Type Description
name java.lang.String The name (key) in collection for an item.

Returns: java.lang.String - Returns specified item

set_Item(String name, String value)

public final void set_Item(String name, String value)

Gets a value from collection by the name.

Parameters:

Parameter Type Description
name java.lang.String The name (key) in collection for an item.
value java.lang.String

get_Item(int index)

public final String get_Item(int index)

Gets a value from collection by the index.

Parameters:

Parameter Type Description
index int The index in collection for an item.

Returns: java.lang.String - Returns specified item

getKey(int index)

public String getKey(int index)

Gets the key at the specified index of the collection.

Parameters:

Parameter Type Description
index int The index of the key.

Returns: java.lang.String - The key at the specified index.

get(int index)

public String get(int index)

Gets the value at the specified index.

Parameters:

Parameter Type Description
index int An integer that represents the position of the element to get.

Returns: java.lang.String - The value at the specified position in current collection.

get(String name)

public final String get(String name)

Gets the header value by a given header name.

Parameters:

Parameter Type Description
name java.lang.String The haeader name.

Returns: java.lang.String - The header value.

getDecodedValue(String name)

public final String getDecodedValue(String name)

Gets the header value.

Parameters:

Parameter Type Description
name java.lang.String The text header name.

Returns: java.lang.String - Decoded text value

getValues(String name)

public final String[] getValues(String name)

Gets the header values.

Parameters:

Parameter Type Description
name java.lang.String The header name.

Returns: java.lang.String[] - The collection of header values.

add_(String name, String value)

public void add_(String name, String value)

Adds the header.

Parameters:

Parameter Type Description
name java.lang.String The header name.
value java.lang.String The header value.

add(HeaderCollection c)

public final void add(HeaderCollection c)

Adds a header to collection.

Parameters:

Parameter Type Description
c HeaderCollection HeaderCollection for adding.

add(String name, String value)

public final void add(String name, String value)

Adds the header.

Parameters:

Parameter Type Description
name java.lang.String The header name.
value java.lang.String The header value.

insert(String name, String 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.

Parameters:

Parameter Type Description
name java.lang.String The header name.
value java.lang.String The header value.

set(String name, String value)

public final void set(String name, String value)

Sets the header.

Parameters:

Parameter Type Description
name java.lang.String The header name.
value java.lang.String The header value.

hasKeys()

public final boolean hasKeys()

Gets a value indicating whether the collection contains keys.

Returns: boolean - Returns true if collection has an items, otherwise returns false.

size()

public int size()

Gets a count of headers

Returns: int

isReadOnly()

public final boolean isReadOnly()

Is collection readonly

Returns: boolean

add(String item)

public final void add(String item)

Adds the header without value

Parameters:

Parameter Type Description
item java.lang.String

clear()

public void clear()

Clears all headers.

contains(String item)

public final boolean contains(String item)

Gets a value indicating whether the specified header is contained in the collection

Parameters:

Parameter Type Description
item java.lang.String A header to search

Returns: boolean - ``` True ``` if collection contains specified ``` item ```; otherwise, ``` false ```

copyTo(String[] array, int arrayIndex)

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.

Parameters:

Parameter Type Description
array java.lang.String[] The destination of the elements copied from the current collection.
arrayIndex int An integer that represents the index in array at which copying begins.

remove(String item)

public final boolean remove(String item)

Removes the header from collection by a given header name.

Parameters:

Parameter Type Description
item java.lang.String The header name.

Returns: boolean - true if item was successfully removed from the collection.

iterator()

public final System.Collections.Generic.IGenericEnumerator<String> iterator()

Returns an enumerator that iterates through a collection.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<java.lang.String> - An ``` System.Collections.Generic.IEnumerator{string} ``` object that can be used to iterate through the collection.

copyTo(System.Array dest, int index)

public void copyTo(System.Array dest, int index)

Parameters:

Parameter Type Description
dest com.aspose.ms.System.Array
index int

getSyncRoot()

public Object getSyncRoot()

Returns: java.lang.Object

isSynchronized()

public boolean isSynchronized()

Returns: boolean