Class IntegerDBIDVar

    • Field Detail

      • id

        int id
        The actual value.
    • Constructor Detail

      • IntegerDBIDVar

        protected IntegerDBIDVar()
        Constructor.
      • IntegerDBIDVar

        protected IntegerDBIDVar​(DBIDRef val)
        Constructor.
        Parameters:
        val -
    • Method Detail

      • internalGetIndex

        public int internalGetIndex()
        Description copied from interface: DBIDRef
        Internal only: Get the internal index.

        NOT FOR PUBLIC USE - ELKI Optimization engine only.

        Specified by:
        internalGetIndex in interface DBIDRef
        Returns:
        Internal index
      • internalSetIndex

        protected void internalSetIndex​(int i)
        Internal set to integer.
        Parameters:
        i - integer value
      • set

        public DBIDVar set​(DBIDRef ref)
        Description copied from interface: DBIDVar
        Assign a new value for the reference.
        Specified by:
        set in interface DBIDVar
        Parameters:
        ref - Reference
        Returns:
        this, for inlining.
      • 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
      • 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.
      • unset

        public void unset()
        Description copied from interface: DBIDVar
        Clear the contents.
        Specified by:
        unset in interface DBIDVar
      • isSet

        public boolean isSet()
        Description copied from interface: DBIDVar
        Test if the variable is well-defined.
        Specified by:
        isSet in interface DBIDVar
        Returns:
        true when assigned.
      • 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
      • 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
      • assignVar

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

        public DBIDVar from​(DBIDDataStore store,
                            DBIDRef ref)
        Description copied from interface: DBIDVar
        Update variable from a data store.
        Specified by:
        from in interface DBIDVar
        Parameters:
        store - Data store
        ref - Reference
        Returns:
        this, for inlining.
      • 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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object