edu.northwestern.at.wordhoard.model.userdata
Class UserGroup

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.userdata.UserGroup
All Implemented Interfaces:
PersistentObject, UserDataObject, java.io.Externalizable, java.io.Serializable

public class UserGroup
extends java.lang.Object
implements PersistentObject, java.io.Externalizable, UserDataObject

A group of users.

See Also:
Serialized Form

Field Summary
protected  java.util.Collection admins
          Collection of userids that can manage this group.
protected  java.util.Date creationTime
          Original creation date/time.
protected  java.lang.String description
          Description of the group.
protected  java.lang.Long id
          Unique persistence id (primary key).
protected  boolean isActive
          True if annotation is active (available for use).
protected  boolean isPublic
          True if public word set (can be seen by other users), false if private word set.
protected  java.util.Collection members
          Collection of member userids belonging to this group.
protected  java.util.Date modificationTime
          Last modification date/time.
protected  java.lang.String owner
          Owner of this group.
protected  java.lang.String query
          The query - part of UserData interface which should probably be factored out
(package private) static long serialVersionUID
           
protected  java.lang.String title
          The title of the group.
protected  java.lang.String webPageURL
          Web page URL.
 
Constructor Summary
UserGroup()
           
UserGroup(java.lang.String title, java.lang.String owner)
           
 
Method Summary
 void addAdmin(java.lang.String admin)
          Adds a admin.
 void addAdmins(java.util.Collection adminCollection)
          Adds admins from a collection of admin ids.
 void addMember(java.lang.String member)
          Adds a member.
 void addMembers(java.util.Collection memberCollection)
          Adds members from a collection of member ids.
 boolean addToDOMDocument(org.w3c.dom.Document document)
          Add word set to DOM document.
 boolean equals(java.lang.Object obj)
          Returns true if some other object is equal to this one.
 java.util.Collection getAdmins()
          Get the group admin ids.
 java.util.Date getCreationTime()
          Gets the creation date.
 java.lang.String getDescription()
          Gets the description.
 java.lang.Long getId()
          Gets the unique id.
 boolean getIsActive()
          Get the active flag.
 boolean getIsPublic()
          Get the public flag.
 java.util.Collection getMembers()
          Get the group member ids.
 java.util.Date getModificationTime()
          Gets the modification date.
 java.lang.String getOwner()
          Get the owner.
 java.lang.String getQuery()
          Get the query.
 java.lang.String getTitle()
          Gets the title.
 java.lang.String getWebPageURL()
          Gets the web page URL.
 int hashCode()
          Returns a hash code for the object.
 void readExternal(java.io.ObjectInput in)
          Reads the annotation from an object input stream (deserializes the object).
 void removeAdmin(java.lang.String admin)
          Removes a admin.
 void removeAdmins(java.util.Collection adminCollection)
          Removes admins passed as collection.
 void removeAllMembers()
          Removes all members.
 void removeMember(java.lang.String member)
          Removes a member.
 void removeMembers(java.util.Collection memberCollection)
          Removes members passed as collection.
 void setCreationTime(java.util.Date creationTime)
          Sets the creation time.
 void setDescription(java.lang.String description)
          Sets the description.
 boolean setFromDOMDocumentNode(org.w3c.dom.Node wordSetNode)
          Set values from DOM document node.
 void setIsActive(boolean isActive)
          Set the active flag.
 void setIsPublic(boolean isPublic)
          Set the public flag.
 void setModificationTime(java.util.Date modificationTime)
          Sets the modification time.
 void setOwner(java.lang.String owner)
          Set the owner.
 void setQuery(java.lang.String query)
          Set the query.
 void setTitle(java.lang.String title)
          Sets the title.
 void setWebPageURL(java.lang.String webPageURL)
          Sets the web page URL.
 java.lang.String toString()
          Gets a string representation of the word set.
 void writeExternal(java.io.ObjectOutput out)
          Writes the annotation to an object output stream (serializes the object).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

id

protected java.lang.Long id
Unique persistence id (primary key).


title

protected java.lang.String title
The title of the group.


description

protected java.lang.String description
Description of the group.


webPageURL

protected java.lang.String webPageURL
Web page URL.


creationTime

protected java.util.Date creationTime
Original creation date/time.


modificationTime

protected java.util.Date modificationTime
Last modification date/time.


members

protected java.util.Collection members
Collection of member userids belonging to this group.

Element type is String. The strings are the unique userids.


admins

protected java.util.Collection admins
Collection of userids that can manage this group.

Element type is String. The strings are the unique userids.


owner

protected java.lang.String owner
Owner of this group.


isPublic

protected boolean isPublic
True if public word set (can be seen by other users), false if private word set.


isActive

protected boolean isActive
True if annotation is active (available for use).


query

protected java.lang.String query
The query - part of UserData interface which should probably be factored out

Constructor Detail

UserGroup

public UserGroup()

UserGroup

public UserGroup(java.lang.String title,
                 java.lang.String owner)
Method Detail

getId

public java.lang.Long getId()
Gets the unique id.

Specified by:
getId in interface PersistentObject
Specified by:
getId in interface UserDataObject
Returns:
The unique id.

