org.apache.poi.hslf.model.textproperties

## Class TextPropCollection

- java.lang.Object
- - org.apache.poi.hslf.model.textproperties.TextPropCollection

- All Implemented Interfaces:
    Duplicatable, GenericRecord

      public class TextPropCollection
      extends java.lang.Object
      implements GenericRecord, Duplicatable

  For a given run of characters, holds the properties (which could be paragraph properties or character properties). Used to hold the number of characters affected, the list of active properties, and the indent level if required.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TextPropCollection.TextPropType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextPropCollection(int charactersCovered, TextPropCollection.TextPropType textPropType)` Create a new collection of text properties (be they paragraph or character) which will be groked via a subsequent call to buildTextPropList().
    `TextPropCollection(TextPropCollection other)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addProp(TextProp textProp)` Add the property at the correct position.
    `<T extends TextProp> T` | `addWithName(java.lang.String name)` Add the TextProp with this name to the list
    `int` | `buildTextPropList(int containsField, byte[] data, int dataOffset)` For an existing set of text properties, build the list of properties coded for in a given run of properties.
    `TextPropCollection` | `copy()` Clones the given text properties
    `boolean` | `equals(java.lang.Object other)` compares most properties apart of the covered characters length
    `<T extends TextProp> T` | `findByName(java.lang.String textPropName)` Fetch the TextProp with this name, or null if it isn't present
    `int` | `getCharactersCovered()` Fetch the number of characters this styling applies to
    `java.util.Map<java.lang.String,java.util.function.Supplier<?>>` | `getGenericProperties()`
    `short` | `getIndentLevel()`
    `int` | `getSpecialMask()`
    `java.util.List<TextProp>` | `getTextPropList()` Fetch the TextProps that define this styling in the record order
    `TextPropCollection.TextPropType` | `getTextPropType()`
    `int` | `hashCode()`
    `<T extends TextProp> T` | `removeByName(java.lang.String name)`
    `void` | `setIndentLevel(short indentLevel)`
    `java.lang.String` | `toString()`
    `void` | `updateTextSize(int textSize)` Update the size of the text that this set of properties applies to
    `void` | `writeOut(java.io.OutputStream o)` Writes out to disk the header, and then all the properties
    `void` | `writeOut(java.io.OutputStream o, boolean isMasterStyle)` Writes out to disk the header, and then all the properties

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord

      `getGenericChildren, getGenericRecordType`

- - ### Constructor Detail

    - #### TextPropCollection

          public TextPropCollection(int charactersCovered,
                                    TextPropCollection.TextPropType textPropType)

      Create a new collection of text properties (be they paragraph or character) which will be groked via a subsequent call to buildTextPropList().

    - #### TextPropCollection

          public TextPropCollection(TextPropCollection other)

  - ### Method Detail

    - #### getSpecialMask

          public int getSpecialMask()

    - #### getCharactersCovered

          public int getCharactersCovered()

      Fetch the number of characters this styling applies to

    - #### getTextPropList

          public java.util.List<TextProp> getTextPropList()

      Fetch the TextProps that define this styling in the record order

    - #### findByName

          public final <T extends TextProp> T findByName(java.lang.String textPropName)

      Fetch the TextProp with this name, or null if it isn't present

    - #### removeByName

          public final <T extends TextProp> T removeByName(java.lang.String name)

    - #### getTextPropType

          public final TextPropCollection.TextPropType getTextPropType()

    - #### addWithName

          public final <T extends TextProp> T addWithName(java.lang.String name)

      Add the TextProp with this name to the list

    - #### addProp

          public final void addProp(TextProp textProp)

      Add the property at the correct position. Replaces an existing property with the same name.
      Parameters:
        `textProp` - the property to be added

    - #### buildTextPropList

          public int buildTextPropList(int containsField,
                                       byte[] data,
                                       int dataOffset)

      For an existing set of text properties, build the list of properties coded for in a given run of properties.
      Returns:
        the number of bytes that were used encoding the properties list

    - #### copy

          public TextPropCollection copy()

      Clones the given text properties
      Specified by:
        `copy` in interface `Duplicatable`
      Returns:
        a deep copy of the implementing class / instance

    - #### updateTextSize

          public void updateTextSize(int textSize)

      Update the size of the text that this set of properties applies to

    - #### writeOut

          public void writeOut(java.io.OutputStream o)
                        throws java.io.IOException

      Writes out to disk the header, and then all the properties
      Throws:
        `java.io.IOException`

    - #### writeOut

          public void writeOut(java.io.OutputStream o,
                               boolean isMasterStyle)
                        throws java.io.IOException

      Writes out to disk the header, and then all the properties
      Throws:
        `java.io.IOException`

    - #### getIndentLevel

          public short getIndentLevel()

    - #### setIndentLevel

          public void setIndentLevel(short indentLevel)

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object other)

      compares most properties apart of the covered characters length
      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getGenericProperties

          public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()

      Specified by:
        `getGenericProperties` in interface `GenericRecord`

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.