|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.internal.watson.ElementTreeWriter
public class ElementTreeWriter
ElementTreeWriter flattens an ElementTree
onto a data output stream.
This writer generates the most up-to-date format of a saved element tree (cf. readers, which must usually also deal with backward compatibility issues). The flattened representation always includes a format version number.
The writer has an IElementInfoFactory,
which it consults for writing element infos.
Element tree writers are thread-safe; several threads may share a single writer.
| Field Summary | |
|---|---|
static int |
CURRENT_FORMAT
The current format version number. |
static int |
D_INFINITE
Constant representing infinite depth |
| Constructor Summary | |
|---|---|
ElementTreeWriter(IElementInfoFlattener flattener)
Constructs a new element tree writer that works for the given element info flattener. |
|
| Method Summary | |
|---|---|
void |
writeDelta(ElementTree olderTree,
ElementTree newerTree,
org.eclipse.core.runtime.IPath path,
int depth,
java.io.DataOutput output,
IElementComparator comparator)
Writes the delta describing the changes that have to be made to newerTree to obtain olderTree. |
void |
writeDeltaChain(ElementTree[] trees,
org.eclipse.core.runtime.IPath path,
int depth,
java.io.DataOutput output,
IElementComparator comparator)
Writes an array of ElementTrees to the given output stream. |
void |
writeTree(ElementTree tree,
org.eclipse.core.runtime.IPath path,
int depth,
java.io.DataOutput output)
Writes all or some of an element tree to an output stream. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CURRENT_FORMAT
public static final int D_INFINITE
| Constructor Detail |
|---|
public ElementTreeWriter(IElementInfoFlattener flattener)
| Method Detail |
|---|
public void writeDelta(ElementTree olderTree,
ElementTree newerTree,
org.eclipse.core.runtime.IPath path,
int depth,
java.io.DataOutput output,
IElementComparator comparator)
throws java.io.IOException
path - The path of the subtree to write. All nodes on the path above
the subtree are represented as empty nodes.depth - The depth of the subtree to write. A depth of zero writes a
single node, and a depth of D_INFINITE writes the whole subtree.output - The stream to write the subtree to.
java.io.IOException
public void writeDeltaChain(ElementTree[] trees,
org.eclipse.core.runtime.IPath path,
int depth,
java.io.DataOutput output,
IElementComparator comparator)
throws java.io.IOException
trees - A chain of ElementTrees, where on tree in the list is
complete, and all other trees are deltas on the previous tree in the list.path - The path of the subtree to write. All nodes on the path above
the subtree are represented as empty nodes.depth - The depth of the subtree to write. A depth of zero writes a
single node, and a depth of D_INFINITE writes the whole subtree.output - The stream to write the subtree to.
java.io.IOException
public void writeTree(ElementTree tree,
org.eclipse.core.runtime.IPath path,
int depth,
java.io.DataOutput output)
throws java.io.IOException
tree - The tree to writepath - The path of the subtree to write. All nodes on the path above
the subtree are represented as empty nodes.depth - The depth of the subtree to write. A depth of zero writes a
single node, and a depth of D_INFINITE writes the whole subtree.output - The stream to write the subtree to.
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||