public class SequenceUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_VALID_SEQUENCE
initializing maxValidSequence, actually the valid sequence range will be : from 1 to maxValidSequence
|
static int |
MIN_VALID_SEQUENCE |
| Constructor and Description |
|---|
SequenceUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compareMax(int a,
int b) |
static int |
compareMin(int a,
int b) |
static int |
distance(int source,
int destination)
Determines if it has the shortest path to go from source to destination or from destination to source.
|
static int |
distance2(int source,
int destination)
Deprecated.
|
static boolean |
isSequenceInvalid(int sequenceNumber)
Check if the given sequence number is invalid.
|
static int |
latestSequence(int a,
int b) |
static int |
nextSequence(int currentSequence)
Calculates the possible next sequence of given current sequence
|
static int |
previousSequence(int currentSequence)
Calculates the possible previous sequence of given current sequence
|
public static final int MAX_VALID_SEQUENCE
public static final int MIN_VALID_SEQUENCE
public static boolean isSequenceInvalid(int sequenceNumber)
sequenceNumber - sequence number to be checked for validation.@Deprecated public static int distance2(int source, int destination)
source - is previously got sequencedestination - is recently got sequencepublic static int distance(int source,
int destination)
source - is previously got sequencedestination - is recently got sequencesource to destination. This value can be negative as
well.public static int latestSequence(int a,
int b)
a - is previously got sequenceb - is recently got sequencepublic static int previousSequence(int currentSequence)
currentSequence - The value of current sequence, for which previous sequence need to be calculated.public static int nextSequence(int currentSequence)
currentSequence - recently got sequencepublic static int compareMin(int a,
int b)
a - is 1st sequenceb - is 2nd sequencepublic static int compareMax(int a,
int b)
a - is 1st sequenceb - is 2nd sequenceCopyright © 2024. All rights reserved.