com.rubecula.jquantity
Class SystemFlag

java.lang.Object
  extended bycom.rubecula.jquantity.SystemFlag

public class SystemFlag
extends Object

The immutable class SystemFlag represents a system of units.

Note that there are no non-private constructors. The values provided are fixed and immutable.

Version:
$Revision: 1.3 $
Author:
Robin Hillyard

Field Summary
private  int _Flag
          The value of the system flag (as a mask) for this SystemFlag.
static int $_INDEX_ANY
           
static int $_INDEX_CGS
           
static int $_INDEX_CUSTOM
           
static int $_INDEX_IMP
           
static int $_INDEX_MAX
           
static int $_INDEX_NONE
           
static int $_INDEX_SI
           
static int $_INDEX_US
           
(package private) static SystemFlag $F_FLAG_ANY
           
(package private) static SystemFlag $F_FLAG_CGS
           
(package private) static SystemFlag $F_FLAG_IMP
           
(package private) static SystemFlag $F_FLAG_NONE
           
(package private) static SystemFlag $F_FLAG_SI
           
(package private) static String $S_SYSTEM_CGS
           
(package private) static String $S_SYSTEM_ENGLISH
           
(package private) static String $S_SYSTEM_IMPERIAL
           
(package private) static String $S_SYSTEM_SI
           
(package private) static String $S_SYSTEM_UD
           
private static int SystemIndex
          Class field (global) to store the current system index.
private static SystemFlag UnitsSystem
           
 
Constructor Summary
private SystemFlag(int flag)
          Private Primary constructor.
 
Method Summary
(package private)  SystemFlag getCommon(SystemFlag other)
           
protected  int getFlag()
          Method to get the integer value of this flag.
(package private)  int getIndex()
           
static int GetMatchingSystem(String system)
           
static int GetSysIndex()
           
static String[] GetSystemNames()
           
static String GetUnitSystemName()
           
private  int intersection(SystemFlag other)
           
(package private)  boolean isInSystem(int sysIndex)
           
(package private)  boolean match(SystemFlag other)
           
static void setSysIndex(int system)
           
 String toString()
           
static SystemFlag valueOf(int sysIndex)
          Factory method to create a SystemFlag for system index defined by sysIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

$_INDEX_NONE

public static final int $_INDEX_NONE
See Also:
Constant Field Values

$_INDEX_ANY

public static final int $_INDEX_ANY
See Also:
Constant Field Values

$_INDEX_SI

public static final int $_INDEX_SI
See Also:
Constant Field Values

$_INDEX_CGS

public static final int $_INDEX_CGS
See Also:
Constant Field Values

$_INDEX_IMP

public static final int $_INDEX_IMP
See Also:
Constant Field Values

$_INDEX_US

public static final int $_INDEX_US
See Also:
Constant Field Values

$_INDEX_CUSTOM

public static final int $_INDEX_CUSTOM
See Also:
Constant Field Values

$_INDEX_MAX

public static final int $_INDEX_MAX
See Also:
Constant Field Values

$S_SYSTEM_SI

static final String $S_SYSTEM_SI
See Also:
Constant Field Values

$S_SYSTEM_CGS

static final String $S_SYSTEM_CGS
See Also:
Constant Field Values

$S_SYSTEM_IMPERIAL

static final String $S_SYSTEM_IMPERIAL
See Also:
Constant Field Values

$S_SYSTEM_ENGLISH

static final String $S_SYSTEM_ENGLISH
See Also:
Constant Field Values

$S_SYSTEM_UD

static final String $S_SYSTEM_UD
See Also:
Constant Field Values

$F_FLAG_SI

static final SystemFlag $F_FLAG_SI

$F_FLAG_CGS

static final SystemFlag $F_FLAG_CGS

$F_FLAG_IMP

static final SystemFlag $F_FLAG_IMP

$F_FLAG_ANY

static final SystemFlag $F_FLAG_ANY

$F_FLAG_NONE

static final SystemFlag $F_FLAG_NONE

SystemIndex

private static int SystemIndex
Class field (global) to store the current system index.


UnitsSystem

private static SystemFlag UnitsSystem

_Flag

private final int _Flag
The value of the system flag (as a mask) for this SystemFlag.

Constructor Detail

SystemFlag

private SystemFlag(int flag)
Private Primary constructor.

Parameters:
flag - the integer value which this flag will take.
Method Detail

GetSystemNames

public static String[] GetSystemNames()

GetUnitSystemName

public static String GetUnitSystemName()

valueOf

public static SystemFlag valueOf(int sysIndex)
Factory method to create a SystemFlag for system index defined by sysIndex

Parameters:
sysIndex - a non-negative integer
Returns:
the new SystemFlag

setSysIndex

public static void setSysIndex(int system)

GetSysIndex

public static int GetSysIndex()

toString

public String toString()

match

final boolean match(SystemFlag other)

isInSystem

final boolean isInSystem(int sysIndex)

getCommon

final SystemFlag getCommon(SystemFlag other)

getIndex

final int getIndex()

getFlag

protected final int getFlag()
Method to get the integer value of this flag.

Returns:
the integer value of the system flag.

intersection

private int intersection(SystemFlag other)

GetMatchingSystem

public static int GetMatchingSystem(String system)