Example usage for org.apache.commons.collections.bidimap TreeBidiMap containsValue

List of usage examples for org.apache.commons.collections.bidimap TreeBidiMap containsValue

Introduction

In this page you can find the example usage for org.apache.commons.collections.bidimap TreeBidiMap containsValue.

Prototype

public boolean containsValue(final Object value) 

Source Link

Document

Checks whether this map contains the a mapping for the specified value.

Usage

From source file:de.topicmapslab.majortom.inmemory.virtual.internal.VirtualReificationStore.java

/**
 * {@inheritDoc}/*from   w  ww.ja va 2s.  c om*/
 */
public void removeVirtualConstruct(IConstruct construct, IConstruct newConstruct) {
    /*
     * construct is a topic
     */
    if (construct instanceof ITopic) {
        TreeBidiMap reificiation = getReificationMap();
        if (reificiation != null && reificiation.containsKey(construct)) {
            Object reified = reificiation.remove(construct);
            reificiation.put(newConstruct, reified);
        }
        if (removedReifications != null && removedReifications.containsKey(construct.getId())) {
            IConstruct reified = (IConstruct) removedReifications.remove(construct.getId());
            removedReifications.put(newConstruct.getId(), reified.getId());
        }
    }
    /*
     * construct is an reified construct
     */
    else if (construct instanceof IReifiable) {
        TreeBidiMap reificiation = getReificationMap();
        if (reificiation != null && reificiation.containsValue(construct)) {
            Object reifier = reificiation.removeValue(construct);
            reificiation.put(reifier, newConstruct);
        }
        if (removedReifications != null && removedReifications.containsValue(construct.getId())) {
            IConstruct reifier = (IConstruct) removedReifications.removeValue(construct.getId());
            removedReifications.put(reifier.getId(), newConstruct.getId());
        }
    }

}