/** * @return the unique integer that identifies this pointer key */ public int getIndex(PointerKey p) { return pointerKeys.getMappedIndex(p); }
@Override public int getNumber(T obj) { return map.getMappedIndex(obj); }
/** * @return the unique integer that identifies this pointer key */ public int getIndex(PointerKey p) { return pointerKeys.getMappedIndex(p); }
@Override public int getNumber(T obj) { return map.getMappedIndex(obj); }
@Override public int getNumber(T obj) { return map.getMappedIndex(obj); }
public int getInstanceIndex(InstanceKey ik) { return instanceKeys.getMappedIndex(ik); }
public int getInstanceIndex(InstanceKey ik) { return instanceKeys.getMappedIndex(ik); }
public void deleteMappedObject(T n) { int index = getMappedIndex(n); if (index != -1) { array[index] = null; map.remove(n); } }
public void deleteMappedObject(T n) { int index = getMappedIndex(n); if (index != -1) { array[index] = null; map.remove(n); } }
public void deleteMappedObject(T n) { int index = getMappedIndex(n); if (index != -1) { array[index] = null; map.remove(n); } }
/** * Replace a in this mapping with b. */ public void replace(T a, T b) throws IllegalArgumentException { int i = getMappedIndex(a); if (i == -1) { throw new IllegalArgumentException("first element does not exist in map"); } map.remove(a); map.put(b, i); array[i] = b; }
/** * Replace a in this mapping with b. */ public void replace(T a, T b) throws IllegalArgumentException { int i = getMappedIndex(a); if (i == -1) { throw new IllegalArgumentException("first element does not exist in map"); } map.remove(a); map.put(b, i); array[i] = b; }
/** * Replace a in this mapping with b. */ public void replace(T a, T b) throws IllegalArgumentException { int i = getMappedIndex(a); if (i == -1) { throw new IllegalArgumentException("first element does not exist in map"); } map.remove(a); map.put(b, i); array[i] = b; }
private int findOrCreateIndex(PointerKey key) { int result = pointerKeys.getMappedIndex(key); if (result == -1) { result = pointerKeys.add(key); } return result; }
public int findOrCreateIndexForInstanceKey(InstanceKey key) { int result = instanceKeys.getMappedIndex(key); if (result == -1) { result = instanceKeys.add(key); } if (DEBUG) { System.err.println("getIndexForInstanceKey " + key + ' ' + result); } return result; }
public int findOrCreateIndexForInstanceKey(InstanceKey key) { int result = instanceKeys.getMappedIndex(key); if (result == -1) { result = instanceKeys.add(key); } if (DEBUG) { System.err.println("getIndexForInstanceKey " + key + ' ' + result); } return result; }
private int findOrCreateIndex(PointerKey key) { int result = pointerKeys.getMappedIndex(key); if (result == -1) { result = pointerKeys.add(key); } return result; }
private OrdinalSet<InstanceKey> toOrdinalSet(InstanceKey[] ik) { MutableSparseIntSet s = MutableSparseIntSet.makeEmpty(); for (InstanceKey element : ik) { int index = instanceKeys.getMappedIndex(element); if (index != -1) { s.add(index); } else { assert index != -1 : "instance " + element + " not mapped!"; } } return new OrdinalSet<>(s, instanceKeys); }
private OrdinalSet<InstanceKey> toOrdinalSet(InstanceKey[] ik) { MutableSparseIntSet s = MutableSparseIntSet.makeEmpty(); for (InstanceKey element : ik) { int index = instanceKeys.getMappedIndex(element); if (index != -1) { s.add(index); } else { assert index != -1 : "instance " + element + " not mapped!"; } } return new OrdinalSet<>(s, instanceKeys); }
/** * If p is unified, returns the representative for p. */ public PointsToSetVariable getPointsToSet(PointerKey p) { if (p == null) { throw new IllegalArgumentException("null p"); } if (isImplicit(p)) { throw new IllegalArgumentException("unexpected: shouldn't ask a PointsToMap for an implicit points-to-set: " + p); } int i = pointerKeys.getMappedIndex(p); if (i == -1) { return null; } int repI = uf.find(i); PointsToSetVariable result = (PointsToSetVariable) pointsToSets.get(repI); if (result != null && p instanceof FilteredPointerKey && (!(result.getPointerKey() instanceof FilteredPointerKey))) { upgradeToFilter(result, ((FilteredPointerKey) p).getTypeFilter()); } return result; }