Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.util
Class TimeGate

    java.lang.Object
      org.crosswire.common.util.TimeGate

    public class TimeGate

extends Object

A TimeGate when entered will cause the gate to be closed for a specified period of time.

Author:
  DM Smith
See Also:
  `The GNU Lesser General Public License for details.`

Field Summary
`private int` | `closeTime` The interval during which the gate is closed.
`private long` | `then` The time in milliseconds that the gate last closed.

Constructor Summary
`TimeGate(int count)` Build a TimeGate that will allow entry no more often than count milliseconds

Method Summary
`boolean` | `open()` Determine whether entry through the gate is allowed.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### closeTime

    private int closeTime

  The interval during which the gate is closed.

### then

    private long then

  The time in milliseconds that the gate last closed.

Constructor Detail

### TimeGate

    public TimeGate(int count)

  Build a TimeGate that will allow entry no more often than count milliseconds

  Parameters:
    `count` - the length of time to keep the gate shut after opening it.

Method Detail

### open

    public boolean open()

  Determine whether entry through the gate is allowed. Opening the gate will close it until the TimeGate's interval has passed.

  Returns:
    true if one may enter.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD