=begin pod :kind("Type") :subkind("class") :category("basic")

=TITLE class Collation

=SUBTITLE Encapsulates instructions about how strings should be sorted

=for code
class Collation { }

C<Collation> is the class that allows proper sorting, taking into account all
Unicode characteristics. It's the class the object
L<C<$*COLLATION>|/language/variables#index-entry-%24*COLLATION> is instantiated
to, and thus includes I<collation levels>, that is, what kind of features should
be looked up when comparing two strings and in which order.

=head1 Methods

=head2 method set

Defined as:

=for code :method
method set (
    Int :$primary    = 1,
    Int :$secondary  = 1,
    Int :$tertiary   = 1,
    Int :$quaternary = 1)

Sets if the different levels should be used in ascending or descending order, or
if they are going to be ignored (when set to 0).

=for code
my $*COLLATION = Collation.new;
say 'a' coll 'z'; # OUTPUT: «Less»
$*COLLATION.set(:primary(-1));
say 'a' coll 'z'; # OUTPUT: «More»

=head2 method primary

Defined as:

    method primary

Returns the state of the primary collation level.

=head2 method secondary

Defined as:

    method secondary

Returns the state of the secondary collation level.

=head2 method tertiary

Defined as:

    method tertiary

Returns the state of the tertiary collation level.

=head2 method quaternary

Defined as:

    method quaternary

Returns the state of the quaternary collation level.

=end pod

# vim: expandtab shiftwidth=4 ft=perl6
