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

gr.james.simplegraph.Edge Maven / Gradle / Ivy

Go to download

Simple Graph is a graph interface for Java 6 that is designed to expose a very simple API to support working with graphs

The newest version!
package gr.james.simplegraph;

/**
 * Represents an edge of a {@link Graph}.
 * 

* Memory Complexity: O(1) */ public interface Edge extends BaseEdge { /** * Returns the vertex at one end of this edge. *

* Complexity: O(1) * * @return the vertex at one end of this edge */ int v(); /** * Returns the vertex at the other end of this edge. *

* Complexity: O(1) * * @return the vertex at the other end of this edge */ int w(); /** * Returns a new {@link Edge} that has the values of {@link #v()} and {@link #w()} interchanged. *

* Because this is an undirected edge it holds that: *


     * assert e.equals(e.swap());
     * 
*

* Complexity: O(1) * * @return a new {@link Edge} that has the values of {@link #v()} and {@link #w()} interchanged */ Edge swap(); /** * {@inheritDoc} * * @param obj {@inheritDoc} * @return {@inheritDoc} */ @Override boolean equals(Object obj); /** * {@inheritDoc} * * @return {@inheritDoc} */ @Override int hashCode(); /** * {@inheritDoc} * * @return {@inheritDoc} */ @Override String toString(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy