class ClientSet
This class represents a set of clients.
attributes
clients: Client[]
operation specifications
+ ClientSet ()
-- constructor
pre:
post: clients has been created
+ add (client: Client): Boolean
-- Add a new client to the set.
pre: client is valid
post: if client is successfully added to clientSet
true is returned
else
false is returned
+ delete (name: String): Boolean
-- Delete the client with matching name from the set.
pre: none
post: if client with matching name was successfully deleted
true is returned
else
false is returned
+ find(name: String): Client
-- return a reference to the client if a client exists with matching name.
pre: none
post: if a client exists with matching name
the client object is returned
else
null is returned
+ getClients(): Client[]
post: clients has been returned
This class represents a set of clients.
attributes
clients: Client[]
operation specifications
+ ClientSet ()
-- constructor
pre:
post: clients has been created
+ add (client: Client): Boolean
-- Add a new client to the set.
pre: client is valid
post: if client is successfully added to clientSet
true is returned
else
false is returned
+ delete (name: String): Boolean
-- Delete the client with matching name from the set.
pre: none
post: if client with matching name was successfully deleted
true is returned
else
false is returned
+ find(name: String): Client
-- return a reference to the client if a client exists with matching name.
pre: none
post: if a client exists with matching name
the client object is returned
else
null is returned
+ getClients(): Client[]
post: clients has been returned
博客介绍了ClientSet类,该类代表一组客户端。包含clients属性,以及构造函数、添加、删除、查找客户端等操作。添加和删除操作会根据结果返回布尔值,查找操作会返回客户端引用或null,还可获取所有客户端。
1140

被折叠的 条评论
为什么被折叠?



