public class DocData
extends java.lang.Object
Constructor and Description |
---|
DocData(java.lang.String title)
Instantiates a new DocumentData object
|
DocData(java.lang.String title,
java.util.Set<java.lang.String> docKeys)
Instantiates a new DocData object with the given set of keys
|
Modifier and Type | Method and Description |
---|---|
void |
addKey(java.lang.String key)
Adds a key to the Document metadata
|
void |
addKey(java.lang.String key,
java.lang.Object value)
Adds a key to the Document metadata with an associated value
|
void |
addKeyMap(java.util.Map<java.lang.String,? extends java.lang.Object> keyMap)
Add a group of keys with values to this docData object.
|
int |
calculateSimilarity(DocData doc)
Calculate similarity between this DocData and another DocData object
based upon the keys that have been set.
|
void |
clearKeys()
Clears the keys associated with this DocData object
|
boolean |
equals(java.lang.Object obj)
Return whether this DocData object is equal to another object.
|
java.lang.String |
getBody()
Gets the body.
|
java.util.Map<java.lang.String,java.lang.Object> |
getKeyMap()
Return the set of keys with their mapped values
|
java.util.Set<java.lang.String> |
getKeys()
Gets the set of keys for this document object.
|
java.lang.String |
getLink()
Get the link associated with this record.
|
java.lang.String |
getName()
Get the name or title of this document
|
java.util.List<java.lang.String> |
getSections()
Return the sections of the document in order.
|
java.lang.String |
getSummary()
Gets the summary data.
|
java.util.Date |
getTimeStamp()
Get the timestamp for the document.
|
java.lang.Object |
getValueForKey(java.lang.String key)
Gets the value associated with a key
|
int |
hashCode()
Return the hashcode for this DocData object
|
boolean |
loadContent()
Loads the content, keys, and other fields for this document.
|
boolean |
matchesKey(java.lang.String key)
Determines if this DocData matches the specified key.
|
void |
setBody(java.lang.String docBody)
Set the document body
|
void |
setLink(java.lang.String linkString)
Set the link associated with this record.
|
void |
setName(java.lang.String newName)
Set the name or title of this DocData object.
|
void |
setSummary(java.lang.String docSummary)
Sets the summary.
|
void |
setTimeStamp(java.util.Date date)
Set the timestamp for the document.
|
java.lang.String |
toString()
Get the string representation of this DocData object
|
public DocData(java.lang.String title)
title
- the title of the documentpublic DocData(java.lang.String title, java.util.Set<java.lang.String> docKeys)
title
- the document titledocKeys
- the set of keys for the documentpublic void addKey(java.lang.String key)
key
- the keypublic void addKey(java.lang.String key, java.lang.Object value)
key
- the keyvalue
- a value objectpublic void addKeyMap(java.util.Map<java.lang.String,? extends java.lang.Object> keyMap)
keyMap
- the map of keys for this docData objectpublic int calculateSimilarity(DocData doc)
doc
- the doc record to compare topublic void clearKeys()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare topublic java.lang.String getBody()
public java.util.Map<java.lang.String,java.lang.Object> getKeyMap()
public java.util.Set<java.lang.String> getKeys()
public java.lang.String getLink()
public java.lang.String getName()
public java.util.List<java.lang.String> getSections()
public java.lang.String getSummary()
public java.util.Date getTimeStamp()
public java.lang.Object getValueForKey(java.lang.String key)
key
- the key to querypublic int hashCode()
hashCode
in class java.lang.Object
public boolean loadContent()
public boolean matchesKey(java.lang.String key)
key
- the keypublic void setBody(java.lang.String docBody)
docBody
- the document bodypublic void setLink(java.lang.String linkString)
linkString
- the link associated with the recordpublic void setName(java.lang.String newName)
newName
- the new Document name or titlepublic void setSummary(java.lang.String docSummary)
docSummary
- the new summarypublic void setTimeStamp(java.util.Date date)
date
- the timestamp for the documentpublic java.lang.String toString()
toString
in class java.lang.Object