In addition, an implementation may be designated as an alternate, which may affect the interpretation of the implementation's rank.
Given a series of Ranked implementations sorted by rank, the first element of the
series will bear the greatest rank.
- Author:
- Laird Nelson
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default rank (0) when returned by an implementation of therank()method. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault booleanoutranks(int j) Returnstrueif thisRankedbears a rank that outranks the rank represented byjaccording to the rules described in the specification for theoutranks(int, int)method.static booleanoutranks(int i, int j) Returnstrueif and only if a rank represented byioutranks a rank represented byj.default booleanReturnstrueif thisRankedoutranks the suppliedRankedaccording to the rules described in the specification for theoutranks(int, int)method.static booleandefault intrank()Returns the rank of thisRankedimplementation.
-
Field Details
-
DEFAULT_RANK
The default rank (0) when returned by an implementation of therank()method.- See Also:
-
-
Method Details
-
rank
Returns the rank of thisRankedimplementation.Implementations of this method may return any integer: positive, zero, or negative.
The default implementation of this method returns the value of the
DEFAULT_RANKfield (0).Overrides of this method must return a determinate value.
- Returns:
- the rank of this
Rankedimplementation - See Also:
-
alternate
Returnstrueif thisRankedis to be considered an alternate, which may have an effect on how the return value of therank()method is interpreted in some situations.The default implementation of this method returns
false.Overrides of this method must be idempotent and return a determinate value.
- Returns:
trueif thisRankedis to be considered an alternate
-
outranks
Returnstrueif thisRankedoutranks the suppliedRankedaccording to the rules described in the specification for theoutranks(int, int)method.Overriding this method, while possible and permitted, is discouraged.
-
outranks
Returnstrueif thisRankedbears a rank that outranks the rank represented byjaccording to the rules described in the specification for theoutranks(int, int)method.Overriding this method, while possible and permitted, is discouraged.
-
outranks
-
outranks
Returnstrueif and only if a rank represented byioutranks a rank represented byj.Given two ranks, i and j, i outranks j if and only if i is greater than (
>) j.- Parameters:
i- anintrepresenting a rankj- anintrepresenting a rank- Returns:
trueif and only ifioutranksj- Idempotency:
- This method is idempotent and deterministic.
- Thread Safety:
- This method is safe for concurrent use by multiple threads.
-