KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > testmodel > IdentifiableMixin


1 /*****************************************************************************
2  * Copyright (c) PicoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  * Idea by Rachel Davies, Original code by various *
9  *****************************************************************************/

10 package org.nanocontainer.testmodel;
11
12 import java.io.Serializable JavaDoc;
13
14 /**
15  * @author Stephen Molitor
16  */

17 public class IdentifiableMixin implements Identifiable, AnotherInterface {
18
19     private Serializable JavaDoc id;
20
21     public IdentifiableMixin(IdGenerator generator) {
22         this.id = generator.nextId();
23     }
24
25     public IdentifiableMixin() {
26         this(new IdGeneratorImpl());
27     }
28
29     public Serializable JavaDoc getId() {
30         return id;
31     }
32
33     public void setId(Serializable JavaDoc id) {
34         this.id = id;
35     }
36
37 }
Popular Tags