Example usage for java.util.concurrent ConcurrentHashMap contains

List of usage examples for java.util.concurrent ConcurrentHashMap contains

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentHashMap contains.

Prototype

public boolean contains(Object value) 

Source Link

Document

Tests if some key maps into the specified value in this table.

Usage

From source file:com.steffi.index.ImgMapIndex.java

@Override
public boolean hasElementForKeyValue(T element, String key, Object value) {
    ConcurrentHashMap<Object, Boolean> curValues = getMap().get(new IndexKeyValue(key, value));
    if (curValues != null) {
        Cell cellElement = indexClass.cast(element);

        if (cellElement instanceof SteffiVertex) {
            return curValues.contains(cellElement.getId());
        } else {//from  w  w  w  . j  av  a  2  s. co  m
            SteffiEdge edge = (SteffiEdge) cellElement;
            return curValues.contains(new EdgeIndexEntry(edge.getSourceCellId(), edge.getId()));
        }
    }

    return false;
}