org.apache.directory.server.ntp.messages
Enum StratumType

java.lang.Object
  extended by java.lang.Enum<StratumType>
      extended by org.apache.directory.server.ntp.messages.StratumType
All Implemented Interfaces:
Serializable, Comparable<StratumType>

public enum StratumType
extends Enum<StratumType>

Stratum: This is a eight-bit unsigned integer indicating the stratum level of the local clock, with values defined as follows: Stratum Meaning ---------------------------------------------- 0 unspecified or unavailable 1 primary reference (e.g., radio clock) 2-15 secondary reference (via NTP or SNTP) 16-255 reserved

Author:
Apache Directory Project

Enum Constant Summary
PRIMARY_REFERENCE
          Constant for the "Primary reference" stratum type.
SECONDARY_REFERENCE
          Constant for the "Secondary reference" stratum type.
UNSPECIFIED
          Constant for the "Unspecified or unavailable" stratum type.
 
Method Summary
 int getOrdinal()
          Returns the number associated with this stratum type.
static StratumType getTypeByOrdinal(int type)
          Returns the stratum type when specified by its ordinal.
 String toString()
           
static StratumType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StratumType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNSPECIFIED

public static final StratumType UNSPECIFIED
Constant for the "Unspecified or unavailable" stratum type.


PRIMARY_REFERENCE

public static final StratumType PRIMARY_REFERENCE
Constant for the "Primary reference" stratum type.


SECONDARY_REFERENCE

public static final StratumType SECONDARY_REFERENCE
Constant for the "Secondary reference" stratum type.

Method Detail

values

public static StratumType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (StratumType c : StratumType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static StratumType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getTypeByOrdinal

public static StratumType getTypeByOrdinal(int type)
Returns the stratum type when specified by its ordinal.

Parameters:
type -
Returns:
The stratum type.

getOrdinal

public int getOrdinal()
Returns the number associated with this stratum type.

Returns:
The stratum type ordinal.

toString

public String toString()
Overrides:
toString in class Enum<StratumType>


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.