public static enum ServiceConnection.LimitUnit extends java.lang.Enum<ServiceConnection.LimitUnit>
Enum Constant and Description |
---|
bytes |
gigabytes |
kilobytes |
megabytes |
rows |
Modifier and Type | Method and Description |
---|---|
long |
bytesFactor()
Gets the factor to convert into bytes the value expressed in this unit.
|
static int |
compare(int leftLimit,
ServiceConnection.LimitUnit leftUnit,
int rightLimit,
ServiceConnection.LimitUnit rightUnit)
Compares the 2 given values (each one expressed in the given unit).
|
static int |
compare(long x,
long y)
(Strict copy of Integer.compare(long,long) of Java 1.7)
|
static int |
compare(long leftLimit,
ServiceConnection.LimitUnit leftUnit,
long rightLimit,
ServiceConnection.LimitUnit rightUnit)
Compares the 2 given values (each one expressed in the given unit).
|
boolean |
isCompatibleWith(ServiceConnection.LimitUnit anotherUnit)
Tells whether the given unit has the same type (bytes or rows).
|
java.lang.String |
toString() |
static ServiceConnection.LimitUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ServiceConnection.LimitUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ServiceConnection.LimitUnit rows
public static final ServiceConnection.LimitUnit bytes
public static final ServiceConnection.LimitUnit kilobytes
public static final ServiceConnection.LimitUnit megabytes
public static final ServiceConnection.LimitUnit gigabytes
public static ServiceConnection.LimitUnit[] values()
for (ServiceConnection.LimitUnit c : ServiceConnection.LimitUnit.values()) System.out.println(c);
public static ServiceConnection.LimitUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isCompatibleWith(ServiceConnection.LimitUnit anotherUnit)
anotherUnit
- A unit.public long bytesFactor()
public static int compare(int leftLimit, ServiceConnection.LimitUnit leftUnit, int rightLimit, ServiceConnection.LimitUnit rightUnit) throws TAPException
Conversions are done internally in order to make a correct comparison between the 2 limits.
leftLimit
- Value/Limit of the comparison left part.leftUnit
- Unit of the comparison left part value.rightLimit
- Value/Limit of the comparison right part.rightUnit
- Unit of the comparison right part value.TAPException
- If the two given units are not compatible.compare(long, tap.ServiceConnection.LimitUnit, long, tap.ServiceConnection.LimitUnit)
public static int compare(long leftLimit, ServiceConnection.LimitUnit leftUnit, long rightLimit, ServiceConnection.LimitUnit rightUnit) throws TAPException
Conversions are done internally in order to make a correct comparison between the 2 limits.
leftLimit
- Value/Limit of the comparison left part.leftUnit
- Unit of the comparison left part value.rightLimit
- Value/Limit of the comparison right part.rightUnit
- Unit of the comparison right part value.TAPException
- If the two given units are not compatible.isCompatibleWith(tap.ServiceConnection.LimitUnit)
,
bytesFactor()
,
Integer.compare(int, int)
,
Long.compare(long, long)
public static int compare(long x, long y)
(Strict copy of Integer.compare(long,long) of Java 1.7)
Compares two long
values numerically.
The value returned is identical to what would be returned by:
Long.valueOf(x).compareTo(Long.valueOf(y))
x
- the first long
to comparey
- the second long
to compare0
if x == y
;
a value less than 0
if x < y
; and
a value greater than 0
if x > y
public java.lang.String toString()
toString
in class java.lang.Enum<ServiceConnection.LimitUnit>