Enum TransportStrategy
- All Implemented Interfaces:
Comparable<TransportStrategy>
The connection topology a transport session uses. The platforms trade
bandwidth against the number of simultaneous links, and this is where an
app says which side of that trade it wants.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMany-to-many: every device may connect to every other.Exactly one connection on each side, and the highest bandwidth of the three.One advertiser, many discoverers. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransportStrategyReturns the enum constant of this type with the specified name.static TransportStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
CLUSTER
Many-to-many: every device may connect to every other. The most flexible and the slowest per link. AndroidStrategy.P2P_CLUSTER; the natural fit for MultipeerConnectivity, which is a mesh by nature. -
STAR
One advertiser, many discoverers. The advertiser accepts several connections and each discoverer holds exactly one. AndroidStrategy.P2P_STAR. -
POINT_TO_POINT
Exactly one connection on each side, and the highest bandwidth of the three. AndroidStrategy.P2P_POINT_TO_POINT.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException- if the argument is null
-