elki.database.ids.package-info Maven / Gradle / Ivy
Show all versions of elki-core-dbids Show documentation
/**
* Database object identification and ID group handling API.
*
* Database IDs (short: DBID) in ELKI are based on the factory pattern, to allow replacing
* the simple Integer-based DBIDs with more complex implementations, e.g., for use with external
* databases or to add tracking for debugging purposes. This also allows adding of more efficient
* implementations later on in a single place.
*
*
DBID interface:
*
* The {@link elki.database.ids.DBID DBID} object identifies a single object.
*
* The {@link elki.database.ids.DBIDs DBIDs} hierarchy contains classes for handling groups (sets, arrays) of IDs, that can
* be seen as a two-dimensional matrix consisting
*
*
*
* {@link elki.database.ids.ArrayDBIDs ArrayDBIDs}
* {@link elki.database.ids.HashSetDBIDs HashSetDBIDs}
*
*
* {@link elki.database.ids.ModifiableDBIDs ModifiableDBIDs}
* {@link elki.database.ids.ArrayModifiableDBIDs ArrayModifiableDBIDs}
* {@link elki.database.ids.HashSetModifiableDBIDs HashSetModifiableDBIDs}
*
*
* {@link elki.database.ids.StaticDBIDs StaticDBIDs}
* {@link elki.database.ids.ArrayStaticDBIDs ArrayStaticDBIDs}
* n/a
*
*
*
* {@link elki.database.ids.StaticDBIDs StaticDBIDs} are structures that cannot support
* modifications, but thus can be implemented more efficiently, for example as Interval. They are
* mostly used by the data sources.
*
* These interfaces cannot be instantiated, obviously. Instead, use the static
* {@link elki.database.ids.DBIDFactory#FACTORY DBIDFactory.FACTORY}, which is also wrapped in the {@link elki.database.ids.DBIDUtil DBIDUtil} class.
*
*
Examples:
* {@code
* DBIDs allids = database.getIDs();
* // preallocate an array of initial capacity 123
* ArrayModifiableDBIDs array = DBIDUtil.newArraySet(123);
* // new DBID hash set with minimum initial capacity
* ModifiableDBIDs hash = DBIDUtil.newHashSet();
*
* // add all DBIDs from the hash
* tree.addDBIDs(hash)
* }
*
*
Utility functions:
*
* - {@link elki.database.ids.DBIDUtil#ensureArray DBIDUtil.ensureArray} to ensure {@link elki.database.ids.ArrayDBIDs ArrayDBIDs}
* - {@link elki.database.ids.DBIDUtil#ensureModifiable DBIDUtil.ensureModifiable} to ensure {@link elki.database.ids.ModifiableDBIDs ModifiableDBIDS}
* - {@link elki.database.ids.DBIDUtil#makeUnmodifiable DBIDUtil.makeUnmodifiable} to wrap DBIDs unmodifiable
*
*
* @opt hide elki.database.ids.DBIDFactory
* @opt hide elki.database.ids.integer.*
* @opt hide elki.database.ids.generic.*
* @opt hide elki.database.ids.EmptyDBIDs.EmptyDBIDIterator
* @opt hide elki.database.*Database
* @opt hide elki.data.Cluster
* @opt hide elki.datasource.filter.*
* @opt hide elki.database.query.*
* @opt hide elki.(algorithm|evaluation|parallel|distance|index|result|persistent|utilities).*
* @opt hide elki.database.relation.*
* @opt hide java.*
*/
/*
* This file is part of ELKI:
* Environment for Developing KDD-Applications Supported by Index-Structures
*
* Copyright (C) 2022
* ELKI Development Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package elki.database.ids;