|
VTT Java 2010 Version |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nlm.nls.vtt.Model.Markups
public class Markups
This class is the collection of Java object Markup. This class is used directly in VTT.
History:
Field Summary | |
---|---|
static int |
ADD
markup action: add a markup |
static int |
CHANGE
markup action: change a markup, position or tag |
static int |
DELETE
markup action: delete a markup |
static int |
JOIN
markup action: join a selected markup and the next |
static int |
MAX_LENGTH_SIZE
Vtt fixed format definiton: max field size for length |
static int |
MAX_OFFSET_SIZE
Vtt fixed format definiton: max field size for offset |
static int |
MAX_TAG_CATEGORY_SIZE
Vtt fixed format definiton: max field size for tag category |
static int |
MAX_TAG_NAME_SIZE
Vtt fixed format definiton: max field size for tag name |
static int |
NO_SELECT
selection variables: no select |
static int |
OVERRIDE
markup action: override selected markups/next |
Constructor Summary | |
---|---|
Markups()
Create a Markups Java object with default values. |
|
Markups(java.lang.String inFile,
Tags tags)
Create a Markups Java object by specifying input file and tags. |
Method Summary | |
---|---|
void |
AddMarkup(Markup markup)
Add a markup to markups list. |
int |
DecreaseSelectIndex(boolean showAll,
VttObj vttObj)
Decrease the selected index to the previous display markup, and then return the end position of markup |
void |
DeleteMarkupByTag(java.lang.String tagNameCategory)
Delete all markups with specified tag nameCategory. |
int |
FindSelectIndex(int curPos)
Find the selected index by specifying the current position. |
void |
FindSelectIndex(int start,
int length)
Find the select index by start and end (smear) |
void |
FindSelectIndex(Markup markup)
Find the select index by specifying the markup |
static java.lang.String |
GetActionStr(int action)
Convert action to the action string. |
int |
GetFirstSelectIndex(boolean showAll,
VttObj vttObj)
Move the selected markup to the first from the beginning and then return the beginning position of the markup. |
int |
GetIndex(Markup markup)
get the index of a specified Markup by name (offset and length), This method returns -1 if the specified markup does not exist. |
int |
GetLastSelectIndex(boolean showAll,
VttObj vttObj)
Move the selected markup to the last from the end and then return the end position of markup. |
Markup |
GetMarkup(int index)
Get markup by specifying the index. |
java.util.Vector<Markup> |
GetMarkups()
Get the markups. |
static java.util.Vector<java.lang.String> |
GetReportStrs(java.util.Vector<java.lang.String> nameCategoryList,
java.util.Vector<Markup> markups)
Get the markup report in a format of line Vector of String. |
int |
GetSelectIndex()
Get the selected index. |
Markup |
GetSelectMarkup()
Get the selected markup. |
int |
GetSize()
Get the size of markups. |
int |
IncreaseSelectIndex(boolean showAll,
VttObj vttObj)
Increase the selected index to the next display markup, and then return the end position of markup |
void |
LoadMarkupsFromFile(java.lang.String inFile,
Tags tags)
Load markups from a file. |
static Markup |
ReadMarkupFromLine(java.lang.String line)
Read a markup from a string (line), without tags checking. |
static Markup |
ReadMarkupFromLine(java.lang.String line,
Tags tags,
int maxTextPos)
Read a markup from a string (line), with tags checking. |
static Markup |
ReadMarkupFromLine(java.lang.String line,
Tags tags,
int maxTextPos,
int verboseType)
Read a markup from a string (line), with tags checking and verbose type options. |
void |
RemoveMarkupAt(int index)
Remove markup from specified position. |
void |
SaveMarkupsToFile(java.lang.String outFile)
save markups to file. |
void |
SetMarkupAt(Markup markup,
int index)
Set markup at specified position. |
void |
SetSelectIndex(int selectIndex)
Set the selected index. |
void |
SetSelectMarkup(Markup markup)
Set a markup to the selected markup on markups list. |
void |
SortMarkups()
Sort the markups by: offset (smaller go first) length (bigger go first if offset is the same) |
static java.lang.String |
ToString(java.util.Vector<Markup> markups)
Convert specified markups to String. |
static java.lang.String |
ToString(java.util.Vector<Markup> markups,
boolean showHeader,
boolean showAnnotation)
Convert specified markups to String with options of showing header and annotation. |
static java.lang.String |
ToString(java.util.Vector<Markup> markups,
java.lang.String text,
int vttFormat,
ConfigObj configObj)
Convert specified markups to string with specifying text, vtt format, and configuration. |
static java.lang.String |
ToString(java.util.Vector<Markup> markups,
java.lang.String text,
int vttFormat,
ConfigObj configObj,
boolean showHeader)
Convert specified markups to string with specifying text, vtt format, configuration, and flag of showing header. |
void |
UpdateTagNameCategoryInMarkups(java.lang.String orgNameCategory,
java.lang.String newNameCategory)
update tag name category for all markups with specified the original and new name category. |
static void |
WriteMarkupsToFile(java.io.BufferedWriter out,
java.util.Vector<Markup> markups)
Write specified markups to a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_SELECT
public static final int ADD
public static final int CHANGE
public static final int DELETE
public static final int JOIN
public static final int OVERRIDE
public static final int MAX_OFFSET_SIZE
public static final int MAX_LENGTH_SIZE
public static final int MAX_TAG_NAME_SIZE
public static final int MAX_TAG_CATEGORY_SIZE
Constructor Detail |
---|
public Markups()
public Markups(java.lang.String inFile, Tags tags)
Method Detail |
---|
public java.util.Vector<Markup> GetMarkups()
public int GetSize()
public Markup GetMarkup(int index)
index
- the index of interested markup
public void AddMarkup(Markup markup)
markup
- the markup to be addedpublic void SetSelectMarkup(Markup markup)
markup
- the markup to be setpublic void SetMarkupAt(Markup markup, int index)
markup
- the markup to be setindex
- the index of markup to be set on the markups listpublic void RemoveMarkupAt(int index)
index
- the position of markup to be removed on the markups listpublic int GetIndex(Markup markup)
markup
- the markup is in interested
public void SaveMarkupsToFile(java.lang.String outFile)
outFile
- the file of markups list to be saved topublic void LoadMarkupsFromFile(java.lang.String inFile, Tags tags)
inFile
- the file of markups list to be loaded fromtags
- the tags used in the VttDocumentpublic void UpdateTagNameCategoryInMarkups(java.lang.String orgNameCategory, java.lang.String newNameCategory)
orgNameCategory
- original nameCategorynewNameCategory
- new nameCategorypublic void DeleteMarkupByTag(java.lang.String tagNameCategory)
tagNameCategory
- tag namecategory of markup to be deletedpublic static void WriteMarkupsToFile(java.io.BufferedWriter out, java.util.Vector<Markup> markups) throws java.io.IOException
out
- the buffered writer of out file destinationmarkups
- markups to be sent to a file
java.io.IOException
public static java.lang.String ToString(java.util.Vector<Markup> markups)
markups
- the markups to be converted to string
public static java.lang.String ToString(java.util.Vector<Markup> markups, boolean showHeader, boolean showAnnotation)
markups
- the markups to be converted to stringshowHeader
- a boolean flag of showing headershowAnnotation
- a boolean flag of showing annotation
public static java.lang.String ToString(java.util.Vector<Markup> markups, java.lang.String text, int vttFormat, ConfigObj configObj)
markups
- the markups to be converted to stringtext
- the text section of vtt documentvttFormat
- vtt formats: SIMPLE_FORMAT, READABLE_FORMAT,
FIX_LENGTH_FORMAT, and SIMPLEST_FORMATconfigObj
- vtt configuration object
public static java.lang.String ToString(java.util.Vector<Markup> markups, java.lang.String text, int vttFormat, ConfigObj configObj, boolean showHeader)
markups
- the markups to be converted to stringtext
- the text section of vtt documentvttFormat
- vtt formats: SIMPLE_FORMAT, READABLE_FORMAT,
FIX_LENGTH_FORMAT, and SIMPLEST_FORMATconfigObj
- vtt configuration objectshowHeader
- a boolean flag of showing header
public static java.util.Vector<java.lang.String> GetReportStrs(java.util.Vector<java.lang.String> nameCategoryList, java.util.Vector<Markup> markups)
nameCategoryList
- the vector of nameCategory to shown on the reportmarkups
- the markups to be reports
public static Markup ReadMarkupFromLine(java.lang.String line)
line
- the input line for the markup
public static Markup ReadMarkupFromLine(java.lang.String line, Tags tags, int maxTextPos)
line
- the input line for the markuptags
- the tags in vtt Document used for valifyingmaxTextPos
- the max. tetx position
public static Markup ReadMarkupFromLine(java.lang.String line, Tags tags, int maxTextPos, int verboseType)
line
- the input line for the markuptags
- the tags in vtt Document used for valifyingmaxTextPos
- the max. tetx positionverboseType
- verbose types: VERVOSE_GUI and VERBOSE_STD_IO
public static java.lang.String GetActionStr(int action)
action
- the integer value of action
public int GetSelectIndex()
public Markup GetSelectMarkup()
public void SetSelectIndex(int selectIndex)
selectIndex
- the selected indexpublic void SortMarkups()
public int FindSelectIndex(int curPos)
curPos
- the current position of caret
public void FindSelectIndex(Markup markup)
markup
- the markup to be found for its indexpublic void FindSelectIndex(int start, int length)
start
- the start position of smearlength
- the length of smearpublic int GetFirstSelectIndex(boolean showAll, VttObj vttObj)
showAll
- a boolean flag of showing all markupsvttObj
- the vtt object
public int GetLastSelectIndex(boolean showAll, VttObj vttObj)
showAll
- a boolean flag of showing all markupsvttObj
- the vtt object
public int IncreaseSelectIndex(boolean showAll, VttObj vttObj)
showAll
- a boolean flag of showing all markupsvttObj
- the vtt object
public int DecreaseSelectIndex(boolean showAll, VttObj vttObj)
showAll
- a boolean flag of showing all markupsvttObj
- the vtt object
|
VTT Java 2010 Version |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |