org.apache.poi.hslf.model.textproperties

## Class BitMaskTextProp

- java.lang.Object
- - org.apache.poi.hslf.model.textproperties.TextProp
  - - org.apache.poi.hslf.model.textproperties.BitMaskTextProp

- All Implemented Interfaces:
    Duplicatable, GenericRecord
  Direct Known Subclasses:
    CharFlagsTextProp, ParagraphFlagsTextProp, WrapFlagsTextProp

      public abstract class BitMaskTextProp
      extends TextProp

  Definition of a special kind of property of some text, or its paragraph. For these properties, a flag in the "contains" header field tells you the data property family will exist. The value of the property is itself a mask, encoding several different (but related) properties

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static POILogger` | `logger`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BitMaskTextProp(BitMaskTextProp other)`
    `protected` | `BitMaskTextProp(int sizeOfDataBlock, int maskInHeader, java.lang.String overallName, java.lang.String... subPropNames)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `BitMaskTextProp` | `clone()` Deprecated.
    `BitMaskTextProp` | `cloneAll()`
    `abstract BitMaskTextProp` | `copy()` Clone, eg when you want to actually make use of one of these.
    `java.util.Map<java.lang.String,java.util.function.Supplier<?>>` | `getGenericProperties()`
    `boolean[]` | `getSubPropMatches()` Fetch the list of if the sub properties match or not
    `java.lang.String[]` | `getSubPropNames()` Fetch the list of the names of the sub properties
    `boolean` | `getSubValue(int idx)` Fetch the true/false status of the subproperty with the given index
    `int` | `getValue()` Return the text property value.
    `int` | `getWriteMask()` Calculate mask from the subPropMatches.
    `void` | `setSubValue(boolean value, int idx)` Set the true/false status of the subproperty with the given index
    `void` | `setValue(int val)` Set the value of the text property, and recompute the sub properties based on it, i.e.
    `void` | `setValueWithMask(int val, int writeMask)` Convenience method to set a value with mask, without splitting it into the subvalues
    `void` | `setWriteMask(int writeMask)` Sets the write mask, i.e.

    - ### Methods inherited from class org.apache.poi.hslf.model.textproperties.TextProp

      `equals, getMask, getName, getSize, hashCode, toString`

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

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

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

      `getGenericChildren, getGenericRecordType`

- - ### Field Detail

    - #### logger

          protected static final POILogger logger

  - ### Constructor Detail

    - #### BitMaskTextProp

          protected BitMaskTextProp(BitMaskTextProp other)

    - #### BitMaskTextProp

          protected BitMaskTextProp(int sizeOfDataBlock,
                                    int maskInHeader,
                                    java.lang.String overallName,
                                    java.lang.String... subPropNames)

  - ### Method Detail

    - #### getSubPropNames

          public java.lang.String[] getSubPropNames()

      Fetch the list of the names of the sub properties

    - #### getSubPropMatches

          public boolean[] getSubPropMatches()

      Fetch the list of if the sub properties match or not

    - #### getWriteMask

          public int getWriteMask()

      Calculate mask from the subPropMatches.
      Overrides:
        `getWriteMask` in class `TextProp`

    - #### setWriteMask

          public void setWriteMask(int writeMask)

      Sets the write mask, i.e. which defines the text properties to be considered
      Parameters:
        `writeMask` - the mask, bit values outside the property mask range will be ignored

    - #### getValue

          public int getValue()

      Return the text property value. Clears all bits of the value, which are marked as unset.
      Overrides:
        `getValue` in class `TextProp`
      Returns:
        the text property value.

    - #### setValue

          public void setValue(int val)

      Set the value of the text property, and recompute the sub properties based on it, i.e. all unset subvalues will be cleared. Use `setSubValue(boolean, int)` to explicitly set subvalues to `false`.
      Overrides:
        `setValue` in class `TextProp`

    - #### setValueWithMask

          public void setValueWithMask(int val,
                                       int writeMask)

      Convenience method to set a value with mask, without splitting it into the subvalues
      Parameters:
        `val` -
        `writeMask` -

    - #### getSubValue

          public boolean getSubValue(int idx)

      Fetch the true/false status of the subproperty with the given index

    - #### setSubValue

          public void setSubValue(boolean value,
                                  int idx)

      Set the true/false status of the subproperty with the given index

    - #### clone

          @Deprecated
           @Removal(version="5.0.0")
          public BitMaskTextProp clone()

      Deprecated.
      Overrides:
        `clone` in class `TextProp`

    - #### cloneAll

          public BitMaskTextProp cloneAll()

      Returns:
        an identical copy of this, i.e. also the subPropMatches are copied

    - #### getGenericProperties

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

      Specified by:
        `getGenericProperties` in interface `GenericRecord`
      Overrides:
        `getGenericProperties` in class `TextProp`

    - #### copy

          public abstract BitMaskTextProp copy()

      Description copied from class: `TextProp`
      Clone, eg when you want to actually make use of one of these.
      Specified by:
        `copy` in interface `Duplicatable`
      Overrides:
        `copy` in class `TextProp`
      Returns:
        a deep copy of the implementing class / instance

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