package experimentalcode.erich.newdblayer;

/**
 * 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 support {@code long}, it should not require
 * changes in too many places!)
 * 
 * In particular, a developer should not make any assumption of these IDs being
 * consistent across multiple results/databases.
 * 
 * @author Erich Schubert
 */
public final class DBID {
  /**
   * The actual object ID.
   */
  protected int id;

  /**
   * Constructor from integer id.
   * 
   * @param id integer id.
   */
  public DBID(int id) {
    super();
    this.id = id;
  }

  /**
   * Constructor from integer id.
   * 
   * @param id integer id.
   */
  public DBID(Integer id) {
    super();
    this.id = id;
  }

  /**
   * Return the integer value of the object ID.
   * 
   * @return integer id
   */
  public int getIntegerID() {
    return this.id;
  }

  @Override
  public String toString() {
    return Integer.toString(id);
  }

  @Override
  public int hashCode() {
    return id;
  }

  @Override
  public boolean equals(Object obj) {
    if(!(obj instanceof DBID)) {
      return false;
    }
    DBID other = (DBID) obj;
    return this.id == other.id;
  }
}
@@ -37,16 +37,65 @@
 layer;%0A%0A
+import de.lmu.ifi.dbs.elki.data.DatabaseObject;%0A%0A
 /**%0A * D
@@ -556,31 +556,137 @@
  */%0A
-public final class DBID
+// TODO: remove %22implements DatabaseObject%22, getID and setID.%0Apublic final class DBID implements DatabaseObject, Comparable%3CDBID%3E
  %7B%0A 
@@ -1446,16 +1446,16 @@
 D) obj;%0A
-
     retu
@@ -1481,10 +1481,333 @@
 .id;%0A  %7D
+%0A%0A  @Override%0A  @Deprecated%0A  public Integer getID() %7B%0A    return id;%0A  %7D%0A%0A  @Override%0A  @Deprecated%0A  public void setID(@SuppressWarnings(%22unused%22) Integer id) %7B%0A    throw new UnsupportedOperationException(%22IDs in new DB layer are static.%22);%0A  %7D%0A%0A  @Override%0A  public int compareTo(DBID o) %7B%0A    return o.id - this.id;%0A  %7D
 %0A%7D

Add a GeneralizedDBSCAN implemented for the new DB layer.