estraier
Interface Document


public interface Document

Abstraction of document.


Method Summary
 void add_attr(java.lang.String name, java.lang.String value)
          Add an attribute.
 void add_hidden_text(java.lang.String text)
          Add a hidden sentence.
 void add_text(java.lang.String text)
          Add a sentence of text.
 java.util.List attr_names()
          Get a list of attribute names.
 java.lang.String attr(java.lang.String name)
          Get the value of an attribute.
 java.lang.String cat_texts()
          Concatenate sentences of the text.
 java.lang.String dump_draft()
          Dump draft data.
 int id()
          Get the ID number.
 java.lang.String make_snippet(java.util.List words, int wwidth, int hwidth, int awidth)
          Make a snippet of the body text.
 boolean scan_words(java.util.List words)
          Check whether the text includes every specified words.
 java.util.List texts()
          Get a list of sentences of the text.
 

Method Detail

add_attr

public void add_attr(java.lang.String name,
                     java.lang.String value)
Add an attribute.

Parameters:
name - the name of an attribute.
value - the value of the attribute. If it is null, the attribute is removed.

add_hidden_text

public void add_hidden_text(java.lang.String text)
Add a hidden sentence.

Parameters:
text - a hidden sentence.

add_text

public void add_text(java.lang.String text)
Add a sentence of text.

Parameters:
text - sentence of text.

attr_names

public java.util.List attr_names()
Get a list of attribute names.

Returns:
a list object of attribute names.

attr

public java.lang.String attr(java.lang.String name)
Get the value of an attribute.

Parameters:
name - the name of an attribute.
Returns:
the value of the attribute or null if it does not exist.

cat_texts

public java.lang.String cat_texts()
Concatenate sentences of the text.

Returns:
concatenated sentences.

dump_draft

public java.lang.String dump_draft()
Dump draft data.

Returns:
draft data.

id

public int id()
Get the ID number.

Returns:
the ID number. If this object has never been registered, -1 is returned.

make_snippet

public java.lang.String make_snippet(java.util.List words,
                                     int wwidth,
                                     int hwidth,
                                     int awidth)
Make a snippet of the body text.

Parameters:
words - a list object of words to be highlight.
wwidth - whole width of the result.
hwidth - width of strings picked up from the beginning of the text.
awidth - width of strings picked up around each highlighted word.
Returns:
a snippet string of the body text. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.

scan_words

public boolean scan_words(java.util.List words)
Check whether the text includes every specified words.

Parameters:
words - a list object of words to be checked.
Returns:
true if every specified words is found, else it is false.

texts

public java.util.List texts()
Get a list of sentences of the text.

Returns:
a list object of sentences of the text.