Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.bible.book.raw
Class Mem  view Mem download Mem.java

java.lang.Object
  extended bycom.eireneh.bible.book.raw.Mem
Direct Known Subclasses:
InstsMem, ItemsMem

public abstract class Mem
extends java.lang.Object

Mem is the root of all the data sources that load their data fully into memory at init time. This is fairly fast but very memory hungry.

There is code here to implememt compressed data files, however this makes load time very very slow, instead of just slow, so it is all commented out.

Distribution Licence:
Project B is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.

Version:
D0.I0.T0

Field Summary
protected  boolean create
          Are we allowed to create new indexes
protected  java.lang.String leafname
          The leafname of the file read
protected  RawBible raw
          The RawBible co-ordinated the various classes that cache the files
 
Constructor Summary
Mem(RawBible raw, java.lang.String leafname, boolean create)
          Create a WordResource from a File that contains the dictionary.
Mem(RawBible raw, java.lang.String leafname, boolean create, java.lang.StringBuffer messages)
          Create a WordResource from a File that contains the dictionary.
 
Method Summary
private  void ctor(RawBible raw, java.lang.String leafname, boolean create)
          This really should be a constructor, however the StringBuffer ctor wants to trap and muffle exceptions.
abstract  void init()
          Start all over again and clear the decks for more data.
 void load()
          Load the Resource from a named file
abstract  void load(java.io.InputStream in)
          Load the Resource from a stream
 void save()
          Ensure that all changes to the index of words are written to disk
abstract  void save(java.io.OutputStream out)
          Ensure that all changes to the index of words are written to a stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

create

protected boolean create
Are we allowed to create new indexes


leafname

protected java.lang.String leafname
The leafname of the file read


raw

protected RawBible raw
The RawBible co-ordinated the various classes that cache the files

Constructor Detail

Mem

public Mem(RawBible raw,
           java.lang.String leafname,
           boolean create)
    throws java.lang.Exception
Create a WordResource from a File that contains the dictionary.


Mem

public Mem(RawBible raw,
           java.lang.String leafname,
           boolean create,
           java.lang.StringBuffer messages)
Create a WordResource from a File that contains the dictionary.

Method Detail

ctor

private void ctor(RawBible raw,
                  java.lang.String leafname,
                  boolean create)
           throws java.lang.Exception
This really should be a constructor, however the StringBuffer ctor wants to trap and muffle exceptions. and I can't do this: try { this(...) } ...


init

public abstract void init()
Start all over again and clear the decks for more data.


load

public abstract void load(java.io.InputStream in)
                   throws java.io.IOException,
                          java.lang.ClassNotFoundException
Load the Resource from a stream


load

public void load()
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Load the Resource from a named file


save

public abstract void save(java.io.OutputStream out)
                   throws java.io.IOException
Ensure that all changes to the index of words are written to a stream


save

public void save()
          throws java.io.IOException
Ensure that all changes to the index of words are written to disk