org.apache.poi.hslf.model.textproperties
Class TextPropCollection

java.lang.Object
  extended by org.apache.poi.hslf.model.textproperties.TextPropCollection

public class TextPropCollection
extends java.lang.Object

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 random reserved field if required.


Constructor Summary
TextPropCollection(int textSize)
          Create a new collection of text properties (be they paragraph or character) for a run of text without any
TextPropCollection(int charactersCovered, short reservedField)
          Create a new collection of text properties (be they paragraph or character) which will be groked via a subsequent call to buildTextPropList().
 
Method Summary
 TextProp addWithName(java.lang.String name)
          Add the TextProp with this name to the list
 int buildTextPropList(int containsField, TextProp[] potentialProperties, byte[] data, int dataOffset)
          For an existing set of text properties, build the list of properties coded for in a given run of properties.
 TextProp 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
 short getReservedField()
           
 java.util.LinkedList getTextPropList()
          Fetch the TextProps that define this styling
 void setReservedField(short val)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextPropCollection

public TextPropCollection(int charactersCovered,
                          short reservedField)
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(int textSize)
Create a new collection of text properties (be they paragraph or character) for a run of text without any

Method Detail

getCharactersCovered

public int getCharactersCovered()
Fetch the number of characters this styling applies to


getTextPropList

public java.util.LinkedList getTextPropList()
Fetch the TextProps that define this styling


findByName

public TextProp findByName(java.lang.String textPropName)
Fetch the TextProp with this name, or null if it isn't present


addWithName

public TextProp addWithName(java.lang.String name)
Add the TextProp with this name to the list


buildTextPropList

public int buildTextPropList(int containsField,
                             TextProp[] potentialProperties,
                             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

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

getReservedField

public short getReservedField()

setReservedField

public void setReservedField(short val)


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