/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(final ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); final int count = size(); stream.writeInt(count); for (int i = 0; i < count; i++) { final Object object = get(i); if (object != null && object instanceof Serializable) { stream.writeInt(i); stream.writeObject(object); } else { stream.writeInt(-1); } } }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(final ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); final int count = size(); stream.writeInt(count); for (int i = 0; i < count; i++) { final Object object = get(i); if (object != null && object instanceof Serializable) { stream.writeInt(i); stream.writeObject(object); } else { stream.writeInt(-1); } } }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(final ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); final int count = size(); stream.writeInt(count); for (int i = 0; i < count; i++) { final Object object = get(i); if (object != null && object instanceof Serializable) { stream.writeInt(i); stream.writeObject(object); } else { stream.writeInt(-1); } } }
/** * Tests this list for equality with another object. * * @param obj the object to test. * * @return A boolean. */ public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AbstractObjectList)) { return false; } final AbstractObjectList other = (AbstractObjectList) obj; final int listSize = size(); for (int i = 0; i < listSize; i++) { if (!ObjectUtilities.equal(get(i), other.get(i))) { return false; } } return true; }
/** * Tests this list for equality with another object. * * @param obj the object to test. * * @return A boolean. */ public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AbstractObjectList)) { return false; } final AbstractObjectList other = (AbstractObjectList) obj; final int listSize = size(); for (int i = 0; i < listSize; i++) { if (!ObjectUtilities.equal(get(i), other.get(i))) { return false; } } return true; }
/** * Tests this list for equality with another object. * * @param obj the object to test. * * @return A boolean. */ public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AbstractObjectList)) { return false; } final AbstractObjectList other = (AbstractObjectList) obj; final int listSize = size(); for (int i = 0; i < listSize; i++) { if (!ObjectUtilities.equal(get(i), other.get(i))) { return false; } } return true; }