Copyright © Rasmus Sten and contributors, 1997-2004

nu.dll.lyskom
Class TextStat

java.lang.Object
  |
  +--nu.dll.lyskom.TextStat
All Implemented Interfaces:
java.io.Serializable

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

The Text-Stat LysKOM data type (and this class) contains status information about a text, such as its author, creation time, etc. The most notable part of a Text-Stat is the Misc-Info selection, which is a list of Selection objects containing information about recipient, comments, footnotes, and so on. The Misc-Info list is likely to change over time, while the rest of the Text-Stat is not.

Another important part is the AuxItem list. Aux-Items are arbitrary data that can be attached to texts and conferences to specify things not covered in the base protocol, such as Content-Type of a text, FAQ number of conferences, and so on.

For many needs, the Misc-Info helper methods in the Text objects will be quite sufficient, such as getRecipients(), addRecipient(int), and so on. However, for more complex tasks, such as finding out when a specific recipient was added to a text and by whom, you will need to look into the Misc-Info list of Selection objects. Each Selection in the Misc-Info list represents a group of data received by the server.

All Misc-Info selectors specified in Protocol A are available as constants in this class. To manually find all (normal) recipients to a text, and their corresponding local text number, you will have to use getMiscInfo() to retreive a List of Selection objects, examine each object to see if they contain the selector TextStat.miscRecpt, and if they do, you will find the local text number in the same Selection object with the selector tag TextStat.miscLocNo. The method getMiscInfoSelections(int) in this class makes such operations easier by returning all Selections containing a given type of data, such as recipient information. The above procedure can thus be simplified by doing a getMiscInfoSelections(miscRecpt), which then gives you a List containing the Selection objects you are interested in.

For more detailed information, please consult the LysKOM Protocol A specification, node "The Misc-Info List". And better yet, help us improve this documentation and implementation.

See Also:
getMiscInfoSelections(int), Text, Selection, Serialized Form

Field Summary
static int MISC_INFO_COUNT
           
static int miscBccRecpt
          Misc-Info Selection selector for tagging "BCC" recipient data.
static int miscCcRecpt
          Misc-Info Selection selector for tagging CC-recipient data.
static int miscCommIn
          Misc-Info Selection selector for tagging "comment-in" data
static int miscCommTo
          Misc-Info Selection selector for tagging "comment-to" data
static int miscFootnIn
          Misc-Info Selection selector for tagging "footnote-in" data
static int miscFootnTo
          Misc-Info Selection selector for tagging "footnote-to" data
static int miscLocNo
          Misc-Info Selection selector for tagging a local text number
static int miscRecpt
          Misc-Info Selection selector for tagging recipient data.
static int miscRecTime
          Misc-Info Selection selector for tagging a receiving time
static int miscSentAt
          Misc-Info Selection selector for tagging the time at which a recipient was added
static int miscSentBy
          Misc-Info Selection selector for tagging person-no of the person who added a recipient
static int miscXAuthor
          ?
static int miscXPerson
          ?
static int miscXRecpt
          ?
static int miscXSystem
          ?
static int miscXText
          ?
 
Constructor Summary
TextStat()
          Creates an empty TextStat object
 
Method Summary
 void addAuxItem(nu.dll.lyskom.AuxItem a)
          Adds an AuxItem object to this text.
 void addMiscInfoEntry(int key, int value)
          Adds a new Misc-Info Selection entry with the tag key and the value value.
 void addMiscInfoEntry(int key, java.lang.Integer value)
          Adds a new Misc-Info Selection entry with the tag key and the value value.
 void clearMiscInfoEntry(int key)
          Removes all Selections containing the specified key.
 boolean containsAuxItem(int tag)
           
 int countAuxItems()
          Returns the number of AuxItem objects attached to this text.
 int getAuthor()
          Returns the author of the text.
 nu.dll.lyskom.Hollerith[] getAuxData(int tag)
          Returns the AuxItem data for a given AuxItem tag.
 nu.dll.lyskom.AuxItem[] getAuxItems()
          Returns an array of AuxItem object representing the AuxItem list attached to this text.
 java.util.List getAuxItems(int tag)
           
 java.lang.String getCharset()
          Returns the charset for this text.
 java.lang.String getContentType()
          Returns the content-type for this text.
 nu.dll.lyskom.KomTime getCreationTime()
          Returns the time at which this text was created.
 java.util.List getMiscInfo()
          Returns a List containing Selection objects, which in turn makes up the Misc-Info data for this text.
 java.util.List getMiscInfoSelections(int key)
          Returns a List of all Selections containing the tag key.
 int getNo()
          Returns the text number this TextStat information belongs to.
 int getSize()
           
 int[] getStatInts(int no)
          Returns an array containing all values tagged by the specified key no in this texts Misc-Info list.
 void removeMiscInfoEntry(int key, int value)
          Removes tag key if it contains value in this texts Misc-Info list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

