|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.DocContentMap
public class DocContentMap
Utilities for comparing metadata records for content-based equality (rather than structural equality).
Note: why isn't NodeComparator
used to compare? see
more info on
NodeComparator
Method Summary | |
---|---|
static void |
cmpMaps(Map map1,
Map map2)
Compares two docContent Maps - used for debugging and testing. |
static void |
cmpValLists(List list1,
List list2)
compare the values of a doc field for the cashed and active docs |
static void |
cmpVals(List list1,
List list2)
Debugging method to compare two value-lists. |
static Map |
getDocContentMap(Document doc,
MetaDataFramework framework)
Returns a representation of a metadata record that can be compared with another record to determine if there are differences in content. |
Map |
getDocContentMap(File file)
Returns a content map of the provided file, assuming it belongs to the MetaDataFramework of this DocContentMap instance. |
Document |
getDocument()
Gets the document attribute of the DocContentMap object |
static void |
main(String[] args)
The main program for the DocContentMap class |
static void |
prtmap(Map map)
Utility method to print the contents of a contentMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Document getDocument()
public static Map getDocContentMap(Document doc, MetaDataFramework framework)
The DocContentMap has an entry for each normalized (i.e., containing no indexing info) xpath having a value. The entries are a sorted list of the values for that xpath. As a map with sorted entries, this representation allows records to be compared using the Map "equals" method.
DocContentMaps are used to determine if a metadata has been edited in the metadata editor so the user can be warned of unsaved changes before exiting.
doc
- a Document
representing a metadata
recordframework
- the MetaDataFramework for the metadata record
public Map getDocContentMap(File file)
file
- Description of the Parameter
public static void main(String[] args) throws Exception
args
- The command line arguments
Exception
- Description of the Exceptionpublic static void prtmap(Map map)
map
- Description of the Parameterpublic static void cmpMaps(Map map1, Map map2)
map1
- Description of the Parametermap2
- Description of the Parameterpublic static void cmpVals(List list1, List list2)
list1
- Description of the Parameterlist2
- Description of the Parameterpublic static void cmpValLists(List list1, List list2)
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |