All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.graphaware.module.relcount.count.OneForEach Maven / Gradle / Ivy

There is a newer version: 2.3.2.37.9
Show newest version
package com.graphaware.module.relcount.count;

import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;

/**
 * A singleton implementation of {@link WeighingStrategy} that gives each relationship a weight of 1.
 */
public final class OneForEach implements WeighingStrategy {

    private static final OneForEach INSTANCE = new OneForEach();

    private OneForEach() {
    }

    public static OneForEach getInstance() {
        return INSTANCE;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getRelationshipWeight(Relationship relationship, Node pointOfView) {
        return 1;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy