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

All Known Implementing Classes:
DocumentCache.DocManager

public interface DCacheAdapter

A lightweight wrapper type for DefinitionsDocuments that may or may not be resident in memory. An instance of this (??? -- incomplete sentence). The wrapper includes a copy of the String text of the document if it has been kicked out of the cache. It may also contain the currently set keywords so they can be modified without loading in the document.


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.
 void setKeywords(Set<String> keywords)
          Set the specified keywords as keywords for syntax highlighting.
 

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()

setKeywords

void setKeywords(Set<String> keywords)
Set the specified keywords as keywords for syntax highlighting.

Parameters:
keywords - keywords to highlight