xbn.util
Class Range

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.util.Range
Direct Known Subclasses:
RLength

public class Range
extends XBNObject

Manages an int that must conform to a RangeConfig. See RangeConfig.

Source code:  Range.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
Range(Range r_ange)
          Create a copy of the provided Range.
Range(RangeConfig range_config)
          Create a Range.
Range(RangeConfig range_config, int i_value)
          Create a Range.
 
Method Summary
 int get()
          Get the current value.
 RangeConfig getRangeConfig()
          Get the RangeConfig for direct manipulation.
 boolean isSet()
          Has the value of this Range been set yet?
 void reset()
          Initialize this object as if a value were never set into it.
 void set(int i_potential)
          Set the value to the provided int.
 String toString()
          Get some information about this Range.
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range(RangeConfig range_config)

Create a Range.

Note that isSet will return false, until you set a value.

Parameters:
range_config - The RangeConfig. May not be null.

Range

public Range(RangeConfig range_config,
             int i_value)

Create a Range.

Parameters:
range_config - The RangeConfig. May not be null.
i_value - The initial value. Passed directly to set.

Range

public Range(Range r_ange)

Create a copy of the provided Range. This is a deep copy.

Parameters:
r_ange - The Range to copy. May not be null.
Method Detail

get

public int get()

Get the current value.

Throws:
AssertException - If no value has been set into this Range.

set

public final void set(int i_potential)

Set the value to the provided int.

Parameters:
i_potential - The potential value. Must be valid according to getRangeConfig().isValid.

getRangeConfig

public final RangeConfig getRangeConfig()

Get the RangeConfig for direct manipulation.


reset

public final void reset()

Initialize this object as if a value were never set into it. The RangeConfig object is unaffected by this.


isSet

public boolean isSet()

Has the value of this Range been set yet?

Returns:
true If the one-parameter constructor was used to create this object, and the set function has not yet been called.
false If otherwise. See the three-parameter constructor.

toString

public String toString()

Get some information about this Range.

Overrides:
toString in class Object



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo