ymsg.network.event
Class SessionFriendEvent

Object
  extended byEventObject
      extended bySessionEvent
          extended bySessionFriendEvent
All Implemented Interfaces:
Serializable

public class SessionFriendEvent
extends SessionEvent

Fired when friend's details have changed. Like other events, this one can be caused by more than one circumstance, and as such the field use is determined by the type of event.

  getFrom getFriend getFriends getGroup
friendsUpdateReceived y y y n[1]
friendsAddedReceived y y y y
friendsRemoveReceived y y y y

[1] = a friend may be in more than one group - therefore this event is not specific to one group, unlike other friend events.

Since:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class EventObject
source
 
Constructor Summary
SessionFriendEvent(Object o, int sz)
          Create a new instance.
SessionFriendEvent(Object o, YahooUser yu, String gp)
          Create a new instance.
 
Method Summary
 YahooUser getFriend()
          Returns the YahooUser to whom this event applies.
 YahooUser[] getFriends()
          Returns the list of YahooUser's to whom this event applies.
 String getFrom()
          Returns the id of a single user relating to this event.
 String getGroup()
          Returns the group for which this event applies.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class SessionEvent
getMessage, getStatus, getTimestamp, getTo
 
Methods inherited from class EventObject
getSource
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SessionFriendEvent

public SessionFriendEvent(Object o,
                          int sz)
Create a new instance. API users should not call this directly. The API itself will create its own events.

Parameters:
o - source of event (Session)
sz - number of users
Since:
1.0

SessionFriendEvent

public SessionFriendEvent(Object o,
                          YahooUser yu,
                          String gp)
Create a new instance. API users should not call this directly. The API itself will create its own events.

Parameters:
o - source of event (Session)
yu - yahoo user object
gp - group name
Since:
1.0
Method Detail

getFriends

public YahooUser[] getFriends()
Returns the list of YahooUser's to whom this event applies. This field is only set when the friendsUpdateReceived event method is used. Otherwise it is null.

Returns:
array of Yahoo user objects
Since:
1.0

getFriend

public YahooUser getFriend()
Returns the YahooUser to whom this event applies. This field is only set when the friendAddedReceived or friendRemovedReceived event methods are used. Otherwise it is null.

Returns:
yahoo user object
Since:
1.0

getGroup

public String getGroup()
Returns the group for which this event applies. This field is only set when the friendAddedReceived or friendRemovedReceived event methods are used. Otherwise it is null.

Returns:
yahoo user object
Since:
1.0

getFrom

public String getFrom()
Returns the id of a single user relating to this event. Just a shortcut to getFriend().getId().

Overrides:
getFrom in class SessionEvent
Returns:
Yahoo id as a string
Since:
1.0

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class SessionEvent
Returns:
object as a string
Since:
1.0