All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class game.LinkFrame

java.lang.Object
   |
   +----game.LinkFrame

public class LinkFrame
extends Object
implements Serializable
The LinkFrame class is a placeholder for data to be exchanged over the GameLink data link.

A frame object would typically be used this way :

   LinkFrame frame = new LinkFrame(); // construct the frame object
   frame.setGroup(YOUR_FRAME_GROUP_HERE); // type the frame
   frame.setRequest(YOUR_REQUEST, YOUR_SUB_REQUEST); // set the Request
   frame.setData(theDataObject); // put the data in the frame
   // send the frame through the GameLink
 

See Also:
GameLink

Variable Index

 o currentSize
[DESCRIBE ME]
 o data
[DESCRIBE ME]
 o gameId
Id of the game this frame has been created for
 o group
[DESCRIBE ME]
 o request
[DESCRIBE ME]
 o subRequest
[DESCRIBE ME]

Constructor Index

 o LinkFrame()
Creates a new LinkFrame.

Method Index

 o getData()
Returns the data contained in this frame.
 o getGameId()
Returns the game id this frame has been created for.
 o getGroup()
Returns the group the frame belongs to.
 o getRequest()
Returns the request contained in the frame.
 o getSubRequest()
Returns the sub-request contained in the frame.
 o setData(Object)
Puts new data in the frame.
 o setGameId(Object)
Sets the game id this frame has been created for.
 o setGroup(int)
Sets the group the frame belongs to.
 o setRequest(int, int)
Sets the request and the subrequest carried by the frame.
 o setSubRequest(int)
Sets the subRequest carried by the frame.
 o toString()
Returns a string representation of the object.

Variables

 o gameId
 Object gameId
Id of the game this frame has been created for

 o group
 int group
[DESCRIBE ME]

 o request
 int request
[DESCRIBE ME]

 o subRequest
 int subRequest
[DESCRIBE ME]

 o data
 Object data
[DESCRIBE ME]

 o currentSize
 transient int currentSize
[DESCRIBE ME]

Constructors

 o LinkFrame
 public LinkFrame()
Creates a new LinkFrame.

Methods

 o setGameId
 public void setGameId(Object id)
Sets the game id this frame has been created for. This should be automatically done by the GameLinkFilter object.

 o getGameId
 public Object getGameId()
Returns the game id this frame has been created for.

 o setGroup
 public void setGroup(int group)
Sets the group the frame belongs to. The frame group is used to sort the frames when they're received.

Parameters:
group - the frame group
See Also:
GameLinkConstants
 o getGroup
 public int getGroup()
Returns the group the frame belongs to.

See Also:
setGroup
 o setRequest
 public void setRequest(int request,
                        int subRequest)
Sets the request and the subrequest carried by the frame. The request allows the receiver of the frame to know how to deal with the data contained in the frame.

Parameters:
request - the request of this frame.
subRequest - the sub-request of the request. Usually NONE
See Also:
GameLinkConstants
 o setSubRequest
 public void setSubRequest(int subRequest)
Sets the subRequest carried by the frame.

Parameters:
subRequest - the sub-request of the request. Usually NONE
See Also:
setRequest, GameLinkConstants
 o getRequest
 public int getRequest()
Returns the request contained in the frame.

 o getSubRequest
 public int getSubRequest()
Returns the sub-request contained in the frame.

 o setData
 public void setData(Object data)
Puts new data in the frame. The data is a single object, so it has to be a container if you need to carry more than one object. The data object also has to be Serializable, as it will be transmitted as-is on the network. (Note that this may change in the future for performance cosiderations).

Parameters:
data - the data Object, which is necessarily Serializable
See Also:
Serializable
 o getData
 public Object getData()
Returns the data contained in this frame.

See Also:
setData
 o toString
 public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index