spread
public class SpreadGroup extends java.lang.Object
join(SpreadConnection, String)
:
SpreadGroup group = new SpreadGroup(); group.join(connection, "users");
To leave the group, use leave()
:
group.leave();
Modifier and Type | Field and Description |
---|---|
private SpreadConnection |
connection |
private java.lang.String |
name |
Modifier | Constructor and Description |
---|---|
|
SpreadGroup()
Initializes a new SpreadGroup object.
|
protected |
SpreadGroup(SpreadConnection connection,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Checks if two groups are the same.
|
int |
hashCode()
Returns the hash code of the group, which is defined as the
hash code of its name.
|
void |
join(SpreadConnection connection,
java.lang.String name)
Joins the group
name on the connection connection . |
void |
leave()
Leaves the group.
|
java.lang.String |
toString()
Returns the name of the group as a string.
|
private java.lang.String name
private SpreadConnection connection
protected SpreadGroup(SpreadConnection connection, java.lang.String name)
public SpreadGroup()
join(SpreadConnection, String)
.join(SpreadConnection, String)
public void join(SpreadConnection connection, java.lang.String name) throws SpreadException
name
on the connection connection
.
Between when the group has been joined with this method and when it is left with
leave()
, all messages sent to the group will be received by
the connection.connection
- the connection to join the group withname
- the name of the group to joinSpreadException
- if attempting to join again with the same group object, if an illegal character is in the group name, or if there is an error trying to join the groupleave()
public void leave() throws SpreadException
SpreadException
- if the group hasn't been joined, or if there is an error leaving the groupjoin(SpreadConnection, String)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the object to compare againstpublic int hashCode()
hashCode
in class java.lang.Object
Copyright © 2004 Spread Concepts LLC. All Rights Reserved.