Interface DBID

  • All Superinterfaces:
    ArrayDBIDs, java.lang.Comparable<DBIDRef>, DBIDRef, DBIDs, SetDBIDs
    All Known Implementing Classes:
    IntegerDBID

    public interface DBID
    extends DBIDRef, java.lang.Comparable<DBIDRef>, ArrayDBIDs, SetDBIDs
    Database ID object.

    While this currently is just an Integer, it should be avoided to store the object IDs in regular integers to reduce problems if this API ever changes (for example if someone needs to do context tracking for debug purposes!)

    In particular, a developer should not make any assumption of these IDs being consistent across multiple results/databases.

    Since:
    0.4.0
    Author:
    Erich Schubert
    • Method Detail

      • hashCode

        int hashCode()
        In contrast to DBIDRef, the DBID interface is supposed to have a stable hash code. However, it is generally preferred to use optimized storage classes instead of Java collections!
        Specified by:
        hashCode in interface DBIDRef
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code
      • equals

        @Deprecated
        boolean equals​(java.lang.Object obj)
        Deprecated.
        In contrast to DBIDRef, the DBID interface is supposed to have a stable equals for other DBIDs.

        Yet, DBIDUtil.equal(elki.database.ids.DBIDRef, elki.database.ids.DBIDRef) is more type safe and explicit.

        Specified by:
        equals in interface DBIDRef
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Other object
        Returns:
        true when the object is the same DBID.