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


Java IteratorUtils.of方法代码示例

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


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

示例1: constructInsertions

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Put> constructInsertions() {
    final String label = edge.label() != null ? edge.label() : Edge.DEFAULT_LABEL;
    Put put = new Put(ValueUtils.serializeWithSalt(edge.id()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.TO_BYTES,
            ValueUtils.serialize(edge.inVertex().id()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.FROM_BYTES,
            ValueUtils.serialize(edge.outVertex().id()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.LABEL_BYTES,
            ValueUtils.serialize(label));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.CREATED_AT_BYTES,
            ValueUtils.serialize(((HBaseEdge) edge).createdAt()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
            ValueUtils.serialize(((HBaseEdge) edge).updatedAt()));
    ((HBaseEdge) edge).getProperties().entrySet()
            .forEach(entry -> {
                byte[] bytes = ValueUtils.serializePropertyValue(graph, ElementType.EDGE, label, entry.getKey(), entry.getValue());
                put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(entry.getKey()), bytes);
            });
    return IteratorUtils.of(put);
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:22,代码来源:EdgeWriter.java

示例2: standardAlgorithm

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
protected Iterator<Traverser.Admin<S>> standardAlgorithm() throws NoSuchElementException {
    while (true) {
        if (this.repeatTraversal.getEndStep().hasNext()) {
            return this.repeatTraversal.getEndStep();
        } else {
            final Traverser.Admin<S> start = this.starts.next();
            if (doUntil(start, true)) {
                start.resetLoops();
                return IteratorUtils.of(start);
            }
            this.repeatTraversal.addStart(start);
            if (doEmit(start, true)) {
                final Traverser.Admin<S> emitSplit = start.split();
                emitSplit.resetLoops();
                return IteratorUtils.of(emitSplit);
            }
        }
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:21,代码来源:RepeatStep.java

示例3: vertices

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(Direction direction) {
  switch (direction) {
    case OUT:
      return IteratorUtils.of(outVertex);
    case IN:
      return IteratorUtils.of(inVertex);
    case BOTH:
      return IteratorUtils.of(outVertex, inVertex);
    default:
      throw new IllegalArgumentException(String.format("Unknown direction %s.", direction));
  }
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:14,代码来源:FactEdge.java

示例4: vertices

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(final Direction direction) {
    if (removed) return Collections.emptyIterator();
    switch (direction) {
        case OUT:
            return IteratorUtils.of(this.outVertex);
        case IN:
            return IteratorUtils.of(this.inVertex);
        default:
            return IteratorUtils.of(this.outVertex, this.inVertex);
    }
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:13,代码来源:TinkerEdge.java

示例5: properties

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <V> Iterator<Property<V>> properties(final String... propertyKeys) {
    if (null == this.properties) return Collections.emptyIterator();
    if (propertyKeys.length == 1) {
        final Property<V> property = this.properties.get(propertyKeys[0]);
        return null == property ? Collections.emptyIterator() : IteratorUtils.of(property);
    } else
        return (Iterator) this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys)).map(entry -> entry.getValue()).collect(Collectors.toList()).iterator();
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:10,代码来源:TinkerEdge.java

示例6: properties

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
    if (null == this.properties) return Collections.emptyIterator();
    if (propertyKeys.length == 1) {
        final Property<U> property = this.properties.get(propertyKeys[0]);
        return null == property ? Collections.emptyIterator() : IteratorUtils.of(property);
    } else
        return (Iterator) this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys)).map(entry -> entry.getValue()).collect(Collectors.toList()).iterator();
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:10,代码来源:TinkerVertexProperty.java

示例7: properties

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <V> Iterator<VertexProperty<V>> properties(String... propertyKeys) {
    if (propertyKeys.length == 0) { // return all properties
        return (Iterator) specificKeys.stream().map(key -> property(key)).filter(vp -> vp.isPresent()).iterator();
    } else if (propertyKeys.length == 1) { // treating as special case for performance
        VertexProperty<V> ret = property(propertyKeys[0]);
        if (ret.isPresent()) {
            return IteratorUtils.of(ret);
        } else {
            return Collections.emptyIterator();
        }
    } else {
        return Arrays.stream(propertyKeys).map(key -> (VertexProperty<V>) property(key)).filter(vp -> vp.isPresent()).iterator();
    }
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:16,代码来源:SpecializedTinkerVertex.java

示例8: properties

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <V> Iterator<Property<V>> properties(String... propertyKeys) {
    if (propertyKeys.length == 0) {
        return (Iterator) specificKeys.stream().map(key -> property(key)).filter(vp -> vp.isPresent()).iterator();
    } else if (propertyKeys.length == 1) { // treating as special case for performance
        return IteratorUtils.of(property(propertyKeys[0]));
    } else {
        return Arrays.stream(propertyKeys).map(key -> (Property<V>) property(key)).filter(vp -> vp.isPresent()).iterator();
    }
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:11,代码来源:SpecializedTinkerEdge.java

示例9: vertices

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(final Direction direction) {
    switch (direction) {
        case OUT:
            return IteratorUtils.of(this.outVertex);
        case IN:
            return IteratorUtils.of(this.inVertex);
        default:
            return IteratorUtils.of(this.outVertex, this.inVertex);
    }
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:12,代码来源:DetachedEdge.java

示例10: constructInsertions

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Put> constructInsertions() {
    Put put = new Put(graph.getLabelMetadataModel().serialize(label.key()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.CREATED_AT_BYTES,
            ValueUtils.serialize(label.createdAt()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
            ValueUtils.serialize(label.updatedAt()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(propertyKey),
            ValueUtils.serialize(type.getCode()));
    return IteratorUtils.of(put);
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:12,代码来源:PropertyMetadataWriter.java

示例11: vertices

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(final Direction direction) {
    if (direction.equals(Direction.OUT))
        return IteratorUtils.of(this.outVertex);
    else if (direction.equals(Direction.IN))
        return IteratorUtils.of(this.inVertex);
    else
        return IteratorUtils.of(this.outVertex, this.inVertex);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:10,代码来源:ReferenceEdge.java

示例12: constructInsertions

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Put> constructInsertions() {
    Put put = new Put(graph.getIndexMetadataModel().serialize(index.key()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UNIQUE_BYTES,
            ValueUtils.serialize(index.isUnique()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.INDEX_STATE_BYTES,
            ValueUtils.serialize(index.state().toString()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.CREATED_AT_BYTES,
            ValueUtils.serialize(index.createdAt()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
            ValueUtils.serialize(index.updatedAt()));
    return IteratorUtils.of(put);
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:14,代码来源:IndexMetadataWriter.java

示例13: constructMutations

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Mutation> constructMutations() {
    Put put = new Put(graph.getIndexMetadataModel().serialize(index.key()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.INDEX_STATE_BYTES,
            ValueUtils.serialize(index.state().toString()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
            ValueUtils.serialize(index.updatedAt()));
    return IteratorUtils.of(put);
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:10,代码来源:IndexMetadataWriter.java

示例14: constructMutations

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Mutation> constructMutations() {
    byte[] bytes = ValueUtils.serializePropertyValue(graph, ((HBaseElement) element).getElementType(), element.label(), key, value);
    Put put = new Put(ValueUtils.serializeWithSalt(element.id()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(key), bytes);
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
            ValueUtils.serialize(((HBaseElement) element).updatedAt()));
    return IteratorUtils.of(put);
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:10,代码来源:PropertyWriter.java

示例15: constructMutations

import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Mutation> constructMutations() {
    Increment incr = new Increment(ValueUtils.serializeWithSalt(element.id()));
    incr.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(key), value);
    Put put = new Put(ValueUtils.serializeWithSalt(element.id()));
    put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
            ValueUtils.serialize(((HBaseElement) element).updatedAt()));
    return IteratorUtils.of(incr, put);
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:10,代码来源:PropertyIncrementer.java


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