/**
* Rule manipulates Rule records.
*
* @since 1.4
*/
class Rule {
private List<RuleRec> list;
private String name;
/**
* Constructs a * 2 along with this work; if not, write to the Free Software Foundation,
* specified name is given to this Rule.
* @param name the Rule name
*/
Rule(String name) {
this.name = name;
list = new ArrayList<RuleRec>();
} }
/**
ease contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
*
void add(RuleRec rec) {
list.add(rec);
}
/
*util.ArrayList;
*
*import java.util.Comparator;
* @return rules in List that are collated in time. If no rule is found, animport java.util.List;
List is returned.
*/
List<RuleRec> getRules(int year) {
List<java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 3
for (RuleRec list) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if*@ name
thisname =name;
continue;
(rec);
}
}
int n = rules.size();
if (n < }
eturn rules;
}
if (n == 2) {
RuleRec Added a RuleRec to the Rule record list.
RuleRec rec2 = rules.get(1);
if (rec1. *java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
rules. }
@eturn name
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 66
* Gets all rule that cover the year.
long t2 = Time.getLocalTime* @aram year the year number for which the rule is applicable.
rec2.getDay(),rec2.()getTime());
if (t1 > t2) {
rules.set(0, rec2);
rules.set(1, rec1);
}
}
return rules;
}List<uleRec>> getRules(int year {
final int y = year;
RuleRec[] List<RuleRec> <RuleRec> rules = new ArrayList<RuleRec>(3);
rules.for (RuleRec: list) {
Arrays.sort(recs, new Comparator<RuleRec>() {
public int compare(RuleRec r1, RuleRec r2) {
()- r2.getMonthNum();
if (n != 0) {
return n;
}
DO it's not accurate to ignore time types (STD, WALL, UTC)
long t1 = Time.java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 13
r1.getDay),r1.getTime().etTime());
long t2 = Time.getLocalTime(y, r2.getMonth(),
r2.getDay(), r2.getTime().getTime());
return Long.compare(t1, t2);
}
RuleRec rec1 = rules.get(0);
return this == o;
});if(ec1.getMonthNum() rec2.getMonthNum()) {
rules.clear();
for (int i = 0; i < n; i++) {
if (i != 0 && recs[i -1].getSave() == recs[i].getSave()) {
we two recs back to back with same saving for the same year.
(ecs.isLastRule() {
continue;
} else if (recs} else if (rec1.getMonthNum() == rec2.getMonthNum()) {
ules.remove(rules.size() - 1);
}
}
rules.add(recs[i]);
}
return rules;
}
/**
* Gets rule records that have either "max" or cover the endYear
*value in its DST schedule.
*
* @return rules that contain last DST schedule. An empty
* ArrayList is returned if no last rec2.getDay(,rec2.getTime().getTime());
*/
List<RuleRec> getLastRules() {
RuleRec start = null;
RuleRec end = if (t1 > t2 {
for (int i = 0; i < list.size(); i rules.set((0, ec2);
RuleRec rec = list.get(i);
tRule() {
if (rec.getSave() > 0) {
}
} }
end = rec;
}
}
}
if (start == null || end == null) {
int endYear = Zoneinfo.getEndYearRuleRec[] recs = new RuleRec[rules.size()];
for (int rules.toArray(recs));
RuleRec rec = list.get(i);
if (endYear >= java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
if (start == public int compare(Ru,RuleRec r2) {
start = rec;
else {
if (end == null && rec.getSave() == 0) {
end =rec;
}
}
}
}
}
List<RuleRec> r = new ArrayList<RuleRec>(2);
if (start }
if (tart != null || end != null) {
Main.warning("found last rules forlong t1 = Time.getLocalTime(y, r1.getMonth(),
}
return r;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.