ICU-4907 modifications for eclipse/1.3/foundation compatibility
X-SVN-Rev: 18966
This commit is contained in:
parent
cb74cd1d83
commit
52f3fe2636
@ -1,6 +1,6 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2004-2005, International Business Machines Corporation and *
|
||||
* Copyright (C) 2004-2006, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
@ -67,15 +67,15 @@ public class GatherAPIData {
|
||||
return 2;
|
||||
} else if (option.equals("-output")) {
|
||||
return 2;
|
||||
} else if (option.equals("-base")) {
|
||||
return 2;
|
||||
} else if (option.equals("-filter")) {
|
||||
return 2;
|
||||
} else if (option.equals("-zip")) {
|
||||
return 1;
|
||||
} else if (option.equals("-gzip")) {
|
||||
return 1;
|
||||
}
|
||||
} else if (option.equals("-base")) {
|
||||
return 2;
|
||||
} else if (option.equals("-filter")) {
|
||||
return 2;
|
||||
} else if (option.equals("-zip")) {
|
||||
return 1;
|
||||
} else if (option.equals("-gzip")) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -94,14 +94,14 @@ public class GatherAPIData {
|
||||
} else if (opt.equals("-output")) {
|
||||
this.output = options[i][1];
|
||||
} else if (opt.equals("-base")) {
|
||||
this.base = options[i][1]; // should not include '.'
|
||||
} else if (opt.equals("-filter")) {
|
||||
this.filter = options[i][1];
|
||||
} else if (opt.equals("-zip")) {
|
||||
this.zip = true;
|
||||
} else if (opt.equals("-gzip")) {
|
||||
this.gzip = true;
|
||||
}
|
||||
this.base = options[i][1]; // should not include '.'
|
||||
} else if (opt.equals("-filter")) {
|
||||
this.filter = options[i][1];
|
||||
} else if (opt.equals("-zip")) {
|
||||
this.zip = true;
|
||||
} else if (opt.equals("-gzip")) {
|
||||
this.gzip = true;
|
||||
}
|
||||
}
|
||||
|
||||
results = new TreeSet(APIInfo.defaultComparator());
|
||||
@ -113,15 +113,15 @@ public class GatherAPIData {
|
||||
OutputStream os = System.out;
|
||||
if (output != null) {
|
||||
try {
|
||||
if (zip) {
|
||||
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(output + ".zip"));
|
||||
zos.putNextEntry(new ZipEntry(output));
|
||||
os = zos;
|
||||
} else if (gzip) {
|
||||
os = new GZIPOutputStream(new FileOutputStream(output + ".gz"));
|
||||
} else {
|
||||
os = new FileOutputStream(output);
|
||||
}
|
||||
if (zip) {
|
||||
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(output + ".zip"));
|
||||
zos.putNextEntry(new ZipEntry(output));
|
||||
os = zos;
|
||||
} else if (gzip) {
|
||||
os = new GZIPOutputStream(new FileOutputStream(output + ".gz"));
|
||||
} else {
|
||||
os = new FileOutputStream(output);
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
RuntimeException re = new RuntimeException(e.getMessage());
|
||||
@ -135,16 +135,16 @@ public class GatherAPIData {
|
||||
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");
|
||||
bw = new BufferedWriter(osw);
|
||||
|
||||
// writing data file
|
||||
bw.write(String.valueOf(APIInfo.VERSION) + APIInfo.SEP); // header version
|
||||
bw.write(srcName + APIInfo.SEP); // source name
|
||||
bw.write((base == null ? "" : base) + APIInfo.SEP); // base
|
||||
bw.newLine();
|
||||
writeResults(results, bw);
|
||||
bw.close(); // should flush, close all, etc
|
||||
// if (zip) {
|
||||
// ((ZipOutputStream)os).finish();
|
||||
// }
|
||||
// writing data file
|
||||
bw.write(String.valueOf(APIInfo.VERSION) + APIInfo.SEP); // header version
|
||||
bw.write(srcName + APIInfo.SEP); // source name
|
||||
bw.write((base == null ? "" : base) + APIInfo.SEP); // base
|
||||
bw.newLine();
|
||||
writeResults(results, bw);
|
||||
bw.close(); // should flush, close all, etc
|
||||
// if (zip) {
|
||||
// ((ZipOutputStream)os).finish();
|
||||
// }
|
||||
} catch (IOException e) {
|
||||
try { bw.close(); } catch (IOException e2) {}
|
||||
RuntimeException re = new RuntimeException("write error: " + e.getMessage());
|
||||
@ -174,17 +174,19 @@ public class GatherAPIData {
|
||||
doDocs(cdoc.innerClasses());
|
||||
}
|
||||
|
||||
APIInfo info = createInfo(doc);
|
||||
if (info != null) {
|
||||
results.add(info);
|
||||
}
|
||||
APIInfo info = createInfo(doc);
|
||||
if (info != null) {
|
||||
results.add(info);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean ignore(ProgramElementDoc doc) {
|
||||
if (doc == null) return true;
|
||||
if (doc.isPrivate() || doc.isPackagePrivate()) return true;
|
||||
if (doc instanceof ConstructorDoc && ((ConstructorDoc)doc).isSynthetic()) return true;
|
||||
if (doc.qualifiedName().indexOf(".misc") != -1) { System.out.println("misc: " + doc.qualifiedName()); return true; }
|
||||
if (doc.qualifiedName().indexOf(".misc") != -1) {
|
||||
System.out.println("misc: " + doc.qualifiedName()); return true;
|
||||
}
|
||||
Tag[] tags = doc.tags();
|
||||
for (int i = 0; i < tags.length; ++i) {
|
||||
if (tagKindIndex(tags[i].kind()) == INTERNAL) return true;
|
||||
@ -197,130 +199,131 @@ public class GatherAPIData {
|
||||
Iterator iter = c.iterator();
|
||||
while (iter.hasNext()) {
|
||||
APIInfo info = (APIInfo)iter.next();
|
||||
info.writeln(w);
|
||||
info.writeln(w);
|
||||
}
|
||||
}
|
||||
|
||||
private String trimBase(String arg) {
|
||||
if (base != null) {
|
||||
for (int n = arg.indexOf(base); n != -1; n = arg.indexOf(base, n)) {
|
||||
arg = arg.substring(0, n) + arg.substring(n+base.length());
|
||||
if (base != null) {
|
||||
for (int n = arg.indexOf(base); n != -1; n = arg.indexOf(base, n)) {
|
||||
arg = arg.substring(0, n) + arg.substring(n+base.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
return arg;
|
||||
return arg;
|
||||
}
|
||||
|
||||
public APIInfo createInfo(ProgramElementDoc doc) {
|
||||
|
||||
// Doc. name
|
||||
// Doc. isField, isMethod, isConstructor, isClass, isInterface
|
||||
// ProgramElementDoc. containingClass, containingPackage
|
||||
// ProgramElementDoc. isPublic, isProtected, isPrivate, isPackagePrivate
|
||||
// ProgramElementDoc. isStatic, isFinal
|
||||
// MemberDoc.isSynthetic
|
||||
// ExecutableMemberDoc isSynchronized, signature
|
||||
// Type.toString() // e.g. "String[][]"
|
||||
// ClassDoc.isAbstract, superClass, interfaces, fields, methods, constructors, innerClasses
|
||||
// FieldDoc type
|
||||
// ConstructorDoc qualifiedName
|
||||
// MethodDoc isAbstract, returnType
|
||||
// Doc. name
|
||||
// Doc. isField, isMethod, isConstructor, isClass, isInterface
|
||||
// ProgramElementDoc. containingClass, containingPackage
|
||||
// ProgramElementDoc. isPublic, isProtected, isPrivate, isPackagePrivate
|
||||
// ProgramElementDoc. isStatic, isFinal
|
||||
// MemberDoc.isSynthetic
|
||||
// ExecutableMemberDoc isSynchronized, signature
|
||||
// Type.toString() // e.g. "String[][]"
|
||||
// ClassDoc.isAbstract, superClass, interfaces, fields, methods, constructors, innerClasses
|
||||
// FieldDoc type
|
||||
// ConstructorDoc qualifiedName
|
||||
// MethodDoc isAbstract, returnType
|
||||
|
||||
APIInfo info = new APIInfo();
|
||||
APIInfo info = new APIInfo();
|
||||
|
||||
// status
|
||||
info.setType(APIInfo.STA, tagStatus(doc));
|
||||
// status
|
||||
info.setType(APIInfo.STA, tagStatus(doc));
|
||||
|
||||
// visibility
|
||||
if (doc.isPublic()) {
|
||||
info.setPublic();
|
||||
} else if (doc.isProtected()) {
|
||||
info.setProtected();
|
||||
} else if (doc.isPrivate()) {
|
||||
info.setPrivate();
|
||||
} else {
|
||||
// default is package
|
||||
}
|
||||
|
||||
// static
|
||||
if (doc.isStatic()) {
|
||||
info.setStatic();
|
||||
} else {
|
||||
// default is non-static
|
||||
}
|
||||
|
||||
// final
|
||||
if (doc.isFinal()) {
|
||||
info.setFinal();
|
||||
} else {
|
||||
// default is non-final
|
||||
}
|
||||
|
||||
// type
|
||||
if (doc.isField()) {
|
||||
info.setField();
|
||||
} else if (doc.isMethod()) {
|
||||
info.setMethod();
|
||||
} else if (doc.isConstructor()) {
|
||||
info.setConstructor();
|
||||
} else if (doc.isClass() || doc.isInterface()) {
|
||||
info.setClass();
|
||||
}
|
||||
|
||||
info.setPackage(trimBase(doc.containingPackage().name()));
|
||||
info.setClassName((doc.isClass() || doc.isInterface() || (doc.containingClass() == null))
|
||||
? ""
|
||||
: trimBase(doc.containingClass().name()));
|
||||
info.setName(trimBase(doc.name()));
|
||||
|
||||
if (doc instanceof FieldDoc) {
|
||||
FieldDoc fdoc = (FieldDoc)doc;
|
||||
info.setSignature(trimBase(fdoc.type().toString()));
|
||||
} else if (doc instanceof ClassDoc) {
|
||||
ClassDoc cdoc = (ClassDoc)doc;
|
||||
|
||||
if (cdoc.isClass() && cdoc.isAbstract()) { // interfaces are abstract by default, don't mark them as abstract
|
||||
info.setAbstract();
|
||||
}
|
||||
|
||||
StringBuffer buf = new StringBuffer();
|
||||
if (cdoc.isClass()) {
|
||||
buf.append("extends ");
|
||||
buf.append(cdoc.superclass().qualifiedName());
|
||||
}
|
||||
ClassDoc[] imp = cdoc.interfaces();
|
||||
if (imp != null && imp.length > 0) {
|
||||
if (buf.length() > 0) {
|
||||
buf.append(" ");
|
||||
}
|
||||
buf.append("implements");
|
||||
for (int i = 0; i < imp.length; ++i) {
|
||||
if (i != 0) {
|
||||
buf.append(",");
|
||||
}
|
||||
buf.append(" ");
|
||||
buf.append(imp[i].qualifiedName());
|
||||
}
|
||||
}
|
||||
info.setSignature(trimBase(buf.toString()));
|
||||
} else {
|
||||
ExecutableMemberDoc emdoc = (ExecutableMemberDoc)doc;
|
||||
if (emdoc.isSynchronized()) {
|
||||
info.setSynchronized();
|
||||
}
|
||||
|
||||
if (doc instanceof MethodDoc) {
|
||||
MethodDoc mdoc = (MethodDoc)doc;
|
||||
if (mdoc.isAbstract()) {
|
||||
info.setAbstract();
|
||||
}
|
||||
info.setSignature(trimBase(mdoc.returnType().toString() + emdoc.signature()));
|
||||
// visibility
|
||||
if (doc.isPublic()) {
|
||||
info.setPublic();
|
||||
} else if (doc.isProtected()) {
|
||||
info.setProtected();
|
||||
} else if (doc.isPrivate()) {
|
||||
info.setPrivate();
|
||||
} else {
|
||||
// constructor
|
||||
info.setSignature(trimBase(emdoc.signature()));
|
||||
// default is package
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
// static
|
||||
if (doc.isStatic()) {
|
||||
info.setStatic();
|
||||
} else {
|
||||
// default is non-static
|
||||
}
|
||||
|
||||
// final
|
||||
if (doc.isFinal()) {
|
||||
info.setFinal();
|
||||
} else {
|
||||
// default is non-final
|
||||
}
|
||||
|
||||
// type
|
||||
if (doc.isField()) {
|
||||
info.setField();
|
||||
} else if (doc.isMethod()) {
|
||||
info.setMethod();
|
||||
} else if (doc.isConstructor()) {
|
||||
info.setConstructor();
|
||||
} else if (doc.isClass() || doc.isInterface()) {
|
||||
info.setClass();
|
||||
}
|
||||
|
||||
info.setPackage(trimBase(doc.containingPackage().name()));
|
||||
info.setClassName((doc.isClass() || doc.isInterface() || (doc.containingClass() == null))
|
||||
? ""
|
||||
: trimBase(doc.containingClass().name()));
|
||||
info.setName(trimBase(doc.name()));
|
||||
|
||||
if (doc instanceof FieldDoc) {
|
||||
FieldDoc fdoc = (FieldDoc)doc;
|
||||
info.setSignature(trimBase(fdoc.type().toString()));
|
||||
} else if (doc instanceof ClassDoc) {
|
||||
ClassDoc cdoc = (ClassDoc)doc;
|
||||
|
||||
if (cdoc.isClass() && cdoc.isAbstract()) {
|
||||
// interfaces are abstract by default, don't mark them as abstract
|
||||
info.setAbstract();
|
||||
}
|
||||
|
||||
StringBuffer buf = new StringBuffer();
|
||||
if (cdoc.isClass()) {
|
||||
buf.append("extends ");
|
||||
buf.append(cdoc.superclass().qualifiedName());
|
||||
}
|
||||
ClassDoc[] imp = cdoc.interfaces();
|
||||
if (imp != null && imp.length > 0) {
|
||||
if (buf.length() > 0) {
|
||||
buf.append(" ");
|
||||
}
|
||||
buf.append("implements");
|
||||
for (int i = 0; i < imp.length; ++i) {
|
||||
if (i != 0) {
|
||||
buf.append(",");
|
||||
}
|
||||
buf.append(" ");
|
||||
buf.append(imp[i].qualifiedName());
|
||||
}
|
||||
}
|
||||
info.setSignature(trimBase(buf.toString()));
|
||||
} else {
|
||||
ExecutableMemberDoc emdoc = (ExecutableMemberDoc)doc;
|
||||
if (emdoc.isSynchronized()) {
|
||||
info.setSynchronized();
|
||||
}
|
||||
|
||||
if (doc instanceof MethodDoc) {
|
||||
MethodDoc mdoc = (MethodDoc)doc;
|
||||
if (mdoc.isAbstract()) {
|
||||
info.setAbstract();
|
||||
}
|
||||
info.setSignature(trimBase(mdoc.returnType().toString() + emdoc.signature()));
|
||||
} else {
|
||||
// constructor
|
||||
info.setSignature(trimBase(emdoc.signature()));
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
private static int tagStatus(final Doc doc) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
//##header 1133571410000 VERSION_1.4
|
||||
//##header VERSION_1.4
|
||||
/**
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2002-2005, International Business Machines Corporation and *
|
||||
* Copyright (C) 2002-2006, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2001-2005, International Business Machines
|
||||
* Copyright (C) 2001-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
@ -19,7 +19,7 @@ public final class ArabicShapingException extends Exception {
|
||||
* Constuct the exception with the given message
|
||||
* @param msg the error message for this exception
|
||||
*
|
||||
* @draft ICU 3.6
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
public ArabicShapingException(String message) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2005, International Business Machines Corporation and *
|
||||
* Copyright (C) 1996-2006, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
@ -95,7 +95,7 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* Constant for context.
|
||||
* @draft ICU 3.6
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
public static final int DT_CONTEXT_COUNT = 2;
|
||||
@ -125,7 +125,7 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* Constant for width.
|
||||
* @draft ICU 3.6
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
public static final int DT_WIDTH_COUNT = 3;
|
||||
@ -385,7 +385,7 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
||||
/**
|
||||
* Sets era name strings. For example: "Anno Domini" and "Before Christ".
|
||||
* @param newEras the new era strings.
|
||||
* @draft ICU 3.6
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public void setEraNames(String[] newEraNames) {
|
||||
eraNames = duplicate(newEraNames);
|
||||
@ -457,10 +457,9 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
||||
* @param context The formatting context, FORMAT or STANDALONE.
|
||||
* @param width The width of the month string,
|
||||
* either WIDE, ABBREVIATED, or NARROW.
|
||||
* @draft ICU 3.6
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
|
||||
public void setMonths(String[] newMonths, int context, int width) {
|
||||
switch (context) {
|
||||
case FORMAT :
|
||||
@ -569,10 +568,9 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
||||
* @param context The formatting context, FORMAT or STANDALONE.
|
||||
* @param width The width of the strings,
|
||||
* either WIDE, ABBREVIATED, or NARROW.
|
||||
* @draft ICU 3.6
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
|
||||
public void setWeekdays(String[] newWeekdays, int context, int width) {
|
||||
switch (context) {
|
||||
case FORMAT :
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2005, International Business Machines Corporation and *
|
||||
* Copyright (C) 1996-2006, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
@ -1668,6 +1668,7 @@ public abstract class Transliterator {
|
||||
* Register a Transliterator object with the given ID.
|
||||
* @param ID the ID of this transliterator
|
||||
* @param trans the Transliterator object
|
||||
* @internal
|
||||
*/
|
||||
static void registerInstance(Transliterator trans, boolean visible) {
|
||||
registry.put(trans.getID(), trans, visible);
|
||||
@ -1679,6 +1680,7 @@ public abstract class Transliterator {
|
||||
* This is generally used to create short aliases of compound IDs.
|
||||
* @param aliasID The new ID being registered.
|
||||
* @param realID The existing ID that the new ID should be an alias of.
|
||||
* @draft ICU 3.4.1
|
||||
*/
|
||||
public static void registerAlias(String aliasID, String realID) {
|
||||
registry.put(aliasID, realID, true);
|
||||
@ -1715,6 +1717,7 @@ public abstract class Transliterator {
|
||||
* Any-target.getInverse() => Any-inverseTarget
|
||||
* @param bidirectional if true, register the reverse relation
|
||||
* as well, that is, Any-inverseTarget.getInverse() => Any-target
|
||||
* @internal
|
||||
*/
|
||||
static void registerSpecialInverse(String target,
|
||||
String inverseTarget,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2005, International Business Machines Corporation and *
|
||||
* Copyright (C) 1996-2006, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
@ -624,8 +624,20 @@ public class UnicodeSet extends UnicodeFilter {
|
||||
* Generate and append a string representation of this set to result.
|
||||
* This does not use this.pat, the cleaned up copy of the string
|
||||
* passed to applyPattern().
|
||||
* @param result the buffer into which to generate the pattern
|
||||
* @param escapeUnprintable escape unprintable characters if true
|
||||
* @stable ICU 2.0
|
||||
*/
|
||||
public StringBuffer _generatePattern(StringBuffer result, boolean escapeUnprintable) {
|
||||
return _generatePattern(result, escapeUnprintable, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate and append a string representation of this set to result.
|
||||
* This does not use this.pat, the cleaned up copy of the string
|
||||
* passed to applyPattern().
|
||||
* @param includeStrings if false, doesn't include the strings.
|
||||
* @internal
|
||||
*/
|
||||
public StringBuffer _generatePattern(StringBuffer result,
|
||||
boolean escapeUnprintable, boolean includeStrings) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* Copyright (C) 2005, International Business Machines Corporation and *
|
||||
* Copyright (C) 200-2006, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
******************************************************************************
|
||||
*/
|
||||
@ -305,6 +305,8 @@ package com.ibm.icu.util;
|
||||
* </pre>
|
||||
*
|
||||
* </blockquote>
|
||||
*
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public interface Freezable extends Cloneable {
|
||||
/**
|
||||
@ -320,4 +322,4 @@ public interface Freezable extends Cloneable {
|
||||
* Provides for the clone operation. Any clone is initially unlocked.
|
||||
*/
|
||||
public Object cloneAsThawed();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1996-2005, International Business Machines
|
||||
* Copyright (C) 1996-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*/
|
||||
|
||||
@ -178,8 +178,8 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
/**
|
||||
* get the raw offset.
|
||||
*
|
||||
* @return the raw offset
|
||||
* @draft ICU 3.6
|
||||
* @return the raw offset
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
public int getRawOffset() {
|
||||
@ -499,10 +499,12 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
/**
|
||||
* Returns a string representation of this object.
|
||||
* @return a string representation of this object.
|
||||
* @draft ICU 3.4.2
|
||||
*/
|
||||
public String toString() {
|
||||
return "SimpleTimeZone: " + getID();
|
||||
}
|
||||
|
||||
private STZInfo getSTZInfo() {
|
||||
if (xinfo == null) {
|
||||
xinfo = new STZInfo();
|
||||
@ -520,6 +522,9 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public int getOffset(int era, int year, int month, int day,
|
||||
int dayOfWeek, int millis)
|
||||
{
|
||||
@ -537,6 +542,9 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
return getOffset(era, year, month, day, dayOfWeek, millis, staticMonthLength[month]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public int getOffset(int era, int year, int month, int day,
|
||||
int dayOfWeek, int millis,
|
||||
int monthLength) {
|
||||
@ -662,11 +670,12 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
public static final int
|
||||
private static final int
|
||||
DOM_MODE = 1,
|
||||
DOW_IN_MONTH_MODE=2,
|
||||
DOW_GE_DOM_MODE=3,
|
||||
DOW_LE_DOM_MODE=4;
|
||||
|
||||
/**
|
||||
* TimeMode is used, together with a millisecond offset after
|
||||
* midnight, to specify a rule transition time. Most rules
|
||||
@ -780,23 +789,32 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
private boolean useDaylight; // flag indicating whether this TimeZone uses DST
|
||||
private int startMode, endMode; // flags indicating what kind of rules the DST rules are
|
||||
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public boolean useDaylightTime(){
|
||||
return useDaylight;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public boolean inDaylightTime(Date date){
|
||||
GregorianCalendar gc = new GregorianCalendar(this);
|
||||
gc.setTime(date);
|
||||
return gc.inDaylightTime();
|
||||
}
|
||||
|
||||
public SimpleTimeZone( int raw, String ID,
|
||||
int startMonth, int startDay,
|
||||
int startDayOfWeek, int startTime,
|
||||
int startTimeMode,
|
||||
int endMonth, int endDay,
|
||||
int endDayOfWeek, int endTime,
|
||||
int endTimeMode,int dst){
|
||||
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public SimpleTimeZone(int raw, String ID,
|
||||
int startMonth, int startDay,
|
||||
int startDayOfWeek, int startTime,
|
||||
int startTimeMode,
|
||||
int endMonth, int endDay,
|
||||
int endDayOfWeek, int endTime,
|
||||
int endTimeMode,int dst){
|
||||
/*this(new java.util.SimpleTimeZone(rawOffsetGMT, ID, savingsStartMonth, savingsStartDay,
|
||||
savingsStartDayOfWeek, savingsStartTime, savingsEndMonth,
|
||||
savingsEndDay, savingsEndDayOfWeek, savingsEndTime, savingsDST), ID);*/
|
||||
@ -807,6 +825,7 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
endTime, endTimeMode,
|
||||
dst);
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
/*
|
||||
SimpleTimeZone(int rawOffsetGMT, String ID,
|
||||
@ -954,7 +973,6 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
* @see #decodeStartRule
|
||||
*/
|
||||
private void decodeEndRule() {
|
||||
|
||||
useDaylight = (boolean)((startDay != 0) && (endDay != 0) ? true : false);
|
||||
if (useDaylight && dst == 0) {
|
||||
dst = TimeZone.MILLIS_PER_DAY;
|
||||
@ -995,6 +1013,9 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @draft ICU 3.4.2
|
||||
*/
|
||||
public boolean equals(Object obj){
|
||||
if (this == obj) return true;
|
||||
if (obj == null || getClass() != obj.getClass()) return false;
|
||||
@ -1029,6 +1050,10 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @draft ICU 3.4.2
|
||||
*/
|
||||
public int hashCode(){
|
||||
int ret = (int)( super.hashCode() +
|
||||
raw ^ (raw>>>8) +
|
||||
@ -1052,6 +1077,9 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @draft ICU 3.4.2
|
||||
*/
|
||||
public Object clone() {
|
||||
SimpleTimeZone clone = new SimpleTimeZone( raw, getID());
|
||||
clone.startMonth = startMonth;
|
||||
@ -1071,6 +1099,10 @@ public class SimpleTimeZone extends JDKTimeZone {
|
||||
clone.useDaylight = useDaylight;
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
public boolean hasSameRules(TimeZone othr) {
|
||||
if(!(othr instanceof SimpleTimeZone)){
|
||||
return false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @(#)TimeZone.java 1.51 00/01/19
|
||||
*
|
||||
* Copyright (C) 1996-2005, International Business Machines
|
||||
* Copyright (C) 1996-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*/
|
||||
|
||||
@ -309,10 +309,13 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* The number of milliseconds in an hour.
|
||||
* @internal
|
||||
*/
|
||||
protected static final int MILLIS_PER_HOUR = 60*60*1000;
|
||||
|
||||
/**
|
||||
* The number of milliseconds in one day.
|
||||
* @internal
|
||||
*/
|
||||
protected static final int MILLIS_PER_DAY = 24*MILLIS_PER_HOUR;
|
||||
|
||||
@ -745,14 +748,23 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
throw new InternalError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @draft ICU 3.4.2
|
||||
*/
|
||||
public boolean equals(Object obj){
|
||||
if (this == obj) return true;
|
||||
if (obj == null || getClass() != obj.getClass()) return false;
|
||||
return (ID.equals(((TimeZone)obj).ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* @draft ICU 3.4.2
|
||||
*/
|
||||
public int hashCode(){
|
||||
return ID.hashCode();
|
||||
}
|
||||
|
||||
// =======================privates===============================
|
||||
|
||||
/**
|
||||
|
@ -2624,8 +2624,8 @@ public final class ULocale implements Serializable {
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
|
||||
public static ULocale acceptLanguage(String acceptLanguageList, ULocale[]
|
||||
availableLocales, boolean[] fallback) {
|
||||
public static ULocale acceptLanguage(String acceptLanguageList, ULocale[] availableLocales,
|
||||
boolean[] fallback) {
|
||||
/**
|
||||
* @internal ICU 3.4
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2004-2005, International Business Machines Corporation and *
|
||||
* Copyright (C) 2004-2006, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
@ -126,7 +126,6 @@ public abstract class UResourceBundle extends ResourceBundle{
|
||||
protected static UResourceBundle getBundleInstance(String baseName, String localeName, ClassLoader root, boolean disableFallback){
|
||||
return instantiateBundle(baseName, localeName, root, disableFallback);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sole constructor. (For invocation by subclass constructors, typically
|
||||
@ -205,7 +204,7 @@ public abstract class UResourceBundle extends ResourceBundle{
|
||||
* If null the bundle for default locale is opened.
|
||||
* @param loader the loader to use
|
||||
* @return a resource bundle for the given base name and locale
|
||||
* @draft ICU 3.4.2
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
public static UResourceBundle getBundleInstance(String baseName, Locale locale, ClassLoader loader){
|
||||
@ -221,7 +220,7 @@ public abstract class UResourceBundle extends ResourceBundle{
|
||||
* If null the bundle for default locale is opened.
|
||||
* @param loader the loader to use
|
||||
* @return a resource bundle for the given base name and locale
|
||||
* @draft ICU 3.4.2
|
||||
* @internal revisit for ICU 3.6
|
||||
* @deprecated This is a draft API and might change in a future release of ICU.
|
||||
*/
|
||||
public static UResourceBundle getBundleInstance(String baseName, ULocale locale, ClassLoader loader){
|
||||
@ -288,10 +287,16 @@ public abstract class UResourceBundle extends ResourceBundle{
|
||||
m.put(key, b);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
protected static synchronized void addToCache(ClassLoader cl, String fullName, ULocale defaultLocale, UResourceBundle b){
|
||||
cacheKey.setKeyValues(cl, fullName, defaultLocale);
|
||||
addToCache(cacheKey, b);
|
||||
}
|
||||
/**
|
||||
* @internal revisit for ICU 3.6
|
||||
*/
|
||||
protected static synchronized UResourceBundle loadFromCache(ClassLoader cl, String fullName, ULocale defaultLocale){
|
||||
cacheKey.setKeyValues(cl, fullName, defaultLocale);
|
||||
return loadFromCache(cacheKey);
|
||||
@ -306,8 +311,6 @@ public abstract class UResourceBundle extends ResourceBundle{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Key used for cached resource bundles. The key checks
|
||||
* the resource name, the class root, and the default
|
||||
|
Loading…
Reference in New Issue
Block a user