@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ShortBag intBag = (ShortBag) o; return size == intBag.size() && Arrays.equals(data, intBag.data); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ShortBag intBag = (ShortBag) o; return size == intBag.size() && Arrays.equals(data, intBag.data); }
/** * Adds the specified elements to the end of this bag. * <p> * If required, it also increases the capacity of the bag. * </p> * * @param other * elements to be added to this list */ public void addAll(ShortBag other) { for (int i = 0; i < other.size(); i++) { add(other.get(i)); } }
/** * Adds the specified elements to the end of this bag. * <p> * If required, it also increases the capacity of the bag. * </p> * * @param other * elements to be added to this list */ public void addAll(ShortBag other) { for (int i = 0; i < other.size(); i++) { add(other.get(i)); } }