|
|||||||||
| Home >> All >> org >> eclipse >> [ compare overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.compare
Class BufferedContent

java.lang.Objectorg.eclipse.compare.BufferedContent
- All Implemented Interfaces:
- IContentChangeNotifier, IStreamContentAccessor
- Direct Known Subclasses:
- ResourceNode
- public abstract class BufferedContent
- extends java.lang.Object
- implements IContentChangeNotifier, IStreamContentAccessor
- extends java.lang.Object
Abstract implementation for a buffered IStreamContentAccessor.
Subclasses must implement the createStream method
to connect the buffered content with a streamable source (e.g., a file).
As long as the contents of BufferedContent is only retrieved as an input stream
(by means of getContents) and the BufferedContent is not modified (with
setContent) no buffering takes place.
Buffering starts when either method getContent or setContent is called.
| Field Summary | |
(package private) byte[] |
fContent
|
private org.eclipse.jface.util.ListenerList |
fListenerList
|
| Constructor Summary | |
protected |
BufferedContent()
Creates a buffered stream content accessor. |
| Method Summary | |
void |
addContentChangeListener(IContentChangeListener listener)
Adds a content change listener to this notifier. |
protected abstract java.io.InputStream |
createStream()
Creates and returns a stream for reading the contents. |
void |
discardBuffer()
Discards the buffered content. |
protected void |
fireContentChanged()
Notifies all registered IContentChangeListeners of a content change. |
byte[] |
getContent()
Returns the contents as an array of bytes. |
java.io.InputStream |
getContents()
Returns an open InputStream for this object which can be used to retrieve the object's content. |
void |
removeContentChangeListener(IContentChangeListener listener)
Removes the given content changed listener from this notifier. |
void |
setContent(byte[] contents)
Sets the contents. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
fContent
byte[] fContent
fListenerList
private org.eclipse.jface.util.ListenerList fListenerList
| Constructor Detail |
BufferedContent
protected BufferedContent()
- Creates a buffered stream content accessor.
| Method Detail |
getContents
public java.io.InputStream getContents() throws org.eclipse.core.runtime.CoreException
- Description copied from interface:
IStreamContentAccessor - Returns an open
InputStreamfor this object which can be used to retrieve the object's content. The client is responsible for closing the stream when finished. Returnsnullif this object has no streamable contents.- Specified by:
getContentsin interfaceIStreamContentAccessor
createStream
protected abstract java.io.InputStream createStream() throws org.eclipse.core.runtime.CoreException
- Creates and returns a stream for reading the contents.
Subclasses must implement this method.
setContent
public void setContent(byte[] contents)
- Sets the contents. Registered content change listeners are notified.
getContent
public byte[] getContent()
- Returns the contents as an array of bytes.
discardBuffer
public void discardBuffer()
- Discards the buffered content.
addContentChangeListener
public void addContentChangeListener(IContentChangeListener listener)
- Description copied from interface:
IContentChangeNotifier - Adds a content change listener to this notifier.
Has no effect if an identical listener is already registered.
- Specified by:
addContentChangeListenerin interfaceIContentChangeNotifier
removeContentChangeListener
public void removeContentChangeListener(IContentChangeListener listener)
- Description copied from interface:
IContentChangeNotifier - Removes the given content changed listener from this notifier.
Has no effect if the listener is not registered.
- Specified by:
removeContentChangeListenerin interfaceIContentChangeNotifier
fireContentChanged
protected void fireContentChanged()
- Notifies all registered
IContentChangeListeners of a content change.
|
|||||||||
| Home >> All >> org >> eclipse >> [ compare overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.eclipse.compare.BufferedContent