class AddressSet implements AddressSetView {

	@Override
	public final boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		if (obj == this) {
			return true;
		}

		if (!(obj instanceof AddressSetView)) {
			return false;
		}
		AddressSetView set = (AddressSetView) obj;

		if (this.getNumAddresses() != set.getNumAddresses()) {
			return false;
		}

		// if don't have same number of ranges, not equal
		if (this.getNumAddressRanges() != set.getNumAddressRanges()) {
			return false;
		}

		AddressRangeIterator otherRanges = set.getAddressRanges();
		AddressRangeIterator myRanges = getAddressRanges();
		while (myRanges.hasNext()) {
			AddressRange myRange = myRanges.next();
			AddressRange otherRange = otherRanges.next();
			if (!myRange.equals(otherRange)) {
				return false;
			}
		}
		return true;
	}

	public  AddressSet();
	@Deprecated public  AddressSet(AddressFactory factory);
	public  AddressSet(AddressRange range);
	@Deprecated public  AddressSet(AddressFactory factory, AddressRange range);
	public  AddressSet(Address start, Address end);
	@Deprecated public  AddressSet(AddressFactory factory, Address start, Address end);
	public  AddressSet(Program program, Address start, Address end);
	@Deprecated public  AddressSet(AddressFactory factory, AddressSetView set);
	public  AddressSet(AddressSetView set);
	@Deprecated public  AddressSet(AddressFactory factory, Address addr);
	public  AddressSet(Address addr);

}