|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetcharts.pro.common.NFBaseClass
netcharts.pro.common.NFFormat
public class NFFormat
Provides formatting for data-derived labels found in axes and popup data labels, If the format type is INTEGER or FLOAT, the input data value is expected to be of type integer or float and will be parsed as such (if string conversion is necessary). The format itself is a C-language style sprintf format. Some examples:
Data Type Format Output 1000 INTEGER %d 1000 1000 INTEGER $,%d $1,000 1000 INTEGER %d% 1000% 1000 FLOAT %f 1000.0 1000 FLOAT %.2f 1000.00 1000 FLOAT $,.2f $1,000.00If the format type is SIMPLEDATE, the format syntax is consistent with those defined in the Java SimpleDateFormat spec. If the format type is DECIMAL, the format syntax is consistent with those defined in the Java DecimalFormat spec. If the format type is DATE, the format expression may include any of the following elements:
Element Result %L standard Java locale format ('Mon Jan 01 00:00:00 1996') %G standard Java GMT format ('1 Jan 1996 00:00:00 GMT') %Y year as YYYY (1900+) %y year as YY (00-99) %M month as MM (01-12) %N long month name ("January", "February", ...) %n short month name ("Jan", "Feb", ...) %W long weekday name ("Sunday", "Monday", ...) %w short weekday name ("Sun", "Mon", ...) %d day of month as DD (01-31) %h hour as HH (00-23) %m minute as MM (00-59) %s second as SS (00-59)Details on formats can be found in the NetCharts documentation in the Axis section.
Field Summary | |
---|---|
static int |
DATE
Date format |
static int |
DECIMAL
Decimal format |
static int |
FLOAT
Floating point format |
static java.util.Hashtable |
formatTypeMap
The set of allowed format types. |
static int |
INTEGER
Integer format |
static int |
NONE
No format |
static int |
SIMPLEDATE
Simple Date format |
Constructor Summary | |
---|---|
NFFormat()
Constructs a default format object |
|
NFFormat(int formatType,
java.lang.String format)
Constructs a format object with the given type and expression |
Method Summary | |
---|---|
java.lang.String |
getCDL()
Generate CDL parameters representing this format |
void |
getCDL(java.lang.StringBuffer sb)
Append CDL parameters representing this format to the given StringBuffer. |
void |
getCDL(java.lang.StringBuffer sb,
boolean includeParens)
Append CDL parameters representing this format to the given StringBuffer. |
java.lang.String |
getFormat()
Gets the format expression. |
int |
getFormatType()
Gets the type of format |
java.util.Date |
getTimeBase()
Gets the time base. |
NFTimeUnit |
getTimeUnit()
Gets the time unit. |
void |
setCDL(java.lang.Object cdlObject)
Configures this object from a CDL parameter object. |
void |
setCDL(java.lang.String cdl)
Configures this object from a CDL parameter representation. |
void |
setCDL(java.lang.String[] elements)
Configures this object from a CDL parameter representation. |
void |
setFormat(java.lang.String format)
Sets the format expression. |
void |
setFormatType(int formatType)
Sets the type of format. |
void |
setTimeBase(java.util.Date timeBase)
Sets the time base. |
void |
setTimeUnit(NFTimeUnit timeUnit)
Sets the time unit. |
java.lang.String |
toString()
Returns a new String object representing this format. |
Methods inherited from class netcharts.pro.common.NFBaseClass |
---|
clone, getModified, getUserObject, setModified, setUserObject |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NONE
public static final int INTEGER
public static final int FLOAT
public static final int DATE
public static final int SIMPLEDATE
public static final int DECIMAL
public static java.util.Hashtable formatTypeMap
NONE, INTEGER, FLOAT, DATE, SIMPLEDATE, DECIMAL
.
Constructor Detail |
---|
public NFFormat()
public NFFormat(int formatType, java.lang.String format)
formatType
- One of NONE, INTEGER, FLOAT, DATE, SIMPLEDATE
format
- A format expressionMethod Detail |
---|
public void setFormatType(int formatType)
If the value passed is not a valid format type an IllegalArgumentException will be thrown.
formatType
- One of NONE, INTEGER, FLOAT, DATE, SIMPLEDATE, DECIMAL
public int getFormatType()
NONE, INTEGER, FLOAT, DATE, SIMPLEDATE, DECIMAL
or
INTEGER
if not set.public void setFormat(java.lang.String format)
format
- See documentation above or NetCharts documentation
on specific formats.public java.lang.String getFormat()
public void setTimeBase(java.util.Date timeBase)
timeBase
- public java.util.Date getTimeBase()
public void setTimeUnit(NFTimeUnit timeUnit)
timeUnit
- public NFTimeUnit getTimeUnit()
public void setCDL(java.lang.Object cdlObject)
cdlObject
- CDL in a String form or in a user object.public void setCDL(java.lang.String cdl)
setCDL
in interface NFCDLGenerator
cdl
- CDL in the form: (formatType, formatExpression, "timeBase", "timeunit")
public void setCDL(java.lang.String[] elements)
cdl
- CDL in the form: (formatType, formatExpression, "timeBase", "timeunit")
public java.lang.String getCDL()
getCDL
in interface NFCDLGenerator
(formatType, formatExpression, "timebase", "timeunit")
public void getCDL(java.lang.StringBuffer sb)
sb
- Target buffer to append the CDL parameterspublic void getCDL(java.lang.StringBuffer sb, boolean includeParens)
sb
- Target buffer to append the CDL parametersincludeParens
- Whether to surround the param with parenthesespublic java.lang.String toString()
toString
in interface NFCDLGenerator
toString
in class java.lang.Object
|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2011 |
Last Modified: Jun 28, 2011 |