scuffed-code/tools/unicodetools/com/ibm/text/UCD/Default.java

46 lines
1.4 KiB
Java
Raw Normal View History

package com.ibm.text.UCD;
import com.ibm.text.utility.*;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
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();
}
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())));
}
2003-03-12 16:01:26 +00:00
static DateFormat myDateFormat = new SimpleDateFormat("yyyy-MM-dd', 'HH:mm:ss' GMT'");
static {
myDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
}
public static String getDate() {
return myDateFormat.format(new Date());
}
}