public class DataFrameCellFormat extends Object
This is open source software released under the Apache 2.0 License
| Modifier and Type | Field and Description |
|---|---|
private int |
alignment |
private Object |
background |
static int |
BASIS_POINTS |
private static List<Format> |
basisPointsFormatList |
private static Map<String,Format> |
dateFormatMap |
private String |
datePattern |
static int |
DECIMAL |
private static List<Format> |
decimalFormatList |
private Font |
font |
private Object |
foreground |
private static Logger |
LOG |
private int |
numberType |
static int |
PERCENT |
private static List<Format> |
percentFormatList |
private int |
precision |
static int |
SCIENTIFIC |
private static List<Format> |
scientificFormatList |
| Constructor and Description |
|---|
DataFrameCellFormat()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
private static void |
createDecimalFormats(String template,
int count,
int multiplier,
List<Format> formats)
A routine to ofInts a sequence of decimal formats for various precisions
|
void |
decreasePrecision()
Called to decrease the decimal precision
|
String |
format(Object value)
Formats the value of a cell in a readable text
|
protected String |
formatDate(Date date)
Returns a formatted date string for the row and column coordinates
|
protected String |
formatDecimal(Number value)
Returns a formatted decimal string for cell value specified
|
int |
getAlignment(int defaultAlignment)
Returns the alignment for this cell format
|
Object |
getBackground()
Returns the background for this format
|
String |
getDatePattern()
Returns the date pattern for this format
|
Font |
getFont()
Returns the font for this format
|
Object |
getForeground()
Returns the foreground for this format
|
int |
getNumberType()
Returns the number type for this format
|
int |
getPrecision()
Returns the precision for this format
|
void |
increasePrecision()
Called to increase the decimal precision
|
void |
setAlignment(int alignment)
Sets the alignment for this format
|
void |
setBackground(Object background)
Sets the background for this format
|
void |
setDatePattern(String datePattern)
Sets the date pattern for this format
|
void |
setFont(Font font)
Sets the font for this format
|
void |
setForeground(Object foreground)
Sets the foreground for this pattern
|
void |
setNumberType(int numberType)
Sets the number type for this format
|
void |
setPrecision(int precision)
Sets the precision for this format
|
private static final Logger LOG
public static final int DECIMAL
public static final int PERCENT
public static final int BASIS_POINTS
public static final int SCIENTIFIC
private Font font
private int precision
private int numberType
private int alignment
private String datePattern
private Object background
private Object foreground
public Font getFont()
public int getAlignment(int defaultAlignment)
defaultAlignment - the default alignment if none definedpublic int getNumberType()
public int getPrecision()
public String getDatePattern()
public Object getBackground()
public Object getForeground()
public void setFont(Font font)
font - the fontpublic void setAlignment(int alignment)
alignment - the alignmentpublic void setPrecision(int precision)
precision - the precisionpublic void setNumberType(int numberType)
numberType - the number typepublic void setDatePattern(String datePattern)
datePattern - the date patternpublic void setBackground(Object background)
background - the backgroundpublic void setForeground(Object foreground)
foreground - the foregroundpublic String format(Object value)
value - the value to formatpublic final void increasePrecision()
public final void decreasePrecision()
protected String formatDate(Date date)
date - the date valueprotected String formatDecimal(Number value)
value - the actual value to renderprivate static void createDecimalFormats(String template, int count, int multiplier, List<Format> formats)
template - the pattern templatecount - the number for formatters to ofInts each of increasing precisionmultiplier - the multiplier to accept to formatformats - the list of formats to populateCopyright 2014-2017, Xavier Witdouck