graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java
public long countEdges(final Direction iDirection, final String... iLabels) {
    checkIfAttached();

    long counter = 0;

    OrientBaseGraph.getEdgeClassNames(getGraph(), iLabels);
    OrientBaseGraph.encodeClassNames(iLabels);

    if (settings.isUseVertexFieldsForEdgeLabels() || iLabels == null || iLabels.length == 0) {
      // VERY FAST
      final ODocument doc = getRecord();
      for (String fieldName : doc.fieldNames()) {
        final OPair<Direction, String> connection = getConnection(iDirection, fieldName, iLabels);
        if (connection == null)
          // SKIP THIS FIELD
          continue;

        final Object fieldValue = doc.field(fieldName);
        if (fieldValue != null)
          if (fieldValue instanceof Collection<?>)
            counter += ((Collection<?>) fieldValue).size();
          else if (fieldValue instanceof Map<?, ?>)
            counter += ((Map<?, ?>) fieldValue).size();
          else if (fieldValue instanceof ORidBag) {
            counter += ((ORidBag) fieldValue).size();
          } else {
            counter++;
          }
      }
    } else {
      // SLOWER: BROWSE & FILTER
      for (Edge e : getEdges(iDirection, iLabels))
        if (e != null)
          counter++;
    }
    return counter;
  }
public long countEdges(final Direction iDirection, final String... iLabels) {
    checkIfAttached();

    long counter = 0;

    OrientBaseGraph.getEdgeClassNames(getGraph(), iLabels);
    OrientBaseGraph.encodeClassNames(iLabels);

    if (settings.isUseVertexFieldsForEdgeLabels() || iLabels == null || iLabels.length == 0) {
      // VERY FAST
      final ODocument doc = getRecord();
      for (String fieldName : doc.fieldNames()) {
        final OPair<Direction, String> connection = getConnection(iDirection, fieldName, iLabels);
        if (connection == null)
          // SKIP THIS FIELD
          continue;

        final Object fieldValue = doc.field(fieldName);
        if (fieldValue != null)
          if (fieldValue instanceof Collection<?>)
            counter += ((Collection<?>) fieldValue).size();
          else if (fieldValue instanceof Map<?, ?>)
            counter += ((Map<?, ?>) fieldValue).size();
          else if (fieldValue instanceof ORidBag) {
            counter += ((ORidBag) fieldValue).size();
          } else {
            counter++;
          }
      }
    } else {
      // SLOWER: BROWSE & FILTER
      for (Edge e : getEdges(iDirection, iLabels))
        if (e != null)
          counter++;
    }
    return counter;
  }
public long countEdges ( final Direction iDirection , final String ... iLabels ) { checkIfAttached ( ) ; long counter = 0 ; OrientBaseGraph . getEdgeClassNames ( getGraph ( ) , iLabels ) ; OrientBaseGraph . encodeClassNames ( iLabels ) ; if ( settings . isUseVertexFieldsForEdgeLabels ( ) || iLabels == null || iLabels . length == 0 ) { // VERY FAST final ODocument doc = getRecord ( ) ; for ( String fieldName : doc . fieldNames ( ) ) { final OPair < Direction , String > connection = getConnection ( iDirection , fieldName , iLabels ) ; if ( connection == null ) // SKIP THIS FIELD continue ; final Object fieldValue = doc . field ( fieldName ) ; if ( fieldValue != null ) if ( fieldValue instanceof Collection < ? > ) counter += ( ( Collection < ? > ) fieldValue ) . size ( ) ; else if ( fieldValue instanceof Map < ? , ? > ) counter += ( ( Map < ? , ? > ) fieldValue ) . size ( ) ; else if ( fieldValue instanceof ORidBag ) { counter += ( ( ORidBag ) fieldValue ) . size ( ) ; } else { counter ++ ; } } } else { // SLOWER: BROWSE & FILTER for ( Edge e : getEdges ( iDirection , iLabels ) ) if ( e != null ) counter ++ ; } return counter ; }
(Blueprints Extension) Returns the number of edges connected to the current Vertex.

@param iDirection The direction between OUT, IN or BOTH
@param iLabels    Optional labels as Strings to consider

@return A long with the total edges found
( Blueprints Extension ) Returns the number of edges connected to the current Vertex .