sg.edu.nus.peer
Enum PeerType

java.lang.Object
  extended by java.lang.Enum<PeerType>
      extended by sg.edu.nus.peer.PeerType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<PeerType>

public enum PeerType
extends java.lang.Enum<PeerType>

This class defines the peer type.

Version:
1.0 2006-1-6
Author:
Xu Linhao

Enum Constant Summary
BOOTSTRAP
          the string identifier representing the bootstrap server
CERTAUTHORITY
          the string identifier representing the certificate authority
CLIENTPEER
          the string identifier respresenting the client peer
SUPERPEER
          the string identifier representing the super peer
 
Method Summary
static boolean checkValue(java.lang.String peerType)
          Check if the peer type exists.
 java.lang.String getValue()
          Get the peer type.
static PeerType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static PeerType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CERTAUTHORITY

public static final PeerType CERTAUTHORITY
the string identifier representing the certificate authority


BOOTSTRAP

public static final PeerType BOOTSTRAP
the string identifier representing the bootstrap server


SUPERPEER

public static final PeerType SUPERPEER
the string identifier representing the super peer


CLIENTPEER

public static final PeerType CLIENTPEER
the string identifier respresenting the client peer

Method Detail

values

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

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

valueOf

public static PeerType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getValue

public java.lang.String getValue()
Get the peer type.

Returns:
the peer type

checkValue

public static boolean checkValue(java.lang.String peerType)
Check if the peer type exists.

Parameters:
peerType - the peer type
Returns:
true if exists; otherwise, false