org.apache.poi.hssf.record
Class CFRuleRecord

java.lang.Object
  extended by org.apache.poi.hssf.record.Record
      extended by org.apache.poi.hssf.record.CFRuleRecord

public final class CFRuleRecord
extends Record

Conditional Formatting Rule Record.

Author:
Dmitriy Kumshayev

Nested Class Summary
static class CFRuleRecord.ComparisonOperator
           
 
Field Summary
static byte CONDITION_TYPE_CELL_VALUE_IS
           
static byte CONDITION_TYPE_FORMULA
           
static short sid
           
 
Constructor Summary
CFRuleRecord(RecordInputStream in)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean containsAlignFormattingBlock()
           
 boolean containsBorderFormattingBlock()
           
 boolean containsFontFormattingBlock()
           
 boolean containsPatternFormattingBlock()
           
 boolean containsProtectionFormattingBlock()
           
static CFRuleRecord create(HSSFWorkbook workbook, byte comparisonOperation, java.lang.String formulaText1, java.lang.String formulaText2)
          Creates a new comparison operation rule
static CFRuleRecord create(HSSFWorkbook workbook, java.lang.String formulaText)
          Creates a new comparison operation rule
protected  void fillFields(RecordInputStream in)
          called by the constructor, should set class level fields.
 BorderFormatting getBorderFormatting()
           
 byte getComparisonOperation()
           
 byte getConditionType()
           
 FontFormatting getFontFormatting()
           
 int getOptions()
          get the option flags
 Ptg[] getParsedExpression1()
          get the stack of the 1st expression as a list
 Ptg[] getParsedExpression2()
          get the stack of the 2nd expression as a list
 PatternFormatting getPatternFormatting()
           
 int getRecordSize()
          gives the current serialized size of the record.
 short getSid()
          return the non static version of the id for this record.
 boolean isBottomBorderModified()
           
 boolean isBottomLeftTopRightBorderModified()
           
 boolean isLeftBorderModified()
           
 boolean isPatternBackgroundColorModified()
           
 boolean isPatternColorModified()
           
 boolean isPatternStyleModified()
           
 boolean isRightBorderModified()
           
 boolean isTopBorderModified()
           
 boolean isTopLeftBottomRightBorderModified()
           
 int serialize(int pOffset, byte[] data)
          called by the class that is responsible for writing this sucker.
 void setAlignFormattingUnchanged()
           
 void setBorderFormatting(BorderFormatting borderFormatting)
           
 void setBottomBorderModified(boolean modified)
           
 void setBottomLeftTopRightBorderModified(boolean modified)
           
 void setComparisonOperation(byte operation)
           
 void setFontFormatting(FontFormatting fontFormatting)
           
 void setLeftBorderModified(boolean modified)
           
 void setPatternBackgroundColorModified(boolean modified)
           
 void setPatternColorModified(boolean modified)
           
 void setPatternFormatting(PatternFormatting patternFormatting)
           
 void setPatternStyleModified(boolean modified)
           
 void setProtectionFormattingUnchanged()
           
 void setRightBorderModified(boolean modified)
           
 void setTopBorderModified(boolean modified)
           
 void setTopLeftBottomRightBorderModified(boolean modified)
           
 java.lang.String toString()
          get a string representation of the record (for biffview/debugging)
protected  void validateSid(short id)
          called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
 
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, isInValueSection, isValue, serialize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public static final short sid
See Also:
Constant Field Values

CONDITION_TYPE_CELL_VALUE_IS

public static final byte CONDITION_TYPE_CELL_VALUE_IS
See Also:
Constant Field Values

CONDITION_TYPE_FORMULA

public static final byte CONDITION_TYPE_FORMULA
See Also:
Constant Field Values
Constructor Detail

CFRuleRecord

public CFRuleRecord(RecordInputStream in)
Method Detail

create

public static CFRuleRecord create(HSSFWorkbook workbook,
                                  java.lang.String formulaText)
Creates a new comparison operation rule


create

public static CFRuleRecord create(HSSFWorkbook workbook,
                                  byte comparisonOperation,
                                  java.lang.String formulaText1,
                                  java.lang.String formulaText2)
Creates a new comparison operation rule


fillFields

