winterwell.jtwitter
Class RateLimit

java.lang.Object
  extended by winterwell.jtwitter.RateLimit

public final class RateLimit
extends java.lang.Object

Info on your Twitter API usage - how many calls do you have to use?


Constructor Summary
RateLimit(java.lang.String limit, java.lang.String remaining, java.lang.String reset)
           
 
Method Summary
 int getLimit()
           
 int getRemaining()
           
 java.util.Date getReset()
           
 boolean isOutOfDate()
           
 java.lang.String toString()
           
 void waitForReset()
          Wait until the reset date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RateLimit

public RateLimit(java.lang.String limit,
                 java.lang.String remaining,
                 java.lang.String reset)
Method Detail

getLimit

public int getLimit()

getRemaining

public int getRemaining()

getReset

public java.util.Date getReset()
Returns:
The date at which the limit will be reset.

isOutOfDate

public boolean isOutOfDate()
Returns:
true if the reset time has passed, so this rate limit no longer applies.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

waitForReset

public void waitForReset()
Wait until the reset date. This will put the thread to sleep until the reset date (regardless of whether you still have remaining calls or not). Does nothing if the reset date has passed.