2002-07-14 22:07:00 +00:00
|
|
|
package com.ibm.text.UCD;
|
|
|
|
import com.ibm.text.utility.*;
|
|
|
|
import java.util.Date;
|
2002-07-30 09:57:18 +00:00
|
|
|
import java.text.DateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.TimeZone;
|
|
|
|
|
2002-07-14 22:07:00 +00:00
|
|
|
|
|
|
|
public final class Default implements UCD_Types {
|
|
|
|
|
|
|
|
public static String ucdVersion = UCD.latestVersion;
|
|
|
|
public static UCD ucd;
|
|
|
|
public static Normalizer nfc;
|
|
|
|
public static Normalizer nfd;
|
|
|
|
public static Normalizer nfkc;
|
|
|
|
public static Normalizer nfkd;
|
|
|
|
public static Normalizer[] nf = new Normalizer[4];
|
|
|
|
|
2003-03-15 02:36:49 +00:00
|
|
|
public static void ensureUCD() {
|
|
|
|
if (ucd == null) setUCD();
|
|
|
|
}
|
|
|
|
|
2002-07-14 22:07:00 +00:00
|
|
|
public static void setUCD(String version) {
|
|
|
|
ucdVersion = version;
|
|
|
|
setUCD();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setUCD() {
|
|
|
|
ucd = UCD.make(ucdVersion);
|
|
|
|
nfd = nf[NFD] = new Normalizer(Normalizer.NFD, ucdVersion);
|
|
|
|
nfc = nf[NFC] = new Normalizer(Normalizer.NFC, ucdVersion);
|
|
|
|
nfkd = nf[NFKD] = new Normalizer(Normalizer.NFKD, ucdVersion);
|
|
|
|
nfkc = nf[NFKC] = new Normalizer(Normalizer.NFKC, ucdVersion);
|
|
|
|
System.out.println("Loaded UCD" + ucd.getVersion() + " " + (new Date(ucd.getDate())));
|
|
|
|
}
|
2002-07-30 09:57:18 +00:00
|
|
|
|
2003-03-12 16:01:26 +00:00
|
|
|
static DateFormat myDateFormat = new SimpleDateFormat("yyyy-MM-dd', 'HH:mm:ss' GMT'");
|
2002-07-30 09:57:18 +00:00
|
|
|
static {
|
|
|
|
myDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String getDate() {
|
|
|
|
return myDateFormat.format(new Date());
|
|
|
|
}
|
2002-07-14 22:07:00 +00:00
|
|
|
|
|
|
|
}
|