本文整理汇总了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;
}