当前位置: 首页>>代码示例>>Java>>正文


Java Property.isPresent方法代码示例

本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.Property.isPresent方法的典型用法代码示例。如果您正苦于以下问题:Java Property.isPresent方法的具体用法?Java Property.isPresent怎么用?Java Property.isPresent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tinkerpop.gremlin.structure.Property的用法示例。


在下文中一共展示了Property.isPresent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: properties

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
// THERE ARE TWO MORE COPIES OF THIS CODE IN ELEMENT AND VERTEX
public <T> Iterator<Property<T>> properties(String... propertyKeys) {
    ArrayList<Property<T>> ans = new ArrayList<Property<T>>();

    if (propertyKeys.length == 0) {
    	if (this.properties == null) return Collections.emptyIterator();
    	propertyKeys = this.properties.getPropertyKeys();
    }

    for (String key : propertyKeys) {
        Property<T> prop = property(key);
        if (prop.isPresent()) ans.add(prop);
    }
    return ans.iterator();
}
 
开发者ID:lambdazen,项目名称:bitsy,代码行数:17,代码来源:BitsyEdge.java

示例2: areEqual

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
/**
 * A standard method for determining if two {@link org.apache.tinkerpop.gremlin.structure.Property} objects are equal. This method should be used by any
 * {@link Object#equals(Object)} implementation to ensure consistent behavior.
 *
 * @param a the first {@link org.apache.tinkerpop.gremlin.structure.Property}
 * @param b the second {@link org.apache.tinkerpop.gremlin.structure.Property}
 * @return true if equal and false otherwise
 */
public static boolean areEqual(final Property a, final Object b) {
    if (null == a)
        throw Graph.Exceptions.argumentCanNotBeNull("a");
    if (null == b)
        throw Graph.Exceptions.argumentCanNotBeNull("b");

    if (a == b)
        return true;
    if (!(b instanceof Property))
        return false;
    if (!a.isPresent() && !((Property) b).isPresent())
        return true;
    if (!a.isPresent() && ((Property) b).isPresent() || a.isPresent() && !((Property) b).isPresent())
        return false;
    return a.key().equals(((Property) b).key()) && a.value().equals(((Property) b).value()) && areEqual(a.element(), ((Property) b).element());

}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:26,代码来源:ElementHelper.java

示例3: map

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public void map(final Vertex vertex, final MapEmitter<Serializable, Long> emitter) {
    final Property<Serializable> cluster = vertex.property(PeerPressureVertexProgram.CLUSTER);
    if (cluster.isPresent()) {
        emitter.emit(cluster.value(), 1l);
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:8,代码来源:ClusterPopulationMapReduce.java

示例4: validatePropertyEquality

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
public static void validatePropertyEquality(final Property originalProperty, final Property otherProperty) {
    assertEquals(originalProperty, otherProperty);
    assertEquals(otherProperty, originalProperty);
    if (originalProperty.isPresent()) {
        assertEquals(originalProperty.key(), otherProperty.key());
        assertEquals(originalProperty.value(), otherProperty.value());
        assertEquals(originalProperty.element(), otherProperty.element());
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:10,代码来源:TestHelper.java

示例5: contextEquals

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
private boolean contextEquals(final String expected, final Edge edge) {
    Property<String> actual = edge.property(Schema.EdgeProperties.CONTEXT);
    if (actual.isPresent()) {
        return null != expected && actual.value().equals(expected);
    } else {
        return null == expected;
    }
}
 
开发者ID:joshsh,项目名称:graphsail,代码行数:9,代码来源:DataStore.java

示例6: properties

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public <T> Iterator<? extends Property<T>> properties(String... propertyKeys) {
    ArrayList<Property<T>> ans = new ArrayList<Property<T>>();
    if (propertyKeys.length == 0) {
    	if (this.properties == null) return Collections.emptyIterator();
    	propertyKeys = this.properties.getPropertyKeys();
    }

    for (String key : propertyKeys) {
    	Property<T> prop = property(key);
    	if (prop.isPresent()) ans.add(prop);
    }

    return ans.iterator();
}
 
开发者ID:lambdazen,项目名称:bitsy,代码行数:16,代码来源:BitsyElement.java

示例7: property

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
/**
 *
 * @param key The key of the property to mutate
 * @param value The value to commit into the property
 */
public void property(P key, Object value){
    if(value == null) {
        element().property(key.name()).remove();
    } else {
        Property<Object> foundProperty = element().property(key.name());
        if(!foundProperty.isPresent() || !foundProperty.value().equals(value)){
            element().property(key.name(), value);
        }
    }
}
 
开发者ID:graknlabs,项目名称:grakn,代码行数:16,代码来源:AbstractElement.java

示例8: map

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public void map(final Vertex vertex, final MapEmitter<Object, Double> emitter) {
    final Property pageRank = vertex.property(PageRankVertexProgram.PAGE_RANK);
    if (pageRank.isPresent()) {
        emitter.emit(vertex.id(), (Double) pageRank.value());
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:8,代码来源:PageRankMapReduce.java

示例9: map

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
@Override
public void map(final Vertex vertex, final MapEmitter<NullObject, Serializable> emitter) {
    final Property<Serializable> cluster = vertex.property(PeerPressureVertexProgram.CLUSTER);
    if (cluster.isPresent()) {
        emitter.emit(NullObject.instance(), cluster.value());
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:8,代码来源:ClusterCountMapReduce.java

示例10: getContext

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
private Resource getContext(final Edge edge) {
    Property<String> prop = edge.property(Schema.EdgeProperties.CONTEXT);
    return prop.isPresent() ? toResource(prop.value()) : null;
}
 
开发者ID:joshsh,项目名称:graphsail,代码行数:5,代码来源:DataStore.java

示例11: getLanguage

import org.apache.tinkerpop.gremlin.structure.Property; //导入方法依赖的package包/类
private String getLanguage(final Vertex vertex) {
    Property<String> prop = vertex.property(Schema.VertexProperties.LANGUAGE);
    return prop.isPresent() ? prop.value() : null;
}
 
开发者ID:joshsh,项目名称:graphsail,代码行数:5,代码来源:DataStore.java


注:本文中的org.apache.tinkerpop.gremlin.structure.Property.isPresent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。