Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet Class Reference

Inherits Serializable.

List of all members.

Public Member Functions

 ColorIDSet (Collection< String > ids)
int getColor (String id)
int getFavoriteColor (String id)
Set< String > getParticipants ()
long getTimestamp ()
boolean isAvailable (int colorID)
boolean equals (Object o)
int hashCode ()
String toString ()
void resetTimestamp ()
void setColor (String id, int colorID) throws IllegalArgumentException
void setFavoriteColor (String id, int colorID) throws IllegalArgumentException
ColorIDSet extendSet (Collection< String > ids)

Package Functions

 ColorIDSet (Map< String, UserColorID > colorIDs)
void setTimestamp (long time)

Detailed Description

Represents a combination of user colors. It is used to give the same combination of participants the same colors in each session.

 This class is NOT thread safe.
 Updating or retrieving the set via the provided methods
 of the ColorIDSetStorage class must not be
 called while using the methods that are provided by this class.
 

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.ColorIDSet ( Map< String, UserColorID colorIDs) [package]

Creates a ColorIDSet.

Parameters:
colorIDsa map from ids to color ids
de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.ColorIDSet ( Collection< String >  ids)

Creates a ColorIDSet and sets color for each id to { UserColorID.UNKNOWN}

Parameters:
ids

Member Function Documentation

boolean de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.equals ( Object  o)

Two color ID sets are considered equals if they contain the same set of JIDs.

ColorIDSet de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.extendSet ( Collection< String >  ids)

Creates a new set, containing the added ids.

Parameters:
ids
Returns:
int de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.getColor ( String  id)

Gets the color id for a given id.

Parameters:
id
Returns:
color id or { UserColorID.UNKNOWN} if the id was not found in the set or no color id is assigned to that id
int de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.getFavoriteColor ( String  id)

Gets the favorite color id for a given id.

Parameters:
id
Returns:
favorite color id or { UserColorID.UNKNOWN} if the id was not found in the set or no favorite color id is assigned to that id
Set<String> de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.getParticipants ( )

Gets a new copy of the participants.

Returns:
participants contained
long de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.getTimestamp ( )

Tells when the set was used last.

Returns:
timestamp of that last usage
int de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.hashCode ( )
boolean de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.isAvailable ( int  colorID)

Returns whether colorId is not yet in use of this set

Parameters:
colorID
Returns:
false if colorId is in use true otherwise, because it is still available
void de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.resetTimestamp ( )

Resets the timestamp to the current system.

void de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.setColor ( String  id,
int  colorID 
) throws IllegalArgumentException

Set the colorId of the set for a given user id.

Parameters:
id
colorID
void de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.setFavoriteColor ( String  id,
int  colorID 
) throws IllegalArgumentException

Set the favorite color id of the set for the given user id.

Parameters:
id
colorID
void de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.setTimestamp ( long  time) [package]

Sets the Timestamp.

Parameters:
timethe timestamp
String de.fu_berlin.inf.dpp.editor.colorstorage.ColorIDSet.toString ( )
 All Classes Namespaces Files Functions Variables Enumerations