org.jhotdraw8.icollection.readonly.AbstractReadOnlyList Maven / Gradle / Ivy
/*
* @(#)AbstractReadOnlyList.java
* Copyright © 2023 The authors and contributors of JHotDraw. MIT License.
*/
package org.jhotdraw8.icollection.readonly;
/**
* Abstract base class for {@link ReadOnlyList}s.
*
* @param the element type
*/
public abstract class AbstractReadOnlyList extends AbstractReadOnlyCollection implements ReadOnlyList {
/**
* Constructs a new instance.
*/
public AbstractReadOnlyList() {
}
@Override
public boolean equals(Object o) {
return ReadOnlyList.listEquals(this, o);
}
@Override
public int hashCode() {
return ReadOnlyList.iteratorToHashCode(iterator());
}
}