com.lowagie.text.rtf.style

## Class RtfColorList

- java.lang.Object
- - com.lowagie.text.rtf.RtfElement
  - - com.lowagie.text.rtf.style.RtfColorList

- All Implemented Interfaces:
    RtfBasicElement, RtfExtendedElement, RtfElementInterface

      public class RtfColorList
      extends RtfElement
      implements RtfExtendedElement

  The RtfColorList stores all colors that appear in the document. Black and White are always added
  Version:
    $Id$
  Author:
    Mark Hall (Mark.Hall@mail.room3b.eu), Thomas Bickel (tmb99@inode.at)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static byte[]` | `COLOR_TABLE` Constant for the beginning of the color table
    `(package private) java.util.ArrayList` | `colorList` ArrayList containing all colors of this RtfColorList

    - ### Fields inherited from class com.lowagie.text.rtf.RtfElement

      `document, inHeader, inTable`

    - ### Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement

      `CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RtfColorList(RtfDocument doc)` Constructs a new RtfColorList for the RtfDocument.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getColorNumber(RtfColor color)` Returns the index of the given RtfColor in the color list.
    `void` | `writeContent(java.io.OutputStream out)` unused
    `void` | `writeDefinition(java.io.OutputStream result)` Write the definition part of the color list.

    - ### Methods inherited from class com.lowagie.text.rtf.RtfElement

      `intToByteArray, isInTable, setInHeader, setInTable, setRtfDocument`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.lowagie.text.rtf.RtfBasicElement

      `setInHeader, setInTable, setRtfDocument`

- - ### Field Detail

    - #### COLOR_TABLE

          private static final byte[] COLOR_TABLE

      Constant for the beginning of the color table

    - #### colorList

          java.util.ArrayList colorList

      ArrayList containing all colors of this RtfColorList

  - ### Constructor Detail

    - #### RtfColorList

          public RtfColorList(RtfDocument doc)

      Constructs a new RtfColorList for the RtfDocument. Will add the default black and white colors.
      Parameters:
        `doc` - The RtfDocument this RtfColorList belongs to

  - ### Method Detail

    - #### getColorNumber

          public int getColorNumber(RtfColor color)

      Returns the index of the given RtfColor in the color list. If the RtfColor is not in the list of colors, then it is added.
      Parameters:
        `color` - The RtfColor for which to get the index
      Returns:
        The index of the RtfColor

    - #### writeContent

          public void writeContent(java.io.OutputStream out)
                            throws java.io.IOException

      unused
      Specified by:
        `writeContent` in interface `RtfBasicElement`
      Specified by:
        `writeContent` in class `RtfElement`
      Parameters:
        `out` - The `OutputStream` to write the content to
      Throws:
        `java.io.IOException`

    - #### writeDefinition

          public void writeDefinition(java.io.OutputStream result)
                               throws java.io.IOException

      Write the definition part of the color list. Calls the writeDefinition methods of the RtfColors in the color list.
      Specified by:
        `writeDefinition` in interface `RtfExtendedElement`
      Parameters:
        `result` - The `OutputStream` to write the element definition to
      Throws:
        `java.io.IOException`