Package io.keikai.app.impl
Class CollaborationInfoImpl
- java.lang.Object
-
- io.keikai.app.impl.CollaborationInfoImpl
-
- All Implemented Interfaces:
CollaborationInfo
,Serializable
public class CollaborationInfoImpl extends Object implements CollaborationInfo, Serializable
- Author:
- JerryChen
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.keikai.app.CollaborationInfo
CollaborationInfo.CollaborationEvent, CollaborationInfo.CollaborationEventListener
-
-
Field Summary
Fields Modifier and Type Field Description protected static CollaborationInfo
collaborationInfo
-
Constructor Summary
Constructors Constructor Description CollaborationInfoImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEvent(CollaborationInfo.CollaborationEventListener listener)
Event Mechanismboolean
addUsername(String username, String oldUsername)
add username and remove old usernamestatic CollaborationInfo
getInstance()
Set<String>
getUsedUsernames(String bookName)
return username of users which are using book "bookName"String
getUsername(String originName)
return a username which doesn't duplicate with othersboolean
isUsernameExist(String username)
ask if username is existingvoid
removeRelationship(String username)
remove books having relationship to usernamevoid
removeUsername(String username)
remove usernamevoid
setRelationship(String username, Book book)
set relationship between username and book
-
-
-
Field Detail
-
collaborationInfo
protected static CollaborationInfo collaborationInfo
-
-
Method Detail
-
getInstance
public static CollaborationInfo getInstance()
-
setRelationship
public void setRelationship(String username, Book book)
Description copied from interface:CollaborationInfo
set relationship between username and book- Specified by:
setRelationship
in interfaceCollaborationInfo
-
removeRelationship
public void removeRelationship(String username)
Description copied from interface:CollaborationInfo
remove books having relationship to username- Specified by:
removeRelationship
in interfaceCollaborationInfo
-
isUsernameExist
public boolean isUsernameExist(String username)
Description copied from interface:CollaborationInfo
ask if username is existing- Specified by:
isUsernameExist
in interfaceCollaborationInfo
- Returns:
- true if username has already existed, false otherwise.
-
addUsername
public boolean addUsername(String username, String oldUsername)
Description copied from interface:CollaborationInfo
add username and remove old username- Specified by:
addUsername
in interfaceCollaborationInfo
- Returns:
-
removeUsername
public void removeUsername(String username)
Description copied from interface:CollaborationInfo
remove username- Specified by:
removeUsername
in interfaceCollaborationInfo
-
getUsedUsernames
public Set<String> getUsedUsernames(String bookName)
Description copied from interface:CollaborationInfo
return username of users which are using book "bookName"- Specified by:
getUsedUsernames
in interfaceCollaborationInfo
- Returns:
- a set containing usernames
-
getUsername
public String getUsername(String originName)
Description copied from interface:CollaborationInfo
return a username which doesn't duplicate with others- Specified by:
getUsername
in interfaceCollaborationInfo
- Returns:
- unique username
-
addEvent
public void addEvent(CollaborationInfo.CollaborationEventListener listener)
Description copied from interface:CollaborationInfo
Event Mechanism- Specified by:
addEvent
in interfaceCollaborationInfo
-
-