gov.nist.antd.optical
Class ProtectionMode

java.lang.Object
  |
  +--gov.nist.antd.optical.ProtectionMode

public final class ProtectionMode
extends java.lang.Object

The protection mode specified how the component can be used. The mode specifies the possible values of the attribute protection in the used component.
ProtectionMode NONE protection false (fixed)
ProtectionMode ONLY protection true (fixed)
ProtectionMode SHARED protection true/false (variable)

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, Rouil

Field Summary
static int NEVER
          Only for non protection purpose - protection is false only (VALUE==2).
private static java.lang.String NEVER_STR
          the string representation of this mode (VALUE==NONE).
static int ONLY
          Only for protection purpose - protection is true only (VALUE==1).
private static java.lang.String ONLY_STR
          the string representation of this mode (VALUE==ONLY).
static int SHARED
          Protection can be set and reset (VALUE==0).
private static java.lang.String SHARED_STR
          the string representation of this mode (VALUE==SHARED).
 
Constructor Summary
private ProtectionMode()
          To prevent instantiation.
 
Method Summary
static java.lang.String modeToStr(int mode)
          Converts a protection mode into a String.
static int strToMode(java.lang.String modeStr)
          Converts a protection string into the mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHARED

public static final int SHARED
Protection can be set and reset (VALUE==0).

See Also:
Constant Field Values

ONLY

public static final int ONLY
Only for protection purpose - protection is true only (VALUE==1).

See Also:
Constant Field Values

NEVER

public static final int NEVER
Only for non protection purpose - protection is false only (VALUE==2).

See Also:
Constant Field Values

SHARED_STR

private static final java.lang.String SHARED_STR
the string representation of this mode (VALUE==SHARED).

See Also:
Constant Field Values

ONLY_STR

private static final java.lang.String ONLY_STR
the string representation of this mode (VALUE==ONLY).

See Also:
Constant Field Values

NEVER_STR

private static final java.lang.String NEVER_STR
the string representation of this mode (VALUE==NONE).

See Also:
Constant Field Values
Constructor Detail

ProtectionMode

private ProtectionMode()
To prevent instantiation.

Method Detail

strToMode

public static final int strToMode(java.lang.String modeStr)
Converts a protection string into the mode. The string check is not case sensitive.

Parameters:
modeStr - The String that contains the mode.
Returns:
the int that represents this mode.
Throws:
IllegalDataException - If the string is not known.

modeToStr

public static final java.lang.String modeToStr(int mode)
Converts a protection mode into a String. The string is uppercase.

Parameters:
mode - The int that contains the mode.
Returns:
The name of the mode as String.
Throws:
IllegalDataException - If the mode is not known.