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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `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

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.