Package unlimited.fc.client.engine
Enum NetworkCalc
- java.lang.Object
-
- java.lang.Enum<NetworkCalc>
-
- unlimited.fc.client.engine.NetworkCalc
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<NetworkCalc>
public enum NetworkCalc extends java.lang.Enum<NetworkCalc>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNetworkCalc.NetworkParamBuilderstatic classNetworkCalc.NetworkParams
-
Enum Constant Summary
Enum Constants Enum Constant Description instance
-
Method Summary
-
-
-
Enum Constant Detail
-
instance
public static final NetworkCalc instance
-
-
Method Detail
-
values
public static NetworkCalc[] 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 (NetworkCalc c : NetworkCalc.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NetworkCalc 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 namejava.lang.NullPointerException- if the argument is null
-
getThreadsNeeded
public long getThreadsNeeded(NetworkCalc.NetworkParams params)
-
getBlockRetransmissionCount
public long getBlockRetransmissionCount(NetworkCalc.NetworkParams params)
-
getTimeNotInTransit
public long getTimeNotInTransit(NetworkCalc.NetworkParams params)
-
getRTTO
public double getRTTO(NetworkCalc.NetworkParams params)
- Parameters:
params-- Returns:
- value in seconds
-
guestimateRTTO
public long guestimateRTTO(NetworkCalc.NetworkParams params)
-
getNumThreadsNeeded
public int getNumThreadsNeeded(NetworkCalc.NetworkParams params)
-
getHighestPossibleRate
public long getHighestPossibleRate(NetworkCalc.NetworkParams params)
-
guestimateOptimalBlockSize
public long guestimateOptimalBlockSize(NetworkCalc.NetworkParams params)
-
adjustBlockSizeToPacketSize
public long adjustBlockSizeToPacketSize(NetworkCalc.NetworkParams params, long rawSize)
-
getOptimizedNetworkParams
public NetworkCalc.NetworkParams getOptimizedNetworkParams(NetworkDiagnostics diag, boolean isUpstream) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getOptimizedRate
public int getOptimizedRate(NetworkDiagnostics diag, int pathMTU, int rateInKbps) throws java.lang.Exception
- Throws:
java.lang.Exception
-
builder
public static NetworkCalc.NetworkParamBuilder builder()
-
-