protected void fillFields(RecordInputStream in)
Description copied from class: Record
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.

Specified by:
fillFields in class Record
Parameters:
in - the RecordInputstream to read the record from

getConditionType

public byte getConditionType()

containsFontFormattingBlock

public boolean containsFontFormattingBlock()

setFontFormatting

public void setFontFormatting(FontFormatting fontFormatting)

getFontFormatting

public FontFormatting getFontFormatting()

containsAlignFormattingBlock

public boolean containsAlignFormattingBlock()

setAlignFormattingUnchanged

public void setAlignFormattingUnchanged()

containsBorderFormattingBlock

public boolean containsBorderFormattingBlock()

setBorderFormatting

public void setBorderFormatting(BorderFormatting borderFormatting)

getBorderFormatting

public BorderFormatting getBorderFormatting()

containsPatternFormattingBlock

public boolean containsPatternFormattingBlock()

setPatternFormatting

public void setPatternFormatting(PatternFormatting patternFormatting)

getPatternFormatting

public PatternFormatting getPatternFormatting()

containsProtectionFormattingBlock

public boolean containsProtectionFormattingBlock()

setProtectionFormattingUnchanged

public void setProtectionFormattingUnchanged()

setComparisonOperation

public void setComparisonOperation(byte operation)

getComparisonOperation

public byte getComparisonOperation()

getOptions

public int getOptions()
get the option flags

Returns:
bit mask

isLeftBorderModified

public boolean isLeftBorderModified()

setLeftBorderModified

public void setLeftBorderModified(boolean modified)

isRightBorderModified

public boolean isRightBorderModified()

setRightBorderModified

public void setRightBorderModified(boolean modified)

isTopBorderModified

public boolean isTopBorderModified()

setTopBorderModified

public void setTopBorderModified(boolean modified)

isBottomBorderModified

public boolean isBottomBorderModified()

setBottomBorderModified

public void setBottomBorderModified(boolean modified)

isTopLeftBottomRightBorderModified

public boolean isTopLeftBottomRightBorderModified()

setTopLeftBottomRightBorderModified

public void setTopLeftBottomRightBorderModified(boolean modified)

isBottomLeftTopRightBorderModified

public boolean isBottomLeftTopRightBorderModified()

setBottomLeftTopRightBorderModified

public void setBottomLeftTopRightBorderModified(boolean modified)

isPatternStyleModified

public boolean isPatternStyleModified()

setPatternStyleModified

public void setPatternStyleModified(boolean modified)

isPatternColorModified

public boolean isPatternColorModified()

setPatternColorModified

public void setPatternColorModified(boolean modified)

isPatternBackgroundColorModified

public boolean isPatternBackgroundColorModified()

setPatternBackgroundColorModified

public void setPatternBackgroundColorModified(boolean modified)

getParsedExpression1

public Ptg[] getParsedExpression1()
get the stack of the 1st expression as a list

Returns:
list of tokens (casts stack to a list and returns it!) this method can return null is we are unable to create Ptgs from existing excel file callers should check for null!

getParsedExpression2

public Ptg[] getParsedExpression2()
get the stack of the 2nd expression as a list

Returns:
list of tokens (casts stack to a list and returns it!) this method can return null is we are unable to create Ptgs from existing excel file callers should check for null!

validateSid

protected void validateSid(short id)
called by constructor, should throw runtime exception in the event of a record passed with a differing ID.

Specified by:
validateSid in class Record
Parameters:
id - alleged id for this record

getSid

public short getSid()
Description copied from class: Record
return the non static version of the id for this record.

Specified by:
getSid in class Record

serialize

public int serialize(int pOffset,
                     byte[] data)
called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.

Specified by:
serialize in class Record
Parameters:
offset - to begin writing at
data - byte array containing instance data
Returns:
number of bytes written

getRecordSize

public int getRecordSize()
Description copied from class: Record
gives the current serialized size of the record. Should include the sid and reclength (4 bytes).

Overrides:
getRecordSize in class Record

toString

public java.lang.String toString()
Description copied from class: Record
get a string representation of the record (for biffview/debugging)

Overrides:
toString in class Record

clone

public java.lang.Object clone()
Overrides:
clone in class Record


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