Example usage for org.apache.commons.collections15 MultiMap put

List of usage examples for org.apache.commons.collections15 MultiMap put

Introduction

In this page you can find the example usage for org.apache.commons.collections15 MultiMap put.

Prototype

V put(K key, V value);

Source Link

Document

Adds the value to the collection associated with the specified key.

Usage

From source file:org.openanzo.rdf.MemQuadStore.java

/**
 * Index this statement// ww w .j  a va  2  s .co m
 * 
 * @param stmt
 *            Statement to index
 */
private void addMaps(Statement stmt) {
    URI c = stmt.getNamedGraphUri();
    Resource s = stmt.getSubject();
    URI p = stmt.getPredicate();
    Value o = stmt.getObject();
    subjectMap.put(s, stmt);
    predMap.put(p, stmt);
    objMap.put(o, stmt);
    namedGraphMap.put(c, stmt);
    MultiMap<Value, Statement> poIndexMap = poIndex.get(p);
    if (poIndexMap == null) {
        poIndexMap = new MultiTreeArrayMap<Value, Statement>();
        poIndex.put(p, poIndexMap);
    }
    poIndexMap.put(o, stmt);

    MultiMap<Resource, Statement> psIndexMap = psIndex.get(p);
    if (psIndexMap == null) {
        psIndexMap = new MultiTreeArrayMap<Resource, Statement>();
        psIndex.put(p, psIndexMap);
    }
    psIndexMap.put(s, stmt);
}