01: /*
02: * Copyright (C) 2005 db4objects Inc. http://www.db4o.com
03: */
04: package com.db4o.f1.chapter3;
05:
06: import java.util.List;
07: import java.util.Map;
08:
09: import com.db4o.ObjectContainer;
10:
11: public class Db4oCollectionExample {
12: private List myList;
13:
14: private static final int INITIAL_SIZE = 10;
15: private Map myMap;
16:
17: private ObjectContainer database;
18:
19: /**
20: * @return Returns the myList.
21: */
22: public List getMyList() {
23: if (myList == null) {
24: myList = database.ext().collections().newLinkedList();
25: }
26: return myList;
27: }
28:
29: /**
30: * @return Returns the myMap.
31: */
32: public Map getMyMap() {
33: if (myMap == null) {
34: myMap = database.ext().collections().newHashMap(
35: INITIAL_SIZE);
36: }
37: return myMap;
38: }
39: }
|