ooodev.adapter.container.index_access_implement module

class ooodev.adapter.container.index_access_implement.IndexAccessImplement(elements, element_type='[]any')[source]

Bases: XTypeProvider, XIndexAccess, XElementAccess, XInterface

Index Access that implements XIndexAccess

Note

Supports iteration including reversed, slicing, and indexing.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

__init__(elements, element_type='[]any')[source]

Initializes the Index Access

Parameters:
  • elements (Sequence[Any]) – Any sequence of elements that can be accessed by index such as a tuple

  • element_type (str, optional) – Used to get the Element type of this instance. Defaults to “[]any”.

Return type:

None

Note

element_type is used to set the Element type of this instance. Can be value such as:

  • [][]com.sun.star.beans.PropertyValue, a tuple of tuple of PropertyValue

  • []com.sun.star.beans.PropertyValue, a tuple of PropertyValue

  • [][]long, a tuple of tuple of int

  • []long, a tuple of int

  • [][]string, a tuple of tuple of str

  • []string, a tuple of str

  • []any, a tuple of Any.

List are also supported but depending on how the instance is used, it may have unexpected results.

acquire()[source]
Return type:

None

getByIndex(index)[source]

Gets the element at the specified index.

Parameters:

index (int) – index of element to return.

Returns:

element at the specified index.

Return type:

Any

getCount()[source]

Gets the number of elements in the collection.

Returns:

number of elements in the collection.

Return type:

int

getElementType()[source]

Gets te Element Type

Return type:

Any

getImplementationId()[source]

Obsolete unique identifier.

Return type:

Any

getTypes()[source]

returns a sequence of all types (usually interface types) provided by the object.

Return type:

Tuple[Any, ...]

hasElements()[source]

Determines whether the collection has elements.

Returns:

True if the collection has elements, otherwise False.

Return type:

bool

queryInterface(a_type)[source]
Return type:

Any

Parameters:

a_type (Any) –

release()[source]
Return type:

None