/** * Creates new Result object with supplied instances parameter. * @param instances to be used to return from the lookup */ SimpleLookup(Collection<Object> instances) { allItems = new ArrayList<Item<?>>(instances.size()); for (Iterator i = instances.iterator(); i.hasNext();) { allItems.add(new InstanceContent.SimpleItem<Object>(i.next())); } }
/** Changes all pairs in the lookup to new values. Converts collection of * instances to collection of pairs. * @param col the collection of (Item) objects * @param conv the convertor to use or null */ public final <T,R> void set(Collection<T> col, Convertor<T,R> conv) { ArrayList<Pair<?>> l = new ArrayList<Pair<?>>(col.size()); Iterator<T> it = col.iterator(); if (conv == null) { while (it.hasNext()) { l.add(new SimpleItem<T>(it.next())); } } else { while (it.hasNext()) { l.add(new ConvertingItem<T,R>(it.next(), conv)); } } setPairs(l); }
/** * Creates new Result object with supplied instances parameter. * @param instances to be used to return from the lookup */ SimpleLookup(Collection<Object> instances) { allItems = new ArrayList<Item<?>>(instances.size()); for (Iterator i = instances.iterator(); i.hasNext();) { allItems.add(new InstanceContent.SimpleItem<Object>(i.next())); } }
/** Changes all pairs in the lookup to new values. Converts collection of * instances to collection of pairs. * @param col the collection of (Item) objects * @param conv the convertor to use or null */ public final void set (Collection col, Convertor conv) { ArrayList l = new ArrayList(col.size()); Iterator it = col.iterator(); if (conv == null) { while (it.hasNext()) { l.add (new SimpleItem (it.next())); } } else { while (it.hasNext()) { l.add (new ConvertingItem (it.next(), conv)); } } setPairs (l); }
/** Changes all pairs in the lookup to new values. Converts collection of * instances to collection of pairs. * @param col the collection of (Item) objects * @param conv the convertor to use or null */ public final <T,R> void set(Collection<T> col, Convertor<T,R> conv) { ArrayList<Pair<?>> l = new ArrayList<Pair<?>>(col.size()); Iterator<T> it = col.iterator(); if (conv == null) { while (it.hasNext()) { l.add(new SimpleItem<T>(it.next())); } } else { while (it.hasNext()) { l.add(new ConvertingItem<T,R>(it.next(), conv)); } } setPairs(l); }
/** Changes all pairs in the lookup to new values. Converts collection of * instances to collection of pairs. * @param col the collection of (Item) objects * @param conv the convertor to use or null */ public final <T,R> void set(Collection<T> col, Convertor<T,R> conv) { ArrayList<Pair<?>> l = new ArrayList<Pair<?>>(col.size()); Iterator<T> it = col.iterator(); if (conv == null) { while (it.hasNext()) { l.add(new SimpleItem<T>(it.next())); } } else { while (it.hasNext()) { l.add(new ConvertingItem<T,R>(it.next(), conv)); } } setPairs(l); }
/** Changes all pairs in the lookup to new values. Converts collection of * instances to collection of pairs. * @param col the collection of (Item) objects * @param conv the convertor to use or null */ public final void set (Collection col, Convertor conv) { ArrayList l = new ArrayList(col.size()); Iterator it = col.iterator(); if (conv == null) { while (it.hasNext()) { l.add (new SimpleItem (it.next())); } } else { while (it.hasNext()) { l.add (new ConvertingItem (it.next(), conv)); } } setPairs (l); }
/** Remove instance. * @param inst instance */ public final void remove (Object inst) { removePair (new SimpleItem (inst)); }
/** The method to add instance to the lookup with. * @param inst instance */ public final void add (Object inst) { addPair(new SimpleItem (inst)); }
/** * Creates new Result object with supplied instances parameter. * @param instances to be used to return from the lookup */ SimpleLookup(Collection instances) { allItems = new ArrayList(instances.size()); for (Iterator i = instances.iterator(); i.hasNext(); ) { allItems.add(new InstanceContent.SimpleItem(i.next())); } }
/** * Creates new Result object with supplied instances parameter. * @param instances to be used to return from the lookup */ SimpleLookup(Collection<Object> instances) { allItems = new ArrayList<Item<?>>(instances.size()); for (Iterator i = instances.iterator(); i.hasNext();) { allItems.add(new InstanceContent.SimpleItem<Object>(i.next())); } }
/** Remove instance. * @param inst instance */ public final void remove(Object inst) { removePair(new SimpleItem<Object>(inst)); }
/** * Creates new Result object with supplied instances parameter. * @param instances to be used to return from the lookup */ SimpleLookup(Collection instances) { allItems = new ArrayList(instances.size()); for (Iterator i = instances.iterator(); i.hasNext(); ) { allItems.add(new InstanceContent.SimpleItem(i.next())); } }
/** The method to add instance to the lookup with. * @param inst instance */ public final void add (Object inst) { addPair(new SimpleItem (inst)); }
/** The method to add instance to the lookup with. * @param inst instance */ public final void add(Object inst) { addPair(new SimpleItem<Object>(inst)); }
/** The method to add instance to the lookup with. * @param inst instance */ public final void add(Object inst) { addPair(new SimpleItem<Object>(inst)); }
/** Remove instance. * @param inst instance */ public final void remove (Object inst) { removePair (new SimpleItem (inst)); }
/** Remove instance. * @param inst instance */ public final void remove(Object inst) { removePair(new SimpleItem<Object>(inst)); }
/** The method to add instance to the lookup with. * @param inst instance */ public final void add(Object inst) { addPair(new SimpleItem<Object>(inst)); }
/** Remove instance. * @param inst instance */ public final void remove(Object inst) { removePair(new SimpleItem<Object>(inst)); }