package model.array;
import java.util.ArrayList;
import java.util.Collection;
import model.movie.Actor;
public class ActorArray extends ArrayList<Actor> {
private static final long serialVersionUID = 254557710697699104L;
public ActorArray() {
super();
}
public ActorArray(Collection <? extends Actor> e) {
super(e);
}
@Override
public boolean add(Actor e) {
if (!contains(e))
return super.add(e);
return false;
}
public boolean remove(String uri) {
for (Actor a : this)
if (a.getUri().equals(uri))
return remove(a);
return false;
}
@Override
public boolean contains(Object o) {
if (o instanceof Actor) {
Actor actor = (Actor) o;
for (Actor a : this)
if (a.getUri().equals(actor.getUri()))
return true;
return false;
} else return super.contains(o);
}
}