edu.rice.cs.drjava.model.cache
Interface DCacheAdapter


public interface DCacheAdapter

A lightweight wrapper type for DefinitionsDocuments that may or may not be resident in memory. An instance of this The wrapper includes a copy of the String text of the document if it has been kicked out of the cache.


Method Summary
 void addDocumentListener(DocumentListener l)
          Adds a DocumentListener to the reconstructor.
 void close()
          Closes the corresponding document for this adapter.
 void documentModified()
           
 void documentReset()
           
 void documentSaved()
           
 DefinitionsDocument getDocument()
          Retrieves the document for its corresponding ODD
 int getLength()
           
 String getText()
           
 String getText(int offset, int length)
           
 boolean isReady()
          Checks whether the document is ready to be returned.
 

Method Detail

getDocument

DefinitionsDocument getDocument()
                                throws IOException,
                                       FileMovedException
Retrieves the document for its corresponding ODD

Returns:
the definitions document for the corresponding ODD
Throws:
IOException
FileMovedException

getLength

int getLength()

getText

String getText()

getText

String getText(int offset,
               int length)
               throws BadLocationException
Throws:
BadLocationException

isReady

boolean isReady()
Checks whether the document is ready to be returned. If false, then the document would have to be loaded from disk when getDocument() is called.

Returns:
if the document is already loaded

close

void close()
Closes the corresponding document for this adapter.


addDocumentListener

void addDocumentListener(DocumentListener l)
Adds a DocumentListener to the reconstructor.


documentSaved

void documentSaved()

documentModified

void documentModified()

documentReset

void documentReset()