com.threerings.presents.net
Enum Transport.Type

java.lang.Object
  extended by java.lang.Enum<Transport.Type>
      extended by com.threerings.presents.net.Transport.Type
All Implemented Interfaces:
Serializable, Comparable<Transport.Type>
Enclosing class:
Transport

public static enum Transport.Type
extends Enum<Transport.Type>

The available types of transport.


Enum Constant Summary
RELIABLE_ORDERED
          Messages are guaranteed to arrive, and will arrive in the order in which they are sent.
RELIABLE_UNORDERED
          Messages are guaranteed to arrive eventually, but they are not guaranteed to arrive in order.
UNRELIABLE_ORDERED
          Messages are not guaranteed to arrive, but if they do arrive, then they will arrive in order and without duplicates.
UNRELIABLE_UNORDERED
          Messages are neither guaranteed to arrive nor, if they do arrive, to arrive in order and without duplicates.
 
Field Summary
protected  boolean _ordered
           
protected  boolean _reliable
           
 
Method Summary
abstract  Transport.Type combine(Transport.Type other)
          Returns a transport type that combines the requirements of this type with those of the specified other type.
 boolean isOrdered()
          Checks whether this transport type guarantees that messages will be received in the order in which they were sent, if they are received at all.
 boolean isReliable()
          Checks whether this transport type guarantees that messages will be delivered.
static Transport.Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Transport.Type[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNRELIABLE_UNORDERED

public static final Transport.Type UNRELIABLE_UNORDERED
Messages are neither guaranteed to arrive nor, if they do arrive, to arrive in order and without duplicates. Functionally identical to UDP.


UNRELIABLE_ORDERED

public static final Transport.Type UNRELIABLE_ORDERED
Messages are not guaranteed to arrive, but if they do arrive, then they will arrive in order and without duplicates. In other words, out-of-order packets will be dropped.


RELIABLE_UNORDERED

public static final Transport.Type RELIABLE_UNORDERED
Messages are guaranteed to arrive eventually, but they are not guaranteed to arrive in order.


RELIABLE_ORDERED

public static final Transport.Type RELIABLE_ORDERED
Messages are guaranteed to arrive, and will arrive in the order in which they are sent. Functionally identical to TCP.

Field Detail

_reliable

protected boolean _reliable

_ordered

protected boolean _ordered
Method Detail

values

public static Transport.Type[] 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 (Transport.Type c : Transport.Type.values())
    System.out.println(c);

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

valueOf

public static Transport.Type 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

isReliable

public boolean isReliable()
Checks whether this transport type guarantees that messages will be delivered.


isOrdered

public boolean isOrdered()
Checks whether this transport type guarantees that messages will be received in the order in which they were sent, if they are received at all.


combine

public abstract Transport.Type combine(Transport.Type other)
Returns a transport type that combines the requirements of this type with those of the specified other type.