org.activemath.presentation
Class Fragment
java.lang.Object
org.activemath.presentation.Fragment
- All Implemented Interfaces:
- Serializable
public class Fragment
- extends Object
- implements Serializable
A transformed content item.
Content is stored as bytes, supposed to be UTF-8 encoded.
Implements Serializable for use as cache objects in org.apache.cache.Cache.
Since we are not using a persistent cache, no care has been taken to provide
a custum serialization. See Chapter 10 of "Effective Java" by Joshua Bloch.
- Version:
- $Revision: 1.10 $ $Date: 2005/04/18 07:52:48 $
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static Category log
Fragment
public Fragment(String id,
String format,
String lang)
getId
public String getId()
getFormat
public String getFormat()
getLang
public String getLang()
getTimeStamp
public long getTimeStamp()
getContent
public byte[] getContent()
getContentUTF8
public String getContentUTF8()
- Convert the content of this fragment as UTF-8 string.
Takes about 15ms for 180KB buffer. This string is currently not
stored because of excessive memory requirements (for storing n KB
of HTML, we would need 3*n KB of storage).
- Returns:
- content of this fragment as UTF-8 string.
setContent
public void setContent(byte[] content)
- Set the content for this fragment.
- Parameters:
content - content as bytes
setTimeStamp
public void setTimeStamp(long timeStamp)