net.hivecell.hive.event.cell
Class AgentBornCellEvent
java.lang.Object
|
+--java.util.EventObject
|
+--net.hivecell.hive.event.RemoteEvent
|
+--net.hivecell.hive.event.HiveEvent
|
+--net.hivecell.hive.event.cell.CellEvent
|
+--net.hivecell.hive.event.cell.AgentBornCellEvent
- public class AgentBornCellEvent
- extends CellEvent
- See Also:
- Serialized Form
Fields inherited from class net.hivecell.hive.event.cell.CellEvent |
AGENTBORN,
AGENTDISCONNECTALL,
AGENTDYING,
AGENTMESSAGE,
AGENTMOVINGFROM,
AGENTMOVINGTO,
AGENTSCONNECT,
AGENTSDISCONNECT,
eventCount,
SERVERBORN,
serverEventCode,
SERVERGOINGDOWN,
SERVERREPORT,
SERVERWITHDRAWN,
source |
Fields inherited from class java.util.EventObject |
source |
Method Summary |
CellEvent |
createNewEvent(java.lang.Object newSender,
long eventCount)
This method is used so a new CellEvent type can be created
with this data, but with a different source and a different
count |
Agent |
getAgent()
Get the handle to the agent which has just born |
CellAddress |
getAgentAddress()
Get the address to the cell that this agent was born on |
CellAddress[] |
getCellAddresses()
This methoud should return all the servers taht this server
event pertains to -- "pertains to" is defined by the server
event itself |
boolean |
matchesCellAddress(CellAddress toTest)
This method should return true if the cell address that it
comparing with pertains to this server event -- it will return
false otherwise |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
AgentBornCellEvent
public AgentBornCellEvent(java.lang.Object broadcastingAgent,
long eventCount,
Agent bornAgent,
CellAddress serverBornOn)
- Create an agent born server event.
- Parameters:
broadcastingAgent
- the agent which is going to be sending out this eventeventCount
- the number of event which the helper is going to send outbornAgent
- the agent which was just bornserverBornOn
- the address of the cell this agent was born on
getAgent
public Agent getAgent()
- Get the handle to the agent which has just born
- Returns:
- the handle to the agent
getAgentAddress
public CellAddress getAgentAddress()
- Get the address to the cell that this agent was born on
- Returns:
- the address of the cell
matchesCellAddress
public boolean matchesCellAddress(CellAddress toTest)
- Description copied from class: CellEvent
- This method should return true if the cell address that it
comparing with pertains to this server event -- it will return
false otherwise
- Overrides:
- matchesCellAddress in class CellEvent
- Tags copied from class: CellEvent
- Parameters:
toTest
- the address to test on- Returns:
- true if the toTest pertains to this server event
getCellAddresses
public CellAddress[] getCellAddresses()
- Description copied from class: CellEvent
- This methoud should return all the servers taht this server
event pertains to -- "pertains to" is defined by the server
event itself
- Overrides:
- getCellAddresses in class CellEvent
- Tags copied from class: CellEvent
- Returns:
- an array of server addresses this event pertains to
createNewEvent
public CellEvent createNewEvent(java.lang.Object newSender,
long eventCount)
- Description copied from class: CellEvent
- This method is used so a new CellEvent type can be created
with this data, but with a different source and a different
count
- Overrides:
- createNewEvent in class CellEvent
- Tags copied from class: CellEvent
- Parameters:
newSender
- the new sender to create a server event witheventCount
- the new event count- Returns:
- a new server event with the new senders and the count