1 package mir.storage.store;
4 * Title: StoreContainer
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.
12 * Copyright: Copyright (c) 2002
20 public class StoreContainer {
22 private final static int DEFAULT_SIZE=10;
24 private LinkedList container;
25 private int maxSize=DEFAULT_SIZE;
27 public StoreContainer() {
28 container=new LinkedList();
31 public StoreContainer(int maxSize) {
36 /** @todo methods: release, toString() */
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
45 public boolean has(StoreIdentifier sid) {
46 return true; // yes yes
49 public void add(StoreIdentifier sid) {
50 // add to head of linkedlist, if size is exeded throw away tail until