bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public void addNotify() { if (peer == null) peer = getToolkit().createChoice(this); super.addNotify(); }
|
public void addNotify() { if (peer == null) peer = getToolkit().createChoice(this); super.addNotify(); }
| 12,121
|
public int countItems() { return (pItems.size()); }
|
public int countItems() { return (pItems.size()); }
| 12,122
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
| 12,123
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
| 12,124
|
public String getItem(int index) { return ((String) pItems.elementAt(index)); }
|
public String getItem(int index) { return ((String) pItems.elementAt(index)); }
| 12,125
|
public int getItemCount() { return (pItems.size()); }
|
public int getItemCount() { return (pItems.size()); }
| 12,126
|
public int getSelectedIndex() { return (selectedIndex); }
|
public int getSelectedIndex() { return (selectedIndex); }
| 12,127
|
public synchronized String getSelectedItem() { return (selectedIndex == -1 ? null : ((String) pItems.elementAt(selectedIndex))); }
|
public synchronized String getSelectedItem() { return (selectedIndex == -1 ? null : ((String) pItems.elementAt(selectedIndex))); }
| 12,128
|
public synchronized Object[] getSelectedObjects() { if (selectedIndex == -1) return null; Object[] objs = new Object[1]; objs[0] = pItems.elementAt(selectedIndex); return (objs); }
|
public synchronized Object[] getSelectedObjects() { if (selectedIndex == -1) return null; Object[] objs = new Object[1]; objs[0] = pItems.elementAt(selectedIndex); return (objs); }
| 12,129
|
public synchronized Object[] getSelectedObjects() { if (selectedIndex == -1) return null; Object[] objs = new Object[1]; objs[0] = pItems.elementAt(selectedIndex); return (objs); }
|
public synchronized Object[] getSelectedObjects() { if (selectedIndex == -1) return null; Object[] objs = new Object[1]; objs[0] = pItems.elementAt(selectedIndex); return (objs); }
| 12,130
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
| 12,131
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
| 12,132
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
| 12,133
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
| 12,134
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
| 12,135
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
|
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); } if (getItemCount() == 1 || selectedIndex >= index) select(0); }
| 12,136
|
protected String paramString() { return ("selectedIndex=" + selectedIndex + "," + super.paramString()); }
|
protected String paramString() { return ("selectedIndex=" + selectedIndex + "," + super.paramString()); }
| 12,137
|
protected String paramString() { return ("selectedIndex=" + selectedIndex + "," + super.paramString()); }
|
protected String paramString() { return ("selectedIndex=" + selectedIndex + "," + super.paramString()); }
| 12,138
|
protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
|
protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
| 12,139
|
protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
|
protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
| 12,140
|
protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
|
protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
| 12,141
|
protected void processItemEvent(ItemEvent event) { if (item_listeners != null) item_listeners.itemStateChanged(event); }
|
protected void processItemEvent(ItemEvent event) { if (item_listeners != null) item_listeners.itemStateChanged(event); }
| 12,142
|
protected void processItemEvent(ItemEvent event) { if (item_listeners != null) item_listeners.itemStateChanged(event); }
|
protected void processItemEvent(ItemEvent event) { if (item_listeners != null) item_listeners.itemStateChanged(event); }
| 12,143
|
public synchronized void remove(String item) { int index = pItems.indexOf(item); if (index == -1) throw new IllegalArgumentException("item \"" + item + "\" not found in Choice"); remove(index); }
|
public synchronized void remove(String item) { int index = pItems.indexOf(item); if (index == -1) throw new IllegalArgumentException("item \"" + item + "\" not found in Choice"); remove(index); }
| 12,144
|
public synchronized void remove(String item) { int index = pItems.indexOf(item); if (index == -1) throw new IllegalArgumentException("item \"" + item + "\" not found in Choice"); remove(index); }
|
public synchronized void remove(String item) { int index = pItems.indexOf(item); if (index == -1) throw new IllegalArgumentException("item \"" + item + "\" not found in Choice"); remove(index); }
| 12,145
|
public synchronized void remove(String item) { int index = pItems.indexOf(item); if (index == -1) throw new IllegalArgumentException("item \"" + item + "\" not found in Choice"); remove(index); }
|
public synchronized void remove(String item) { int index = pItems.indexOf(item); if (index == -1) throw new IllegalArgumentException("item \"" + item + "\" not found in Choice"); remove(index); }
| 12,146
|
public synchronized void removeAll() { int count = getItemCount(); for (int i = 0; i < count; i++) { // Always remove 0. remove(0); } }
|
public synchronized void removeAll() { int count = getItemCount(); for (int i = 0; i < count; i++) { // Always remove 0. remove(0); } }
| 12,147
|
public synchronized void removeAll() { int count = getItemCount(); for (int i = 0; i < count; i++) { // Always remove 0. remove(0); } }
|
public synchronized void removeAll() { int count = getItemCount(); for (int i = 0; i < count; i++) { // Always remove 0. remove(0); } }
| 12,148
|
public synchronized void removeItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.remove(item_listeners, listener); }
|
public synchronized void removeItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.remove(item_listeners, listener); }
| 12,150
|
public synchronized void removeItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.remove(item_listeners, listener); }
|
public synchronized void removeItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.remove(item_listeners, listener); }
| 12,151
|
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
|
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
| 12,152
|
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
|
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
| 12,153
|
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
|
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
| 12,154
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (! (o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,157
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,158
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (! useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,159
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,160
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) o; if (zone.hashCode() != hashCode() || !getID().equals(zone.getID()) || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,161
|
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); else return 30 + (month & 1); }
|
privateintgetDaysInMonth(intmonth,intyear){//MostofthisiscopiedfromGregorianCalendar.getActualMaximum()if(month==Calendar.FEBRUARY){ return((year&3)==0&&(year%100!=0||year%400==0)) ?29:28;}elseif(month<Calendar.AUGUST)return31-(month&1);elsereturn30+(month&1);}
| 12,162
|
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); else return 30 + (month & 1); }
|
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); else return 30 + (month & 1); }
| 12,163
|
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); else return 30 + (month & 1); }
|
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); else return 30 + (month & 1); }
| 12,164
|
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); else return 30 + (month & 1); }
|
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); else return monthArr[month]; }
| 12,165
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
| 12,166
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range:" + month); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
| 12,167
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
| 12,168
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
| 12,169
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
| 12,170
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; return rawOffset + daylightSavings; }
| 12,171
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
| 12,172
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range"); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) { // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; } else { // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; return rawOffset + daylightSavings; }
| 12,173
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (! (other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,174
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,175
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (! useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,176
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,177
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
|
public boolean hasSameRules(TimeZone other) { if (this == other) return true; if (!(other instanceof SimpleTimeZone)) return false; SimpleTimeZone zone = (SimpleTimeZone) other; if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight) return false; if (!useDaylight) return true; return (startYear == zone.startYear && startMonth == zone.startMonth && startDay == zone.startDay && startDayOfWeek == zone.startDayOfWeek && startTime == zone.startTime && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek && endTime == zone.endTime && endTimeMode == zone.endTimeMode); }
| 12,178
|
public synchronized int hashCode() { return rawOffset ^ (useDaylight ? startMonth ^ startDay ^ startDayOfWeek ^ startTime ^ endMonth ^ endDay ^ endDayOfWeek ^ endTime : 0); }
|
public synchronized int hashCode() { return rawOffset ^ (useDaylight ? startMonth ^ startDay ^ startDayOfWeek ^ startTime ^ endMonth ^ endDay ^ endDayOfWeek ^ endTime : 0); }
| 12,179
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
| 12,180
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,181
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,182
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,183
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,184
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,185
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,186
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,187
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,188
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
privatebooleanisBefore(intcalYear, intcalMonth,intcalDayOfMonth,intcalDayOfWeek, intcalMillis,intmode,intmonth, intday,intdayOfWeek,intmillis){//ThismethodiscalledbyCalendar,sowemustn'tusethatclass.//Wehavetodoallcalculationsbyhand.//checkthemonths://XXX-thisisnotcorrect://fortheDOW_GE_DOMandDOW_LE_DOMmodesthechangedatemay//beinadifferentmonth.if(calMonth!=month)returncalMonth<month;//checktheday:switch(mode){caseDOM_MODE: if(calDayOfMonth!=day) returncalDayOfMonth<day; break;caseDOW_IN_MONTH_MODE: { //Thiscomputesthedayofmonthofthedayoftype //"dayOfWeek"thatliesinthesame(sundaybased)weekascal. calDayOfMonth+=(dayOfWeek-calDayOfWeek); //Nowweconvertitto7basednumber(togetaonebasedoffset //afterdividingby7).Ifwecountfromtheendofthe //month,wegetwanta-7basednumbercountingthedaysfrom //theend: if(day<0) calDayOfMonth-=getDaysInMonth(calMonth,calYear)+7; else calDayOfMonth+=6; //day>0day<0 //SMTWTFSSMTWTFS //789101112-36-35-34-33-32-31 //13141516171819-30-29-28-27-26-25-24 //20212223242526-23-22-21-20-19-18-17 //27282930313233-16-15-14-13-12-11-10 //343536-9-8-7 //Nowwecalculatethedayofweekinmonth: intweek=calDayOfMonth/7; //day>0day<0 //SMTWTFSSMTWTFS //111111-5-5-4-4-4-4 //1222222-4-4-4-3-3-3-3 //2333333-3-3-3-2-2-2-2 //3444444-2-2-2-1-1-1-1 //455-1-1-1 if(week!=day) returnweek<day; if(calDayOfWeek!=dayOfWeek) returncalDayOfWeek<dayOfWeek; //daylightsavingsstarts/endsonthegivenday. break; }caseDOW_LE_DOM_MODE: //ThegreatestsundaybeforeorequalDecember,12 //isthesameassmallestsundayafterorequalDecember,6. day=Math.abs(day)-6;caseDOW_GE_DOM_MODE: //Calculatethedayofmonthofthedayoftype //"dayOfWeek"thatliesbefore(oron)thegivendate. calDayOfMonth-=(calDayOfWeek<dayOfWeek?7:0) +calDayOfWeek-dayOfWeek; if(calDayOfMonth<day) returntrue; if(calDayOfWeek!=dayOfWeek||calDayOfMonth>=day+7) returnfalse; //nowwehavethesameday break;}//themillisdecides:return(calMillis<millis);}
| 12,189
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
|
private boolean isBefore(int calYear, int calMonth, int calDayOfMonth, int calDayOfWeek, int calMillis, int mode, int month, int day, int dayOfWeek, int millis) { // This method is called by Calendar, so we mustn't use that class. // We have to do all calculations by hand. // check the months: // XXX - this is not correct: // for the DOW_GE_DOM and DOW_LE_DOM modes the change date may // be in a different month. if (calMonth != month) return calMonth < month; // check the day: switch (mode) { case DOM_MODE: if (calDayOfMonth != day) return calDayOfMonth < day; break; case DOW_IN_MONTH_MODE: { // This computes the day of month of the day of type // "dayOfWeek" that lies in the same (sunday based) week as cal. calDayOfMonth += (dayOfWeek - calDayOfWeek); // Now we convert it to 7 based number (to get a one based offset // after dividing by 7). If we count from the end of the // month, we get want a -7 based number counting the days from // the end: if (day < 0) calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7; else calDayOfMonth += 6; // day > 0 day < 0 // S M T W T F S S M T W T F S // 7 8 9 10 11 12 -36-35-34-33-32-31 // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24 // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17 // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10 // 34 35 36 -9 -8 -7 // Now we calculate the day of week in month: int week = calDayOfMonth / 7; // day > 0 day < 0 // S M T W T F S S M T W T F S // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4 // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3 // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2 // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1 // 4 5 5 -1 -1 -1 if (week != day) return week < day; if (calDayOfWeek != dayOfWeek) return calDayOfWeek < dayOfWeek; // daylight savings starts/ends on the given day. break; } case DOW_LE_DOM_MODE: // The greatest sunday before or equal December, 12 // is the same as smallest sunday after or equal December, 6. day = Math.abs(day) - 6; case DOW_GE_DOM_MODE: // Calculate the day of month of the day of type // "dayOfWeek" that lies before (or on) the given date. calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek - dayOfWeek; if (calDayOfMonth < day) return true; if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7) return false; // now we have the same day break; } // the millis decides: return (calMillis < millis); }
| 12,190
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); if (serialVersionOnStream == 0) { // initialize the new fields to default values. dstSavings = 60 * 60 * 1000; endMode = DOW_IN_MONTH_MODE; startMode = DOW_IN_MONTH_MODE; startTimeMode = WALL_TIME; endTimeMode = WALL_TIME; serialVersionOnStream = 2; } else { int length = input.readInt(); byte[] byteArray = new byte[length]; input.read(byteArray, 0, length); if (length >= 4) { // Lets hope that Sun does extensions to the serialized // form in a sane manner. startDay = byteArray[0]; startDayOfWeek = byteArray[1]; endDay = byteArray[2]; endDayOfWeek = byteArray[3]; } } }
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); if (serialVersionOnStream == 0) { // initialize the new fields to default values. dstSavings = 60 * 60 * 1000; endMode = DOW_IN_MONTH_MODE; startMode = DOW_IN_MONTH_MODE; startTimeMode = WALL_TIME; endTimeMode = WALL_TIME; serialVersionOnStream = 2; } else { int length = input.readInt(); byte[] byteArray = new byte[length]; input.read(byteArray, 0, length); if (length >= 4) { // Lets hope that Sun does extensions to the serialized // form in a sane manner. startDay = byteArray[0]; startDayOfWeek = byteArray[1]; endDay = byteArray[2]; endDayOfWeek = byteArray[3]; } } }
| 12,192
|
public String toString() { // the test for useDaylight is an incompatibility to jdk1.2, but // I think this shouldn't hurt. return getClass().getName() + "[" + "id=" + getID() + ",offset=" + rawOffset + ",dstSavings=" + dstSavings + ",useDaylight=" + useDaylight + (useDaylight ? ",startYear=" + startYear + ",startMode=" + startMode + ",startMonth=" + startMonth + ",startDay=" + startDay + ",startDayOfWeek=" + startDayOfWeek + ",startTime=" + startTime + ",startTimeMode=" + startTimeMode + ",endMode=" + endMode + ",endMonth=" + endMonth + ",endDay=" + endDay + ",endDayOfWeek=" + endDayOfWeek + ",endTime=" + endTime + ",endTimeMode=" + endTimeMode : "") + "]"; }
|
public String toString() { // the test for useDaylight is an incompatibility to jdk1.2, but // I think this shouldn't hurt. return getClass().getName() + "[" + "id=" + getID() + ",offset=" + rawOffset + ",dstSavings=" + dstSavings + ",useDaylight=" + useDaylight + (useDaylight ? ",startYear=" + startYear + ",startMode=" + startMode + ",startMonth=" + startMonth + ",startDay=" + startDay + ",startDayOfWeek=" + startDayOfWeek + ",startTime=" + startTime + ",startTimeMode=" + startTimeMode + ",endMode=" + endMode + ",endMonth=" + endMonth + ",endDay=" + endDay + ",endDayOfWeek=" + endDayOfWeek + ",endTime=" + endTime + ",endTimeMode=" + endTimeMode : "") + "]"; }
| 12,193
|
private void writeObject(java.io.ObjectOutputStream output) throws java.io.IOException { byte[] byteArray = new byte[] { (byte) startDay, (byte) startDayOfWeek, (byte) endDay, (byte) endDayOfWeek}; /* calculate the approximation for JDK 1.1 */ switch (startMode) { case DOM_MODE: startDayOfWeek = Calendar.SUNDAY; // random day of week // fall through case DOW_GE_DOM_MODE: case DOW_LE_DOM_MODE: startDay = (startDay + 6) / 7; } switch (endMode) { case DOM_MODE: endDayOfWeek = Calendar.SUNDAY; // fall through case DOW_GE_DOM_MODE: case DOW_LE_DOM_MODE: endDay = (endDay + 6) / 7; } // the required part: output.defaultWriteObject(); // the optional part: output.writeInt(byteArray.length); output.write(byteArray, 0, byteArray.length); }
|
private void writeObject(java.io.ObjectOutputStream output) throws java.io.IOException { byte[] byteArray = new byte[] { (byte) startDay, (byte) startDayOfWeek, (byte) endDay, (byte) endDayOfWeek}; /* calculate the approximation for JDK 1.1 */ switch (startMode) { case DOM_MODE: startDayOfWeek = Calendar.SUNDAY; // random day of week // fall through case DOW_GE_DOM_MODE: case DOW_LE_DOM_MODE: startDay = (startDay + 6) / 7; } switch (endMode) { case DOM_MODE: endDayOfWeek = Calendar.SUNDAY; // fall through case DOW_GE_DOM_MODE: case DOW_LE_DOM_MODE: endDay = (endDay + 6) / 7; } // the required part: output.defaultWriteObject(); // the optional part: output.writeInt(byteArray.length); output.write(byteArray, 0, byteArray.length); }
| 12,194
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { return getScrollableUnitIncrement(visibleRect, orientation, direction); }
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { int block; if (orientation == SwingConstants.VERTICAL) block = visibleRect.height; else block = visibleRect.width; return block; }
| 12,196
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row too high. int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1); row = row + direction; if (row < 0) row = 0; Rectangle newTop = getRowBounds(row); delta = newTop.y - visibleRect.y; } else delta = direction * rowHeight == 0 ? 20 : rowHeight; return delta; }
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta = 0; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row too high. int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1); row = row + direction; if (row < 0) row = 0; Rectangle newTop = getRowBounds(row); delta = newTop.y - visibleRect.y; } else delta = direction * rowHeight == 0 ? 20 : rowHeight; return delta; }
| 12,197
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row too high. int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1); row = row + direction; if (row < 0) row = 0; Rectangle newTop = getRowBounds(row); delta = newTop.y - visibleRect.y; } else delta = direction * rowHeight == 0 ? 20 : rowHeight; return delta; }
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row too high. int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1); row = row + direction; if (row < 0) row = 0; Rectangle newTop = getRowBounds(row); delta = newTop.y - visibleRect.y; } else delta = direction * rowHeight == 0 ? 20 : rowHeight; return delta; }
| 12,198
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row too high. int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1); row = row + direction; if (row < 0) row = 0; Rectangle newTop = getRowBounds(row); delta = newTop.y - visibleRect.y; } else delta = direction * rowHeight == 0 ? 20 : rowHeight; return delta; }
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row too high. int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1); row = row + direction; if (row < 0) row = 0; Rectangle newTop = getRowBounds(row); delta = newTop.y - visibleRect.y; } else { if (direction < 0) { if (row != 0) { b = getRowBounds(row - 1); delta = b.height; } } else delta = b.height; } } } else delta = 4; return delta; }
| 12,199
|
public void setSelectionModel(TreeSelectionModel model) { if (selectionModel == model) return; if (selectionModel != null) selectionModel.removeTreeSelectionListener(selectionRedirector); TreeSelectionModel oldValue = selectionModel; selectionModel = model; if (selectionModel != null) selectionModel.addTreeSelectionListener(selectionRedirector); firePropertyChange(SELECTION_MODEL_PROPERTY, oldValue, model); revalidate(); repaint(); }
|
public void setSelectionModel(TreeSelectionModel model) { if (selectionModel == model) return; selectionModel.removeTreeSelectionListener(selectionRedirector); TreeSelectionModel oldValue = selectionModel; selectionModel = model; selectionModel.addTreeSelectionListener(selectionRedirector); firePropertyChange(SELECTION_MODEL_PROPERTY, oldValue, model); revalidate(); repaint(); }
| 12,200
|
private LongItem(int kind, int offsetToFP, Register lsb, Register msb, long val) { super(kind, offsetToFP, lsb, msb); this.value = val; }
|
private LongItem(int kind, int offsetToFP, Register lsb, Register msb, long val) { super(kind, offsetToFP, lsb, msb); this.value = val; }
| 12,201
|
protected DoubleWordItem cloneConstant() { return createConst(getValue()); }
|
protected DoubleWordItem cloneConstant() { return createConst(getValue()); }
| 12,202
|
final int getLsbValue() { assertCondition(kind == Kind.CONSTANT, "kind == Kind.CONSTANT"); return (int)(value & 0xFFFFFFFFL); }
|
final int getLsbValue() { assertCondition(kind == Kind.CONSTANT, "kind == Kind.CONSTANT"); return (int) (value & 0xFFFFFFFFL); }
| 12,203
|
final int getMsbValue() { assertCondition(kind == Kind.CONSTANT, "kind == Kind.CONSTANT"); return (int)((value >>> 32) & 0xFFFFFFFFL); }
|
final int getMsbValue() { assertCondition(kind == Kind.CONSTANT, "kind == Kind.CONSTANT"); return (int) ((value >>> 32) & 0xFFFFFFFFL); }
| 12,204
|
final int getType() { return JvmType.LONG; }
|
final int getType() { return JvmType.LONG; }
| 12,205
|
protected final void loadToConstant(EmitterContext ec, AbstractX86Stream os, Register lsb, Register msb) { final int lsbv = (int) (value & 0xFFFFFFFFL); final int msbv = (int) ((value >>> 32) & 0xFFFFFFFFL); os.writeMOV_Const(lsb, lsbv); os.writeMOV_Const(msb, msbv); }
|
protected final void loadToConstant(EmitterContext ec, AbstractX86Stream os, Register lsb, Register msb) { final int lsbv = (int) (value & 0xFFFFFFFFL); final int msbv = (int) ((value >>> 32) & 0xFFFFFFFFL); os.writeMOV_Const(lsb, lsbv); os.writeMOV_Const(msb, msbv); }
| 12,206
|
protected final void loadToConstant(EmitterContext ec, AbstractX86Stream os, Register lsb, Register msb) { final int lsbv = (int) (value & 0xFFFFFFFFL); final int msbv = (int) ((value >>> 32) & 0xFFFFFFFFL); os.writeMOV_Const(lsb, lsbv); os.writeMOV_Const(msb, msbv); }
|
protected final void loadToConstant(EmitterContext ec, AbstractX86Stream os, Register lsb, Register msb) { final int lsbv = (int) (value & 0xFFFFFFFFL); final int msbv = (int) ((value >>> 32) & 0xFFFFFFFFL); os.writeMOV_Const(lsb, lsbv); os.writeMOV_Const(msb, msbv); }
| 12,207
|
protected void popFromFPU(AbstractX86Stream os, Register reg, int disp) { os.writeFISTP64(reg, disp); }
|
protected void popFromFPU(AbstractX86Stream os, Register reg, int disp) { os.writeFISTP64(reg, disp); }
| 12,208
|
protected final void pushConstant(EmitterContext ec, AbstractX86Stream os) { os.writePUSH(getMsbValue()); os.writePUSH(getLsbValue()); }
|
protected final void pushConstant(EmitterContext ec, AbstractX86Stream os) { os.writePUSH(getMsbValue()); os.writePUSH(getLsbValue()); }
| 12,209
|
public synchronized void connect() throws IOException { // Call is ignored if already connected. if (connected) return; jar_url = getJarFileURL(); jar_file = JarFileCache.get (jar_url, useCaches); String entry_name = getEntryName(); if (entry_name != null && !entry_name.equals ("")) { jar_entry = (JarEntry) jar_file.getEntry (entry_name); if(jar_entry == null) throw new IOException ("No entry for " + entry_name + " exists."); } connected = true; }
|
public synchronized void connect() throws IOException { // Call is ignored if already connected. if (connected) return; jar_url = getJarFileURL(); jar_file = JarFileCache.get (jar_url, useCaches); String entry_name = getEntryName(); if (entry_name != null && !entry_name.equals ("")) { jar_entry = (JarEntry) jar_file.getEntry (entry_name); if(jar_entry == null) throw new FileNotFoundException("No entry for " + entry_name + " exists."); } connected = true; }
| 12,215
|
public InputStream getInputStream() throws IOException { if (!connected) connect(); if (! doInput) throw new ProtocolException("Can't open InputStream if doInput is false"); if (jar_entry == null) throw new IOException (jar_url + " couldn't be found."); return jar_file.getInputStream (jar_entry); }
|
public InputStream getInputStream() throws IOException { if (!connected) connect(); if (! doInput) throw new ProtocolException("Can't open InputStream if doInput is false"); if (jar_entry == null) throw new IOException (jar_url + " couldn't be found."); return jar_file.getInputStream (jar_entry); }
| 12,216
|
protected JButton createArrowButton() { return new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(), new CellRendererPane(), listBox); }
|
protected JButton createArrowButton() { JButton button = new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(), new CellRendererPane(), listBox); }
| 12,219
|
protected void editablePropertyChanged(PropertyChangeEvent e) { if (arrowButton instanceof MetalComboBoxButton) { MetalComboBoxButton b = (MetalComboBoxButton) arrowButton; b.setIconOnly(comboBox.isEditable()); } if (comboBox.isEditable()) { arrowButton.setText(null); if (editor != null) editor.setVisible(true); } else { arrowButton.setText(comboBox.getSelectedItem().toString()); if (editor != null) editor.setVisible(true); } }
|
protected void editablePropertyChanged(PropertyChangeEvent e) { if (arrowButton instanceof MetalComboBoxButton) { MetalComboBoxButton b = (MetalComboBoxButton) arrowButton; b.setIconOnly(comboBox.isEditable()); } if (comboBox.isEditable()) { arrowButton.setText(null); if (editor != null) editor.setVisible(true); } else { String text = ""; Object selected = comboBox.getSelectedItem(); if (selected != null) text = selected.toString(); arrowButton.setText(text); if (editor != null) editor.setVisible(true); } }
| 12,221
|
public Dimension getMinimumSize(JComponent c) { // FIXME: this needs work Dimension result = super.getMinimumSize(c); result.height = result.height + 9; return result; }
|
public Dimension getMinimumSize(JComponent c) { // FIXME: this needs work Dimension result = super.getMinimumSize(c); result.height = result.height + 9; return result; }
| 12,222
|
public void actionPerformed(ActionEvent event) { JTextField textField = (JTextField) event.getSource(); textField.fireActionPerformed(); }
|
public void actionPerformed(ActionEvent event) { JTextField textField = (JTextField) event.getSource(); textField.fireActionPerformed(); }
| 12,223
|
protected void configurePropertiesFromAction(Action action) { if (action != null) { setEnabled(action.isEnabled()); setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION)); } else { setEnabled(true); setToolTipText(null); } }
|
protected void configurePropertiesFromAction(Action action) { if (action != null) { setEnabled(action.isEnabled()); setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION)); } else { setEnabled(true); setToolTipText(null); } }
| 12,224
|
protected void configurePropertiesFromAction(Action action) { if (action != null) { setEnabled(action.isEnabled()); setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION)); } else { setEnabled(true); setToolTipText(null); } }
|
protected void configurePropertiesFromAction(Action action) { if (action != null) { setEnabled(action.isEnabled()); setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION)); } else { setEnabled(true); setToolTipText(null); } }
| 12,225
|
protected PropertyChangeListener createActionPropertyChangeListener(Action action) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } } }; }
|
protected PropertyChangeListener createActionPropertyChangeListener(Action action) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } } }; }
| 12,226
|
protected PropertyChangeListener createActionPropertyChangeListener(Action action) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } } }; }
|
protected PropertyChangeListener createActionPropertyChangeListener(Action action) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } } }; }
| 12,227
|
public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } }
|
public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } }
| 12,228
|
public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } }
|
public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) { boolean enabled = ((Boolean) event.getNewValue()).booleanValue(); JTextField.this.setEnabled(enabled); } else if (name.equals(Action.SHORT_DESCRIPTION)) { JTextField.this.setToolTipText((String) event.getNewValue()); } }
| 12,229
|
protected Document createDefaultModel() { // subclassed to swallow newlines return new PlainDocument() { public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { if (str != null && str.indexOf('\n') == -1) super.insertString(offset, str, a); } }; }
|
protected Document createDefaultModel() { // subclassed to swallow newlines return new PlainDocument() { public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { if (str != null && str.indexOf('\n') == -1) super.insertString(offset, str, a); } }; }
| 12,230
|
protected Document createDefaultModel() { // subclassed to swallow newlines return new PlainDocument() { public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { if (str != null && str.indexOf('\n') == -1) super.insertString(offset, str, a); } }; }
|
protected Document createDefaultModel() { // subclassed to swallow newlines return new PlainDocument() { public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { if (str != null && str.indexOf('\n') == -1) super.insertString(offset, str, a); } }; }
| 12,231
|
public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { if (str != null && str.indexOf('\n') == -1) super.insertString(offset, str, a); }
|
public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { if (str != null && str.indexOf('\n') == -1) super.insertString(offset, str, a); }
| 12,232
|
protected void fireActionPerformed() { ActionEvent event = new ActionEvent(this, 0, notifyAction); ActionListener[] listeners = getActionListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].actionPerformed(event); }
|
protected void fireActionPerformed() { ActionEvent event = new ActionEvent(this, 0, notifyAction); ActionListener[] listeners = getActionListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].actionPerformed(event); }
| 12,233
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.