db4ocollectionexample.java

来自「db4o db4o是一个嵌入式的开源对象数据库引擎.对于Java与.NET开发者」· Java 代码 · 共 40 行

JAVA
40
字号
/*
 * Copyright (C) 2005 db4objects Inc.  http://www.db4o.com
 */
package com.db4o.f1.chapter3;

import java.util.List;
import java.util.Map;

import com.db4o.ObjectContainer;

public class Db4oCollectionExample {
    private List myList;

    private static final int INITIAL_SIZE = 10;
    private Map myMap;
    
    private ObjectContainer database;
    
    /**
     * @return Returns the myList.
     */
    public List getMyList() {
        if (myList == null) {
            myList = database.ext().collections().newLinkedList();
        }
        return myList;
    }
    
    /**
     * @return Returns the myMap.
     */
    public Map getMyMap() {
        if (myMap == null) {
            myMap = database.ext()
                    .collections().newHashMap(INITIAL_SIZE);
        }
        return myMap;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?