eTextReader.clientInterface
Class Notation

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable
          extended by eTextReader.clientInterface.Notation
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class Notation
extends java.util.Hashtable

A class to hold a notation for a document.

Version:
3.0, 7/10/2002
Author:
Marty Kane
See Also:
Hashtable, Serialized Form

Nested Class Summary
static class Notation.AnnotationType
          An enum outlining all the possible types of annotations, and allowing access to several properties based on this type.
static class Notation.ICON_LOCATION
          An enum that is used by the AnnotationType enum to indicate where the icon for an annotation should be placed
static class Notation.ViewMode
           
 
Field Summary
static java.lang.String ANNOTATION
          Type annotation - generic annotation.
static java.lang.String ANNOTATION_BOOKMARK
          Type Annotation Bookmark - Bookmarks that point to annotations.
static java.lang.String BOLD
          Type bold - a section of BOLD text
static java.lang.String BOOKMARK
          Type bookmark - a reference to a specific point in the text
static java.lang.String CHANGE
          Type change - notification of a change.
static java.lang.String COMMENT
          Type comment - a general comment.
static java.lang.String DIAGRAM
          Type comment - a diagram.
static java.lang.String DISCUSSION
          Type comment - a discussion.
static java.lang.String EXAMPLE
          Type example - an example.
static java.lang.String EXERCIZE
          Type exersize - a practice exersize.
static java.lang.String EXPLANATION
          Type explanation - explanation of a concept or answer to a question.
static java.lang.String GLOBAL_BOOKMARK
          Type Global Bookmark - Bookmarks set by moderator.
static java.lang.String HIGHLIGHT
          Type highlight - a highlighted section of text.
static java.lang.String INLINE
          Type inline - annotation between text paragraphs.
static java.lang.String INSTRUCTION
          Type instruction - instructions for the professor.
static java.lang.String ITALIC
          Type italic - an italicized section of text.
static java.lang.String LAST_POSITION
          Type last-position - the last position of the user
static java.lang.String LINK
          Type link - a link to another document.
static java.lang.String PROGRAM_REFERENCE
          Type program reference - a reference to a java program.
static java.lang.String QUESTION
          Type question - a question.
static java.lang.String QUICK_NOTE
          Type quick_note - a short note in a pop-up window
static java.lang.String SEE_ALSO
          Type see_also - a reference to a related section or document.
static java.lang.String TEXT_NOTE
          Type text note - a text-based annotation.
static java.lang.String UNDERLINE
          Type underline - an underlined section of text.
static java.lang.String WINDOW
          Type window - a separate annotation window.
 
Constructor Summary
Notation()
          Create a new, empty notation.
 
Method Summary
 boolean equals(java.lang.Object anotherNotation)
          overrides Object.equals so that if two Notations have the same id they are considered equal
 Notation.AnnotationType getAnnotationType()
          Returns the AnnotationType object associated with this particular notation
 int getInt(java.lang.String field)
          Return the value of the field as an int.
 java.lang.String getString(java.lang.String field)
          Return the value of the field as a String.
 java.lang.Object getValue(java.lang.String field)
          Gets the value of the given field.
 Notation.ViewMode getViewMode()
           
 boolean isDeleteableBy(java.lang.String userName)
          Determines whether or not a given user can delete this notation.
 boolean isEditableBy(java.lang.String userName)
          Determines whether or not a given user can edit this notation
 void set(java.lang.String field, boolean value)
          Sets the given field to the given value.
 void set(java.lang.String field, double value)
          Sets the given field to the given value.
 void set(java.lang.String field, int value)
          Sets the given field to the given value.
 void set(java.lang.String field, java.lang.Object value)
          Sets the given field to the given value.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANNOTATION

public static final java.lang.String ANNOTATION
Type annotation - generic annotation. (Should be unnecessary eventually)

See Also:
Constant Field Values

ANNOTATION_BOOKMARK

public static final java.lang.String ANNOTATION_BOOKMARK
Type Annotation Bookmark - Bookmarks that point to annotations.

See Also:
Constant Field Values

BOLD

public static final java.lang.String BOLD
Type bold - a section of BOLD text

See Also:
Constant Field Values

BOOKMARK

public static final java.lang.String BOOKMARK
Type bookmark - a reference to a specific point in the text

See Also:
Constant Field Values

CHANGE

public static final java.lang.String CHANGE
Type change - notification of a change.

See Also:
Constant Field Values

COMMENT

public static final java.lang.String COMMENT
Type comment - a general comment.

See Also:
Constant Field Values

DIAGRAM

