summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/convert/FieldMatches.java
blob: f78a8f551e8dc1a2a34a8b360b4d58c5b75679b5 (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
26
27
28
29
30
31
32
33
34
35
package cuchaz.enigma.convert;

import java.util.Collection;
import java.util.Set;

import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Sets;

import cuchaz.enigma.mapping.ClassEntry;
import cuchaz.enigma.mapping.FieldEntry;


public class FieldMatches {

	private BiMap<FieldEntry,FieldEntry> m_matches;
	private Set<FieldEntry> m_unmatchedSourceFields;
	
	public FieldMatches() {
		m_matches = HashBiMap.create();
		m_unmatchedSourceFields = Sets.newHashSet();
	}
	
	public void addUnmatchedSourceFields(Set<FieldEntry> fieldEntries) {
		m_unmatchedSourceFields.addAll(fieldEntries);
	}
	
	public Collection<ClassEntry> getSourceClassesWithUnmatchedFields() {
		Set<ClassEntry> classEntries = Sets.newHashSet();
		for (FieldEntry fieldEntry : m_unmatchedSourceFields) {
			classEntries.add(fieldEntry.getClassEntry());
		}
		return classEntries;
	}
}