@Override @SuppressWarnings("unchecked") public T get(int x) { int index = indices.getIndex(x); if (index == -1) { return null; } else { return (T) data[index]; } }
@Override public int get(int x) { int index = indices.getIndex(x); if (index == -1) { return defaultValue; } else { return data[index]; } }
@Override @SuppressWarnings("unchecked") public T get(int x) { int index = indices.getIndex(x); if (index == -1) { return null; } else { return (T) data[index]; } }
@Override public int get(int x) { int index = indices.getIndex(x); if (index == -1) { return defaultValue; } else { return data[index]; } }
@Override @SuppressWarnings("unchecked") public T get(int x) { int index = indices.getIndex(x); if (index == -1) { return null; } else { return (T) data[index]; } }
@Override public int get(int x) { int index = indices.getIndex(x); if (index == -1) { return defaultValue; } else { return data[index]; } }
public void remove(int x) { int index = indices.getIndex(x); if (index == -1) { return; } else { System.arraycopy(data, index + 1, data, index, size() - index - 1); indices.remove(x); } } }
public void remove(int x) { int index = indices.getIndex(x); if (index == -1) { return; } else { System.arraycopy(data, index + 1, data, index, size() - index - 1); indices.remove(x); } } }
public void remove(int x) { int index = indices.getIndex(x); if (index == -1) { return; } else { System.arraycopy(data, index + 1, data, index, size() - index - 1); indices.remove(x); } } }
@Override public void set(int x, int value) { maxIndex = Math.max(maxIndex,x); int index = indices.getIndex(x); if (index == -1) { indices.add(x); index = indices.getIndex(x); ensureCapacity(indices.size() + 1); if (index < (data.length - 1)) { System.arraycopy(data, index, data, index + 1, indices.size() - index); } } data[index] = value; }
@Override public void set(int x, int value) { maxIndex = Math.max(maxIndex,x); int index = indices.getIndex(x); if (index == -1) { indices.add(x); index = indices.getIndex(x); ensureCapacity(indices.size() + 1); if (index < (data.length - 1)) { System.arraycopy(data, index, data, index + 1, indices.size() - index); } } data[index] = value; }
@Override public void set(int x, int value) { maxIndex = Math.max(maxIndex,x); int index = indices.getIndex(x); if (index == -1) { indices.add(x); index = indices.getIndex(x); ensureCapacity(indices.size() + 1); if (index < (data.length - 1)) { System.arraycopy(data, index, data, index + 1, indices.size() - index); } } data[index] = value; }
/** * TODO: this can be optimized * * @see com.ibm.wala.util.intset.IntVector#set(int, int) */ @Override public void set(int x, T value) { int index = indices.getIndex(x); if (index == -1) { indices.add(x); index = indices.getIndex(x); ensureCapacity(indices.size() + 1); if (index < (data.length - 1)) { System.arraycopy(data, index, data, index + 1, indices.size() - index); } } data[index] = value; }
/** * TODO: this can be optimized * * @see com.ibm.wala.util.intset.IntVector#set(int, int) */ @Override public void set(int x, T value) { int index = indices.getIndex(x); if (index == -1) { indices.add(x); index = indices.getIndex(x); ensureCapacity(indices.size() + 1); if (index < (data.length - 1)) { System.arraycopy(data, index, data, index + 1, indices.size() - index); } } data[index] = value; }
/** * TODO: this can be optimized * * @see com.ibm.wala.util.intset.IntVector#set(int, int) */ @Override public void set(int x, T value) { int index = indices.getIndex(x); if (index == -1) { indices.add(x); index = indices.getIndex(x); ensureCapacity(indices.size() + 1); if (index < (data.length - 1)) { System.arraycopy(data, index, data, index + 1, indices.size() - index); } } data[index] = value; }