From: <th...@us...> - 2009-01-01 17:45:14
|
Revision: 8778 http://pcgen.svn.sourceforge.net/pcgen/?rev=8778&view=rev Author: thpr Date: 2009-01-01 17:45:11 +0000 (Thu, 01 Jan 2009) Log Message: ----------- equals and hashCode for TripleKeyMap Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/base/util/TripleKeyMap.java Modified: Trunk/pcgen/code/src/java/pcgen/base/util/TripleKeyMap.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/base/util/TripleKeyMap.java 2009-01-01 16:45:39 UTC (rev 8777) +++ Trunk/pcgen/code/src/java/pcgen/base/util/TripleKeyMap.java 2009-01-01 17:45:11 UTC (rev 8778) @@ -427,4 +427,29 @@ return new HashSet<V>(subMap.values()); } + /** + * A consistent-with-equals hashCode for TripleKeyMap + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() + { + return map.hashCode(); + } + + /** + * Returns true if the TripleKeyMap is equal to the given Object. Equality + * is defined as the given Object being a TripleKeyMap with equal keys and + * values as defined by the underlying Maps. + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object o) + { + return o instanceof TripleKeyMap + && map.equals(((TripleKeyMap<?, ?, ?, ?>) o).map); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |