IncrementableSequential

com.phasmidsoftware.lascala.IncrementableSequential
case class IncrementableSequential[T](t: T, isSnapshot: Boolean = ..., by: String = ...)(using evidence$1: Incrementable[T]) extends OrderedSequential[IncrementableSequential[T]]

This is a simple implementation of the Sequential trait which does not allow for sub-versions.

Type parameters

T

the underlying type of this Sequential: it is defined that there exist an implicit value of Incrementable[T] available -- in practice, this typically means an integer of some sort, as String or a LocalDate.

Value parameters

by

the unit of the increment

isSnapshot

(defaults to false) true if this is a snapshot

t

the value of this IncrementalSequential

Attributes

Graph
Supertypes
trait Product
trait Equals
trait Ordered[IncrementableSequential[T]]
trait Comparable[IncrementableSequential[T]]
trait Ordering[IncrementableSequential[T]]
trait PartialOrdering[IncrementableSequential[T]]
trait Equiv[IncrementableSequential[T]]
trait Serializable
trait Comparator[IncrementableSequential[T]]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

class OrderingOps(lhs: Ordering.this.T)

This inner class defines comparison operators available for T.

This inner class defines comparison operators available for T.

It can't extend AnyVal because it is not a top-level class or a member of a statically accessible object.

Value parameters

lhs

the left-hand side value for infix comparison operations

Attributes

Inherited from:
Ordering
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

Method to compare two IncrementalSequential instances

Method to compare two IncrementalSequential instances

Value parameters

i1

the first

i2

the second

Attributes

Returns

the comparison of their underlying values, assuming it is non-zero, otherwise, we compare the isSnapshot statuses (true comes before false)

def compare(that: IncrementableSequential[T]): Int

Method to compare this IncrementalSequential with an IncrementableSequential

Method to compare this IncrementalSequential with an IncrementableSequential

Value parameters

that

the other IncrementableSequential

Attributes

Returns

the comparison of this and that

def next(isSnapshot: Boolean = ...): Try[IncrementableSequential[T]]

Value parameters

isSnapshot

(defaults to false) If true, then the next Sequential will be a snapshot. The expected behavior is that when isSnapshot changes from false to true, it will be accompanied by a change in sequence (where the new Sequential is ordered after this), otherwise not.

Attributes

Returns

Try[T]

Inherited methods

def <(that: IncrementableSequential[T]): Boolean

Returns true if this is less than that

Returns true if this is less than that

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
def <=(that: IncrementableSequential[T]): Boolean

Returns true if this is less than or equal to that.

Returns true if this is less than or equal to that.

Attributes

Inherited from:
Ordered
def >(that: IncrementableSequential[T]): Boolean

Returns true if this is greater than that.

Returns true if this is greater than that.

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
def >=(that: IncrementableSequential[T]): Boolean

Returns true if this is greater than or equal to that.

Returns true if this is greater than or equal to that.

Attributes

Inherited from:
Ordered
def compareTo(that: IncrementableSequential[T]): Int

Result of comparing this with operand that.

Result of comparing this with operand that.

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
override def equiv(x: IncrementableSequential[T], y: IncrementableSequential[T]): Boolean

Returns true if x == y in the ordering.

Returns true if x == y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering -> Equiv
Inherited from:
Ordering
override def gt(x: IncrementableSequential[T], y: IncrementableSequential[T]): Boolean

Returns true if x > y in the ordering.

Returns true if x > y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def gteq(x: IncrementableSequential[T], y: IncrementableSequential[T]): Boolean

Returns true if x >= y in the ordering.

Returns true if x >= y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def isReverseOf(other: Ordering[_]): Boolean

Returns whether or not the other ordering is the opposite ordering of this one.

Returns whether or not the other ordering is the opposite ordering of this one.

Equivalent to other == this.reverse.

Implementations should only override this method if they are overriding reverse as well.

Value parameters

other

the ordering to check

Attributes

Returns

true if other is the reverse of this ordering, false otherwise

Inherited from:
Ordering
override def lt(x: IncrementableSequential[T], y: IncrementableSequential[T]): Boolean

Returns true if x < y in the ordering.

Returns true if x < y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def lteq(x: IncrementableSequential[T], y: IncrementableSequential[T]): Boolean

Returns true if x <= y in the ordering.

Returns true if x <= y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def max[U <: IncrementableSequential[T]](x: U, y: U): U

Returns x if x >= y, otherwise y.

Returns x if x >= y, otherwise y.

Type parameters

U

a subtype of T, used to preserve the specific type in the return value

Value parameters

x

the first candidate value

y

the second candidate value

Attributes

Inherited from:
Ordering
def min[U <: IncrementableSequential[T]](x: U, y: U): U

Returns x if x <= y, otherwise y.

Returns x if x <= y, otherwise y.

Type parameters

U

a subtype of T, used to preserve the specific type in the return value

Value parameters

x

the first candidate value

y

the second candidate value

Attributes

Inherited from:
Ordering
def on[U](f: U => IncrementableSequential[T]): Ordering[U]

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

def compare[U, T: Ordering](x: U, y: U, f: U => T) = Ordering[T].compare(f(x), f(y))

Type parameters

U

the type of the values to be ordered

Value parameters

f

the function to extract a T value from a U value

Attributes

Returns

an Ordering[U] that orders values by applying f and comparing the results using this ordering

Inherited from:
Ordering
def orElse(other: Ordering[IncrementableSequential[T]]): Ordering[IncrementableSequential[T]]

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Value parameters

other

an Ordering to use if this Ordering returns zero

Attributes

Returns

an Ordering[T] that uses this ordering first, falling back to other when values are equal

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElse(Ordering.by[Pair, Int](_.b))
Inherited from:
Ordering
def orElseBy[S](f: IncrementableSequential[T] => S)(implicit ord: Ordering[S]): Ordering[IncrementableSequential[T]]

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

def compare[T, S: Ordering](x: T, y: T, f: T => S) = Ordering[S].compare(f(x), f(y))

This function is equivalent to passing the result of Ordering.by(f) to orElse.

Type parameters

S

the type returned by the extraction function f

Value parameters

f

the function to extract a comparison key from a T value

ord

the implicit ordering for the extracted key type S

Attributes

Returns

an Ordering[T] that uses this ordering first, falling back to comparing by f when values are equal

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElseBy[Int](_.b)
Inherited from:
Ordering
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
override def reverse: Ordering[IncrementableSequential[T]]

Returns the opposite ordering of this one.

Returns the opposite ordering of this one.

Implementations overriding this method MUST override isReverseOf as well if they change the behavior at all (for example, caching does not require overriding it).

Attributes

Returns

an Ordering[T] that compares elements in the reverse order of this ordering

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def reversed(): Comparator[IncrementableSequential[T]]

Attributes

Inherited from:
Comparator
def thenComparing[U <: Comparable[_ >: U <: <FromJavaObject>]](x$0: Function[_ >: IncrementableSequential[T] <: <FromJavaObject>, _ <: U]): Comparator[IncrementableSequential[T]]

Attributes

Inherited from:
Comparator
def thenComparing[U <: <FromJavaObject>](x$0: Function[_ >: IncrementableSequential[T] <: <FromJavaObject>, _ <: U], x$1: Comparator[_ >: U <: <FromJavaObject>]): Comparator[IncrementableSequential[T]]

Attributes

Inherited from:
Comparator
def thenComparing(x$0: Comparator[_ >: IncrementableSequential[T] <: <FromJavaObject>]): Comparator[IncrementableSequential[T]]

Attributes

Inherited from:
Comparator
def thenComparingDouble(x$0: ToDoubleFunction[_ >: IncrementableSequential[T] <: <FromJavaObject>]): Comparator[IncrementableSequential[T]]

Attributes

Inherited from:
Comparator
def thenComparingInt(x$0: ToIntFunction[_ >: IncrementableSequential[T] <: <FromJavaObject>]): Comparator[IncrementableSequential[T]]

Attributes

Inherited from:
Comparator
def thenComparingLong(x$0: ToLongFunction[_ >: IncrementableSequential[T] <: <FromJavaObject>]): Comparator[IncrementableSequential[T]]

Attributes

Inherited from:
Comparator

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Inherited from:
Ordering

Implicits

Inherited implicits

This implicit method augments T with the comparison operators defined in scala.math.Ordering.Ops.

This implicit method augments T with the comparison operators defined in scala.math.Ordering.Ops.

Value parameters

lhs

the value to enrich with ordering operators

Attributes

Inherited from:
Ordering