uk.ac.man.documentparser.dataholders
Class Document

java.lang.Object
  extended by uk.ac.man.documentparser.dataholders.Document
All Implemented Interfaces:
java.io.Serializable

public class Document
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
static class Document.Text_raw_type
           
static class Document.Type
           
 
Field Summary
private  java.lang.String abs
           
private  Author[] authors
           
private  java.lang.String body
           
private  ExternalID externalID
           
private  java.lang.String ID
           
private  boolean ignoreCoordinates
           
private  java.lang.String issue
           
private  Journal journal
           
private  java.lang.String pages
           
private  Document.Text_raw_type raw_type
           
private  java.lang.String rawContent
           
private static long serialVersionUID
           
private  java.lang.String title
           
private  Document.Type type
           
private  java.lang.String volume
           
private  java.lang.String xml
           
private  java.lang.String year
           
 
Constructor Summary
Document(java.lang.String id, java.lang.String title, java.lang.String abs, java.lang.String body, java.lang.String raw, Document.Text_raw_type raw_type, java.lang.String year, Journal journal, Document.Type type, Author[] authors, java.lang.String volume, java.lang.String issue, java.lang.String pages, java.lang.String xml, ExternalID externalID)
           
 
Method Summary
 java.lang.String getAbs()
           
 Author[] getAuthors()
           
 java.lang.String getBody()
           
 java.lang.String getDescription()
           
 ExternalID getExternalID()
           
 java.lang.String getID()
           
 java.lang.String getIssue()
           
 Journal getJournal()
           
 java.util.HashSet<java.lang.Integer> getMeshTaxIDs(java.util.HashMap<java.lang.String,java.lang.Integer> meshToTax)
           
 java.lang.String getPages()
           
 Document.Text_raw_type getRaw_type()
           
 java.lang.String getRawContent()
           
static long getSerialVersionUID()
           
 java.lang.String getTitle()
           
 Document.Type getType()
           
 java.lang.String getVolume()
           
 java.lang.String getXml()
           
 java.lang.String getYear()
           
 boolean hasTitle()
           
 boolean isIgnoreCoordinates()
           
 boolean isValid(int start, int end)
           
static java.sql.PreparedStatement prepareInsertStatements(java.sql.Connection conn, boolean clear)
           
static java.sql.PreparedStatement prepareInsertStatements(java.sql.Connection conn, java.lang.String table, boolean clear)
           
 void print()
           
 void saveToDB(java.sql.PreparedStatement pstmt)
           
 void saveToTextFile(java.io.File file, boolean simplify)
           
 void setAbs(java.lang.String abs)
           
 void setBody(java.lang.String body)
           
 void setIgnoreCoordinates(boolean ignoreCoordinates)
           
 void setRaw_type(Document.Text_raw_type raw_type)
           
 void setRawContent(java.lang.String rawContent)
           
 void setTitle(java.lang.String title)
           
 java.lang.String toHTML()
           
 java.lang.String toString()
           
 java.lang.String toString(boolean simplify)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

ID

private java.lang.String ID

title

private java.lang.String title

abs

private java.lang.String abs

body

private java.lang.String body

rawContent

private java.lang.String rawContent

raw_type

private Document.Text_raw_type raw_type

year

private java.lang.String year

ignoreCoordinates

private boolean ignoreCoordinates

authors

private Author[] authors

journal

private Journal journal

externalID

private ExternalID externalID

type

private Document.Type type

volume

private java.lang.String volume

issue

private java.lang.String issue

pages

private java.lang.String pages

xml

private java.lang.String xml
Constructor Detail

Document

public Document(java.lang.String id,
                java.lang.String title,
                java.lang.String abs,
                java.lang.String body,
                java.lang.String raw,
                Document.Text_raw_type raw_type,
                java.lang.String year,
                Journal journal,
                Document.Type type,
                Author[] authors,
                java.lang.String volume,
                java.lang.String issue,
                java.lang.String pages,
                java.lang.String xml,
                ExternalID externalID)
Method Detail

getID

public java.lang.String getID()

isValid

public boolean isValid(int start,
                       int end)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean simplify)

print

public void print()

prepareInsertStatements

public static java.sql.PreparedStatement prepareInsertStatements(java.sql.Connection conn,
                                                                 boolean clear)

prepareInsertStatements

public static java.sql.PreparedStatement prepareInsertStatements(java.sql.Connection conn,
                                                                 java.lang.String table,
                                                                 boolean clear)
Parameters:
conn - the SQL connection used for the insertion
Returns:
0: INSERT INTO articles_raw (xml, raw_text, date_inserted)... ; 1: "INSERT INTO articles (id_art, text_title, text_abstract, text_body, text_raw, text_raw_type, year, id_issn, article_type, authors, volume, issue, pages, id_ext, source)

saveToDB

public void saveToDB(java.sql.PreparedStatement pstmt)

getTitle

public java.lang.String getTitle()

getYear

public java.lang.String getYear()

hasTitle

public boolean hasTitle()

saveToTextFile

public void saveToTextFile(java.io.File file,
                           boolean simplify)

toHTML

public java.lang.String toHTML()

getRawContent

public java.lang.String getRawContent()

getMeshTaxIDs

public java.util.HashSet<java.lang.Integer> getMeshTaxIDs(java.util.HashMap<java.lang.String,java.lang.Integer> meshToTax)

isIgnoreCoordinates

public boolean isIgnoreCoordinates()
Returns:
the ignoreCoordinates

setIgnoreCoordinates

public void setIgnoreCoordinates(boolean ignoreCoordinates)
Parameters:
ignoreCoordinates - the ignoreCoordinates to set

getSerialVersionUID

public static long getSerialVersionUID()
Returns:
the serialVersionUID

getAbs

public java.lang.String getAbs()
Returns:
the abs

getBody

public java.lang.String getBody()
Returns:
the body

getRaw_type

public Document.Text_raw_type getRaw_type()
Returns:
the raw_type

getAuthors

public Author[] getAuthors()
Returns:
the authors

getJournal

public Journal getJournal()
Returns:
the journal

getExternalID

public ExternalID getExternalID()
Returns:
the externalIDs

getType

public Document.Type getType()
Returns:
the type

getVolume

public java.lang.String getVolume()
Returns:
the volume

getIssue

public java.lang.String getIssue()
Returns:
the issue

getPages

public java.lang.String getPages()
Returns:
the pages

setBody

public void setBody(java.lang.String body)
Parameters:
body - the body to set

setRawContent

public void setRawContent(java.lang.String rawContent)
Parameters:
rawContent - the rawContent to set

getXml

public java.lang.String getXml()
Returns:
the xml

setRaw_type

public void setRaw_type(Document.Text_raw_type raw_type)
Parameters:
raw_type - the raw_type to set

getDescription

public java.lang.String getDescription()

setTitle

public void setTitle(java.lang.String title)

setAbs

public void setAbs(java.lang.String abs)