Search in sources :

Example 1 with Long2ObjectMap

use of it.unimi.dsi.fastutil.longs.Long2ObjectMap in project gephi by gephi.

the class ImportContainerImpl method edgeExists.

@Override
public boolean edgeExists(String source, String target) {
    checkId(source);
    checkId(target);
    NodeDraftImpl sourceNode = getNode(source);
    NodeDraftImpl targetNode = getNode(target);
    if (sourceNode != null && targetNode != null) {
        boolean undirected = edgeDefault.equals(EdgeDirectionDefault.UNDIRECTED) || (undirectedEdgesCount > 0 && directedEdgesCount == 0);
        long edgeId = getLongId(sourceNode, targetNode, !undirected);
        for (Long2ObjectMap l : edgeTypeSets) {
            if (l != null) {
                if (l.containsKey(edgeId)) {
                    return true;
                }
            }
        }
    }
    return false;
}
Also used : Long2ObjectMap(it.unimi.dsi.fastutil.longs.Long2ObjectMap)

Aggregations

Long2ObjectMap (it.unimi.dsi.fastutil.longs.Long2ObjectMap)1