receivedturnevent.java

来自「手机无线网络纸牌游戏源代码。非常适合学习使用」· Java 代码 · 共 42 行

JAVA
42
字号
// ReceivedTurnEvent.java
//
// Copyright (c) 2000-2001 Symbian Ltd. All rights reserved

package com.symbian.devnet.whist.tokenRing;

/**
 * Event that indicates reception of a new ReceivedTurnEvent.
 * Can be used to access the received data.
 * @author Symbian Devnet
 */
public class ReceivedTurnEvent extends java.util.EventObject
{
	/** A reference to the content of the datagram */
	private char[] data;

	/**	
	 * Constructor for the class. 
	 * @param source 	The TokenRing object that produced this event
	 * @param data 		A reference to the raw data contained 
	 *           		within the RTeceivedTurnEvent which will be available 
	 * 					to listeners
	 */	
	public ReceivedTurnEvent(Object source, char[] data)
	{
		super(source);
		this.data = data;
	}
	
	/** 
	 * Method to retrieve a reference to the raw data
	 * contained within the received ReceivedTurnEvent that
	 * caused this event
	 */	
	public char[] getData()
	{
		char[] newdata = new char[data.length];
		for (int i = 0; i < data.length; i++)
			newdata[i] = data[i];
		return newdata;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?