ooodev.adapter.container.index_container_partial module

class ooodev.adapter.container.index_container_partial.IndexContainerPartial(component, interface=com.sun.star.container.XIndexContainer)[source]

Bases: IndexReplacePartial[T], Generic[T]

Partial Class for XIndexContainer.

__init__(component, interface=com.sun.star.container.XIndexContainer)[source]

Constructor

Parameters:
  • component (XIndexContainer) – UNO Component that implements com.sun.star.container.XIndexContainer interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XIndexContainer.

Return type:

None

insert_by_index(index, element)[source]

Inserts the given element at the specified index.

To append an element, use the index last index +1.

Parameters:
  • index (int) – The Zero-based index at which the element should be inserted.

  • element (T) – The element to insert.

Raises:
  • IllegalArgumentExceptioncom.sun.star.lang.IllegalArgumentException

  • IndexOutOfBoundsExceptioncom.sun.star.lang.IndexOutOfBoundsException

  • WrappedTargetExceptioncom.sun.star.lang.WrappedTargetException

Return type:

None

remove_by_index(index)[source]

Removes the element at the specified index.

Parameters:

index (int) – The Zero-based index of the element to remove.

Raises:
  • IndexOutOfBoundsExceptioncom.sun.star.lang.IndexOutOfBoundsException

  • WrappedTargetExceptioncom.sun.star.lang.WrappedTargetException

Return type:

None

ooodev.adapter.container.index_container_partial.T = TypeVar(T)

Type:    TypeVar

Invariant TypeVar.