|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjet.runtime.ProgressionUtil
public class ProgressionUtil
| Method Summary | |
|---|---|
static int |
getProgressionFinalElement(int start,
int end,
int increment)
Calculates the final element of a bounded arithmetic progression, i.e. |
static long |
getProgressionFinalElement(long start,
long end,
long increment)
Calculates the final element of a bounded arithmetic progression, i.e. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int getProgressionFinalElement(int start,
int end,
int increment)
start to end in case of a positive increment, or from end to start in case of a negative
increment.
No validation on passed parameters is performed. The given parameters should satisfy the condition: either
increment > 0 and start <= end, or increment < 0 and start >= end.
start - first element of the progressionend - ending bound for the progressionincrement - increment, or difference of successive elements in the progression
public static long getProgressionFinalElement(long start,
long end,
long increment)
start to end in case of a positive increment, or from end to start in case of a negative
increment.
No validation on passed parameters is performed. The given parameters should satisfy the condition: either
increment > 0 and start <= end, or increment < 0 and start >= end.
start - first element of the progressionend - ending bound for the progressionincrement - increment, or difference of successive elements in the progression
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||