@Override public Features getFeatures() { Features features = baseGraph.getFeatures().copyFeatures(); features.ignoresSuppliedIds = false; features.isWrapper = true; features.supportsEdgeIteration = false; features.supportsThreadedTransactions = false; features.supportsVertexIteration = false; return features; }
public ReadOnlyGraph(final T baseGraph) { this.baseGraph = baseGraph; this.features = this.baseGraph.getFeatures().copyFeatures(); this.features.isWrapper = true; }
public WrappedGraph(final T baseGraph) { this.baseGraph = baseGraph; this.features = this.baseGraph.getFeatures().copyFeatures(); this.features.isWrapper = true; }
/** * @return The features of the underlying graph but with transactions supported. */ @Override public Features getFeatures() { Features f = graph.getFeatures().copyFeatures(); f.isWrapper = true; f.supportsTransactions = true; return f; }
public PartitionGraph(final T baseGraph, final String partitionKey, final String writePartition, final Set<String> readPartitions) { this.baseGraph = baseGraph; this.partitionKey = partitionKey; this.writePartition = writePartition; this.readPartitions.addAll(readPartitions); this.features = this.baseGraph.getFeatures().copyFeatures(); this.features.isWrapper = true; }
public EventGraph(final T baseGraph) { this.baseGraph = baseGraph; this.features = this.baseGraph.getFeatures().copyFeatures(); this.features.isWrapper = true; this.trigger = new EventTrigger(this, false); }
public Features getFeatures() { Features features = config.getConfiguredGraph().getFeatures().copyFeatures(); features.isWrapper = true; return features; }
public Features getFeatures() { Features features = config.getConfiguredGraph().getFeatures().copyFeatures(); features.isWrapper = true; return features; }
public VersionedGraphBase(T baseGraph, GraphIdentifierBehavior<V> identifierBehavior, Configuration conf) { Preconditions.checkNotNull(baseGraph, "Base graph must be set."); Preconditions.checkNotNull(identifierBehavior, "Identifier behavior must be set."); this.underlineGraph = baseGraph; this.identifierBehavior = identifierBehavior; this.identifierBehavior.setGraph(this); if (conf == null) { this.conf = new Configuration.ConfBuilder().build(); } else { this.conf = conf; } this.features = baseGraph.getFeatures().copyFeatures(); features.isWrapper = true; if (this.conf.useNaturalIds || (this.conf.useNaturalIdsOnlyIfSuppliedIdsAreIgnored && baseGraph.getFeatures().ignoresSuppliedIds)) { features.ignoresSuppliedIds = true; } }
/** * Adds custom ID functionality to the given graph, * supporting either custom vertex IDs, custom edge IDs, or both. * * @param baseGraph the base graph which does not necessarily support custom IDs * @param supportVertexIds whether to support custom vertex IDs * @param supportEdgeIds whether to support custom edge IDs */ public IdGraph(final T baseGraph, final boolean supportVertexIds, final boolean supportEdgeIds) { this.baseGraph = baseGraph; this.features = this.baseGraph.getFeatures().copyFeatures(); features.isWrapper = true; features.ignoresSuppliedIds = false; this.supportVertexIds = supportVertexIds; this.supportEdgeIds = supportEdgeIds; if (!supportVertexIds && !supportEdgeIds) { throw new IllegalArgumentException("if neither custom vertex IDs nor custom edge IDs are supported, IdGraph can't help you!"); } createIndices(); vertexIdFactory = new DefaultIdFactory(); edgeIdFactory = new DefaultIdFactory(); }
/** * Adds custom ID functionality to the given graph, supporting either custom vertex IDs, custom edge IDs, or both. * * @param baseGraph the base graph which does not necessarily support custom IDs * @param supportVertexIds whether to support custom vertex IDs * @param supportEdgeIds whether to support custom edge IDs */ public IdGraph(KeyIndexableGraph baseGraph, boolean supportVertexIds, boolean supportEdgeIds) { this.baseGraph = checkNotNull(baseGraph, "baseGraph"); this.supportVertexIds = supportVertexIds; this.supportEdgeIds = supportEdgeIds; checkArgument(supportVertexIds || supportEdgeIds, "If neither custom vertex IDs nor custom edge IDs are supported, IdGraph can't help you!"); // Create indices if (supportVertexIds && !baseGraph.getIndexedKeys(Vertex.class).contains(ID)) { baseGraph.createKeyIndex(ID, Vertex.class); } if (supportEdgeIds && !baseGraph.getIndexedKeys(Edge.class).contains(ID)) { baseGraph.createKeyIndex(ID, Edge.class); } features = baseGraph.getFeatures().copyFeatures(); features.isWrapper = true; features.ignoresSuppliedIds = false; }