swisseph
クラス Extlib

java.lang.Object
  上位を拡張 swisseph.Extlib
すべての実装されたインタフェース:
java.io.Serializable

public class Extlib
extends java.lang.Object
implements java.io.Serializable

Some supportive methods, mainly for internationalization. These methods are not available in the original Swiss Ephemeris package.

関連項目:
直列化された形式

コンストラクタの概要
Extlib()
          This class contains some additional method not contained in the original Swiss Ephemeris package.
 
メソッドの概要
 java.text.SimpleDateFormat createLocDateTimeFormatter(java.lang.String locString, boolean force24h)
          Creates a localized date time formatter suitable for tabular output with 4 digit years and UTC timezone.
 java.lang.String getDecimalSeparator(java.text.NumberFormat nf)
          Returns the decimal separator of the NumberFormat
 java.util.Locale getLocale(java.lang.String locString)
          Returns the requested locale from a locale string.
 java.lang.String[] getLocales()
          This method returns all available locale strings
 java.lang.String getNormalizedDatePattern(java.lang.String pattern, boolean force24h)
          Ensures a date pattern with four letter year, two letter month and day and 24h time format, if requested.
 int getPatternLastIdx(java.lang.String pattern, java.lang.String what, java.text.SimpleDateFormat dof)
          Returns the index in the formatter pattern of the given pattern 'what' recalculated to the APPLIED pattern of the formatter.
static void main(java.lang.String[] argv)
          This method is for debugging purposes only.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Extlib

public Extlib()
This class contains some additional method not contained in the original Swiss Ephemeris package. Currently, these methods deal with internationalization primarily.

メソッドの詳細

main

public static void main(java.lang.String[] argv)
This method is for debugging purposes only.


getLocales

public java.lang.String[] getLocales()
This method returns all available locale strings


getLocale

public java.util.Locale getLocale(java.lang.String locString)
Returns the requested locale from a locale string.

パラメータ:
locString - A String describing the locale as a two letter language code, a two letter language code plus a "_" plus a two letter country code, or null or the empty string. Null or the empty string will return the default locale, all others will return the requested locale.
戻り値:
The locale

createLocDateTimeFormatter

public java.text.SimpleDateFormat createLocDateTimeFormatter(java.lang.String locString,
                                                             boolean force24h)
Creates a localized date time formatter suitable for tabular output with 4 digit years and UTC timezone. You will format dates like this:

    SimpleDateFormat sdf = createLocDateTimeFormatter("da_DK", true);
   SweDate sd = new SweDate(2005,3,27);
   //...
   System.out.println(sdf.format(sd.getDate(0)));

Years B.C. will be prefixed by a "-". Years are counted including year "0", which differs from normal DateFormat output.

パラメータ:
locString - The input locale for which this date time format should be created. See getLocale() for more infos.
戻り値:
The normalized form of the DateFormat.

getNormalizedDatePattern

public java.lang.String getNormalizedDatePattern(java.lang.String pattern,
                                                 boolean force24h)
Ensures a date pattern with four letter year, two letter month and day and 24h time format, if requested.


getDecimalSeparator

public java.lang.String getDecimalSeparator(java.text.NumberFormat nf)
Returns the decimal separator of the NumberFormat


getPatternLastIdx

public int getPatternLastIdx(java.lang.String pattern,
                             java.lang.String what,
                             java.text.SimpleDateFormat dof)
Returns the index in the formatter pattern of the given pattern 'what' recalculated to the APPLIED pattern of the formatter. E.g. for locale zh_HK the pattern is: yyyy'?エ'MM'孫?dd'茸? ahh:mm:ss The index of 'ss' would NOT be 25, which we would get when simply counting in the pattern string, but rather 20, when counting in the resulting string.