FileDocCategorySizeDatePackage
Support_TimeZone.javaAPI DocAndroid 1.5 API2337Wed May 06 22:41:06 BST 2009tests.support

Support_TimeZone

public class Support_TimeZone extends TimeZone
Sample java.util.TimeZone subclass to test getDSTSavings() and getOffset(long) APIs

Fields Summary
private static final long
serialVersionUID
int
rawOffset
boolean
useDaylightTime
Constructors Summary
public Support_TimeZone(int rawOffset, boolean useDaylightTime)


         
        this.rawOffset = rawOffset;
        this.useDaylightTime = useDaylightTime;
    
Methods Summary
public intgetOffset(int p1, int p2, int p3, int p4, int p5, int p6)

        return 0;
    
public intgetRawOffset()

        return rawOffset;
    
public booleaninDaylightTime(java.util.Date p1)
let's assume this timezone has daylight savings from the 4th month till the 10th month of the year to ame things simple.

        if (!useDaylightTime) {
            return false;
        }
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(p1);
        int month = cal.get(Calendar.MONTH);

        if (month > 4 && month < 10) {
            return true;
        }
        return false;
    
public voidsetRawOffset(int p1)

        rawOffset = p1;
    
public booleanuseDaylightTime()

        return useDaylightTime;