All pastes #341752 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-05 21:11 UTC
rendered paste body
	public boolean equals(Object f){
		if(f.getClass() == this.getClass()){
			FIFO temp = (FIFO)f;
			if (temp.size() == this.size()){
				for(int n = 0; n < this.size(); n++){
					Object temp1 = temp.queue.get(n);
					Object temp2 = this.queue.get(n);
					if(temp1 != temp2){
						return false;
					}
				}
				return true;
			}
			else{
				return false;
			}
		}
		else{
			throw new ClassCastException();
		}
	}