org.multiverse.transactional.refs
Class ShortRef

java.lang.Object
  extended by org.multiverse.transactional.refs.ShortRef

public class ShortRef
extends Object

A Ref for storing a short.

Author:
Peter Veentjer

Constructor Summary
ShortRef()
           
ShortRef(short value)
           
 
Method Summary
 void await(short desired)
           
 short awaitLargerOrEqualThan(short than)
           
 short awaitLargerThan(short than)
           
 short awaitNotEqualTo(short than)
           
 short awaitSmallerOrEqualThan(short than)
           
 short awaitSmallerThan(short than)
           
 short dec()
          Decreases the value by one.
 short dec(short amount)
          Increases the value with the given amount.
 boolean equals(Object thatObj)
           
 short get()
          Gets the current value.
 int hashCode()
           
 short inc()
          Increases the value by one.
 short inc(short amount)
          Increases the value with the given amount.
 short set(short newValue)
          Sets the new value and returns the old value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShortRef

public ShortRef()

ShortRef

public ShortRef(short value)
Method Detail

get

public final short get()
Gets the current value.

Returns:
the current value.

await

public final void await(short desired)

awaitLargerThan

public final short awaitLargerThan(short than)

awaitLargerOrEqualThan

public final short awaitLargerOrEqualThan(short than)

awaitSmallerThan

public final short awaitSmallerThan(short than)

awaitSmallerOrEqualThan

public final short awaitSmallerOrEqualThan(short than)

awaitNotEqualTo

public final short awaitNotEqualTo(short than)

set

public short set(short newValue)
Sets the new value and returns the old value.

Parameters:
newValue - the new value.
Returns:
the previous value.

inc

public final short inc()
Increases the value by one.

Returns:
the new value.

inc

public final short inc(short amount)
Increases the value with the given amount.

Parameters:
amount - the amount to increase with.
Returns:
the new value.

dec

public final short dec()
Decreases the value by one.

Returns:
the new value.

dec

public final short dec(short amount)
Increases the value with the given amount.

Parameters:
amount - the amount to increase with
Returns:
the new value

toString

public final String toString()
Overrides:
toString in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object thatObj)
Overrides:
equals in class Object


Copyright © 2008-2010 Multiverse. All Rights Reserved.