Skip to content

Commit

Permalink
Resolving merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsh committed Jul 6, 2012
2 parents b0bc70c + 409a5bb commit e8a663d
Show file tree
Hide file tree
Showing 42 changed files with 54 additions and 170 deletions.
10 changes: 0 additions & 10 deletions blueprints-core/src/main/java/com/tinkerpop/blueprints/Edge.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,4 @@ public interface Edge extends Element {
* @return the edge label
*/
public String getLabel();

/**
* Assign a key/value property to the edge.
* If a value already exists for this key, then the previous key/value is overwritten.
*
* @param key the string key of the property
* @param value the object value o the property
* @return return the edge with the newly added property
*/
public Edge setProperty(String key, Object value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ public abstract interface Element {
*
* @param key the string key of the property
* @param value the object value o the property
* @return return the element with the newly added property
*/
public Element setProperty(String key, Object value);
public void setProperty(String key, Object value);

/**
* Un-assigns a key/value property from the element.
Expand Down
10 changes: 0 additions & 10 deletions blueprints-core/src/main/java/com/tinkerpop/blueprints/Vertex.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,4 @@ public interface Vertex extends Element {
* @return a vertex query object with methods for constraining which data is pulled from the underlying graph
*/
public Query query();

/**
* Assign a key/value property to the vertex.
* If a value already exists for this key, then the previous key/value is overwritten.
*
* @param key the string key of the property
* @param value the object value o the property
* @return return the vertex with the newly added property
*/
public Vertex setProperty(String key, Object value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,4 @@ else if (direction.equals(Direction.OUT))
public String toString() {
return StringFactory.edgeString(this);
}

public Edge setProperty(final String key, final Object value) {
return (Edge) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Object getProperty(final String key) {
return this.properties.get(key);
}

public Element setProperty(final String key, final Object value) {
public void setProperty(final String key, final Object value) {
if (key.equals(StringFactory.ID))
throw ExceptionFactory.propertyKeyIdIsReserved();
if (key.equals(StringFactory.LABEL) && this instanceof Edge)
Expand All @@ -47,8 +47,6 @@ public Element setProperty(final String key, final Object value) {
this.graph.vertexKeyIndex.autoUpdate(key, value, oldValue, (TinkerVertex) this);
else
this.graph.edgeKeyIndex.autoUpdate(key, value, oldValue, (TinkerEdge) this);

return this;
}

public Object removeProperty(final String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,4 @@ protected void addInEdge(final String label, final Edge edge) {
}
edges.add(edge);
}

public Vertex setProperty(final String key, final Object value) {
return (Vertex) super.setProperty(key, value);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,8 @@ public Query query() {
}

@Override
public Vertex setProperty(String key, Object value) {
public void setProperty(String key, Object value) {
getCachedVertex(externalID).setProperty(key, value);
return this;
}

@Override
Expand Down Expand Up @@ -362,9 +361,8 @@ public String getLabel() {
}

@Override
public Edge setProperty(String key, Object value) {
public void setProperty(String key, Object value) {
getWrappedEdge().setProperty(key, value);
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class EventEdge extends EventElement implements Edge {

protected EventEdge(final Edge rawEdge, final List<GraphChangedListener> graphChangedListeners,
final EventTrigger trigger) {
final EventTrigger trigger) {
super(rawEdge, graphChangedListeners, trigger);
}

Expand All @@ -31,8 +31,4 @@ public String getLabel() {
public Edge getBaseEdge() {
return (Edge) this.baseElement;
}

public Edge setProperty(final String key, final Object value) {
return (Edge) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public abstract class EventElement implements Element {
protected final List<GraphChangedListener> graphChangedListeners;

protected EventElement(final Element baseElement, final List<GraphChangedListener> graphChangedListeners,
final EventTrigger trigger) {
final EventTrigger trigger) {
this.baseElement = baseElement;
this.graphChangedListeners = graphChangedListeners;
this.trigger = trigger;
Expand Down Expand Up @@ -78,16 +78,14 @@ public Object getProperty(final String key) {
/**
* Raises a vertexPropertyRemoved or edgePropertyChanged event.
*/
public Element setProperty(final String key, final Object value) {
public void setProperty(final String key, final Object value) {
this.baseElement.setProperty(key, value);

if (this instanceof Vertex) {
this.onVertexPropertyChanged((Vertex) this, key, value);
} else if (this instanceof Edge) {
this.onEdgePropertyChanged((Edge) this, key, value);
}

return this;
}

public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,4 @@ public Iterable<Edge> edges() {
public Vertex getBaseVertex() {
return (Vertex) this.baseElement;
}

public Vertex setProperty(final String key, final Object value) {
return (Vertex) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public String getLabel() {
return ((Edge) this.baseElement).getLabel();
}

public Edge setProperty(final String key, final Object value) {
return (Edge) super.setProperty(key, value);
public void setProperty(final String key, final Object value) {
super.setProperty(key, value);
}

public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ public Set<String> getPropertyKeys() {
return s;
}

public Element setProperty(final String key, final Object value) {
public void setProperty(final String key, final Object value) {
if (key.equals(IdGraph.ID)) {
throw new IllegalArgumentException("Unable to set value for reserved property " + IdGraph.ID);
}

baseElement.setProperty(key, value);
return this;
}

public Object removeProperty(final String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public IdGraph(final T baseGraph, final IdFactory idFactory) {
/**
* Adds custom ID functionality to the given graph, also specifying (separate) factories for new vertex and edge IDs.
*
* @param baseGraph the base graph which may or may not permit custom element IDs
* @param baseGraph the base graph which may or may not permit custom element IDs
* @param vertexIdFactory a factory for new vertex IDs.
* When vertices are created using null IDs, the actual IDs are chosen based on this factory.
* @param edgeIdFactory a factory for new edge IDs.
* When edges are created using null IDs, the actual IDs are chosen based on this factory.
* When vertices are created using null IDs, the actual IDs are chosen based on this factory.
* @param edgeIdFactory a factory for new edge IDs.
* When edges are created using null IDs, the actual IDs are chosen based on this factory.
*/
public IdGraph(final T baseGraph,
final IdFactory vertexIdFactory,
Expand Down Expand Up @@ -95,15 +95,7 @@ public Vertex addVertex(final Object id) {
}

final Vertex base = baseGraph.addVertex(null);

Object v = null == id ? vertexIdFactory.createId() : id;

if (null == v) {
base.removeProperty(ID);
} else {
base.setProperty(ID, v);
}

base.setProperty(ID, null == id ? vertexIdFactory.createId() : id);
return new IdVertex(base);
}

Expand Down Expand Up @@ -152,17 +144,11 @@ public Edge addEdge(final Object id, final Vertex outVertex, final Vertex inVert
verifyNativeElement(outVertex);
verifyNativeElement(inVertex);

Edge base = baseGraph.addEdge(null, ((IdVertex) outVertex).getBaseVertex(), ((IdVertex) inVertex).getBaseVertex(), label);

Object v = null == id ? edgeIdFactory.createId() : id;
Edge e = baseGraph.addEdge(null, ((IdVertex) outVertex).getBaseVertex(), ((IdVertex) inVertex).getBaseVertex(), label);

if (null == v) {
base.removeProperty(ID);
} else {
base.setProperty(ID, v);
}
e.setProperty(ID, null == id ? edgeIdFactory.createId() : id);

return new IdEdge(base);
return new IdEdge(e);
}

public Edge getEdge(final Object id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public Iterable<Edge> edges() {
};
}

public Vertex setProperty(final String key, final Object value) {
return (Vertex) super.setProperty(key, value);
public void setProperty(final String key, final Object value) {
super.setProperty(key, value);
}

public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@ public String getLabel() {
public Edge getBaseEdge() {
return (Edge) this.baseElement;
}

public Edge setProperty(final String key, final Object value) {
return (Edge) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ protected PartitionElement(final Element baseElement, final PartitionGraph graph
this.graph = graph;
}

public Element setProperty(final String key, final Object value) {
public void setProperty(final String key, final Object value) {
if (!key.equals(this.graph.getPartitionKey()))
this.baseElement.setProperty(key, value);
return this;
}

public Object getProperty(final String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,4 @@ public Iterable<Edge> edges() {
public Vertex getBaseVertex() {
return (Vertex) this.baseElement;
}

public Vertex setProperty(final String key, final Object value) {
return (Vertex) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@ public Vertex getVertex(final Direction direction) throws IllegalArgumentExcepti
public String getLabel() {
return ((Edge) this.baseElement).getLabel();
}

public Edge setProperty(final String key, final Object value) {
throw new UnsupportedOperationException(ReadOnlyTokens.MUTATE_ERROR_MESSAGE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Object getProperty(final String key) {
/**
* @throws UnsupportedOperationException
*/
public Element setProperty(final String key, final Object value) throws UnsupportedOperationException {
public void setProperty(final String key, final Object value) throws UnsupportedOperationException {
throw new UnsupportedOperationException(ReadOnlyTokens.MUTATE_ERROR_MESSAGE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,4 @@ public Iterable<Edge> edges() {
}
};
}

public Vertex setProperty(final String key, final Object value) {
throw new UnsupportedOperationException(ReadOnlyTokens.MUTATE_ERROR_MESSAGE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Element;
import com.tinkerpop.blueprints.Vertex;

/**
Expand All @@ -25,8 +24,4 @@ public String getLabel() {
public Edge getBaseEdge() {
return (Edge) this.baseElement;
}

public Edge setProperty(final String key, final Object value) {
return (Edge) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ protected WrappedElement(final Element baseElement) {
this.baseElement = baseElement;
}

public Element setProperty(final String key, final Object value) {
public void setProperty(final String key, final Object value) {
this.baseElement.setProperty(key, value);
return this;
}

public Object getProperty(final String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,4 @@ public Iterable<Edge> edges() {
public Vertex getBaseVertex() {
return (Vertex) this.baseElement;
}

public Vertex setProperty(final String key, final Object value) {
return (Vertex) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,4 @@ public String getLabel() {
public String toString() {
return StringFactory.edgeString(this);
}

public Edge setProperty(final String key, final Object value) {
return (Edge) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public Set<String> getPropertyKeys() {
* java.lang.Object)
*/
@Override
public Element setProperty(final String key, final Object value) {
public void setProperty(final String key, final Object value) {
//System.out.println(this + "!!" + key + "!!" + value);
if (key.equals(StringFactory.ID))
throw ExceptionFactory.propertyKeyIdIsReserved();
Expand Down Expand Up @@ -220,7 +220,7 @@ public Element setProperty(final String key, final Object value) {
//System.out.println("\t" + this + "!!" + attr + "!!" + v);
// throw e;
//}
return this;

}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,4 @@ else if (labels.length == 1) {
public Query query() {
return new DefaultQuery(this);
}

public Vertex setProperty(final String key, final Object value) {
return (Vertex) super.setProperty(key, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public String toString() {
return StringFactory.edgeString(this);
}

public Edge setProperty(final String key, final Object value) {
return (Edge) super.setProperty(key, value);
}

public Relationship getRawEdge() {
return (Relationship) this.rawElement;
}
Expand Down
Loading

0 comments on commit e8a663d

Please sign in to comment.