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

cdc.graphs.impl.tests.TestEdge Maven / Gradle / Ivy

There is a newer version: 0.71.2
Show newest version
package cdc.graphs.impl.tests;

import java.util.Objects;

import cdc.graphs.GraphEdge;

public interface TestEdge extends GraphEdge {
    /**
     * @return The edge name (identifier-like).
     */
    public String getName();

    /**
     * @return The edge label.
     */
    public String getLabel();

    /**
     * Sets the edge label.
     *
     * @param label The label.
     */
    public void setLabel(String label);

    /**
     * @return A hash code based on definition of this edge.
     */
    public default int getDefinitionHashCode() {
        return Objects.hash(getLabel(),
                            getName(),
                            getSource().getDefinitionHashCode(),
                            getTarget().getDefinitionHashCode());
    }

    /**
     * @param edge The other edge.
     * @return {@code true} if this edge and {@code edge} have the same definition.
     */
    public default boolean hasSameDefinition(TestEdge edge) {
        return Objects.equals(getLabel(), edge.getLabel())
                && Objects.equals(getName(), edge.getName())
                && getSource().hasSameDefinition(edge.getSource())
                && getTarget().hasSameDefinition(edge.getTarget());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy