@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; }
var appendages = { legs : 2 }; var Features = function() { this.ears = 4; this.eyes = 1; } // Extend Features class with Appendages class. Features.prototype = appendages; var sara = new Features(); sara.legs; // Returns 2.
private static Features getBaselineTitanFeatures() { Features features = new Features(); features.supportsDuplicateEdges = true; features.supportsSelfLoops = true; features.supportsThreadedTransactions = true; setIfExists(features, "supportsThreadIsolatedTransactions", true); features.checkCompliance(); return features;
public ReadOnlyGraph(final T baseGraph) { this.baseGraph = baseGraph; this.features = this.baseGraph.getFeatures().copyFeatures(); this.features.isWrapper = true; }
var appendages = { legs : 2 }; var Features = function() { this.ears = 4; this.eyes = 1; } // Extend Features class with Appendages class. Features.prototype = appendages; var sara = new Features(); sara.legs; // Returns 2. appendages.hair = true; sara.hair; // Returns true.
public WrappedGraph(final T baseGraph) { this.baseGraph = baseGraph; this.features = this.baseGraph.getFeatures().copyFeatures(); this.features.isWrapper = true; }
public static Features get() { Features f = new Features();
/** * @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 static Features get() { Features f = new Features();
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; }
/** * This method copies the features in this features object to another feature object. * * @return a feature object with a clone of the features in the prior. */ public Features copyFeatures() { try { final Features features = new Features(); for (final Field field : this.getClass().getFields()) { field.set(features, field.get(this)); } return features; } catch (IllegalAccessException e) { throw new RuntimeException(e.getMessage(), e); } } }
public EventGraph(final T baseGraph) { this.baseGraph = baseGraph; this.features = this.baseGraph.getFeatures().copyFeatures(); this.features.isWrapper = true; this.trigger = new EventTrigger(this, false); }
features= new Features(primary,features, video, secondary);
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; }