use of com.intellij.util.keyFMap.OneElementFMap in project intellij-community by JetBrains.
the class MapReference method equals.
@Override
public boolean equals(Object obj) {
if (obj == this)
return true;
if (!(obj instanceof MapReference) || myHash != ((MapReference) obj).myHash)
return false;
KeyFMap o1 = get();
KeyFMap o2 = ((MapReference) obj).get();
if (o1 == null || o2 == null)
return false;
if (o1 instanceof OneElementFMap && o2 instanceof OneElementFMap) {
OneElementFMap m1 = (OneElementFMap) o1;
OneElementFMap m2 = (OneElementFMap) o2;
return m1.getKey() == m2.getKey() && m1.getValue() == m2.getValue();
}
if (o1 instanceof PairElementsFMap && o2 instanceof PairElementsFMap) {
PairElementsFMap m1 = (PairElementsFMap) o1;
PairElementsFMap m2 = (PairElementsFMap) o2;
return m1.getKey1() == m2.getKey1() && m1.getKey2() == m2.getKey2() && m1.getValue1() == m2.getValue1() && m1.getValue2() == m2.getValue2();
}
if (o1 instanceof ArrayBackedFMap && o2 instanceof ArrayBackedFMap) {
ArrayBackedFMap m1 = (ArrayBackedFMap) o1;
ArrayBackedFMap m2 = (ArrayBackedFMap) o2;
return Arrays.equals(m1.getKeyIds(), m2.getKeyIds()) && containSameElements(m1.getValues(), m2.getValues());
}
return false;
}
Aggregations