object store - first draft work in progress
[mir.git] / source / mir / storage / store / StoreContainer.java
1 package mir.storage.store;
2
3 /**
4  * Title:         StoreContainer
5  *
6  * Description:   This is the bucket object for one type of StorableObjects,
7  *                mainy a linked list of StoreIdenfiers. On use or creation
8  *                an object stored in StoreIdentifier is put to head of the
9  *                list. if maximum size of the list is reached, the
10  *                StoreIdentifier at the end of the list is released.
11  *
12  * Copyright:     Copyright (c) 2002
13  * Company:       indy
14  * @author        //rk
15  * @version 1.0
16  */
17
18 import java.util.*;
19
20 public class StoreContainer {
21
22   private final static int DEFAULT_SIZE=10;
23
24   private LinkedList    container;
25   private int           maxSize=DEFAULT_SIZE;
26
27   public StoreContainer() {
28     container=new LinkedList();
29   }
30
31   public StoreContainer(int maxSize) {
32     this();
33     this.maxSize=maxSize;
34   }
35
36   /** @todo methods: release, toString() */
37
38   public Object use(StoreIdentifier sid) {
39     // find sid in LinkedList or die
40     // move sid to head of linked list
41     // return reference on object
42     return null;
43   }
44
45   public boolean has(StoreIdentifier sid) {
46     return true; // yes yes
47   }
48
49   public void add(StoreIdentifier sid) {
50     // add to head of linkedlist, if size is exeded throw away tail until
51     // size ok.
52   }
53
54 }