palmed.buffer
Class RecordBufferManager

java.lang.Object
  extended by palmed.buffer.RecordBufferManager
All Implemented Interfaces:
IBufferManager, ISerializable

public final class RecordBufferManager
extends java.lang.Object
implements IBufferManager, ISerializable

This class provides multi-buffer support using records.

Version:
$Revision: 372 $ $Date: 2005-12-28 13:22:43 +0900 (mer., 28 déc. 2005) $
Author:
Mathieu Champlon

Constructor Summary
RecordBufferManager(IBufferFactory factory)
          Create a buffer manager.
 
Method Summary
 void close()
          Close the current buffer.
 boolean hasBeenModified()
          Test if the current buffer has been modified.
 void marshall(java.io.OutputStream stream)
          Write to an output stream.
 void next()
          Switch to the next buffer.
 void open()
          Open an empty buffer.
 void open(IFile file)
          Open the given file in a buffer.
 void previous()
          Switch to the previous buffer.
 boolean save()
          Save the file in the current buffer.
 void save(IFile file)
          Save the current buffer into the given file.
 void unmarshall(java.io.InputStream stream)
          Read from an input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordBufferManager

public RecordBufferManager(IBufferFactory factory)
Create a buffer manager.

Parameters:
factory - the buffer factory
Method Detail

previous

public void previous()
Switch to the previous buffer.

Specified by:
previous in interface IBufferManager

next

public void next()
Switch to the next buffer.

Specified by:
next in interface IBufferManager

open

public void open()
Open an empty buffer.

Specified by:
open in interface IBufferManager

open

public void open(IFile file)
Open the given file in a buffer.

Specified by:
open in interface IBufferManager
Parameters:
file - the file to read from

close

public void close()
Close the current buffer.

Specified by:
close in interface IBufferManager

save

public boolean save()
Save the file in the current buffer.

This operation must fail if no file is associated to the buffer.

Specified by:
save in interface IBufferManager
Returns:
whether the file could be saved or not

save

public void save(IFile file)
Save the current buffer into the given file.

Specified by:
save in interface IBufferManager
Parameters:
file - the file to write into

hasBeenModified

public boolean hasBeenModified()
Test if the current buffer has been modified.

Specified by:
hasBeenModified in interface IBufferManager
Returns:
whether the buffer has been modified or not

unmarshall

public void unmarshall(java.io.InputStream stream)
                throws java.io.IOException
Read from an input stream.

Specified by:
unmarshall in interface ISerializable
Parameters:
stream - the stream to read from
Throws:
java.io.IOException - an io exception occurs

marshall

public void marshall(java.io.OutputStream stream)
              throws java.io.IOException
Write to an output stream.

Specified by:
marshall in interface ISerializable
Parameters:
stream - the stream to write to
Throws:
java.io.IOException - an io exception occurs


Copyright © 2004-2006 PalmEd. All Rights Reserved.