|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.util.LaTeXFormatter
public class LaTeXFormatter
Provides methods for formatting times and number for typesetting with LATEX.
Field Summary | |
---|---|
static String |
DEFAULTMATHENSURINGCMD
Default math-ensuring command, ensuremath. |
static String |
DEFAULTNAN
Default string for representing NaN, --. |
Constructor Summary | |
---|---|
LaTeXFormatter()
|
|
LaTeXFormatter(Appendable out)
|
|
LaTeXFormatter(Appendable out,
Locale locale)
|
|
LaTeXFormatter(File file)
|
|
LaTeXFormatter(File file,
Locale locale)
|
|
LaTeXFormatter(File file,
String csn)
|
|
LaTeXFormatter(File file,
String csn,
Locale locale)
|
|
LaTeXFormatter(Locale locale)
|
|
LaTeXFormatter(OutputStream os)
|
|
LaTeXFormatter(OutputStream os,
Locale locale)
|
|
LaTeXFormatter(OutputStream os,
String csn)
|
|
LaTeXFormatter(OutputStream os,
String csn,
Locale locale)
|
|
LaTeXFormatter(PrintStream ps)
|
|
LaTeXFormatter(PrintStream ps,
Locale locale)
|
|
LaTeXFormatter(String fileName)
|
|
LaTeXFormatter(String fileName,
Locale locale)
|
|
LaTeXFormatter(String fileName,
String csn)
|
|
LaTeXFormatter(String fileName,
String csn,
Locale locale)
|
Method Summary | |
---|---|
LaTeXFormatter |
append(char c)
|
LaTeXFormatter |
append(CharSequence csq)
|
LaTeXFormatter |
append(CharSequence csq,
int start,
int end)
|
void |
close()
|
static String |
fixGroupingAndDecimal(NumberFormat nf,
String str)
Fixes groupings of the string str formatted by the number formatter nf, for LATEX compatibility. |
static String |
fixScientific(String str,
String mathEnsuringCmd)
Converts the string str using Java scientific notation to LATEX notation. |
void |
flush()
|
LaTeXFormatter |
formatFixed(double x)
|
LaTeXFormatter |
formatFixed(int precision,
double x)
Formats the given double-precision number x to a string with a fixed number precision of decimal digits, for the locale locale. |
LaTeXFormatter |
formatInteger(int precision,
long x)
Formats the integer x for the locale locale with at least precision digits. |
LaTeXFormatter |
formatInteger(long x)
|
LaTeXFormatter |
formatNumber(double x)
|
LaTeXFormatter |
formatNumber(int precision,
double x)
Formats the given number x for the locale locale, with precision significant digits. |
LaTeXFormatter |
formatNumber(int digitsSmall,
int digitsLarge,
double x)
Formats x with digitsSmall significant digits if it is smaller than 1, and digitsLarge significant digits if it is larger than 1. |
LaTeXFormatter |
formatScientific(double x)
|
LaTeXFormatter |
formatScientific(int precision,
double x)
Formats the double-precision value x into a string with the scientific notation for the locale locale, with precision decimal digits of precision. |
LaTeXFormatter |
formatTime(double time)
Formats a string representing the time duration time, given in seconds. |
static NumberFormat |
getFixedFormatter(Locale locale,
int precision,
boolean grouping)
|
static NumberFormat |
getIntegerFormatter(Locale locale,
int precision,
boolean grouping)
|
String |
getMathEnsuringCmd()
|
String |
getNanString()
|
static DecimalFormat |
getScientificFormatter(Locale locale,
int precision,
boolean showAllDecimals)
|
IOException |
ioException()
|
boolean |
isGroupingUsed()
|
Locale |
locale()
|
Appendable |
out()
|
static String |
processInfiniteAndNaN(double x,
String mathEnsuringCmd,
String nanString)
Returns a string representing infinite or NaN for x, or null if x is finite. |
void |
setGroupingUsed(boolean grouping)
|
void |
setLocale(Locale locale)
|
void |
setMathEnsuringCmd(String mathEnsuringCmd)
|
void |
setNanString(String nanString)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULTMATHENSURINGCMD
public static final String DEFAULTNAN
Constructor Detail |
---|
public LaTeXFormatter()
public LaTeXFormatter(Locale locale)
public LaTeXFormatter(Appendable out)
public LaTeXFormatter(Appendable out, Locale locale)
public LaTeXFormatter(File file) throws IOException
IOException
public LaTeXFormatter(File file, String csn) throws IOException
IOException
public LaTeXFormatter(File file, Locale locale) throws IOException
IOException
public LaTeXFormatter(File file, String csn, Locale locale) throws IOException
IOException
public LaTeXFormatter(OutputStream os) throws IOException
IOException
public LaTeXFormatter(OutputStream os, String csn) throws IOException
IOException
public LaTeXFormatter(OutputStream os, Locale locale) throws IOException
IOException
public LaTeXFormatter(OutputStream os, String csn, Locale locale) throws IOException
IOException
public LaTeXFormatter(String fileName) throws IOException
IOException
public LaTeXFormatter(String fileName, String csn) throws IOException
IOException
public LaTeXFormatter(String fileName, Locale locale) throws IOException
IOException
public LaTeXFormatter(String fileName, String csn, Locale locale) throws IOException
IOException
public LaTeXFormatter(PrintStream ps)
public LaTeXFormatter(PrintStream ps, Locale locale)
Method Detail |
---|
public IOException ioException()
public Appendable out()
public Locale locale()
public void setLocale(Locale locale)
public String getMathEnsuringCmd()
public void setMathEnsuringCmd(String mathEnsuringCmd)
public String getNanString()
public void setNanString(String nanString)
public boolean isGroupingUsed()
public void setGroupingUsed(boolean grouping)
public void flush()
flush
in interface Flushable
public void close()
close
in interface Closeable
public String toString()
toString
in class Object
public LaTeXFormatter formatTime(double time)
time
- the time to be formatted.
public LaTeXFormatter formatInteger(long x)
public LaTeXFormatter formatInteger(int precision, long x)
precision
- the minimal number of digits.x
- the integer being formatted.
IllegalArgumentException
- if precision is negative.public static NumberFormat getIntegerFormatter(Locale locale, int precision, boolean grouping)
public LaTeXFormatter formatFixed(double x)
public LaTeXFormatter formatFixed(int precision, double x)
precision
- the number of decimal digits.x
- the number being formatted.
IllegalArgumentException
- if precision is negative.public static NumberFormat getFixedFormatter(Locale locale, int precision, boolean grouping)
public LaTeXFormatter formatScientific(double x)
public LaTeXFormatter formatScientific(int precision, double x)
precision
- the number of decimal digits.x
- the value being formatted.
IllegalArgumentException
- if precision is negative.public static DecimalFormat getScientificFormatter(Locale locale, int precision, boolean showAllDecimals)
public LaTeXFormatter formatNumber(double x)
public LaTeXFormatter formatNumber(int precision, double x)
precision
- the number of significant digits.x
- the value being formatted.
IllegalArgumentException
- if precision is negative or 0.public LaTeXFormatter formatNumber(int digitsSmall, int digitsLarge, double x)
formatFixed(int,double)
with 0 decimal digit of precision. If
x < 10-d2, the formatter uses formatScientific(double)
with d2 digits
of precision. Otherwise, the formatter uses
formatNumber(int,int,double)
with d1 or
d2 significant digits, depending if | x| is smaller than or equal to
1, or greater than 1.
digitsSmall
- the number of significant digits for small numbers.digitsLarge
- the number of significant digits for large numbers.x
- the value to be formatted.
public static String processInfiniteAndNaN(double x, String mathEnsuringCmd, String nanString)
double)
,
double)
, and
int, double)
.
x
- the number being processed.mathEnsuringCmd
- the math-ensuring command.nanString
- the string representing NaN.
public static String fixGroupingAndDecimal(NumberFormat nf, String str)
str
- the string to fix.nf
- the number formatter having formatted the string.
public static String fixScientific(String str, String mathEnsuringCmd)
str
- the string being fixed.mathEnsuringCmd
- the math-ensuring LATEX command.
public LaTeXFormatter append(char c)
append
in interface Appendable
public LaTeXFormatter append(CharSequence csq, int start, int end)
append
in interface Appendable
public LaTeXFormatter append(CharSequence csq)
append
in interface Appendable
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |