abstractpublic class Formulas extends WeakBase implements XAddIn,XServiceName,XServiceInfo(Code)
Base class for methods to export as formulas in the
OpenOffice spread sheet.
since: 2.2 version: $Id: Formulas.java 27862 2007-11-12 19:51:19Z desruisseaux $ author: Martin Desruisseaux
Field Summary
final protected static long
DAY_TO_MILLIS Factor for conversions of days to milliseconds.
toDate(XPropertySet xOptions, double time) Converts a date from a spreadsheet value to a Java
java.util.Date object.
The timezone is the one specified during the last invocation of
Formulas.setTimeZone .
Parameters: xOptions - Provided by OpenOffice. Parameters: time - The spreadsheet numerical value for a date, by default in the local timezone.
The string to returns when a formula don't have any value to return.
getArgumentDescription
publicString getArgumentDescription(String function, int argument)(Code)
Returns the description of the specified argument. The argument description is
shown to the user when prompting for arguments. It may be translated to the
.
Parameters: function - The exact name of a method within its interface. Parameters: argument - The index of the argument (0-based). The description of the specified argument.
getDisplayArgumentName
publicString getDisplayArgumentName(String function, int argument)(Code)
Returns the user-visible name of the specified argument. The argument name is
shown to the user when prompting for arguments. It should be a single word and
may be translated to the
.
Parameters: function - The exact name of a method within its interface. Parameters: argument - The index of the argument (0-based). The user-visible name of the specified argument.
Returns the user-visible name of the category the function belongs to.
This is used when category names are shown to the user.
Parameters: function - The exact name of a method within its interface. The user-visible category name the specified function belongs to.
Returns the user-visible function name for an internal name.
The user-visible name of a function is the name shown to the user.
It may be translated to the
,
so it is never stored in files. It should be a single word and is used
when entering or displaying formulas.
Parameters: function - The exact name of a method within its interface. The user-visible name of the specified function.
Returns the spreadsheet epoch. The timezone is the one specified during the
last invocation of
Formulas.setTimeZone . The epoch is used for date conversions
as in
Formulas.toDate .
Parameters: xOptions - Provided by OpenOffice. The spreedsheet epoch, always as a new Java Date object.
getFailure
protected static double[][] getFailure(int rows, int cols)(Code)
Returns a table filled with
Double.NaN NaN values. This method is invoked when
an operation failed for a whole table.
since: 2.3
Returns the description of a function. The description is shown to the user
when selecting functions. It may be translated to the
.
Parameters: function - The exact name of a method within its interface. The description of the specified function.
Returns the minimal length of the specified arrays. In the special case where one array
has a length of 1, we assume that this single element will be repeated for all elements
in the other array.
Returns the localized message from the specified exception. If no message is available,
returns a default string. This method never returns a null value.
Returns the logger to use for logging warnings. The default implementation returns the
org.geotools.openoffice logger. Subclasses should override this method if they
want to use a different logger.
Returns the programmatic name of the category the function belongs to.
The category name is used to group similar functions together. The programmatic
category name should always be in English, it is never shown to the user. It
is usually one of the names listed in
com.sun.star.sheet.XAddIn interface.
Parameters: function - The exact name of a method within its interface. The category name the specified function belongs to.
Returns the internal function name for an user-visible name. The user-visible
name of a function is the name shown to the user. It may be translated to the
, so it is never stored in files. It
should be a single word and is used when entering or displaying formulas.
Attention: The method name contains a spelling error. Due to compatibility
reasons the name cannot be changed.
Parameters: display - The user-visible name of a function. The exact name of the method within its interface.
The service name that can be used to create such an object by a factory.
This is defined as a field in the subclass with exactly the following signature:
Reports an exception. This is used if an exception occured in a method which can't returns
a
String object. This method log the stack trace at the FINE level. We don't use
the WARNING level since this is not a program disfunction; the failure is probably caused
by wrong user-specified parameters.
Converts a date from a spreadsheet value to a Java
java.util.Date object.
The timezone is the one specified during the last invocation of
Formulas.setTimeZone .
Parameters: xOptions - Provided by OpenOffice. Parameters: time - The spreadsheet numerical value for a date, by default in the local timezone. The date as a Java object.
Converts a date from a Java
java.util.Date object to a spreadsheet value.
The timezone is the one specified during the last invocation of
Formulas.setTimeZone .