public static void removeElementIndex(final TinkerVertex vertex) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.removeElement(vertex); }
public static void autoUpdateIndex(final TinkerVertex vertex, final String key, final Object newValue, final Object oldValue) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.autoUpdate(key, newValue, oldValue, vertex); }
public static void removeIndex(final TinkerVertex vertex, final String key, final Object value) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.remove(key, value, vertex); }
@Override public Set<String> keys() { if (null == this.properties) return Collections.emptySet(); return TinkerHelper.inComputerMode((TinkerGraph) graph()) ? Vertex.super.keys() : this.properties.keySet(); }
/** * This constructor will not validate the ID type against the {@link Graph}. It will always just use a * {@code Long} for its identifier. This is useful for constructing a {@link VertexProperty} for usage * with {@link TinkerGraphComputerView}. */ public TinkerVertexProperty(final TinkerVertex vertex, final String key, final V value, final Object... propertyKeyValues) { super(((TinkerGraph) vertex.graph()).vertexPropertyIdManager.getNextId((TinkerGraph) vertex.graph()), key); this.vertex = vertex; this.key = key; this.value = value; ElementHelper.legalPropertyKeyValueArray(propertyKeyValues); ElementHelper.attachProperties(this, propertyKeyValues); }
@Override public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) { if (this.removed) return Collections.emptyIterator(); if (TinkerHelper.inComputerMode((TinkerGraph) graph())) return (Iterator) ((TinkerGraph) graph()).graphComputerView.getProperties(TinkerVertex.this).stream().filter(p -> ElementHelper.keyExists(p.key(), propertyKeys)).iterator(); else { if (null == this.properties) return Collections.emptyIterator(); if (propertyKeys.length == 1) { final List<VertexProperty> properties = this.properties.getOrDefault(propertyKeys[0], Collections.emptyList()); if (properties.size() == 1) { return IteratorUtils.of(properties.get(0)); } else if (properties.isEmpty()) { return Collections.emptyIterator(); } else { return (Iterator) new ArrayList<>(properties).iterator(); } } else return (Iterator) this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys)).flatMap(entry -> entry.getValue().stream()).collect(Collectors.toList()).iterator(); } } }
public static void removeIndex(final TinkerVertex vertex, final String key, final Object value) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.remove(key, value, vertex); }
public static void removeElementIndex(final TinkerVertex vertex) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.removeElement(vertex); }
public static void autoUpdateIndex(final TinkerVertex vertex, final String key, final Object newValue, final Object oldValue) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.autoUpdate(key, newValue, oldValue, vertex); }
public static void removeElementIndex(final TinkerVertex vertex) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.removeElement(vertex); }
public static void removeIndex(final TinkerVertex vertex, final String key, final Object value) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.remove(key, value, vertex); }
public static void autoUpdateIndex(final TinkerVertex vertex, final String key, final Object newValue, final Object oldValue) { final TinkerGraph graph = (TinkerGraph) vertex.graph(); if (graph.vertexIndex != null) graph.vertexIndex.autoUpdate(key, newValue, oldValue, vertex); }
@Override public Set<String> keys() { if (null == this.properties) return Collections.emptySet(); return TinkerHelper.inComputerMode((TinkerGraph) graph()) ? Vertex.super.keys() : this.properties.keySet(); }
@Override public Set<String> keys() { if (null == this.properties) return Collections.emptySet(); return TinkerHelper.inComputerMode((TinkerGraph) graph()) ? Vertex.super.keys() : this.properties.keySet(); }
/** * This constructor will not validate the ID type against the {@link Graph}. It will always just use a * {@code Long} for its identifier. This is useful for constructing a {@link VertexProperty} for usage * with {@link TinkerGraphComputerView}. */ public TinkerVertexProperty(final TinkerVertex vertex, final String key, final V value, final Object... propertyKeyValues) { super(((TinkerGraph) vertex.graph()).vertexPropertyIdManager.getNextId((TinkerGraph) vertex.graph()), key); this.vertex = vertex; this.key = key; this.value = value; ElementHelper.legalPropertyKeyValueArray(propertyKeyValues); ElementHelper.attachProperties(this, propertyKeyValues); }
/** * This constructor will not validate the ID type against the {@link Graph}. It will always just use a * {@code Long} for its identifier. This is useful for constructing a {@link VertexProperty} for usage * with {@link TinkerGraphComputerView}. */ public TinkerVertexProperty(final TinkerVertex vertex, final String key, final V value, final Object... propertyKeyValues) { super(((TinkerGraph) vertex.graph()).vertexPropertyIdManager.getNextId((TinkerGraph) vertex.graph()), key); this.vertex = vertex; this.key = key; this.value = value; ElementHelper.legalPropertyKeyValueArray(propertyKeyValues); ElementHelper.attachProperties(this, propertyKeyValues); }
@Override public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) { if (this.removed) return Collections.emptyIterator(); if (TinkerHelper.inComputerMode((TinkerGraph) graph())) return (Iterator) ((TinkerGraph) graph()).graphComputerView.getProperties(TinkerVertex.this).stream().filter(p -> ElementHelper.keyExists(p.key(), propertyKeys)).iterator(); else { if (null == this.properties) return Collections.emptyIterator(); if (propertyKeys.length == 1) { final List<VertexProperty> properties = this.properties.getOrDefault(propertyKeys[0], Collections.emptyList()); if (properties.size() == 1) { return IteratorUtils.of(properties.get(0)); } else if (properties.isEmpty()) { return Collections.emptyIterator(); } else { return (Iterator) new ArrayList<>(properties).iterator(); } } else return (Iterator) this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys)).flatMap(entry -> entry.getValue().stream()).collect(Collectors.toList()).iterator(); } } }
@Override public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) { if (this.removed) return Collections.emptyIterator(); if (TinkerHelper.inComputerMode((TinkerGraph) graph())) return (Iterator) ((TinkerGraph) graph()).graphComputerView.getProperties(TinkerVertex.this).stream().filter(p -> ElementHelper.keyExists(p.key(), propertyKeys)).iterator(); else { if (null == this.properties) return Collections.emptyIterator(); if (propertyKeys.length == 1) { final List<VertexProperty> properties = this.properties.getOrDefault(propertyKeys[0], Collections.emptyList()); if (properties.size() == 1) { return IteratorUtils.of(properties.get(0)); } else if (properties.isEmpty()) { return Collections.emptyIterator(); } else { return (Iterator) new ArrayList<>(properties).iterator(); } } else return (Iterator) this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys)).flatMap(entry -> entry.getValue().stream()).collect(Collectors.toList()).iterator(); } } }