nathan.middleware
Class MessageID

java.lang.Object
  extended by nathan.middleware.MessageID

public class MessageID
extends java.lang.Object

MessageID is used to create logical timestamps for messages.

Author:
Nathan Balon Advance Operating Systems CIS 578
University of Michigan Dearborn
Remote Method Invocation Middleware Project

Constructor Summary
MessageID()
          Creates a new instance of message ID
 
Method Summary
 int getID()
          Gets the current ID number.
 int getMaxID(int otherID)
          Compares two IDs and returns the largest values after incrementing the ID by on.
 int getNextID()
          Gets the next availiable ID number to use.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageID

public MessageID()
Creates a new instance of message ID

Method Detail

getNextID

public int getNextID()
Gets the next availiable ID number to use.

Returns:
int The id number to be used.

getID

public int getID()
Gets the current ID number.

Returns:
int The current ID number.

getMaxID

public int getMaxID(int otherID)
Compares two IDs and returns the largest values after incrementing the ID by on.

Parameters:
otherID - The ID to compare with.
Returns:
int The largest of the IDs incremented by 1.