Interface SpacialIndex2DEnumerator<K>

  • Type Parameters:
    K - The key type, inherited from the SpacialIndex2D

    public interface SpacialIndex2DEnumerator<K>
    Enumerator returned when querying a SpacialIndex2D, used to iterate over the results of the query.

    Example usage:
    
     SpacialIndex2D spacialIndex = networkViewSnapshot.getSpacialIndex2D();
     SpacialIndex2DEnumerator<Long> enumerator = spacialIndex.queryAll();
     float[] extents = new float[4];
     while(enumerator.hasNext()) {
         // extents will contain the coordinates of the bottom left and top right corners of the rectangle
         Long suid = enumerator.nextExtents(extents);
         float bottomLeftX = extents[SpacialIndex2D.X_MIN];
         float bottomLeftY = extents[SpacialIndex2D.Y_MIN];
         float topRightX = extents[SpacialIndex2D.X_MAX];
         float topRightY = extents[SpacialIndex2D.Y_MAX];
         // suid can be used to look up the View from CyNetworkView or CyNetworkViewSnapshot
         View<CyNode> nodeView = networkViewSnapshot.getNodeView(suid);
     }
     
    Since:
    3.8
    See Also:
    SpacialIndex2D.queryOverlap(float, float, float, float), SpacialIndex2D.queryAll()

    Module: viewmodel-api

    To use this in your app, include the following dependency in your POM:

    <dependency>
        <groupId>org.cytoscape</groupId>
        <artifactId>viewmodel-api</artifactId>
    </dependency>

    Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.
    • Method Detail

      • size

        int size()
      • hasNext

        boolean hasNext()
      • nextExtents

        K nextExtents​(float[] extents)
      • next

        default K next()