FileDocCategorySizeDatePackage
SerializableList.javaAPI DocExample1486Thu Nov 08 00:22:52 GMT 2001com.ora.rmibook.chapter15

SerializableList

public abstract class SerializableList extends Object implements Serializable

Fields Summary
protected ArrayList
_containedObjects
Constructors Summary
public SerializableList()

/* here so we can deserialize */
    
public SerializableList(Collection objects)

        _containedObjects = new ArrayList(objects.size());
        Iterator i = objects.iterator();

        while (i.hasNext()) {
            _containedObjects.add(i.next());
        }
    
Methods Summary
protected abstract booleancontainerIsOfSameType(java.lang.Object object)

protected abstract booleanequalObjects(java.lang.Object firstObject, java.lang.Object secondObject)

public synchronized booleanequals(java.lang.Object otherObject)

        if (false == (containerIsOfSameType(otherObject))) {
            return false;
        }
        SerializableList otherComparableList = (SerializableList) otherObject;
        int size = _containedObjects.size();

        if (size != otherComparableList.getSize()) {
            return false;
        }
        for (int i = 0; i < size; i++) {
            if (false == equalObjects(_containedObjects.get(i), otherComparableList.get(i))) {
                return false;
            }
        }
        return true;
    
public synchronized java.lang.Objectget(int index)

        return _containedObjects.get(index);
    
public synchronized intgetSize()

        return _containedObjects.size();