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
-
currentSize
- [DESCRIBE ME]
-
data
- [DESCRIBE ME]
-
gameId
- Id of the game this frame has been created for
-
group
- [DESCRIBE ME]
-
request
- [DESCRIBE ME]
-
subRequest
- [DESCRIBE ME]
-
LinkFrame()
- Creates a new LinkFrame.
-
getData()
- Returns the data contained in this frame.
-
getGameId()
- Returns the game id this frame has been created for.
-
getGroup()
- Returns the group the frame belongs to.
-
getRequest()
- Returns the request contained in the frame.
-
getSubRequest()
- Returns the sub-request contained in the frame.
-
setData(Object)
- Puts new data in the frame.
-
setGameId(Object)
- Sets the game id this frame has been created for.
-
setGroup(int)
- Sets the group the frame belongs to.
-
setRequest(int, int)
- Sets the request and the subrequest carried by the frame.
-
setSubRequest(int)
- Sets the subRequest carried by the frame.
-
toString()
- Returns a string representation of the object.
gameId
Object gameId
- Id of the game this frame has been created for
group
int group
- [DESCRIBE ME]
request
int request
- [DESCRIBE ME]
subRequest
int subRequest
- [DESCRIBE ME]
data
Object data
- [DESCRIBE ME]
currentSize
transient int currentSize
- [DESCRIBE ME]
LinkFrame
public LinkFrame()
- Creates a new LinkFrame.
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.
getGameId
public Object getGameId()
- Returns the game id this frame has been created for.
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
getGroup
public int getGroup()
- Returns the group the frame belongs to.
- See Also:
- setGroup
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
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
getRequest
public int getRequest()
- Returns the request contained in the frame.
getSubRequest
public int getSubRequest()
- Returns the sub-request contained in the frame.
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
getData
public Object getData()
- Returns the data contained in this frame.
- See Also:
- setData
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