From 54d17da93c6708e54c296d63783a60f1c024797b Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 2 Mar 2015 01:01:51 -0500 Subject: finished most of the matching gui --- src/cuchaz/enigma/convert/Matches.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/cuchaz/enigma/convert/Matches.java') diff --git a/src/cuchaz/enigma/convert/Matches.java b/src/cuchaz/enigma/convert/Matches.java index 75ecc2a..5faa923 100644 --- a/src/cuchaz/enigma/convert/Matches.java +++ b/src/cuchaz/enigma/convert/Matches.java @@ -17,6 +17,8 @@ import cuchaz.enigma.mapping.ClassEntry; public class Matches implements Iterable { Collection m_matches; + Map m_matchesBySource; + Map m_matchesByDest; BiMap m_uniqueMatches; Map m_ambiguousMatchesBySource; Map m_ambiguousMatchesByDest; @@ -29,6 +31,8 @@ public class Matches implements Iterable { public Matches(Collection matches) { m_matches = matches; + m_matchesBySource = Maps.newHashMap(); + m_matchesByDest = Maps.newHashMap(); m_uniqueMatches = HashBiMap.create(); m_ambiguousMatchesBySource = Maps.newHashMap(); m_ambiguousMatchesByDest = Maps.newHashMap(); @@ -73,6 +77,12 @@ public class Matches implements Iterable { m_uniqueMatches.put(match.getUniqueSource(), match.getUniqueDest()); } } + for (ClassEntry entry : match.sourceClasses) { + m_matchesBySource.put(entry, match); + } + for (ClassEntry entry : match.destClasses) { + m_matchesByDest.put(entry, match); + } } public BiMap getUniqueMatches() { @@ -86,4 +96,20 @@ public class Matches implements Iterable { public Set getUnmatchedDestClasses() { return m_unmatchedDestClasses; } + + public Set getAmbiguouslyMatchedSourceClasses() { + return m_ambiguousMatchesBySource.keySet(); + } + + public ClassMatch getAmbiguousMatchBySource(ClassEntry sourceClass) { + return m_ambiguousMatchesBySource.get(sourceClass); + } + + public ClassMatch getMatchBySource(ClassEntry sourceClass) { + return m_matchesBySource.get(sourceClass); + } + + public ClassMatch getMatchByDest(ClassEntry destClass) { + return m_matchesByDest.get(destClass); + } } -- cgit v1.2.3