getTitle

public java.lang.String getTitle()
Gets the title.

Specified by:
getTitle in interface UserDataObject
Returns:
The title.

getDescription

public java.lang.String getDescription()
Gets the description.

Specified by:
getDescription in interface UserDataObject
Returns:
The description.

getWebPageURL

public java.lang.String getWebPageURL()
Gets the web page URL.

Specified by:
getWebPageURL in interface UserDataObject
Returns:
The web page URL.

getCreationTime

public java.util.Date getCreationTime()
Gets the creation date.

Specified by:
getCreationTime in interface UserDataObject
Returns:
The creation date.

getModificationTime

public java.util.Date getModificationTime()
Gets the modification date.

Specified by:
getModificationTime in interface UserDataObject
Returns:
The modification date.

getOwner

public java.lang.String getOwner()
Get the owner.

Specified by:
getOwner in interface UserDataObject
Returns:
The owner.

getIsPublic

public boolean getIsPublic()
Get the public flag.

Specified by:
getIsPublic in interface UserDataObject
Returns:
True if the word set is public, false if private.

getIsActive

public boolean getIsActive()
Get the active flag.

Specified by:
getIsActive in interface UserDataObject
Returns:
True if the word set is active.

getQuery

public java.lang.String getQuery()
Get the query.

Specified by:
getQuery in interface UserDataObject
Returns:
The query for generating this word set.

setTitle

public void setTitle(java.lang.String title)
Sets the title.

Specified by:
setTitle in interface UserDataObject
Parameters:
title - The title.

setDescription

public void setDescription(java.lang.String description)
Sets the description.

Specified by:
setDescription in interface UserDataObject
Parameters:
description - The description.

setWebPageURL

public void setWebPageURL(java.lang.String webPageURL)
Sets the web page URL.

Specified by:
setWebPageURL in interface UserDataObject
Parameters:
webPageURL - The web page URL.

setCreationTime

public void setCreationTime(java.util.Date creationTime)
Sets the creation time.

Specified by:
setCreationTime in interface UserDataObject
Parameters:
creationTime - The creation time.

setModificationTime

public void setModificationTime(java.util.Date modificationTime)
Sets the modification time.

Specified by:
setModificationTime in interface UserDataObject
Parameters:
modificationTime - The modification time.

setOwner

public void setOwner(java.lang.String owner)
Set the owner.

Parameters:
owner - The owner.

setIsPublic

public void setIsPublic(boolean isPublic)
Set the public flag.

Parameters:
isPublic - True if the word set is public, false if private.

setIsActive

public void setIsActive(boolean isActive)
Set the active flag.

Parameters:
isActive - True if the word set is active.

setQuery

public void setQuery(java.lang.String query)
Set the query.

Parameters:
query - The query for generating this word set.

setFromDOMDocumentNode

public boolean setFromDOMDocumentNode(org.w3c.dom.Node wordSetNode)
Set values from DOM document node.

Specified by:
setFromDOMDocumentNode in interface UserDataObject
Parameters:
wordSetNode - DOM document node with word set settings.
Returns:
true if settings retrieved.

addToDOMDocument

public boolean addToDOMDocument(org.w3c.dom.Document document)
Add word set to DOM document.

Specified by:
addToDOMDocument in interface UserDataObject
Parameters:
document - DOM document to which to add word set. Must not be null. In most cases, this document should have a "wordhoard" node as the root element.
Returns:
true if DOM addition successful, false otherwise.

toString

public java.lang.String toString()
Gets a string representation of the word set.

Overrides:
toString in class java.lang.Object
Returns:
The title.

equals

public boolean equals(java.lang.Object obj)
Returns true if some other object is equal to this one.

The two objects are equal if their ids are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes the annotation to an object output stream (serializes the object).

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - Object output stream.
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the annotation from an object input stream (deserializes the object).

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - Object input stream.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getMembers

public java.util.Collection getMembers()
Get the group member ids.

Returns:
The members as an unmodifiable collection.

addMembers

public void addMembers(java.util.Collection memberCollection)
Adds members from a collection of member ids.

Parameters:
memberCollection - The new members as a collection.

addMember

public void addMember(java.lang.String member)
Adds a member.

Parameters:
member - The new member userid.

removeMembers

public void removeMembers(java.util.Collection memberCollection)
Removes members passed as collection.


removeAllMembers

public void removeAllMembers()
Removes all members.


removeMember

public void removeMember(java.lang.String member)
Removes a member.

Parameters:
member - The new member userid.

getAdmins

public java.util.Collection getAdmins()
Get the group admin ids.

Returns:
The admins as an unmodifiable collection.

addAdmins

public void addAdmins(java.util.Collection adminCollection)
Adds admins from a collection of admin ids.

Parameters:
adminCollection - The new admins as a collection.

addAdmin

public void addAdmin(java.lang.String admin)
Adds a admin.

Parameters:
admin - The new admin userid.

removeAdmins

public void removeAdmins(java.util.Collection adminCollection)
Removes admins passed as collection.


removeAdmin

public void removeAdmin(java.lang.String admin)
Removes a admin.

Parameters:
admin - The new admin userid.