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

hydra.langs.tinkerpop.propertyGraph.Graph Maven / Gradle / Ivy

package hydra.langs.tinkerpop.propertyGraph;

import java.io.Serializable;

/**
 * A graph; a self-contained collection of vertices and edges
 */
public class Graph implements Serializable {
  public static final hydra.core.Name NAME = new hydra.core.Name("hydra/langs/tinkerpop/propertyGraph.Graph");
  
  public final java.util.Map> vertices;
  
  public final java.util.Map> edges;
  
  public Graph (java.util.Map> vertices, java.util.Map> edges) {
    this.vertices = vertices;
    this.edges = edges;
  }
  
  @Override
  public boolean equals(Object other) {
    if (!(other instanceof Graph)) {
      return false;
    }
    Graph o = (Graph) (other);
    return vertices.equals(o.vertices) && edges.equals(o.edges);
  }
  
  @Override
  public int hashCode() {
    return 2 * vertices.hashCode() + 3 * edges.hashCode();
  }
  
  public Graph withVertices(java.util.Map> vertices) {
    return new Graph(vertices, edges);
  }
  
  public Graph withEdges(java.util.Map> edges) {
    return new Graph(vertices, edges);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy