Refactoring
- changed to maven - modified hashMap and HashSet to Tree - modified files path
This commit is contained in:
18
src/main/java/berack96/lib/graph/ObjectsComparator.java
Normal file
18
src/main/java/berack96/lib/graph/ObjectsComparator.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package berack96.lib.graph;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* Compare two arbitrary objects.<br>
|
||||
* It uses the method hashCode that every object has to compare two objects.<br>
|
||||
* This is a simple use
|
||||
*/
|
||||
public class ObjectsComparator implements Comparator<Object> {
|
||||
static public final ObjectsComparator instance = new ObjectsComparator();
|
||||
|
||||
private ObjectsComparator(){};
|
||||
|
||||
@Override
|
||||
public int compare(Object o1, Object o2) {
|
||||
return o1.hashCode() - o2.hashCode();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user