Top Description Inners Fields Constructors Methods
org.apache.poi.ss.format

public Class CellElapsedFormatter

extends CellFormatter
Class Inheritance
Imports
java.util.ArrayList, .Formatter, .List, .ListIterator, .Locale, java.util.regex.Matcher, .Pattern

This class implements printing out an elapsed time format.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class

Field Summary

Modifier and TypeField and Description
private static final double
private static final double
private static final Pattern
private final String
private static final double
private final List<CellElapsedFormatter.TimeSpec>
private CellElapsedFormatter.TimeSpec
Inherited from org.apache.poi.ss.format.CellFormatter:
formatlocale

Constructor Summary

AccessConstructor and Description
public
CellElapsedFormatter(String
The pattern to parse.
pattern
)

Creates an elapsed time formatter.

Method Summary

Modifier and TypeMethod and Description
private CellElapsedFormatter.TimeSpec
assignSpec(char type, int pos, int len)

private static double
factorFor(char type, int len)

public void
formatValue(StringBuffer
The buffer to append to.
toAppendTo
,
Object
The value to format.
value
)

Implements abstract org.apache.poi.ss.format.CellFormatter.formatValue.

Format a value according the format string.

private static double
modFor(char type, int len)

public void
simpleValue(StringBuffer
The buffer to append to.
toAppendTo
,
Object
The value to format.
value
)

Implements abstract org.apache.poi.ss.format.CellFormatter.simpleValue.

Format a value according to the type, in the most basic way.

Inherited from org.apache.poi.ss.format.CellFormatter:
formatquotesimpleFormat

Field Detail

HOUR__FACTORback to summary
private static final double HOUR__FACTOR
MIN__FACTORback to summary
private static final double MIN__FACTOR
PERCENTSback to summary
private static final Pattern PERCENTS
printfFmtback to summary
private final String printfFmt
SEC__FACTORback to summary
private static final double SEC__FACTOR
specsback to summary
private final List<CellElapsedFormatter.TimeSpec> specs
topmostback to summary
private CellElapsedFormatter.TimeSpec topmost

Constructor Detail

CellElapsedFormatterback to summary
public CellElapsedFormatter(String pattern)

Creates an elapsed time formatter.

Parameters
pattern:String

The pattern to parse.

Method Detail

assignSpecback to summary
private CellElapsedFormatter.TimeSpec assignSpec(char type, int pos, int len)
factorForback to summary
private static double factorFor(char type, int len)
formatValueback to summary
public void formatValue(StringBuffer toAppendTo, Object value)

Implements abstract org.apache.poi.ss.format.CellFormatter.formatValue.

Doc from org.apache.poi.ss.format.CellFormatter.formatValue.

Format a value according the format string.

Note

this method must be thread safe! In particular, if it uses a Format instance that is not thread safe, i.e. DateFormat, this method must be synchronized, either on the method, if the format is a final property, or on the format instance itself.

Parameters
toAppendTo:StringBuffer

The buffer to append to.

value:Object

The value to format.

Annotations
@Override
modForback to summary
private static double modFor(char type, int len)
simpleValueback to summary
public void simpleValue(StringBuffer toAppendTo, Object value)

Implements abstract org.apache.poi.ss.format.CellFormatter.simpleValue.

Doc from org.apache.poi.ss.format.CellFormatter.simpleValue.

Format a value according to the type, in the most basic way.

Note

this method must be thread safe! In particular, if it uses a Format instance that is not thread safe, i.e. DateFormat, this method must be synchronized, either on the method, if the format is a final property, or on the format instance itself.

For a date, this is "mm/d/y".

Parameters
toAppendTo:StringBuffer

The buffer to append to.

value:Object

The value to format.

Annotations
@Override
org.apache.poi.ss.format back to summary

private Class CellElapsedFormatter.ElapsedPartHandler

extends Object
implements PartHandler
Class Inheritance
  • java.lang.Object
  • org.apache.poi.ss.format.CellElapsedFormatter.ElapsedPartHandler
All Implemented Interfaces
org.apache.poi.ss.format.CellFormatPart.PartHandler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ElapsedPartHandlerback to summary
private ElapsedPartHandler()

Method Detail

handlePartback to summary
public String handlePart(Matcher m, String part, CellFormatType type, StringBuffer desc)

Implements org.apache.poi.ss.format.CellFormatPart.PartHandler.handlePart.

Annotations
@Override
org.apache.poi.ss.format back to summary

private Class CellElapsedFormatter.TimeSpec

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final double
pack-priv final int
pack-priv double
pack-priv final int
pack-priv final char

Constructor Summary

AccessConstructor and Description
public
TimeSpec(char type, int pos, int len, double factor)

Method Summary

Modifier and TypeMethod and Description
public long
valueFor(double elapsed)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factorback to summary
pack-priv final double factor
lenback to summary
pack-priv final int len
modByback to summary
pack-priv double modBy
posback to summary
pack-priv final int pos
typeback to summary
pack-priv final char type

Constructor Detail

TimeSpecback to summary
public TimeSpec(char type, int pos, int len, double factor)

Method Detail

valueForback to summary
public long valueFor(double elapsed)