/** * common get logic, used to get by key or get by value * * @param o the key or value that we're looking for * @param index KEY or VALUE * * @return the key (if the value was mapped) or the value (if the * key was mapped); null if we couldn't find the specified * object */ private Object doGet(final Comparable o, final int index) { checkNonNullComparable(o, index); Node node = lookup(o, index); return ((node == null) ? null : node.getData(oppositeIndex(index))); }
/** * common remove logic (remove by key or remove by value) * * @param o the key, or value, that we're looking for * @param index KEY or VALUE * * @return the key, if remove by value, or the value, if remove by * key. null if the specified key or value could not be * found */ private Object doRemove(final Comparable o, final int index) { Node node = lookup(o, index); Object rval = null; if (node != null) { rval = node.getData(oppositeIndex(index)); doRedBlackDelete(node); } return rval; }
/** * common get logic, used to get by key or get by value * * @param o the key or value that we're looking for * @param index KEY or VALUE * * @return the key (if the value was mapped) or the value (if the * key was mapped); null if we couldn't find the specified * object */ private Object doGet(final Comparable o, final int index) { checkNonNullComparable(o, index); Node node = lookup(o, index); return ((node == null) ? null : node.getData(oppositeIndex(index))); }
/** * common remove logic (remove by key or remove by value) * * @param o the key, or value, that we're looking for * @param index KEY or VALUE * * @return the key, if remove by value, or the value, if remove by * key. null if the specified key or value could not be * found */ private Object doRemove(final Comparable o, final int index) { Node node = lookup(o, index); Object rval = null; if (node != null) { rval = node.getData(oppositeIndex(index)); doRedBlackDelete(node); } return rval; }
/** * common get logic, used to get by key or get by value * * @param o the key or value that we're looking for * @param index KEY or VALUE * * @return the key (if the value was mapped) or the value (if the * key was mapped); null if we couldn't find the specified * object */ private Object doGet(final Comparable o, final int index) { checkNonNullComparable(o, index); Node node = lookup(o, index); return ((node == null) ? null : node.getData(oppositeIndex(index))); }
/** * common get logic, used to get by key or get by value * * @param o the key or value that we're looking for * @param index KEY or VALUE * * @return the key (if the value was mapped) or the value (if the * key was mapped); null if we couldn't find the specified * object */ private Object doGet(final Comparable o, final int index) { checkNonNullComparable(o, index); Node node = lookup(o, index); return ((node == null) ? null : node.getData(oppositeIndex(index))); }
/** * common get logic, used to get by key or get by value * * @param o the key or value that we're looking for * @param index KEY or VALUE * * @return the key (if the value was mapped) or the value (if the * key was mapped); null if we couldn't find the specified * object */ private Object doGet(final Comparable o, final int index) { checkNonNullComparable(o, index); Node node = lookup(o, index); return ((node == null) ? null : node.getData(oppositeIndex(index))); }
/** * common get logic, used to get by key or get by value * * @param o the key or value that we're looking for * @param index KEY or VALUE * * @return the key (if the value was mapped) or the value (if the * key was mapped); null if we couldn't find the specified * object */ private Object doGet(final Comparable o, final int index) { checkNonNullComparable(o, index); Node node = lookup(o, index); return ((node == null) ? null : node.getData(oppositeIndex(index))); }
/** * common get logic, used to get by key or get by value * * @param o the key or value that we're looking for * @param index KEY or VALUE * * @return the key (if the value was mapped) or the value (if the * key was mapped); null if we couldn't find the specified * object */ private Object doGet(final Comparable o, final int index) { checkNonNullComparable(o, index); Node node = lookup(o, index); return ((node == null) ? null : node.getData(oppositeIndex(index))); }
/** * common remove logic (remove by key or remove by value) * * @param o the key, or value, that we're looking for * @param index KEY or VALUE * * @return the key, if remove by value, or the value, if remove by * key. null if the specified key or value could not be * found */ private Object doRemove(final Comparable o, final int index) { Node node = lookup(o, index); Object rval = null; if (node != null) { rval = node.getData(oppositeIndex(index)); doRedBlackDelete(node); } return rval; }
/** * common remove logic (remove by key or remove by value) * * @param o the key, or value, that we're looking for * @param index KEY or VALUE * * @return the key, if remove by value, or the value, if remove by * key. null if the specified key or value could not be * found */ private Object doRemove(final Comparable o, final int index) { Node node = lookup(o, index); Object rval = null; if (node != null) { rval = node.getData(oppositeIndex(index)); doRedBlackDelete(node); } return rval; }
/** * common remove logic (remove by key or remove by value) * * @param o the key, or value, that we're looking for * @param index KEY or VALUE * * @return the key, if remove by value, or the value, if remove by * key. null if the specified key or value could not be * found */ private Object doRemove(final Comparable o, final int index) { Node node = lookup(o, index); Object rval = null; if (node != null) { rval = node.getData(oppositeIndex(index)); doRedBlackDelete(node); } return rval; }
/** * common remove logic (remove by key or remove by value) * * @param o the key, or value, that we're looking for * @param index KEY or VALUE * * @return the key, if remove by value, or the value, if remove by * key. null if the specified key or value could not be * found */ private Object doRemove(final Comparable o, final int index) { Node node = lookup(o, index); Object rval = null; if (node != null) { rval = node.getData(oppositeIndex(index)); doRedBlackDelete(node); } return rval; }
/** * common remove logic (remove by key or remove by value) * * @param o the key, or value, that we're looking for * @param index KEY or VALUE * * @return the key, if remove by value, or the value, if remove by * key. null if the specified key or value could not be * found */ private Object doRemove(final Comparable o, final int index) { Node node = lookup(o, index); Object rval = null; if (node != null) { rval = node.getData(oppositeIndex(index)); doRedBlackDelete(node); } return rval; }