/** * Creates a new Configuration. */ @SuppressWarnings("unchecked") protected GradoopConfig() { this.graphHeadFactory = new GraphHeadFactory(); this.vertexFactory = new VertexFactory(); this.edgeFactory = new EdgeFactory(); }
@Override public Vertex cross(GraphHead searchGraphHead, GraphHead patternGraphSeachHead) throws Exception { REUSABLE_VERTEX.setLabel(patternGraphSeachHead.getLabel()); REUSABLE_VERTEX.setProperties(patternGraphSeachHead.getProperties()); REUSABLE_VERTEX.setId(newVertexId); REUSABLE_VERTEX.addGraphId(searchGraphHead.getId()); return REUSABLE_VERTEX; } }
/** * {@inheritDoc} */ @Override public Vertex cross(Tuple1<Long> longTuple1, Vertex vertex) { vertex.setProperty(nameOfMaxDegreeProperty, longTuple1.f0); return vertex; } }
/** * Drop edge properties. * * @param current current edge * @param transformed copy of current except label and properties * @return current edge without properties */ private static Edge dropEdgeProperties(Edge current, Edge transformed) { transformed.setLabel(current.getLabel()); return transformed; }
/** * {@inheritDoc} */ @Override public Tuple2<Vertex, GradoopId> map(Vertex vertex) throws Exception { reuse.f0 = vertex; reuse.f1 = vertex.getId(); return reuse; } }
@Override public Edge initEdge(final GradoopId id, final String label, final GradoopId sourceVertexId, final GradoopId targetVertexId) { return initEdge(id, label, sourceVertexId, targetVertexId, null, null); }
@Override public GraphHead map(GraphHead graphHead) throws Exception { graphHead.setProperty(propertyKey, propertyValue); return graphHead; } }
@Override public PropertyValue getIncrement(Element element) { return element.getPropertyValue(propertyKey); } }
@Override public EL join(EL element, Tuple2<GradoopId, T> propertyTuple) throws Exception { element.setProperty(propertyKey, propertyTuple.f1); return element; } }
@Override public K map(K value) throws Exception { value.addGraphId(newGraphId); return value; } }
@Override public Tuple1<GradoopId> map(EL element) throws Exception { reuseTuple.f0 = element.getId(); return reuseTuple; } }
@Override public String toString() { return super.toString() + "[]"; } }
@Override public Vertex cross(GraphHead searchGraphHead, GraphHead patternGraphSeachHead) throws Exception { REUSABLE_VERTEX.setLabel(patternGraphSeachHead.getLabel()); REUSABLE_VERTEX.setProperties(patternGraphSeachHead.getProperties()); REUSABLE_VERTEX.setId(newVertexId); REUSABLE_VERTEX.addGraphId(searchGraphHead.getId()); return REUSABLE_VERTEX; } }
@Override public Vertex join(Tuple2<GradoopId, Double> resultTuple, Vertex vertex) throws Exception { vertex.setProperty(ClusteringCoefficientBase.PROPERTY_KEY_LOCAL, resultTuple.f1); return vertex; } }
@Override public Edge initEdge(final GradoopId id, final String label, final GradoopId sourceVertexId, final GradoopId targetVertexId, GradoopIdSet graphs) { return initEdge(id, label, sourceVertexId, targetVertexId, null, graphs); }
@Override public PropertyValue getIncrement(Element element) { return element.getPropertyValue(propertyKey); } }
/** * Adds a new property to the element. * * @param element original element to be updated * @return updated element */ @Override public E map(E element) throws Exception { element.setProperty(propertyKey, propertyValue); return element; } }
/** * {@inheritDoc} */ @Override public GE map(GE graphElement) throws Exception { graphElement.addGraphId(graphHeadId); return graphElement; } }
/** * Adds a new property to the element. * * @param element original element to be updated * @return updated element */ @Override public E map(E element) throws Exception { element.setProperty(propertyKey, propertyValue); return element; } }
@Override public GE map(GE graphElement) throws Exception { graphElement.addGraphId(graphId); return graphElement; } }