@ Override public Collection < V > values ( ) { if ( collectionOfValuesByKey == null ) { collectionOfValuesByKey = new AbstractFilterableCollection < V > ( ) { @ Override public Iterator < V > iterator ( ) { return new TransactionalBidiTreeMapIterator < V > ( KEY ) { @ Override protected V doGetNext ( ) { return ( V ) lastReturnedNode . getData ( VALUE ) ; } } ; } @ Override public int size ( ) { return TransactionalBidiTreeMap . this . size ( ) ; } @ Override public boolean contains ( Object o ) { return containsValue ( o ) ; } @ Override public boolean remove ( Object o ) { int oldNodeCount = nodeCount ; removeValue ( o ) ; return nodeCount != oldNodeCount ; } @ Override public boolean removeAll ( Collection < ? > c ) { boolean modified = false ; Iterator < ? > iter = c . iterator ( ) ; while ( iter . hasNext ( ) ) { if ( removeValue ( iter . next ( ) ) != null ) { modified = true ; } } return modified ; } @ Override public void clear ( ) { TransactionalBidiTreeMap . this . clear ( ) ; } } ; } return collectionOfValuesByKey ; }
Returns a collection view of the values contained in this map . The collection is backed by the map so changes to the map are reflected in the collection and vice - versa . If the map is modified while an iteration over the collection is in progress the results of the iteration are undefined . The collection supports element removal which removes the corresponding mapping from the map via the Iterator . remove Collection . remove removeAll retainAll and clear operations . It does not support the add or addAll operations .