本文整理了Java中com.tinkerpop.blueprints.Element.getPropertyKeys()
方法的一些代码示例,展示了Element.getPropertyKeys()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getPropertyKeys()
方法的具体详情如下:
包路径:com.tinkerpop.blueprints.Element
类名称:Element
方法名:getPropertyKeys
[英]Return all the keys associated with the element.
[中]返回与元素关联的所有键。
代码示例来源:origin: BrynCooke/totorom
/**
* @return The property keys of this element.
*/
protected Set<String> getPropertyKeys() {
return element.getPropertyKeys();
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public Set<String> getPropertyKeys() {
return this.baseElement.getPropertyKeys();
}
代码示例来源:origin: apache/incubator-atlas
@Override
public Set<String> getPropertyKeys() {
return wrappedElement.getPropertyKeys();
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public Set<String> getPropertyKeys() {
return this.baseElement.getPropertyKeys();
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public Set<String> getPropertyKeys() {
return this.baseElement.getPropertyKeys();
}
代码示例来源:origin: atlanmod/NeoEMF
@Override
public Set<String> getPropertyKeys() {
if (propertyBased) {
final Set<String> keys = new HashSet<>(base.getPropertyKeys());
keys.remove(IdGraph.ID);
return keys;
}
else {
return base.getPropertyKeys();
}
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public Set<String> getPropertyKeys() {
if (propertyBased) {
final Set<String> keys = baseElement.getPropertyKeys();
final Set<String> s = new HashSet<String>();
s.addAll(keys);
s.remove(IdGraph.ID);
return s;
} else {
return baseElement.getPropertyKeys();
}
}
代码示例来源:origin: thinkaurelius/faunus
private static Set<String> getElementPropertyKeys(final Element element, final boolean edgeIn) {
final Set<String> elementPropertyKeys = new HashSet<String>(element.getPropertyKeys());
elementPropertyKeys.add(GraphSONTokens._ID);
if (element instanceof Edge) {
if (edgeIn) {
elementPropertyKeys.add(GraphSONTokens._IN_V);
} else {
elementPropertyKeys.add(GraphSONTokens._OUT_V);
}
elementPropertyKeys.add(GraphSONTokens._LABEL);
}
return elementPropertyKeys;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public Set<String> getPropertyKeys() {
final Set<String> keys = new HashSet<String>(this.baseElement.getPropertyKeys());
keys.remove(this.graph.getPartitionKey());
return keys;
}
代码示例来源:origin: gentics/mesh
public void debug(Element element) {
System.out.println("---");
for (String key : element.getPropertyKeys()) {
System.out.println(key + " : " + element.getProperty(key));
}
System.out.println("---");
}
代码示例来源:origin: SciGraph/SciGraph
static public <T> Optional<T> getProperty(Element container, String property, Class<T> type) {
Optional<T> value = Optional.<T>empty();
if (container.getPropertyKeys().contains(property)) {
value = Optional.<T>of(type.cast(container.getProperty(property)));
}
return value;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
/**
* Get a clone of the properties of the provided element.
* In other words, a HashMap is created and filled with the key/values of the element's properties.
*
* @param element the element to get the properties of
* @return a clone of the properties of the element
*/
public static Map<String, Object> getProperties(final Element element) {
final Map<String, Object> properties = new HashMap<String, Object>();
for (final String key : element.getPropertyKeys()) {
properties.put(key, element.getProperty(key));
}
return properties;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
/**
* Clear all the properties from an iterable of elements.
*
* @param elements the elements to remove properties from
*/
public static void removeProperties(final Iterable<Element> elements) {
for (final Element element : elements) {
final List<String> keys = new ArrayList<String>();
keys.addAll(element.getPropertyKeys());
for (final String key : keys) {
element.removeProperty(key);
}
}
}
代码示例来源:origin: SciGraph/SciGraph
static void copyProperties(Element source, Element target) {
for (String key : source.getPropertyKeys()) {
Object property = source.getProperty(key);
if (property.getClass().isArray()) {
List<Object> propertyList = new ArrayList<>();
for (int i = 0; i < Array.getLength(property); i++) {
propertyList.add(Array.get(property, i));
}
property = propertyList;
}
target.setProperty(key, property);
}
}
代码示例来源:origin: SciGraph/SciGraph
static public <T> Collection<T> getProperties(Element container, String property, Class<T> type) {
List<T> list = new ArrayList<>();
if (container.getPropertyKeys().contains(property)) {
return getPropertiesAsSet(container.getProperty(property), type);
}
return list;
}
代码示例来源:origin: indexiatech/antiquity
/**
* Copy properties from one element to another.
*
* @param from element to copy properties from
* @param to element to copy properties to
* @param excludedKeys the keys that should be excluded from being copied.
*/
public static void copyProps(Element from, Element to, Set<String> excludedKeys) {
for (String k : from.getPropertyKeys()) {
if (excludedKeys != null && excludedKeys.contains(k)) {
continue;
}
to.setProperty(k, from.getProperty(k));
}
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
private void writeProperties(final Writer writer, final Element e) throws IOException {
for (String key : e.getPropertyKeys()) {
if (!this.strict || regex.matcher(key).matches()) {
final Object property = e.getProperty(key);
writeKey(writer, key);
writeProperty(writer, property, 0);
}
}
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
/**
* Copy the properties (key and value) from one element to another.
* The properties are preserved on the from element.
* ElementPropertiesRule that share the same key on the to element are overwritten.
*
* @param from the element to copy properties from
* @param to the element to copy properties to
*/
public static void copyProperties(final Element from, final Element to) {
for (final String key : from.getPropertyKeys()) {
to.setProperty(key, from.getProperty(key));
}
}
代码示例来源:origin: thinkaurelius/faunus
private static void writeProperties(final Element element, final DataOutput out) throws IOException {
WritableUtils.writeVInt(out, element.getPropertyKeys().size());
if (element.getPropertyKeys().size() > 0) {
final com.thinkaurelius.titan.graphdb.database.serialize.DataOutput o = serialize.getDataOutput(128, true);
for (final String key : element.getPropertyKeys()) {
o.writeObject(key, String.class);
o.writeClassAndObject(element.getProperty(key));
}
final StaticBuffer buffer = o.getStaticBuffer();
WritableUtils.writeVInt(out, buffer.length());
out.write(ByteBufferUtil.getArray(buffer.asByteBuffer()));
}
}
}
代码示例来源:origin: SciGraph/SciGraph
public static void dumpProperties(Element container) {
for (String key: container.getPropertyKeys()) {
System.out.println(key + ": " + container.getProperty(key));
}
}
内容来源于网络,如有侵权,请联系作者删除!