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

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

Introduction

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

Prototype

public boolean containsKey(final Object key) 

Source Link

Document

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

Usage

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

/**
 * {@inheritDoc}/*  ww w.j a  v a2  s .  co  m*/
 */
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());
        }
    }

}