Back to project page KnowledgeBase.
The source code is released under:
MIT License
If you think the Android project KnowledgeBase listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.martin.knowledgebase; //from w ww . j a v a 2 s.c o m import java.util.ArrayList; public class PlainStorage { private static PlainStorage instance; private boolean mNewInstance; private ArrayList<Entry> mEntries; // Restrict the constructor from being instantiated private PlainStorage() { } public static synchronized PlainStorage getInstance() { if (instance == null) { instance = new PlainStorage(); instance.mNewInstance = true; instance.mEntries = new ArrayList<Entry>(); } else { instance.mNewInstance = false; } return instance; } public boolean isNew() { boolean before = mNewInstance; mNewInstance = false; return before; } public ArrayList<Entry> getmEntries() { return mEntries; } public void setmEntries(ArrayList<Entry> mEntries) { this.mEntries = mEntries; } }