diff options
Diffstat (limited to 'src/cuchaz/enigma/mapping/EntryPair.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/EntryPair.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/mapping/EntryPair.java b/src/cuchaz/enigma/mapping/EntryPair.java new file mode 100644 index 0000000..e40e999 --- /dev/null +++ b/src/cuchaz/enigma/mapping/EntryPair.java | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2014 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Public License v3.0 | ||
| 5 | * which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/gpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.mapping; | ||
| 12 | |||
| 13 | import cuchaz.enigma.Util; | ||
| 14 | |||
| 15 | public class EntryPair | ||
| 16 | { | ||
| 17 | public Entry obf; | ||
| 18 | public Entry deobf; | ||
| 19 | |||
| 20 | public EntryPair( Entry obf, Entry deobf ) | ||
| 21 | { | ||
| 22 | this.obf = obf; | ||
| 23 | this.deobf = deobf; | ||
| 24 | } | ||
| 25 | |||
| 26 | @Override | ||
| 27 | public int hashCode( ) | ||
| 28 | { | ||
| 29 | return Util.combineHashesOrdered( obf, deobf ); | ||
| 30 | } | ||
| 31 | |||
| 32 | @Override | ||
| 33 | public boolean equals( Object other ) | ||
| 34 | { | ||
| 35 | if( other instanceof EntryPair ) | ||
| 36 | { | ||
| 37 | return equals( (EntryPair)other ); | ||
| 38 | } | ||
| 39 | return false; | ||
| 40 | } | ||
| 41 | |||
| 42 | public boolean equals( EntryPair other ) | ||
| 43 | { | ||
| 44 | return obf.equals( other.obf ) && deobf.equals( other.deobf ); | ||
| 45 | } | ||
| 46 | } | ||