view artifact-database/src/main/java/de/intevation/artifactdatabase/Id.java @ 93:e27cf9c84eb8

Unified imports. artifacts/trunk@849 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 28 Mar 2010 15:57:40 +0000
parents d348fe1fd822
children 933bbc9fc11f
line wrap: on
line source
package de.intevation.artifactdatabase;

import java.util.List;

/**
 * Class to model the concept of an 'id' in terms of unique integer as
 * used in databases. Subclasses of this class are able to be processed
 * by this id.
 *
 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
 */
public class Id
{
    /**
     * Interface to filter a list of ids.
     */
    public interface Filter {
        /**
         * A list of ids is processed in a functional way to be
         * free from some ids by the implementing code. The resulting
         * list maybe short or equal sized to the original one. The
         * original list is not modified.
         * @param ids The list of input ids.
         * @return A list of processed ids.
         */
        List filterIds(List ids);
    }

    /**
     * The backing int of the id.
     */
    protected int id;

    /**
     * Default constructor: id = 0
     */
    public Id() {
    }

    /**
     * Constructor to create an id with a given value.
     * @param id The id value
     */
    public Id(int id) {
        this.id = id;
    }

    /**
     * Returns the id value.
     * @return The value of the id.
     */
    public int getId() {
        return id;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org