|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdochelper.NaturalOrderParamProcessor
public class NaturalOrderParamProcessor
The class NaturalOrderProcessor
imlements a natural order sorting
mechanism for rresult trees in DocHelper. It implements the Processor
interface in order to perform this task.
In order to perform its, task, and depending on the direction parameter, the
class uses the java TreeMap that nativley implements a sorted tree using
Natural order.
The result of executing this Processor on a ResultNode that represents the
root of a tree will be to sort all of the leaf nodes in reference only with
their sibilings. For this generic processor it is not of to sort leaf nodes
with regards to leafs in other sections of the tree becuase this could imply
chnaging the structure of the tree(shuffling nodes). In DocHelper the first
levels of the tree have semantic meaning: Document --> ReecordSet --> Record.
Assigning a match within one Record to another record in other to sort
all matches looses information. (In what record a match was found.)
Nested Class Summary | |
---|---|
class |
NaturalOrderParamProcessor.ParamResultNodeComparator
|
Field Summary | |
---|---|
protected static java.lang.String |
DIRECTION
The direction param name for the nautal order processor (asc-desc) |
protected java.util.HashMap<java.lang.String,java.lang.Object> |
params
The paramters that describe this Processor |
protected static java.lang.String |
SORT_PARAM
|
Constructor Summary | |
---|---|
NaturalOrderParamProcessor()
|
Method Summary | |
---|---|
void |
checkParams()
Checks that the parameters are correct for this type of Renderer. |
void |
init()
Initialize the Renderer. |
ResultNode |
operate(ResultNode doc)
Performs an operation on a ResultNode tree and returns the resulting tree after the operation. |
private void |
orderTree(ResultNode doc)
|
void |
setParam(java.lang.String paramName,
java.lang.Object value)
Add a parameter to the Configurable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String DIRECTION
protected static final java.lang.String SORT_PARAM
protected java.util.HashMap<java.lang.String,java.lang.Object> params
Constructor Detail |
---|
public NaturalOrderParamProcessor()
Method Detail |
---|
public ResultNode operate(ResultNode doc)
Processor
operate
in interface Processor
doc
- The node that represent the root of the tree to process.private void orderTree(ResultNode doc)
public void setParam(java.lang.String paramName, java.lang.Object value) throws IllegalParamterTypeException
Configurable
setParam
in interface Configurable
paramName
- String Name of the paramter to be storedvalue
- String value of the named param
IllegalParamterTypeException
public void checkParams() throws InvalidValueException, MissingArgumentException, ResourceUnavailableException
Configurable
checkParams
in interface Configurable
InvalidValueException
MissingArgumentException
ResourceUnavailableException
public void init() throws InitializationException, ResourceUnavailableException
Configurable
init
in interface Configurable
InitializationException
ResourceUnavailableException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |