Class UtilityNearestNeighbor


  • public final class UtilityNearestNeighbor
    extends java.lang.Object
    Defines a Nearest Neighbor element in a UtilityNetwork. A filter object to return the next N features from the starting point.
    Since:
    100.8.0
    • Method Detail

      • createWithAssetTypes

        public static UtilityNearestNeighbor createWithAssetTypes​(UtilityNetworkAttribute costNetworkAttribute,
                                                                  int count,
                                                                  java.lang.Iterable<UtilityAssetType> assetTypes)
        Creates a filter object to return the next n features from the starting point with asset types.
        Parameters:
        costNetworkAttribute - the UtilityNetworkAttribute used to determine the definition of "nearest"
        count - the number of nearest features to return
        assetTypes - the collection of UtilityAssetType that are used to define features to return
        Throws:
        java.lang.IllegalArgumentException - if costNetworkAttribute is null
        java.lang.IllegalArgumentException - if count is less than one
        java.lang.IllegalArgumentException - if assetTypes is null or empty
        Since:
        100.8.0
      • createWithCategories

        public static UtilityNearestNeighbor createWithCategories​(UtilityNetworkAttribute costNetworkAttribute,
                                                                  int count,
                                                                  java.lang.Iterable<UtilityCategory> categories)
        Creates a filter object to return the next n features from the starting point with categories.
        Parameters:
        costNetworkAttribute - the UtilityNetworkAttribute used to determine the definition of "nearest"
        count - the number of nearest features to return
        categories - the collection of UtilityCategory that are used to define features to return
        Returns:
        a UtilityNearestNeighbor with nearest categories
        Throws:
        java.lang.IllegalArgumentException - if costNetworkAttribute is null
        java.lang.IllegalArgumentException - if count is less than one
        java.lang.IllegalArgumentException - if categories is null or empty
        Since:
        100.8.0
      • createWithAssetTypesAndCategories

        public static UtilityNearestNeighbor createWithAssetTypesAndCategories​(UtilityNetworkAttribute costNetworkAttribute,
                                                                               int count,
                                                                               java.lang.Iterable<UtilityAssetType> assetTypes,
                                                                               java.lang.Iterable<UtilityCategory> categories)
        Creates a filter object to return the next n features from the starting point with asset types and categories.
        Parameters:
        costNetworkAttribute - the UtilityNetworkAttribute used to determine the definition of "nearest"
        count - the number of nearest features to return
        assetTypes - the collection of UtilityAssetType that are used to define features to return
        categories - the collection of UtilityCategory that are used to define features to return
        Returns:
        a UtilityNearestNeighbor with nearest asset types and categories
        Throws:
        java.lang.IllegalArgumentException - if costNetworkAttribute is null
        java.lang.IllegalArgumentException - if count is less than one
        java.lang.IllegalArgumentException - if assetTypes is null
        java.lang.IllegalArgumentException - if categories is null
        java.lang.IllegalArgumentException - if both assetTypes and categories are empty
        Since:
        100.8.0
      • getCount

        public int getCount()
        Gets the number of nearest features to return.
        Returns:
        the number of nearest features
        Since:
        100.8.0