FileDocCategorySizeDatePackage
Support_GetPutFieldsDeprecated.javaAPI DocAndroid 1.5 API4854Wed May 06 22:41:06 BST 2009tests.support

Support_GetPutFieldsDeprecated

public class Support_GetPutFieldsDeprecated extends Object implements Serializable
Support class to test the methods of {@code ObjectInputStream.GetField} and {@code ObjectOutputStream.PutField}. The difference with class {@code Support_GetPutFields} is that it uses the deprecated method {@code ObjectOutputStream.PutField.write(ObjectOutput)} to write the fields to the output stream.

Fields Summary
private static final long
serialVersionUID
public ObjectInputStream$GetField
getField
public ObjectOutputStream$PutField
putField
public boolean
booleanValue
public byte
byteValue
public char
charValue
public double
doubleValue
public float
floatValue
public long
longValue
public int
intValue
public short
shortValue
public SimpleClass
objectValue
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object obj)

        if (obj == null || obj.getClass() != this.getClass()) {
            return false;
        }
        
        Support_GetPutFields other = (Support_GetPutFields) obj;
        return (booleanValue == other.booleanValue && 
                byteValue == other.byteValue &&
                charValue == other.charValue &&
                doubleValue == other.doubleValue &&
                floatValue == other.floatValue &&
                longValue == other.longValue &&
                intValue == other.intValue &&
                objectValue.equals(other.objectValue) &&
                shortValue == other.shortValue
                );
    
public voidinitTestValues()

        booleanValue = true;
        byteValue = (byte) 0xbe;
        charValue = 'A";
        doubleValue = 1231.342;
        floatValue = 43.22f;
        longValue = 1560732321l;
        intValue = 33333;
        objectValue = new SimpleClass(2001, "A Space Odyssey");
        shortValue = 3078;
    
private voidreadObject(java.io.ObjectInputStream ois)

        booleanValue = getField.get("booleanValue", false);
        byteValue = getField.get("byteValue", (byte) 0);
        charValue = getField.get("charValue", (char) 0);
        doubleValue = getField.get("doubleValue", 0.0);
        floatValue = getField.get("floatValue", 0.0f);
        longValue = getField.get("longValue", (long) 0);
        intValue = getField.get("intValue", 0);
        objectValue = (Support_GetPutFieldsDeprecated.SimpleClass) 
                getField.get("objectValue", (Object) null);
        shortValue = getField.get("shortValue", (short) 0);
    
private voidwriteObject(java.io.ObjectOutputStream oos)

        putField = oos.putFields();
        putField.put("booleanValue", booleanValue);
        putField.put("byteValue", byteValue);
        putField.put("charValue", charValue);
        putField.put("doubleValue", doubleValue);
        putField.put("floatValue", floatValue);
        putField.put("longValue", longValue);
        putField.put("intValue", intValue);
        putField.put("objectValue", objectValue);
        putField.put("shortValue", shortValue);
        putField.write(oos);