Top Description Constructors Methods
org.eclipse.xtext.xbase.lib

public Class ComparableExtensions

extends Object
Class Inheritance
Annotations
@GwtCompatible
Imports
com.google.common.annotations.GwtCompatible

This is an extension library for comparables.
Author
Sven Efftinge - Initial contribution and API

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <C> boolean

Returns:

left.compareTo(right) >= 0
operator_greaterEqualsThan
(Comparable<? super C>
a comparable
left
,
C
the value to compare with
right
)

The comparison operator greater than or equals.

public static <C> boolean

Returns:

left.compareTo(right) > 0
operator_greaterThan
(Comparable<? super C>
a comparable
left
,
C
the value to compare with
right
)

The comparison operator greater than.

public static <C> boolean

Returns:

left.compareTo(right) <= 0
operator_lessEqualsThan
(Comparable<? super C>
a comparable
left
,
C
the value to compare with
right
)

The comparison operator less than or equals.

public static <C> boolean

Returns:

left.compareTo(right) < 0
operator_lessThan
(Comparable<? super C>
a comparable
left
,
C
the value to compare with
right
)

The comparison operator less than.

public static <C> int

Returns:

left.compareTo(right)
operator_spaceship
(Comparable<? super C>
a comparable
left
,
C
the value to compare with
right
)

The spaceship operator <=>.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ComparableExtensionsback to summary
public ComparableExtensions()

Method Detail

operator_greaterEqualsThanback to summary
public static <C> boolean operator_greaterEqualsThan(Comparable<? super C> left, C right)

The comparison operator greater than or equals.

Parameters
left:Comparable<? super C>

a comparable

right:C

the value to compare with

Returns:boolean

left.compareTo(right) >= 0

Annotations
@Pure
@Inline:($1.compareTo($2) >= 0)
operator_greaterThanback to summary
public static <C> boolean operator_greaterThan(Comparable<? super C> left, C right)

The comparison operator greater than.

Parameters
left:Comparable<? super C>

a comparable

right:C

the value to compare with

Returns:boolean

left.compareTo(right) > 0

Annotations
@Pure
@Inline:($1.compareTo($2) > 0)
operator_lessEqualsThanback to summary
public static <C> boolean operator_lessEqualsThan(Comparable<? super C> left, C right)

The comparison operator less than or equals.

Parameters
left:Comparable<? super C>

a comparable

right:C

the value to compare with

Returns:boolean

left.compareTo(right) <= 0

Annotations
@Pure
@Inline:($1.compareTo($2) <= 0)
operator_lessThanback to summary
public static <C> boolean operator_lessThan(Comparable<? super C> left, C right)

The comparison operator less than.

Parameters
left:Comparable<? super C>

a comparable

right:C

the value to compare with

Returns:boolean

left.compareTo(right) < 0

Annotations
@Pure
@Inline:($1.compareTo($2) < 0)
operator_spaceshipback to summary
public static <C> int operator_spaceship(Comparable<? super C> left, C right)

The spaceship operator <=>.

Parameters
left:Comparable<? super C>

a comparable

right:C

the value to compare with

Returns:int

left.compareTo(right)

Annotations
@Pure
@Inline:($1.compareTo($2))
Since
2.4