| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.poi.ss.format.CellFormatPart
public class CellFormatPart
Objects of this class represent a single part of a cell format expression. Each cell can have up to four of these for positive, zero, negative, and text values.
Each format part can contain a color, a condition, and will always contain a format specification. For example "[Red][>=10]#" has a color ([Red]), a condition (>=10) and a format specification (#).
This class also contains patterns for matching the subparts of format specification. These are used internally, but are made public in case other code has use for them.
| Field Summary | |
|---|---|
| static int | COLOR_GROUPWithin FORMAT_PAT, the group number for the matched color. | 
| static java.util.regex.Pattern | COLOR_PATPattern for the color part of a cell format part. | 
| static int | CONDITION_OPERATOR_GROUPWithin FORMAT_PAT, the group number for the operator in the
 condition. | 
| static java.util.regex.Pattern | CONDITION_PATPattern for the condition part of a cell format part. | 
| static int | CONDITION_VALUE_GROUPWithin FORMAT_PAT, the group number for the value in the
 condition. | 
| static java.util.regex.Pattern | CURRENCY_PATPattern for the currency symbol part of a cell format part | 
| static java.util.regex.Pattern | FORMAT_PATPattern for an entire cell single part. | 
| static int | SPECIFICATION_GROUPWithin FORMAT_PAT, the group number for the format
 specification. | 
| static java.util.regex.Pattern | SPECIFICATION_PATPattern for the format specification part of a cell format part. | 
| Constructor Summary | |
|---|---|
| CellFormatPart(java.util.Locale locale,
               java.lang.String desc)Create an object to represent a format part. | |
| CellFormatPart(java.lang.String desc)Create an object to represent a format part. | |
| Method Summary | |
|---|---|
|  boolean | applies(java.lang.Object valueObject)Returns true if this format part applies to the given value. | 
|  CellFormatResult | apply(javax.swing.JLabel label,
      java.lang.Object value)Apply this format part to the given value, applying the result to the given label. | 
|  CellFormatResult | apply(java.lang.Object value)Apply this format part to the given value. | 
| static java.lang.String | group(java.util.regex.Matcher m,
      int g)Returns the string from the group, or "" if the group is null. | 
| static java.lang.StringBuffer | parseFormat(java.lang.String fdesc,
            CellFormatType type,
            org.apache.poi.ss.format.CellFormatPart.PartHandler partHandler) | 
|  java.lang.String | toString() | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.util.regex.Pattern COLOR_PAT
public static final java.util.regex.Pattern CONDITION_PAT
public static final java.util.regex.Pattern SPECIFICATION_PAT
public static final java.util.regex.Pattern CURRENCY_PAT
public static final java.util.regex.Pattern FORMAT_PAT
public static final int COLOR_GROUP
FORMAT_PAT, the group number for the matched color.
public static final int CONDITION_OPERATOR_GROUP
FORMAT_PAT, the group number for the operator in the
 condition.
public static final int CONDITION_VALUE_GROUP
FORMAT_PAT, the group number for the value in the
 condition.
public static final int SPECIFICATION_GROUP
FORMAT_PAT, the group number for the format
 specification.
| Constructor Detail | 
|---|
public CellFormatPart(java.lang.String desc)
desc - The string to parse.
public CellFormatPart(java.util.Locale locale,
                      java.lang.String desc)
locale - The locale to use.desc - The string to parse.| Method Detail | 
|---|
public boolean applies(java.lang.Object valueObject)
valueObject - The value to evaluate.
public CellFormatResult apply(java.lang.Object value)
CellFormatResult object with the results.
value - The value to apply this format part to.
CellFormatResult object containing the results of
         applying the format to the value.
public CellFormatResult apply(javax.swing.JLabel label,
                              java.lang.Object value)
label - The labelvalue - The value to apply this format part to.
public static java.lang.StringBuffer parseFormat(java.lang.String fdesc,
                                                 CellFormatType type,
                                                 org.apache.poi.ss.format.CellFormatPart.PartHandler partHandler)
public static java.lang.String group(java.util.regex.Matcher m,
                                     int g)
m - The matcher.g - The group number.
public java.lang.String toString()
toString in class java.lang.Object| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||