org.neo4j.graphdb.Direction.valueOf()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(129)

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

Direction.valueOf介绍

暂无

代码示例

代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures

public static Direction parseDirection(String direction) {
  if (null == direction) {
    return Direction.BOTH;
  }
  try {
    return Direction.valueOf(direction.toUpperCase());
  } catch (Exception e) {
    throw new RuntimeException(format("Cannot convert value '%s' to Direction. Legal values are '%s'",
        direction, Arrays.toString(Direction.values())));
  }
}

代码示例来源:origin: com.graphaware.neo4j/timetree

private Direction resolveDirection(String direction) {
  if (direction == null) {
    return Direction.INCOMING;
  }
  return Direction.valueOf(direction.toUpperCase());
}

代码示例来源:origin: com.graphaware.neo4j/timetree

private Direction resolveDirection(String direction) {
  if (direction == null) {
    return Direction.INCOMING;
  }
  return Direction.valueOf(direction.toUpperCase());
}

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

@JsonCreator
public DirectedRelationshipType(@JsonProperty("type") String type, @JsonProperty("direction") String direction) {
 this.type = RelationshipType.withName(type);
 this.direction = Direction.valueOf(direction);
}

代码示例来源:origin: com.graphaware.neo4j/common

@Override
public int getDegree(String type, String direction) {
  return entity.getDegree(withName(type), valueOf(direction.toUpperCase()));
}

代码示例来源:origin: com.graphaware.neo4j/common

@Override
public int getDegree(String typeOrDirection) {
  try {
    return entity.getDegree(valueOf(typeOrDirection.toUpperCase()));
  } catch (IllegalArgumentException e) {
    return entity.getDegree(withName(typeOrDirection));
  }
}

代码示例来源:origin: org.neo4j/neo4j-graph-collections

@Override
public Relationship next()
{
  if ( directRelationshipIterator != null && directRelationshipIterator.hasNext() )
  {
    return directRelationshipIterator.next();
  }
  if ( indexedRelationshipIterator != null && indexedRelationshipIterator.hasNext() )
  {
    return indexedRelationshipIterator.next();
  }
  if ( indexedRelationshipDestinationIterator != null && indexedRelationshipDestinationIterator.hasNext() )
  {
    Path path = indexedRelationshipDestinationIterator.next();
    String direction = (String) path.lastRelationship().getProperty(
      IndexedRelationship.RELATIONSHIP_DIRECTION );
    try
    {
      IndexedRelationship indexedRelationship = new IndexedRelationship( path.endNode(), relType,
        Direction.valueOf( direction ) );
      return indexedRelationship.getRelationship( path.relationships().iterator().next() );
    }
    catch ( Exception e )
    {
      throw new RuntimeException( "Comparator class cannot be instantiated" );
    }
  }
  throw new NoSuchElementException();
}

代码示例来源:origin: neo4j-contrib/graph-collections

@Override
public Relationship next()
{
  if ( directRelationshipIterator != null && directRelationshipIterator.hasNext() )
  {
    return directRelationshipIterator.next();
  }
  if ( indexedRelationshipIterator != null && indexedRelationshipIterator.hasNext() )
  {
    return indexedRelationshipIterator.next();
  }
  if ( indexedRelationshipDestinationIterator != null && indexedRelationshipDestinationIterator.hasNext() )
  {
    Path path = indexedRelationshipDestinationIterator.next();
    String direction = (String) path.lastRelationship().getProperty(
      IndexedRelationship.RELATIONSHIP_DIRECTION );
    try
    {
      IndexedRelationship indexedRelationship = new IndexedRelationship( path.endNode(), relType,
        Direction.valueOf( direction ) );
      return indexedRelationship.getRelationship( path.relationships().iterator().next() );
    }
    catch ( Exception e )
    {
      throw new RuntimeException( "Comparator class cannot be instantiated" );
    }
  }
  throw new NoSuchElementException();
}

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

Direction dir = Direction.valueOf(direction);
try {
 if (entail.get()) {

代码示例来源:origin: com.graphaware.neo4j/timetree

Direction direction = Direction.valueOf(config.get(DIRECTION));
LOG.info("Direction set to %s", direction);
configuration = configuration.withDirection(direction);

相关文章