com.echomine.jabber
Class MessageID

java.lang.Object
  extended by com.echomine.jabber.MessageID

public class MessageID
extends java.lang.Object

Holds a singleton instance of the id generator. It will give you unique id sequences. The unique ID sequence has a header prepended before the sequence number. This is to make the ID attribute conform to the XML Specification. The XML standard states that the unique ID attribute in an XML document must begin with an alphabet(a-z), underscore(_), or colon(:).


Method Summary
 int increment()
           
static java.lang.String nextID()
          retrieves the next ID.
static java.lang.String nextID(int initial)
          if this is the first time the method is called, it will initialize the generator to the initial value provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

increment

public int increment()

nextID

public static java.lang.String nextID()
retrieves the next ID. If this is the first time this method is called, the initial value will be set to 10001. If you want to start off at a specific number, use the nextID(int) static method instead.


nextID

public static java.lang.String nextID(int initial)
if this is the first time the method is called, it will initialize the generator to the initial value provided. Subsequent calls to this method will ignore the initial request.



Copyright © 2001-2005 Echomine. All Rights Reserved.