summaryrefslogtreecommitdiffstats
path: root/šola/p1/dn/9/Preganjanje.java
blob: 74485d13a534eb622c8c571ae07e2652daf92b5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.util.*;
public class Preganjanje {
	private Class<?> preganjalec;
	private Class<?> preganjan;
	public Preganjanje (Class<?> preganjalec, Class<?> preganjan) {
		this.preganjalec = preganjalec;
		this.preganjan = preganjan;
	}
	public int hashCode () {
		return 1;
		//return Objects.hash(preganjalec, preganjan);
	}
	@Override
	public boolean equals (Object drugi) {
		if (this == drugi)
			return true;
		if (drugi == null || getClass() != drugi.getClass())
			return false;
		Preganjanje drugo = (Preganjanje) drugi;
		return preganjalec.equals(drugo.preganjalec) && preganjan.equals(drugo.preganjan);
	}
	public String toString () {
		return String.format("%s->%s", preganjalec.getName(), preganjan.getName());
	}
}