at.ac.tuwien.dslab.rmi.common.impl
Class DocumentImpl

java.lang.Object
  extended by at.ac.tuwien.dslab.rmi.common.impl.DocumentImpl
All Implemented Interfaces:
IDocument, java.io.Serializable

public class DocumentImpl
extends java.lang.Object
implements IDocument

The DocumentImpl provides a default implementation of document.

See Also:
Serialized Form

Constructor Summary
DocumentImpl()
          Creates a new and empty IDocument instance.
DocumentImpl(java.lang.String name, long version, byte[] content)
          Creates a new IDocument instance.
 
Method Summary
 byte[] getContent()
          Gets the content of the document.
 java.lang.String getName()
          Gets the name of the document.
 long getVersion()
          Gets the version of this document.
 void setContent(byte[] content)
          Sets the content of the document.
 void setName(java.lang.String name)
          Sets the name of the document.
 void setVersion(long version)
          Sets the version of the document (The first version is always assigned the value 1).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentImpl

public DocumentImpl()
Creates a new and empty IDocument instance.


DocumentImpl

public DocumentImpl(java.lang.String name,
                    long version,
                    byte[] content)
Creates a new IDocument instance.

Parameters:
name - The name of the document.
version - The version of the document.
content - The content of the document.
Method Detail

setName

public void setName(java.lang.String name)
Description copied from interface: IDocument
Sets the name of the document.

Specified by:
setName in interface IDocument
Parameters:
name - The name of the document (has to contain only characters with are allowed in a filename).

getName

public java.lang.String getName()
Description copied from interface: IDocument
Gets the name of the document.

Specified by:
getName in interface IDocument
Returns:
The name of the document.

setVersion

public void setVersion(long version)
Description copied from interface: IDocument
Sets the version of the document (The first version is always assigned the value 1). The version handling has to be done on the server, this class is only a data transfer object, it does not implement any logic.

Specified by:
setVersion in interface IDocument
Parameters:
version - The version of this document.

getVersion

public long getVersion()
Description copied from interface: IDocument
Gets the version of this document.

Specified by:
getVersion in interface IDocument
Returns:
The version of this document.

getContent

public byte[] getContent()
Description copied from interface: IDocument
Gets the content of the document.

Specified by:
getContent in interface IDocument
Returns:
The content of the document as byte array.

setContent

public void setContent(byte[] content)
Description copied from interface: IDocument
Sets the content of the document.

Specified by:
setContent in interface IDocument
Parameters:
content - The content of the document as byte array.