list.add(createInstance(obj, 0)); list.add(createInstance(obj, 1)); int cnt = ((Integer) prev) + 1; map.put(obj, cnt); list.add(createInstance(obj, cnt));
/** Updates the second collection with values from the first one. * If there is a multiple occurrence of an object in the first collection * a Dupl for the object is created to encapsulate it. */ public final void updateList(Collection<? extends T> src, Collection<? super Dupl<T>> target) { java.util.Map<T,Object> map = new HashMap<T,Object>(src.size() * 2); for (T o : src) { updateListAndMap(o, target, map); } }
if (prev == null) { list.add (createInstance (obj, 0)); return; } else { list.add (createInstance (obj, 1)); return; } else { int cnt = ((Integer)prev).intValue () + 1; map.put (obj, new Integer (cnt)); list.add (createInstance (obj, cnt)); return;
if (prev == null) { list.add (createInstance (obj, 0)); return; } else { list.add (createInstance (obj, 1)); return; } else { int cnt = ((Integer)prev).intValue () + 1; map.put (obj, new Integer (cnt)); list.add (createInstance (obj, cnt)); return;
public int hashCode () { return getKey ().hashCode (); }
public int hashCode () { return getKey ().hashCode (); }
/** Updates the second collection with values from the first one. * If there is a multiple occurence of an object in the first collection * a Dupl for the object is created to encapsulate it. */ public final void updateList ( java.util.Collection src, java.util.Collection target ) { java.util.Map map = new java.util.HashMap (src.size () * 2); Iterator it = src.iterator (); while (it.hasNext ()) { Object o = it.next (); updateListAndMap (o, target, map); } }
/** Gets the key represented by this object. * @return the key */ public final Object getKey () { if (key instanceof Dupl) { return ((Dupl)key).getKey (); } else { return key; } }
/** Updates the second collection with values from the first one. * If there is a multiple occurence of an object in the first collection * a Dupl for the object is created to encapsulate it. */ public final void updateList ( java.util.Collection src, java.util.Collection target ) { java.util.Map map = new java.util.HashMap (src.size () * 2); Iterator it = src.iterator (); while (it.hasNext ()) { Object o = it.next (); updateListAndMap (o, target, map); } }
/** Updates the second collection with values from the first array. * If there is a multiple occurence of an object in the first array * a Dupl for the object is created to encapsulate it. */ public final void updateList ( Object[] arr, java.util.Collection target ) { java.util.Map map = new java.util.HashMap (arr.length * 2); for (int i = 0; i < arr.length; i++) { updateListAndMap (arr[i], target, map); } }
/** Updates the second collection with values from the first array. * If there is a multiple occurence of an object in the first array * a Dupl for the object is created to encapsulate it. */ public final void updateList ( Object[] arr, java.util.Collection target ) { java.util.Map map = new java.util.HashMap (arr.length * 2); for (int i = 0; i < arr.length; i++) { updateListAndMap (arr[i], target, map); } }
/** Gets the key represented by this object. * @return the key */ public final Object getKey () { if (key instanceof Dupl) { return ((Dupl)key).getKey (); } else { return key; } }
@Override public int hashCode() { return getKey().hashCode(); }
/** Gets the key represented by this object. * @return the key */ @SuppressWarnings("unchecked") // data structure really weird public T getKey() { if (key instanceof Dupl) { return (T) ((Dupl) key).getKey(); } else { return (T) key; } }
/** Updates the second collection with values from the first array. * If there is a multiple occurrence of an object in the first array * a Dupl for the object is created to encapsulate it. */ public final void updateList(T[] arr, Collection<? super Dupl<T>> target) { java.util.Map<T,Object> map = new HashMap<T,Object>(arr.length * 2); for (T o : arr) { updateListAndMap(o, target, map); } }