miscRecpt

public static final int miscRecpt
Misc-Info Selection selector for tagging recipient data.

See Also:
Constant Field Values

miscCcRecpt

public static final int miscCcRecpt
Misc-Info Selection selector for tagging CC-recipient data.

See Also:
Constant Field Values

miscCommTo

public static final int miscCommTo
Misc-Info Selection selector for tagging "comment-to" data

See Also:
Constant Field Values

miscCommIn

public static final int miscCommIn
Misc-Info Selection selector for tagging "comment-in" data

See Also:
Constant Field Values

miscFootnTo

public static final int miscFootnTo
Misc-Info Selection selector for tagging "footnote-to" data

See Also:
Constant Field Values

miscFootnIn

public static final int miscFootnIn
Misc-Info Selection selector for tagging "footnote-in" data

See Also:
Constant Field Values

miscLocNo

public static final int miscLocNo
Misc-Info Selection selector for tagging a local text number

See Also:
Constant Field Values

miscRecTime

public static final int miscRecTime
Misc-Info Selection selector for tagging a receiving time

See Also:
Constant Field Values

miscSentBy

public static final int miscSentBy
Misc-Info Selection selector for tagging person-no of the person who added a recipient

See Also:
Constant Field Values

miscSentAt

public static final int miscSentAt
Misc-Info Selection selector for tagging the time at which a recipient was added

See Also:
Constant Field Values

miscXAuthor

public static final int miscXAuthor
?

See Also:
Constant Field Values

miscXPerson

public static final int miscXPerson
?

See Also:
Constant Field Values

miscXRecpt

public static final int miscXRecpt
?

See Also:
Constant Field Values

miscXText

public static final int miscXText
?

See Also:
Constant Field Values

miscXSystem

public static final int miscXSystem
?

See Also:
Constant Field Values

miscBccRecpt

public static final int miscBccRecpt
Misc-Info Selection selector for tagging "BCC" recipient data. Added in LysKOM Protocal A version 10, I think.

See Also:
Constant Field Values

MISC_INFO_COUNT

public static final int MISC_INFO_COUNT
See Also:
Constant Field Values
Constructor Detail

TextStat

public TextStat()
Creates an empty TextStat object

Method Detail

getNo

public int getNo()
Returns the text number this TextStat information belongs to.


getAuthor

public int getAuthor()
Returns the author of the text.


getAuxItems

public nu.dll.lyskom.AuxItem[] getAuxItems()
Returns an array of AuxItem object representing the AuxItem list attached to this text.


getCreationTime

public nu.dll.lyskom.KomTime getCreationTime()
Returns the time at which this text was created.


addAuxItem

public void addAuxItem(nu.dll.lyskom.AuxItem a)
Adds an AuxItem object to this text.


containsAuxItem

public boolean containsAuxItem(int tag)

getContentType

public java.lang.String getContentType()
Returns the content-type for this text.


getCharset

public java.lang.String getCharset()
Returns the charset for this text.


getSize

public int getSize()

countAuxItems

public int countAuxItems()
Returns the number of AuxItem objects attached to this text.


getAuxData

public nu.dll.lyskom.Hollerith[] getAuxData(int tag)
Returns the AuxItem data for a given AuxItem tag.

See Also:
AuxItem

getAuxItems

public java.util.List getAuxItems(int tag)

getMiscInfo

public java.util.List getMiscInfo()
Returns a List containing Selection objects, which in turn makes up the Misc-Info data for this text.


clearMiscInfoEntry

public void clearMiscInfoEntry(int key)
Removes all Selections containing the specified key. For example, clearMiscInfoEntry(miscRecpt) will remove all (normal) recipients from this text.


removeMiscInfoEntry

public void removeMiscInfoEntry(int key,
                                int value)
Removes tag key if it contains value in this texts Misc-Info list. For example, a convenient way of subtracting the recipient no. 4711 may be: removeMiscInfo(miscRecpt, 4711.


addMiscInfoEntry

public void addMiscInfoEntry(int key,
                             java.lang.Integer value)
Adds a new Misc-Info Selection entry with the tag key and the value value.


addMiscInfoEntry

public void addMiscInfoEntry(int key,
                             int value)
Adds a new Misc-Info Selection entry with the tag key and the value value.


getMiscInfoSelections

public java.util.List getMiscInfoSelections(int key)
Returns a List of all Selections containing the tag key. To retreive a list of all Selections containing recipient information, do getMiscInfoSelections(miscRecpt). To retreive all selections containing a local text number, i.e. all types of recipients, you can search for that selector tag as well (getMiscInfoSelections(miscLocNo)).


getStatInts

public int[] getStatInts(int no)
Returns an array containing all values tagged by the specified key no in this texts Misc-Info list. For example, getStatInts(miscRecpt) will return an integer array containing all recipients to this text.


Copyright © Rasmus Sten and contributors, 1997-2004