Class IntegerDBIDPair

    • Field Detail

      • first

        public int first
        First value in pair
      • second

        public int second
        Second value in pair
    • Constructor Detail

      • IntegerDBIDPair

        protected IntegerDBIDPair​(int first,
                                  int second)
        Initialize pair
        Parameters:
        first - first parameter
        second - second parameter
    • Method Detail

      • toString

        public java.lang.String toString()
        Canonical toString operator
        Overrides:
        toString in class java.lang.Object
      • getFirst

        @Deprecated
        public final IntegerDBID getFirst()
        Deprecated.
        Description copied from interface: DBIDPair
        Getter for first.
        Specified by:
        getFirst in interface DBIDPair
        Returns:
        first element in pair
      • getSecond

        @Deprecated
        public final IntegerDBID getSecond()
        Deprecated.
        Description copied from interface: DBIDPair
        Getter for second element in pair
        Specified by:
        getSecond in interface DBIDPair
        Returns:
        second element in pair
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Canonical hash function, mixing the two hash values.
        Overrides:
        hashCode in class java.lang.Object
      • size

        public int size()
        Description copied from interface: ArrayDBIDs
        Size of the DBID "collection".
        Specified by:
        size in interface ArrayDBIDs
        Specified by:
        size in interface DBIDs
        Returns:
        size
      • contains

        public boolean contains​(DBIDRef o)
        Description copied from interface: DBIDs
        Test whether an ID is contained.
        Specified by:
        contains in interface DBIDs
        Parameters:
        o - object to test
        Returns:
        true when contained
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: DBIDs
        Test for an empty DBID collection.
        Specified by:
        isEmpty in interface DBIDs
        Returns:
        true when empty.
      • assignVar

        public DBIDVar assignVar​(int index,
                                 DBIDVar var)
        Description copied from interface: ArrayDBIDs
        Assign a DBID variable the value of position index.
        Specified by:
        assignVar in interface ArrayDBIDs
        Parameters:
        index - Position
        var - Variable to assign the value to.
      • slice

        public ArrayDBIDs slice​(int begin,
                                int end)
        Description copied from interface: ArrayDBIDs
        Slice a subarray (as view, not copy!)
        Specified by:
        slice in interface ArrayDBIDs
        Parameters:
        begin - Begin (inclusive)
        end - End (exclusive)
        Returns:
        Array slice.
      • binarySearch

        public int binarySearch​(DBIDRef key)
        Description copied from interface: ArrayDBIDs
        Search for the position of the given key, assuming that the data set is sorted. For unsorted arrays, the result is undefined.

        For keys not found, -(1+insertion position) is returned, as for Java Collections.binarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T)

        Specified by:
        binarySearch in interface ArrayDBIDs
        Parameters:
        key - Key to search for
        Returns:
        Offset of key