Package io.keikai.app.impl
Class CollaborationInfoImpl
- java.lang.Object
-
- io.keikai.app.impl.CollaborationInfoImpl
-
- All Implemented Interfaces:
CollaborationInfo,java.io.Serializable
public class CollaborationInfoImpl extends java.lang.Object implements CollaborationInfo, java.io.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 CollaborationInfocollaborationInfo
-
Constructor Summary
Constructors Constructor Description CollaborationInfoImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEvent(CollaborationInfo.CollaborationEventListener listener)Event MechanismbooleanaddUsername(java.lang.String username, java.lang.String oldUsername)add username and remove old usernamestatic CollaborationInfogetInstance()java.util.Set<java.lang.String>getUsedUsernames(java.lang.String bookName)return username of users which are using book "bookName"java.lang.StringgetUsername(java.lang.String originName)return a username which doesn't duplicate with othersbooleanisUsernameExist(java.lang.String username)ask if username is existingvoidremoveRelationship(java.lang.String username)remove books having relationship to usernamevoidremoveUsername(java.lang.String username)remove usernamevoidsetRelationship(java.lang.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(java.lang.String username, Book book)Description copied from interface:CollaborationInfoset relationship between username and book- Specified by:
setRelationshipin interfaceCollaborationInfo
-
removeRelationship
public void removeRelationship(java.lang.String username)
Description copied from interface:CollaborationInforemove books having relationship to username- Specified by:
removeRelationshipin interfaceCollaborationInfo
-
isUsernameExist
public boolean isUsernameExist(java.lang.String username)
Description copied from interface:CollaborationInfoask if username is existing- Specified by:
isUsernameExistin interfaceCollaborationInfo- Returns:
- true if username has already existed, false otherwise.
-
addUsername
public boolean addUsername(java.lang.String username, java.lang.String oldUsername)Description copied from interface:CollaborationInfoadd username and remove old username- Specified by:
addUsernamein interfaceCollaborationInfo- Returns:
-
removeUsername
public void removeUsername(java.lang.String username)
Description copied from interface:CollaborationInforemove username- Specified by:
removeUsernamein interfaceCollaborationInfo
-
getUsedUsernames
public java.util.Set<java.lang.String> getUsedUsernames(java.lang.String bookName)
Description copied from interface:CollaborationInforeturn username of users which are using book "bookName"- Specified by:
getUsedUsernamesin interfaceCollaborationInfo- Returns:
- a set containing usernames
-
getUsername
public java.lang.String getUsername(java.lang.String originName)
Description copied from interface:CollaborationInforeturn a username which doesn't duplicate with others- Specified by:
getUsernamein interfaceCollaborationInfo- Returns:
- unique username
-
addEvent
public void addEvent(CollaborationInfo.CollaborationEventListener listener)
Description copied from interface:CollaborationInfoEvent Mechanism- Specified by:
addEventin interfaceCollaborationInfo
-
-