public static final java.lang.String DIAGRAM
Type comment - a diagram.

See Also:
Constant Field Values

DISCUSSION

public static final java.lang.String DISCUSSION
Type comment - a discussion.

See Also:
Constant Field Values

EXAMPLE

public static final java.lang.String EXAMPLE
Type example - an example.

See Also:
Constant Field Values

EXERCIZE

public static final java.lang.String EXERCIZE
Type exersize - a practice exersize.

See Also:
Constant Field Values

EXPLANATION

public static final java.lang.String EXPLANATION
Type explanation - explanation of a concept or answer to a question.

See Also:
Constant Field Values

HIGHLIGHT

public static final java.lang.String HIGHLIGHT
Type highlight - a highlighted section of text.

See Also:
Constant Field Values

GLOBAL_BOOKMARK

public static final java.lang.String GLOBAL_BOOKMARK
Type Global Bookmark - Bookmarks set by moderator.

See Also:
Constant Field Values

INLINE

public static final java.lang.String INLINE
Type inline - annotation between text paragraphs.

See Also:
Constant Field Values

INSTRUCTION

public static final java.lang.String INSTRUCTION
Type instruction - instructions for the professor.

See Also:
Constant Field Values

ITALIC

public static final java.lang.String ITALIC
Type italic - an italicized section of text.

See Also:
Constant Field Values

LINK

public static final java.lang.String LINK
Type link - a link to another document.

See Also:
Constant Field Values

PROGRAM_REFERENCE

public static final java.lang.String PROGRAM_REFERENCE
Type program reference - a reference to a java program.

See Also:
Constant Field Values

QUESTION

public static final java.lang.String QUESTION
Type question - a question.

See Also:
Constant Field Values

SEE_ALSO

public static final java.lang.String SEE_ALSO
Type see_also - a reference to a related section or document.

See Also:
Constant Field Values

UNDERLINE

public static final java.lang.String UNDERLINE
Type underline - an underlined section of text.

See Also:
Constant Field Values

QUICK_NOTE

public static final java.lang.String QUICK_NOTE
Type quick_note - a short note in a pop-up window

See Also:
Constant Field Values

LAST_POSITION

public static final java.lang.String LAST_POSITION
Type last-position - the last position of the user

See Also:
Constant Field Values

TEXT_NOTE

public static final java.lang.String TEXT_NOTE
Type text note - a text-based annotation.

See Also:
Constant Field Values

WINDOW

public static final java.lang.String WINDOW
Type window - a separate annotation window.

See Also:
Constant Field Values
Constructor Detail

Notation

public Notation()
Create a new, empty notation.

Method Detail

set

public void set(java.lang.String field,
                boolean value)
Sets the given field to the given value.

Parameters:
field - The field to set.
value - The value to set the field to.

set

public void set(java.lang.String field,
                int value)
Sets the given field to the given value.

Parameters:
field - The field to set.
value - The value to set the field to.

set

public void set(java.lang.String field,
                double value)
Sets the given field to the given value.

Parameters:
field - The field to set.
value - The value to set the field to.

set

public void set(java.lang.String field,
                java.lang.Object value)
Sets the given field to the given value.

Parameters:
field - The field to set.
value - The value to set the field to.

getValue

public java.lang.Object getValue(java.lang.String field)
Gets the value of the given field.

Parameters:
field - The field to get.
Returns:
The value of the specified field.

getString

public java.lang.String getString(java.lang.String field)
Return the value of the field as a String.

Parameters:
field - The field to get.
Returns:
The string representation of the value of the specified field

getInt

public int getInt(java.lang.String field)
Return the value of the field as an int.

Parameters:
field - The field to get.
Returns:
The value of the specified field, attempting to convert it to an int   returns -1 if there is a format error.

equals

public boolean equals(java.lang.Object anotherNotation)
overrides Object.equals so that if two Notations have the same id they are considered equal

Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.util.Hashtable

getAnnotationType

public Notation.AnnotationType getAnnotationType()
Returns the AnnotationType object associated with this particular notation

Returns:

getViewMode

public Notation.ViewMode getViewMode()

isEditableBy

public boolean isEditableBy(java.lang.String userName)
Determines whether or not a given user can edit this notation

Parameters:
userName - the user name who would like to be able to edit this notation
Returns:
true if userName is allowed to edit this notation; false otherwise

isDeleteableBy

public boolean isDeleteableBy(java.lang.String userName)
Determines whether or not a given user can delete this notation. Currently only the author of the notation can delete it; for discussions, there must not be any replies to the discussion, or the user must be an instructor

Parameters:
userName -
Returns: