/*
 * Bytecode Analysis Framework
 * Copyright (C) 2003, University of Maryland
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package edu.umd.cs.daveho.ba;

public class AvailableLoad implements Comparable<AvailableLoad> {
	private final ValueNumber reference;
	private final InstanceField field;

	public AvailableLoad(ValueNumber reference, InstanceField field) {
		this.reference = reference;
		this.field = field;
	}

	public ValueNumber getReference() {
		return reference;
	}

	public InstanceField getField() {
		return field;
	}

	public int compareTo(AvailableLoad other) {
		int cmp = reference.compareTo(other.reference);
		if (cmp != 0)
			return cmp;
		return field.compareTo(other.field);
	}
}

// vim:ts=4

@@ -1399,16 +1399,306 @@
 eld);%0A%09%7D
+%0A%0A%09public int hashCode() %7B%0A%09%09return reference.hashCode() + field.hashCode();%0A%09%7D%0A%0A%09public boolean equals(Object o) %7B%0A%09%09if (this.getClass() != o.getClass())%0A%09%09%09return false;%0A%09%09AvailableLoad other = (AvailableLoad) o;%0A%09%09return reference.equals(other.reference) && field.equals(other.field);%0A%09%7D
 %0A%7D%0A%0A// v

Implemented hashCode() and equals().