public class SitemeshBufferFragment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SitemeshBufferFragment.Builder
A builder for fragments.
|
Modifier and Type | Field and Description |
---|---|
private SitemeshBuffer |
buffer |
private java.util.TreeMap<java.lang.Integer,java.lang.Integer> |
deletions |
private int |
length |
private int |
start |
Constructor and Description |
---|
SitemeshBufferFragment(SitemeshBuffer buffer,
int start,
int length) |
SitemeshBufferFragment(SitemeshBuffer buffer,
int start,
int length,
java.util.TreeMap<java.lang.Integer,java.lang.Integer> deletions)
Create a sitemesh buffer fragment
|
Modifier and Type | Method and Description |
---|---|
static SitemeshBufferFragment.Builder |
builder() |
static SitemeshBufferFragment.Builder |
builder(SitemeshBufferFragment fragment) |
int |
getLength() |
int |
getStart() |
java.lang.String |
getStringContent() |
int |
getTotalLength()
Get the total length of the fragment, taking deletions and chained buffers of the buffer
|
java.lang.String |
toString() |
void |
writeTo(java.io.Writer writer)
Write the fragment to the given writer
|
private final SitemeshBuffer buffer
private final int start
private final int length
private final java.util.TreeMap<java.lang.Integer,java.lang.Integer> deletions
public SitemeshBufferFragment(SitemeshBuffer buffer, int start, int length)
public SitemeshBufferFragment(SitemeshBuffer buffer, int start, int length, java.util.TreeMap<java.lang.Integer,java.lang.Integer> deletions)
buffer
- The buffer that this is a fragment ofstart
- The start of the fragmentlength
- The length of the fragmentdeletions
- Deleted parts of the fragment, as a map of positions to the length to be deleted.public void writeTo(java.io.Writer writer) throws java.io.IOException
writer
- The writer to write the fragment tojava.io.IOException
- If an error occuredpublic int getTotalLength()
public java.lang.String getStringContent()
public java.lang.String toString()
toString
in class java.lang.Object
public int getStart()
public int getLength()
public static SitemeshBufferFragment.Builder builder()
public static SitemeshBufferFragment.Builder builder(SitemeshBufferFragment fragment)