|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dhmp.util.Algorithm
General proposed algorithms.
Nested Class Summary | |
static class |
Algorithm.BinaryFunction
Abstract fucntion for map transformation. |
static class |
Algorithm.UnaryFunction
Abstract fucntion for map transformation. |
Method Summary | |
static HierarchicalMap |
append(HierarchicalMap appended,
HierarchicalMap appender)
Appends second map into first map. |
static HierarchicalMap |
append(HierarchicalMap appended,
HierarchicalMap appender,
boolean checkRecursion)
|
static HierarchicalMap |
append(HierarchicalMap appended,
LinkedHashMultiMap.EntrySet appender)
Appends entryset into HierarchicalMap. |
static HierarchicalMap |
append(HierarchicalMap appended,
java.util.Map appender)
Appends map into HierarchicalMap. |
static HierarchicalMap |
denormalize(HierarchicalMap map,
java.lang.String field,
java.lang.String keyField)
Restructure the map, ordering by content of key field. |
static HierarchicalMap |
find(HierarchicalMap map,
java.lang.String field,
java.lang.String keyField,
java.lang.Object value)
Finds a node which contains a specific value. |
static HierarchicalMap |
foreach(HierarchicalMap input,
Algorithm.BinaryFunction function)
Traverse the entire HierarchicalMap using Depth-first strategie. |
static HierarchicalMap |
foreach(HierarchicalMap input,
Algorithm.UnaryFunction function)
Traverse the entire HierarchicalMap using Depth-first strategie. |
static HierarchicalMap |
merge(java.lang.Object key,
HierarchicalMap target,
HierarchicalMap source)
Merge source HierarchicalMap into target HierarchicalMap under key. |
static HierarchicalMap |
normalize(HierarchicalMap map,
java.lang.String field,
java.lang.String keyField)
Reverse the resul to denormaization. |
static HierarchicalMap |
overwrite(HierarchicalMap overwritten,
HierarchicalMap overwriter)
Overwrites all the content of first map with content of second map. |
static HierarchicalMap |
transform(HierarchicalMap map1,
HierarchicalMap map2,
Algorithm.BinaryFunction function)
Traverse the entire HierarchicalMap using Depth-first strategie and tries to get the same element at second map. |
static HierarchicalMap |
transform(HierarchicalMap map1,
HierarchicalMap map2,
HierarchicalMap map3)
Traverse the entire HierarchicalMap map1 using Depth-first strategie and tries to get the element from second map map2. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static HierarchicalMap denormalize(HierarchicalMap map, java.lang.String field, java.lang.String keyField)
+ | Chapter -----------+ | | Title | ---------- first title | Chapter -----------+ | Title ---------- second titleAfter calling denormalize(map, "Chapter", "Title") will be restructured, i.e. all "Chapter" node will be ordered according its "Title"'s content. to:
+ | Chapter -----------+ | first title --------------+ | | Title | ---------- first title | second title --------------+ | Title ---------- second titleNote that the map passes as parameter will be modifyed after this method.
map
- that will be restructured.field
- all the field affected by this method.keyField
- key field from which its content will be used to order the
structure.
public static HierarchicalMap normalize(HierarchicalMap map, java.lang.String field, java.lang.String keyField)
map
- that will be restructured.field
- all the field affected by this method.keyField
- key field which is inserted into sub-node containing the
original sub-node name.
public static HierarchicalMap find(HierarchicalMap map, java.lang.String field, java.lang.String keyField, java.lang.Object value)
map
- that will be searched.field
- from where the search begins.keyField
- key field which is looked if it contains the value.value
- the value which is looking for.
public static HierarchicalMap merge(java.lang.Object key, HierarchicalMap target, HierarchicalMap source)
key
- pointing to a node on target HierarchicalMap where the source
is added.target
- HierarchicalMap where the source is added. This HierarchicalMap will be m
modified if merge succeeds.source
- containing entries to be added.
public static HierarchicalMap append(HierarchicalMap appended, HierarchicalMap appender)
appended
- map where the content of the other map is appended.appender
- map containing the nodes to be added.
public static HierarchicalMap append(HierarchicalMap appended, HierarchicalMap appender, boolean checkRecursion)
public static HierarchicalMap append(HierarchicalMap appended, java.util.Map appender)
appended
- map where the content of the other map is appended.appender
- map containing the entries to be added.
public static HierarchicalMap append(HierarchicalMap appended, LinkedHashMultiMap.EntrySet appender)
appended
- map where the content of the other map is appended.appender
- entryset containing the entries to be added.
public static HierarchicalMap overwrite(HierarchicalMap overwritten, HierarchicalMap overwriter)
overwritten
- map where the content of the other map is overwritten.overwriter
- map containing the nodes to overwrite.
public static HierarchicalMap foreach(HierarchicalMap input, Algorithm.UnaryFunction function)
input
- map where the content of the other map is traversed.function
- unary function applied to each leaf.
public static HierarchicalMap foreach(HierarchicalMap input, Algorithm.BinaryFunction function)
input
- map where the content of the other map is traversed.function
- binary function applied to each leaf.
public static HierarchicalMap transform(HierarchicalMap map1, HierarchicalMap map2, Algorithm.BinaryFunction function)
map1
- map where the content is traversed.map2
- map where the content of corresponding leaves are retrieved.function
- binary function applied to the leaves.
public static HierarchicalMap transform(HierarchicalMap map1, HierarchicalMap map2, HierarchicalMap map3)
map1
- map where the content is traversed.map2
- map where the content of corresponding leaves are retrieved.map3
- contains the target from where map2 nodes are retrieved and
binary function that will be applied.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |