cz.cuni.amis.utils.collections
Class TranslatedObservableCollection<T,U>

java.lang.Object
  extended by cz.cuni.amis.utils.collections.ObservableCollection<E>
      extended by cz.cuni.amis.utils.collections.ObservableList<T>
          extended by cz.cuni.amis.utils.collections.TranslatedObservableCollection<T,U>
All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>

public abstract class TranslatedObservableCollection<T,U>
extends ObservableList<T>

Translates one observable collection into another


Field Summary
 
Fields inherited from class cz.cuni.amis.utils.collections.ObservableList
l
 
Fields inherited from class cz.cuni.amis.utils.collections.ObservableCollection
col, eventListeners
 
Constructor Summary
TranslatedObservableCollection(ObservableCollection<U> col)
           
 
Method Summary
protected  java.lang.Object getKeyForObj(U elem)
           
protected  void insert(U elem)
           
protected abstract  T translate(U obj)
          Translates object from wrapped collection into this collection.
 
Methods inherited from class cz.cuni.amis.utils.collections.ObservableList
add, addAll, addAll, clear, get, getList, indexOf, lastIndexOf, listIterator, listIterator, remove, set, subList
 
Methods inherited from class cz.cuni.amis.utils.collections.ObservableCollection
add, addCollectionListener, contains, containsAll, isEmpty, iterator, notifyPostAdd, notifyPostRemove, notifyPreAdd, notifyPreRemove, remove, removeAll, removeCollectionListener, retainAll, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
add, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

TranslatedObservableCollection

public TranslatedObservableCollection(ObservableCollection<U> col)
Method Detail

insert

protected void insert(U elem)

getKeyForObj

protected java.lang.Object getKeyForObj(U elem)

translate

protected abstract T translate(U obj)
Translates object from wrapped collection into this collection.

Parameters:
obj - object to be translated
Returns:
the translated object, null if the object shouldn't be added to the collection