本文整理匯總了Java中java.lang.Long.MAX_VALUE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Long.MAX_VALUE屬性的具體用法?Java Long.MAX_VALUE怎麽用?Java Long.MAX_VALUE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.lang.Long
的用法示例。
在下文中一共展示了Long.MAX_VALUE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test00Construction
public void test00Construction() {
long[] values = new long[] {
Long.MIN_VALUE,
-1L,
0L,
1L,
1000L,
1000000L,
1000000000L,
1000000000000L,
1000000000000000L,
1000000000000000000L,
Long.MAX_VALUE
};
ExtendedThrottle ba = new BandwidthAlgorithm();
System.out.println("ba=" + ba);
validateInitialState(ba);
for (long increment : values) {
ba = new BandwidthAlgorithm(increment);
System.out.println("i=" + increment + " ba=" + ba);
validateInitialState(ba);
for (long limit : values)
{
ba = new BandwidthAlgorithm(increment, limit);
System.out.println("i=" + increment + " l=" + limit + " ba=" + ba);
validateInitialState(ba);
}
}
}
示例2: test00Construction
public void test00Construction() {
long[] values = new long[] {
Long.MIN_VALUE,
-1L,
0L,
1L,
1000L,
1000000L,
1000000000L,
1000000000000L,
1000000000000000L,
1000000000000000000L,
Long.MAX_VALUE
};
Throttle gcra = new GenericCellRateAlgorithm();
System.out.println("gcra=" + gcra);
validateInitialState(gcra);
for (long increment : values) {
gcra = new GenericCellRateAlgorithm(increment);
System.out.println("i=" + increment + " gcra=" + gcra);
validateInitialState(gcra);
for (long limit : values)
{
gcra = new GenericCellRateAlgorithm(increment, limit);
System.out.println("i=" + increment + " l=" + limit + " gcra=" + gcra);
validateInitialState(gcra);
}
}
}
示例3: increment
/**
* Compute the BA increment for a variable bit rate (VBR) traffic contract.
* @param pbr is the peak byte rate in bytes per second.
* @param jt is the jitter tolerance in nanoseconds.
* @param sbr is the sustained byte rate in bytes per second.
* @param mbs is the maximum burst size in bytes.
* @return the increment in ticks.
*/
public static long increment(int pbr, int jt, int sbr, int mbs) {
long s = (sbr > 0) ? sbr : 0;
long p = (pbr > 0) ? pbr : 0;
if (s > p) { s = p; }
long i = (s > 0) ? (FREQUENCY + s - 1) / s : Long.MAX_VALUE;
return (i >= 0) ? i : Long.MAX_VALUE;
}
示例4: limit
/**
* Compute the BA limit for a variable bit rate (VBR) traffic contract.
* @param pbr is the peak byte rate in bytes per second.
* @param jt is the jitter tolerance in nanoseconds.
* @param sbr is the sustained byte rate in bytes per second.
* @param mbs is the maximum burst size in bytes.
* @return the limit in ticks.
*/
public static long limit(int pbr, int jt, int sbr, int mbs) {
long l = limit(pbr, jt);
if ((mbs > 1) && (sbr > 0) && (pbr > sbr)) {
l += (mbs - 1) * (increment(pbr, jt, sbr, mbs) - increment(pbr, jt));
}
return (l >= 0) ? l : Long.MAX_VALUE;
}
示例5: increment
/**
* Compute the GCRA increment for a variable bit rate (VBR) traffic contract.
* @param pcr is the peak cell rate in cells per second.
* @param cdvt is the cell delay variation tolerance in microseconds.
* @param scr is the sustained cell rate in cells per second which must be less than or equal to the pcr.
* @param mbs is the maximum burst size in cells.
* @return the increment in ticks.
*/
public static long increment(int pcr, int cdvt, int scr, int mbs) {
long s = (scr > 0) ? scr : 0;
long p = (pcr > 0) ? pcr : 0;
if (s > p) { s = p; }
long i = (s > 0) ? (FREQUENCY + s - 1) / s : Long.MAX_VALUE;
return (i >= 0) ? i : Long.MAX_VALUE;
}
示例6: limit
/**
* Compute the GCRA limit for a variable bit rate (VBR) traffic contract.
* @param pcr is the peak cell rate in cells per second.
* @param cdvt is the cell delay variation tolerance in microseconds.
* @param scr is the sustained cell rate in cells per second.
* @param mbs is the maximum burst size in cells.
* @return the limit in ticks.
*/
public static long limit(int pcr, int cdvt, int scr, int mbs) {
long l = limit(pcr, cdvt);
if ((mbs > 1) && (scr > 0) && (pcr > scr)) {
l += (mbs - 1) * (increment(pcr, cdvt, scr, mbs) - increment(pcr, cdvt));
}
return (l >= 0) ? l : Long.MAX_VALUE;
}