Skip to content

Commit

Permalink
[#1310] Simplified naming of Graph, Element and Factory APIs (#1315)
Browse files Browse the repository at this point in the history
fixes #1310
  • Loading branch information
Kevin Gómez authored and ChrizZz110 committed Jun 25, 2019
1 parent 5ff0afe commit 7138c74
Show file tree
Hide file tree
Showing 655 changed files with 4,570 additions and 4,567 deletions.
2 changes: 1 addition & 1 deletion dev-support/gradoop-idea-codestyle.xml
@@ -1,6 +1,6 @@
<code_scheme name="Gradoop">
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="10" />
<option name="RIGHT_MARGIN" value="100" />
<option name="RIGHT_MARGIN" value="110" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
Expand Down
Expand Up @@ -200,7 +200,7 @@
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!-- Lines cannot exceed 100 chars -->
<module name="LineLength">
<property name="max" value="100"/>
<property name="max" value="110"/>
<property name="ignorePattern" value="^[import|package]|@see|@link"/>
</module>
<!-- Over time, we will revised this down -->
Expand Down
Expand Up @@ -15,15 +15,15 @@
*/
package org.gradoop.common.config;

import org.gradoop.common.model.api.entities.EPGMEdge;
import org.gradoop.common.model.api.entities.EPGMGraphHead;
import org.gradoop.common.model.api.entities.EPGMVertex;
import org.gradoop.common.model.impl.pojo.Edge;
import org.gradoop.common.model.impl.pojo.EdgeFactory;
import org.gradoop.common.model.impl.pojo.GraphHead;
import org.gradoop.common.model.impl.pojo.GraphHeadFactory;
import org.gradoop.common.model.impl.pojo.Vertex;
import org.gradoop.common.model.impl.pojo.VertexFactory;
import org.gradoop.common.model.api.entities.GraphHead;
import org.gradoop.common.model.api.entities.Edge;
import org.gradoop.common.model.api.entities.Vertex;
import org.gradoop.common.model.impl.pojo.EPGMEdge;
import org.gradoop.common.model.impl.pojo.EPGMGraphHead;
import org.gradoop.common.model.impl.pojo.EPGMGraphHeadFactory;
import org.gradoop.common.model.impl.pojo.EPGMVertex;
import org.gradoop.common.model.impl.pojo.EPGMEdgeFactory;
import org.gradoop.common.model.impl.pojo.EPGMVertexFactory;

/**
* Basic Gradoop Configuration.
Expand All @@ -33,30 +33,30 @@
* @param <E> EPGM edge type
*/
public class GradoopConfig
<G extends EPGMGraphHead, V extends EPGMVertex, E extends EPGMEdge> {
<G extends GraphHead, V extends Vertex, E extends Edge> {

/**
* Knows how to create {@link GraphHead}
* Knows how to create {@link EPGMGraphHead}
*/
private final GraphHeadFactory graphHeadFactory;
private final EPGMGraphHeadFactory graphHeadFactory;

/**
* Knows how to create {@link Vertex}
* Knows how to create {@link EPGMVertex}
*/
private final VertexFactory vertexFactory;
private final EPGMVertexFactory vertexFactory;

/**
* Knows how to create {@link Edge}
* Knows how to create {@link EPGMEdge}
*/
private final EdgeFactory edgeFactory;
private final EPGMEdgeFactory edgeFactory;

/**
* Creates a new Configuration.
*/
protected GradoopConfig() {
this.graphHeadFactory = new GraphHeadFactory();
this.vertexFactory = new VertexFactory();
this.edgeFactory = new EdgeFactory();
this.graphHeadFactory = new EPGMGraphHeadFactory();
this.vertexFactory = new EPGMVertexFactory();
this.edgeFactory = new EPGMEdgeFactory();
}

/**
Expand All @@ -65,19 +65,19 @@ protected GradoopConfig() {
*
* @return Default Gradoop configuration.
*/
public static GradoopConfig<GraphHead, Vertex, Edge> getDefaultConfig() {
public static GradoopConfig<EPGMGraphHead, EPGMVertex, EPGMEdge> getDefaultConfig() {
return new GradoopConfig<>();
}

public GraphHeadFactory getGraphHeadFactory() {
public EPGMGraphHeadFactory getGraphHeadFactory() {
return graphHeadFactory;
}

public VertexFactory getVertexFactory() {
public EPGMVertexFactory getVertexFactory() {
return vertexFactory;
}

public EdgeFactory getEdgeFactory() {
public EPGMEdgeFactory getEdgeFactory() {
return edgeFactory;
}
}
Expand Up @@ -24,7 +24,7 @@
/**
* Used to describe entities that can have properties.
*/
public interface EPGMAttributed {
public interface Attributed {

/**
* Returns all properties of that entity.
Expand Down
Expand Up @@ -18,9 +18,9 @@
import org.gradoop.common.model.impl.id.GradoopId;

/**
* Describes data assigned to an edge in the EPGM.
* Describes data assigned to an edge.
*/
public interface EPGMEdge extends EPGMGraphElement {
public interface Edge extends GraphElement {
/**
* Returns the source vertex identifier.
*
Expand Down
Expand Up @@ -20,12 +20,11 @@
import org.gradoop.common.model.impl.properties.Properties;

/**
* Initializes {@link EPGMEdge} objects of a given type.
* Initializes {@link Edge} objects of a given type.
*
* @param <E> EPGM edge type
* @param <E> edge type
*/
public interface EPGMEdgeFactory<E extends EPGMEdge>
extends EPGMElementFactory<E> {
public interface EdgeFactory<E extends Edge> extends ElementFactory<E> {

/**
* Creates a new edge based on the given parameters.
Expand Down
Expand Up @@ -18,12 +18,11 @@
import java.io.Serializable;

/**
* Base interface for all elements in the EPGM.
* Base interface for all elements.
*
* @see EPGMGraphHead
* @see EPGMVertex
* @see EPGMEdge
* @see GraphHead
* @see Vertex
* @see Edge
*/
public interface EPGMElement
extends EPGMIdentifiable, EPGMLabeled, EPGMAttributed, Serializable {
public interface Element extends Identifiable, Labeled, Attributed, Serializable {
}
Expand Up @@ -16,11 +16,11 @@
package org.gradoop.common.model.api.entities;

/**
* Base interfaces for all EPGM factories.
* Base interface for all element factories.
*
* @param <EL> EPGM element type
* @param <EL> element type
*/
public interface EPGMElementFactory<EL extends EPGMElement> {
public interface ElementFactory<EL extends Element> {
/**
* Returns the type of the instances produced by that factory.
*
Expand Down
Expand Up @@ -16,35 +16,35 @@
package org.gradoop.common.model.api.entities;

/**
* Interface that provides getters for the EPGM element factories.
* Interface that provides getters for the element factories.
*
* @param <G> type of the EPGM graph head
* @param <V> type of the EPGM vertex
* @param <E> type of the EPGM edge
* @param <G> type of the graph head
* @param <V> type of the vertex
* @param <E> type of the edge
*/
public interface ElementFactoryProvider<
G extends EPGMGraphHead,
V extends EPGMVertex,
E extends EPGMEdge> {
G extends GraphHead,
V extends Vertex,
E extends Edge> {

/**
* Get the factory that is responsible for creating graph head instances.
*
* @return a factory that creates graph heads
*/
EPGMGraphHeadFactory<G> getGraphHeadFactory();
GraphHeadFactory<G> getGraphHeadFactory();

/**
* Get the factory that is responsible for creating vertex instances.
*
* @return a factory that creates vertices
*/
EPGMVertexFactory<V> getVertexFactory();
VertexFactory<V> getVertexFactory();

/**
* Get the factory that is responsible for creating edge instances.
*
* @return a factory that creates edges
*/
EPGMEdgeFactory<E> getEdgeFactory();
EdgeFactory<E> getEdgeFactory();
}
Expand Up @@ -19,10 +19,10 @@
import org.gradoop.common.model.impl.id.GradoopIdSet;

/**
* A graph element is part of a logical graph. An element can be part of more
* than one logical graph. This applies to vertices and edges in the EPGM.
* A graph element is part of a graph. An element can be part of more
* than one graph. This applies to vertices and edges.
*/
public interface EPGMGraphElement extends EPGMElement {
public interface GraphElement extends Element {
/**
* Returns all graphs that element belongs to.
*
Expand Down
Expand Up @@ -16,7 +16,8 @@
package org.gradoop.common.model.api.entities;

/**
* Describes data assigned to a vertex in the EPGM.
* Describes data specifically assigned to a graph.
*/
public interface EPGMVertex extends EPGMGraphElement {
public interface GraphHead extends Element {

}
Expand Up @@ -19,12 +19,11 @@
import org.gradoop.common.model.impl.properties.Properties;

/**
* Initializes {@link EPGMGraphHead} objects of a given type.
* Initializes {@link GraphHead} objects of a given type.
*
* @param <G> EPGM graph head type
* @param <G> graph head type
*/
public interface EPGMGraphHeadFactory<G extends EPGMGraphHead>
extends EPGMElementFactory<G> {
public interface GraphHeadFactory<G extends GraphHead> extends ElementFactory<G> {

/**
* Creates a new graph head based.
Expand Down
Expand Up @@ -20,7 +20,7 @@
/**
* Describes an identifiable entity.
*/
public interface EPGMIdentifiable {
public interface Identifiable {
/**
* Returns the identifier of that entity.
*
Expand Down
Expand Up @@ -18,7 +18,7 @@
/**
* Describes an entity that has a label.
*/
public interface EPGMLabeled {
public interface Labeled {
/**
* Returns the label of that entity.
*
Expand Down
Expand Up @@ -16,8 +16,7 @@
package org.gradoop.common.model.api.entities;

/**
* Describes data specifically assigned to a logical graph in the EPGM.
* Describes data assigned to a vertex.
*/
public interface EPGMGraphHead extends EPGMElement {

public interface Vertex extends GraphElement {
}
Expand Up @@ -20,12 +20,11 @@
import org.gradoop.common.model.impl.properties.Properties;

/**
* Initializes {@link EPGMVertex} objects of a given type.
* Initializes {@link Vertex} objects of a given type.
*
* @param <V> EPGM vertex type
* @param <V> vertex type
*/
public interface EPGMVertexFactory<V extends EPGMVertex>
extends EPGMElementFactory<V> {
public interface VertexFactory<V extends Vertex> extends ElementFactory<V> {

/**
* Initializes a new vertex based on the given parameters.
Expand Down
Expand Up @@ -15,18 +15,18 @@
*/
package org.gradoop.common.model.impl.comparators;

import org.gradoop.common.model.api.entities.EPGMIdentifiable;
import org.gradoop.common.model.api.entities.Identifiable;

import java.io.Serializable;
import java.util.Comparator;

/**
* Id based EPGM element comparator.
*/
public class EPGMIdentifiableComparator implements Comparator<EPGMIdentifiable>, Serializable {
public class IdentifiableComparator implements Comparator<Identifiable>, Serializable {

@Override
public int compare(EPGMIdentifiable a, EPGMIdentifiable b) {
public int compare(Identifiable a, Identifiable b) {
return a.getId().compareTo(b.getId());
}
}
Expand Up @@ -21,7 +21,7 @@
import org.apache.flink.core.memory.MemorySegment;
import org.apache.flink.types.CopyableValue;
import org.apache.flink.types.NormalizableKey;
import org.gradoop.common.model.api.entities.EPGMIdentifiable;
import org.gradoop.common.model.api.entities.Identifiable;

import java.io.IOException;
import java.net.NetworkInterface;
Expand All @@ -40,7 +40,7 @@
* (org.bson.types.ObjectId) to guarantee uniqueness. Much of the code is copied directly or
* has only small changes.
*
* @see EPGMIdentifiable
* @see Identifiable
* <p>
* references to: org.bson.types.ObjectId
*/
Expand Down
Expand Up @@ -15,30 +15,30 @@
*/
package org.gradoop.common.model.impl.pojo;

import org.gradoop.common.model.api.entities.EPGMEdge;
import org.gradoop.common.model.api.entities.Edge;
import org.gradoop.common.model.impl.id.GradoopId;
import org.gradoop.common.model.impl.id.GradoopIdSet;
import org.gradoop.common.model.impl.properties.Properties;

/**
* POJO Implementation of an EPGM edge.
*/
public class Edge extends GraphElement implements EPGMEdge {
public class EPGMEdge extends EPGMGraphElement implements Edge {

/**
* EPGMVertex identifier of the source vertex.
* Vertex identifier of the source vertex.
*/
private GradoopId sourceId;

/**
* EPGMVertex identifier of the target vertex.
* Vertex identifier of the target vertex.
*/
private GradoopId targetId;

/**
* Default constructor is necessary to apply to POJO rules.
*/
public Edge() {
public EPGMEdge() {
}

/**
Expand All @@ -51,7 +51,7 @@ public Edge() {
* @param properties edge properties
* @param graphIds graphs that edge is contained in
*/
public Edge(final GradoopId id, final String label, final GradoopId sourceId,
public EPGMEdge(final GradoopId id, final String label, final GradoopId sourceId,
final GradoopId targetId, final Properties properties,
GradoopIdSet graphIds) {
super(id, label, properties, graphIds);
Expand Down

0 comments on commit 7138c74

Please sign in to comment.