public class Rank extends Number implements Comparable<Rank>
before()
,
after()
appropriate correlation Ranks can be created.Constructor and Description |
---|
Rank(Object o)
Creates the Rank equivalent to specified object.
|
Modifier and Type | Method and Description |
---|---|
Rank |
after()
Creates Rank with equivalent number and higher offset.
|
Rank |
before()
Creates Rank with equivalent number and lower offset.
|
int |
compareTo(Rank other)
Compares this Rank with the specified Rank.
|
double |
doubleValue() |
boolean |
equals(Object obj)
Compares this object with the specified object.
|
float |
floatValue() |
int |
hashCode()
Returns a hash code for this
Rank . |
int |
intValue() |
boolean |
isAfter()
Determines if Rank has positive offset
|
boolean |
isBefore()
Determines if Rank has negative offset
|
long |
longValue() |
String |
toString()
Returns a string representation of this Rank.
|
byteValue, shortValue
public Rank(Object o)
Rank
- the same Rank
null
, DB.NullObject
-
the highest Rank
String
- must contain integer value with optional
end by + or - sign (ex. 5+, 3-).
Integer value used for Rank number, sign - for offset.
Number
- Rank with number equivalent to specified value
o
- object to get Rank forpublic Rank before()
public Rank after()
public boolean isBefore()
public boolean isAfter()
public String toString()
(offset == 0)
sign character not added.public int intValue()
public long longValue()
public float floatValue()
floatValue
in class Number
float
.public double doubleValue()
doubleValue
in class Number
double
.public boolean equals(Object obj) throws IllegalArgumentException
true
if and only if the argument is not
null
and the Rank
object that has
the same Rank number.
Note: Rank objects with offset which isn't 0 cannot be compared.
(isAfter()
== true
or
isBefore()
== true)
equals
in class Object
obj
- object to compare with.true
if objects equals, false
otherwise.IllegalArgumentException
- if obj
or this
has offset not equal 0.public int hashCode()
Rank
.public int compareTo(Rank other) throws IllegalArgumentException
isAfter()
== true
or
isBefore()
== true)
compareTo
in interface Comparable<Rank>
other
- Rank to compare with.0
if this Rank
is
equal to the argument Rank
; a value less than
0
if this Rank
number is numerically
less than the argument Rank
number; and the value
greater than 0
if this Rank
number is
numerically greater than the argument Rank
number
(signed comparison).IllegalArgumentException
- if obj
or this
has offset not equal 0.Copyright © 2015 VersionOne, Inc.. All rights reserved.