public final class Changes<VID>
extends java.lang.Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
Changes.ChangesIntent  | 
| Constructor and Description | 
|---|
Changes(IdType idType, Changes.ChangesIntent intent)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addEdge(long id, VID srcId, VID dstId)
Adds the edge with the given id, source vertex and destination vertex 
 | 
void | 
addVertex(VID id)
Adds the vertex with the given id. 
 | 
void | 
addVertexLabel(VID id, java.lang.String label)
Adds a label to the given vertex 
 | 
void | 
assertVertexExists(VID vertexId)  | 
static <T extends oracle.pgx.api.graphbuilder.ElementChanges> | 
extractPropertyType(java.util.List<? extends oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<?,T>> changes)
Extracts the property types from a list of changes as map  
propertyKey -> propertyType | 
static IdType | 
extractVertexIdType(java.util.List<? extends oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<?,VertexChanges>> vertexChanges, java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<java.lang.Long,EdgeChanges>> edgeChanges)  | 
static void | 
fixEdgeChanges(java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<java.lang.Long,EdgeChanges>> changes, java.util.Map<java.lang.String,PropertyType> expectedPropTypes, IdType expectedVertexIdType)
fixed edge changes from possible json encoding errors 
 | 
static void | 
fixVertexChanges(java.util.List<? extends oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<?,VertexChanges>> changes, java.util.Map<java.lang.String,PropertyType> expectedPropTypes, IdType expectedVertexIdType)
fixes vertex changes from possible json encoding errors 
 | 
OnAddExistingElement | 
getAddExistingEdgePolicy()  | 
OnAddExistingElement | 
getAddExistingVertexPolicy()  | 
java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<java.lang.Long,EdgeChanges>> | 
getEdgeChanges()
Returns the cached edge changes 
 | 
ChangeType | 
getEdgeChangeType(long id)  | 
java.util.Map<java.lang.String,PropertyType> | 
getEdgePropTypes()  | 
IdType | 
getIdType()  | 
int | 
getNumEdgeChanges()
The number of cached edge changes 
 | 
int | 
getNumVertexChanges()
The number of cached vertex changes 
 | 
java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<VID,VertexChanges>> | 
getVertexChanges()
Returns the cached vertex changes 
 | 
ChangeType | 
getVertexChangeType(VID id)  | 
java.util.Map<java.lang.String,PropertyType> | 
getVertexPropTypes()  | 
void | 
removeEdge(long edgeId)  | 
void | 
removeVertex(VID vertexId)  | 
void | 
removeVertexLabel(VID id, java.lang.String label)  | 
void | 
resetEdge(long edgeId)
Resets the changes for the given id 
 | 
void | 
resetVertex(VID vertexId)
Resets the changes for the given vertex
 
If the vertex was added, all edges which used this vertex are reset as well  | 
void | 
setAddExistingEdgePolicy(OnAddExistingElement addExistingEdgePolicy)  | 
void | 
setAddExistingVertexPolicy(OnAddExistingElement addExistingVertexPolicy)  | 
void | 
setEdgeLabel(long id, java.lang.String label)
Sets the label of a given edge 
 | 
void | 
setEdgeProperty(long id, java.lang.String key, java.lang.Object value)
Sets the property of the given edge to the given value 
 | 
void | 
setVertexProperty(VID id, java.lang.String key, java.lang.Object value)
Sets the property of the given vertex to the given value 
 | 
java.lang.String | 
toString()  | 
void | 
updateEdge(long id)  | 
void | 
updateVertex(VID id)  | 
public Changes(IdType idType, Changes.ChangesIntent intent)
public void addEdge(long id,
                    VID srcId,
                    VID dstId)
id - the id of the edge to addsrcId - the id of the source vertexdstId - the id of the destination vertexpublic void addVertex(VID id)
id - the id of the new vertexpublic void addVertexLabel(VID id, java.lang.String label)
id - the id of the vertexlabel - the label to addpublic final void assertVertexExists(VID vertexId)
public static <T extends oracle.pgx.api.graphbuilder.ElementChanges> java.util.Map<java.lang.String,PropertyType> extractPropertyType(java.util.List<? extends oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<?,T>> changes)
propertyKey -> propertyTypechanges - the list of changes to extract the types frompublic static IdType extractVertexIdType(java.util.List<? extends oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<?,VertexChanges>> vertexChanges, java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<java.lang.Long,EdgeChanges>> edgeChanges)
public static void fixEdgeChanges(java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<java.lang.Long,EdgeChanges>> changes, java.util.Map<java.lang.String,PropertyType> expectedPropTypes, IdType expectedVertexIdType) throws java.io.IOException
changes - the changes to fixexpectedPropTypes - the expected property typesexpectedVertexIdType - the expected vertex id typejava.io.IOExceptionpublic static void fixVertexChanges(java.util.List<? extends oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<?,VertexChanges>> changes, java.util.Map<java.lang.String,PropertyType> expectedPropTypes, IdType expectedVertexIdType) throws java.io.IOException
changes - the changes to fixexpectedPropTypes - the expected property typesexpectedVertexIdType - the expected vertex id typejava.io.IOExceptionpublic OnAddExistingElement getAddExistingEdgePolicy()
public OnAddExistingElement getAddExistingVertexPolicy()
public java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<java.lang.Long,EdgeChanges>> getEdgeChanges()
public ChangeType getEdgeChangeType(long id)
public java.util.Map<java.lang.String,PropertyType> getEdgePropTypes()
public IdType getIdType()
public int getNumEdgeChanges()
public int getNumVertexChanges()
public java.util.List<oracle.pgx.common.util.ChangeTrackingMap.ChangeSetEntry<VID,VertexChanges>> getVertexChanges()
public ChangeType getVertexChangeType(VID id)
public java.util.Map<java.lang.String,PropertyType> getVertexPropTypes()
public void removeEdge(long edgeId)
public void removeVertex(VID vertexId)
public void removeVertexLabel(VID id, java.lang.String label)
public void resetEdge(long edgeId)
edgeId - the id of the edge to resetpublic void resetVertex(VID vertexId)
If the vertex was added, all edges which used this vertex are reset as well
vertexId - the id of the vertex to resetpublic void setAddExistingEdgePolicy(OnAddExistingElement addExistingEdgePolicy)
public void setAddExistingVertexPolicy(OnAddExistingElement addExistingVertexPolicy)
public void setEdgeLabel(long id,
                         java.lang.String label)
id - the id of the edgelabel - the new value of the label
public void setEdgeProperty(long id,
                            java.lang.String key,
                            java.lang.Object value)
id - the id of the edgekey - the property keyvalue - the new valuepublic void setVertexProperty(VID id, java.lang.String key, java.lang.Object value)
id - the id of the vertexkey - the property keyvalue - the new valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic void updateEdge(long id)
public void updateVertex(VID id)
Copyright © 2016, 2018 Oracle and/or its affiliates. All Rights Reserved.