com.tinkerpop.blueprints.Element.getPropertyKeys()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(218)

本文整理了Java中com.tinkerpop.blueprints.Element.getPropertyKeys()方法的一些代码示例,展示了Element.getPropertyKeys()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getPropertyKeys()方法的具体详情如下:
包路径:com.tinkerpop.blueprints.Element
类名称:Element
方法名:getPropertyKeys

Element.getPropertyKeys介绍

[英]Return all the keys associated with the element.
[中]返回与元素关联的所有键。

代码示例

代码示例来源:origin: BrynCooke/totorom

  1. /**
  2. * @return The property keys of this element.
  3. */
  4. protected Set<String> getPropertyKeys() {
  5. return element.getPropertyKeys();
  6. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. public Set<String> getPropertyKeys() {
  2. return this.baseElement.getPropertyKeys();
  3. }

代码示例来源:origin: apache/incubator-atlas

  1. @Override
  2. public Set<String> getPropertyKeys() {
  3. return wrappedElement.getPropertyKeys();
  4. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. public Set<String> getPropertyKeys() {
  2. return this.baseElement.getPropertyKeys();
  3. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. public Set<String> getPropertyKeys() {
  2. return this.baseElement.getPropertyKeys();
  3. }

代码示例来源:origin: atlanmod/NeoEMF

  1. @Override
  2. public Set<String> getPropertyKeys() {
  3. if (propertyBased) {
  4. final Set<String> keys = new HashSet<>(base.getPropertyKeys());
  5. keys.remove(IdGraph.ID);
  6. return keys;
  7. }
  8. else {
  9. return base.getPropertyKeys();
  10. }
  11. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. public Set<String> getPropertyKeys() {
  2. if (propertyBased) {
  3. final Set<String> keys = baseElement.getPropertyKeys();
  4. final Set<String> s = new HashSet<String>();
  5. s.addAll(keys);
  6. s.remove(IdGraph.ID);
  7. return s;
  8. } else {
  9. return baseElement.getPropertyKeys();
  10. }
  11. }

代码示例来源:origin: thinkaurelius/faunus

  1. private static Set<String> getElementPropertyKeys(final Element element, final boolean edgeIn) {
  2. final Set<String> elementPropertyKeys = new HashSet<String>(element.getPropertyKeys());
  3. elementPropertyKeys.add(GraphSONTokens._ID);
  4. if (element instanceof Edge) {
  5. if (edgeIn) {
  6. elementPropertyKeys.add(GraphSONTokens._IN_V);
  7. } else {
  8. elementPropertyKeys.add(GraphSONTokens._OUT_V);
  9. }
  10. elementPropertyKeys.add(GraphSONTokens._LABEL);
  11. }
  12. return elementPropertyKeys;
  13. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. public Set<String> getPropertyKeys() {
  2. final Set<String> keys = new HashSet<String>(this.baseElement.getPropertyKeys());
  3. keys.remove(this.graph.getPartitionKey());
  4. return keys;
  5. }

代码示例来源:origin: gentics/mesh

  1. public void debug(Element element) {
  2. System.out.println("---");
  3. for (String key : element.getPropertyKeys()) {
  4. System.out.println(key + " : " + element.getProperty(key));
  5. }
  6. System.out.println("---");
  7. }

代码示例来源:origin: SciGraph/SciGraph

  1. static public <T> Optional<T> getProperty(Element container, String property, Class<T> type) {
  2. Optional<T> value = Optional.<T>empty();
  3. if (container.getPropertyKeys().contains(property)) {
  4. value = Optional.<T>of(type.cast(container.getProperty(property)));
  5. }
  6. return value;
  7. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. /**
  2. * Get a clone of the properties of the provided element.
  3. * In other words, a HashMap is created and filled with the key/values of the element's properties.
  4. *
  5. * @param element the element to get the properties of
  6. * @return a clone of the properties of the element
  7. */
  8. public static Map<String, Object> getProperties(final Element element) {
  9. final Map<String, Object> properties = new HashMap<String, Object>();
  10. for (final String key : element.getPropertyKeys()) {
  11. properties.put(key, element.getProperty(key));
  12. }
  13. return properties;
  14. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. /**
  2. * Clear all the properties from an iterable of elements.
  3. *
  4. * @param elements the elements to remove properties from
  5. */
  6. public static void removeProperties(final Iterable<Element> elements) {
  7. for (final Element element : elements) {
  8. final List<String> keys = new ArrayList<String>();
  9. keys.addAll(element.getPropertyKeys());
  10. for (final String key : keys) {
  11. element.removeProperty(key);
  12. }
  13. }
  14. }

代码示例来源:origin: SciGraph/SciGraph

  1. static void copyProperties(Element source, Element target) {
  2. for (String key : source.getPropertyKeys()) {
  3. Object property = source.getProperty(key);
  4. if (property.getClass().isArray()) {
  5. List<Object> propertyList = new ArrayList<>();
  6. for (int i = 0; i < Array.getLength(property); i++) {
  7. propertyList.add(Array.get(property, i));
  8. }
  9. property = propertyList;
  10. }
  11. target.setProperty(key, property);
  12. }
  13. }

代码示例来源:origin: SciGraph/SciGraph

  1. static public <T> Collection<T> getProperties(Element container, String property, Class<T> type) {
  2. List<T> list = new ArrayList<>();
  3. if (container.getPropertyKeys().contains(property)) {
  4. return getPropertiesAsSet(container.getProperty(property), type);
  5. }
  6. return list;
  7. }

代码示例来源:origin: indexiatech/antiquity

  1. /**
  2. * Copy properties from one element to another.
  3. *
  4. * @param from element to copy properties from
  5. * @param to element to copy properties to
  6. * @param excludedKeys the keys that should be excluded from being copied.
  7. */
  8. public static void copyProps(Element from, Element to, Set<String> excludedKeys) {
  9. for (String k : from.getPropertyKeys()) {
  10. if (excludedKeys != null && excludedKeys.contains(k)) {
  11. continue;
  12. }
  13. to.setProperty(k, from.getProperty(k));
  14. }
  15. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. private void writeProperties(final Writer writer, final Element e) throws IOException {
  2. for (String key : e.getPropertyKeys()) {
  3. if (!this.strict || regex.matcher(key).matches()) {
  4. final Object property = e.getProperty(key);
  5. writeKey(writer, key);
  6. writeProperty(writer, property, 0);
  7. }
  8. }
  9. }

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

  1. /**
  2. * Copy the properties (key and value) from one element to another.
  3. * The properties are preserved on the from element.
  4. * ElementPropertiesRule that share the same key on the to element are overwritten.
  5. *
  6. * @param from the element to copy properties from
  7. * @param to the element to copy properties to
  8. */
  9. public static void copyProperties(final Element from, final Element to) {
  10. for (final String key : from.getPropertyKeys()) {
  11. to.setProperty(key, from.getProperty(key));
  12. }
  13. }

代码示例来源:origin: thinkaurelius/faunus

  1. private static void writeProperties(final Element element, final DataOutput out) throws IOException {
  2. WritableUtils.writeVInt(out, element.getPropertyKeys().size());
  3. if (element.getPropertyKeys().size() > 0) {
  4. final com.thinkaurelius.titan.graphdb.database.serialize.DataOutput o = serialize.getDataOutput(128, true);
  5. for (final String key : element.getPropertyKeys()) {
  6. o.writeObject(key, String.class);
  7. o.writeClassAndObject(element.getProperty(key));
  8. }
  9. final StaticBuffer buffer = o.getStaticBuffer();
  10. WritableUtils.writeVInt(out, buffer.length());
  11. out.write(ByteBufferUtil.getArray(buffer.asByteBuffer()));
  12. }
  13. }
  14. }

代码示例来源:origin: SciGraph/SciGraph

  1. public static void dumpProperties(Element container) {
  2. for (String key: container.getPropertyKeys()) {
  3. System.out.println(key + ": " + container.getProperty(key));
  4. }
  5. }

相关文章