public final class SortOptionSets extends Object
sort
command with the
the following options:
c  check  Checks that the single input file is ordered as specified by the arguments and the collating sequence of the current locale. No output is produced; only the exit code is affected.  
m  merge  Merge only; the input file are assumed to be already sorted.  
u  unique  Unique: suppress all but one in each set of lines having equal keys.
If used with the c option, checks that there are no lines
with duplicate keys, in addition to checking that the input file is
sorted.  
b  ignoreLeadingBlanks  Ignore leading blanks. (This option is ignored if a comparator operand is present).  
d  dictionaryOrder  Consider only blanks and alphanumeric characters. (This option is ignored if a comparator operand is present).  
f  ignoreCase  Consider all lowercase characters that have uppercase equivalents to be the uppercase equivalent for the purposes of comparison. (This option is ignored if a comparator operand is present).  
n  numericSort  Sort numerically; the number begins each line and consists of
optional blanks, an optional minus sign, and zero or more digits
possibly separated by thousands separators, optionally followed by a
decimalpoint character and zero or more digits. An empty number is
treated as '0'. The current local specifies the decimalpoint
character and thousands separator.
Comparison is exact; there is no rounding error.
Neither a leading '+' nor exponential notation is recognized. To
compare such strings numerically, use the
(This option is ignored if a comparator operand is present).  
g  generalNumericSort  Sort numerically, using the standard Double.parseDouble(String)
function to convert a trimmed line to a doubleprecision floating
point number. This allows floating point numbers to be specified in
scientific notation, like 1.0e34 and 10e100.
Uses the following collating sequence: Lines that cannot be parsed because they do not represent valid double values (in alphanumeric order); "Infinity"; finite numbers in ascending numeric order (with 0 < +0); "Infinity"; "NaN".
This option is usually slower than (This option is ignored if a comparator operand is present).  
h  humanNumericSort  Sort numerically, first by numeric sign (negative, zero, or
positive); then by SI suffix (either empty, or 'k' or 'K', or one
of 'MGTPEZY', in that order); and finally by numeric value. For
example, '1023M' sorts before '1G' because 'M' (mega) precedes 'G'
(giga) as an SI suffix.
This option sorts values that are consistently scaled to the nearest
suffix, regardless of whether suffixes denote powers of 1000 or
1024, and it therefore sorts the output of any single invocation of
the
The syntax for numbers is the same as for the
(This option is ignored if a comparator operand is present).  
M  monthSort  An initial string, consisting of any amount of blanks, followed by a month name abbreviation, is folded to UPPER case and compared in the order: (unknown) < 'JAN' < ... < 'DEC'. The current locale determines the month spellings.  
V  versionSort  Sort by version name and number. It behaves like a standard sort,
except that each sequence of decimal digits is treated numerically
as an index/version number.
(This option is ignored if a comparator operand is present).  
r  reverse  Reverse the sense of comparisons. 
This class serves as entry point to every possible set of sort
options
defined as an enum constant. With this explicit expansion of all possible
option combinations, options can be passed to the command in a very compact
form, such as:
sort(Sort.Options.c, ...); sort(Sort.Options.c.m, ...); ... sort(Sort.Options.c.m.u.b.d.f.n.g.h.M.V.r, ...);
Modifier and Type  Field and Description 

SortOptionSet_MVbcdfghmnru 
b
Option
"b" : Ignore leading blanks. 
SortOptionSet_MVbcdfghnru 
c
Option
"c" : Checks that the single input file is ordered as specified by the
arguments and the collating sequence of the current locale. 
SortOptionSet_MVbcdfghnru 
check
Option
"check" : Checks that the single input file is ordered as specified by the
arguments and the collating sequence of the current locale. 
SortOptionSet_MVbcdfghmnru 
d
Option
"d" : Consider only blanks and alphanumeric characters. 
SortOptionSet_MVbcdfghmnru 
dictionaryOrder
Option
"dictionaryOrder" : Consider only blanks and alphanumeric characters. 
SortOptionSet_MVbcdfghmnru 
f
Option
"f" : Consider all lowercase characters that have uppercase equivalents to
be the uppercase equivalent for the purposes of comparison. 
SortOptionSet_bcdfgmru 
g
Option
"g" : Sort numerically, using the standard Double.parseDouble(String)
function to convert a trimmed line to a doubleprecision floating
point number. 
SortOptionSet_bcdfgmru 
generalNumericSort
Option
"generalNumericSort" : Sort numerically, using the standard Double.parseDouble(String)
function to convert a trimmed line to a doubleprecision floating
point number. 
SortOptionSet_bcdfhmru 
h
Option
"h" : Sort numerically, first by numeric sign (negative, zero, or
positive); then by SI suffix (either empty, or 'k' or 'K', or one
of 'MGTPEZY', in that order); and finally by numeric value. 
SortOptionSet_bcdfhmru 
humanNumericSort
Option
"humanNumericSort" : Sort numerically, first by numeric sign (negative, zero, or
positive); then by SI suffix (either empty, or 'k' or 'K', or one
of 'MGTPEZY', in that order); and finally by numeric value. 
SortOptionSet_MVbcdfghmnru 
ignoreCase
Option
"ignoreCase" : Consider all lowercase characters that have uppercase equivalents to
be the uppercase equivalent for the purposes of comparison. 
SortOptionSet_MVbcdfghmnru 
ignoreLeadingBlanks
Option
"ignoreLeadingBlanks" : Ignore leading blanks. 
static SortOptionSets 
INSTANCE
The singleton instance.

SortOptionSet_MVbdfghmnru 
m
Option
"m" : Merge only; the input file are assumed to be already sorted. 
SortOptionSet_Mbcdfmru 
M
Option
"M" : An initial string, consisting of any amount of blanks, followed by a
month name abbreviation, is folded to UPPER case and compared in the
order: (unknown) < 'JAN' < ... 
SortOptionSet_MVbdfghmnru 
merge
Option
"merge" : Merge only; the input file are assumed to be already sorted. 
SortOptionSet_Mbcdfmru 
monthSort
Option
"monthSort" : An initial string, consisting of any amount of blanks, followed by a
month name abbreviation, is folded to UPPER case and compared in the
order: (unknown) < 'JAN' < ... 
SortOptionSet_bcdfmnru 
n
Option
"n" : Sort numerically; the number begins each line and consists of
optional blanks, an optional minus sign, and zero or more digits
possibly separated by thousands separators, optionally followed by a
decimalpoint character and zero or more digits. 
SortOptionSet_bcdfmnru 
numericSort
Option
"numericSort" : Sort numerically; the number begins each line and consists of
optional blanks, an optional minus sign, and zero or more digits
possibly separated by thousands separators, optionally followed by a
decimalpoint character and zero or more digits. 
SortOptionSet_MVbcdfghmnru 
r
Option
"r" : Reverse the sense of comparisons. 
SortOptionSet_MVbcdfghmnru 
reverse
Option
"reverse" : Reverse the sense of comparisons. 
SortOptionSet_MVbcdfghmnru 
u
Option
"u" : Unique: suppress all but one in each set of lines having equal keys. 
SortOptionSet_MVbcdfghmnru 
unique
Option
"unique" : Unique: suppress all but one in each set of lines having equal keys. 
SortOptionSet_Vbcdfmru 
V
Option
"V" : Sort by version name and number. 
SortOptionSet_Vbcdfmru 
versionSort
Option
"versionSort" : Sort by version name and number. 
Constructor and Description 

SortOptionSets() 
public static final SortOptionSets INSTANCE
public final SortOptionSet_MVbcdfghnru c
"c"
: Checks that the single input file is ordered as specified by the
arguments and the collating sequence of the current locale. No
output is produced; only the exit code is affected.
The option "c"
is equivalent to the "
check
"
option.
public final SortOptionSet_MVbcdfghnru check
"check"
: Checks that the single input file is ordered as specified by the
arguments and the collating sequence of the current locale. No
output is produced; only the exit code is affected.
The option "check"
is equivalent to the "
c
"
option.
public final SortOptionSet_MVbcdfghmnru d
"d"
: Consider only blanks and alphanumeric characters.
(This option is ignored if a comparator operand is present).
The option "d"
is equivalent to the "
dictionaryOrder
"
option.
public final SortOptionSet_MVbcdfghmnru dictionaryOrder
"dictionaryOrder"
: Consider only blanks and alphanumeric characters.
(This option is ignored if a comparator operand is present).
The option "dictionaryOrder"
is equivalent to the "
d
"
option.
public final SortOptionSet_bcdfgmru g
"g"
: Sort numerically, using the standard Double.parseDouble(String)
function to convert a trimmed line to a doubleprecision floating
point number. This allows floating point numbers to be specified in
scientific notation, like 1.0e34 and 10e100.
Uses the following collating sequence: Lines that cannot be parsed because they do not represent valid double values (in alphanumeric order); "Infinity"; finite numbers in ascending numeric order (with 0 < +0); "Infinity"; "NaN".
This option is usually slower than numericsort (n)
and it
can lose information when converting to floating point.
(This option is ignored if a comparator operand is present).
The option "g"
is equivalent to the "
generalNumericSort
"
option.
public final SortOptionSet_bcdfgmru generalNumericSort
"generalNumericSort"
: Sort numerically, using the standard Double.parseDouble(String)
function to convert a trimmed line to a doubleprecision floating
point number. This allows floating point numbers to be specified in
scientific notation, like 1.0e34 and 10e100.
Uses the following collating sequence: Lines that cannot be parsed because they do not represent valid double values (in alphanumeric order); "Infinity"; finite numbers in ascending numeric order (with 0 < +0); "Infinity"; "NaN".
This option is usually slower than numericsort (n)
and it
can lose information when converting to floating point.
(This option is ignored if a comparator operand is present).
The option "generalNumericSort"
is equivalent to the "
g
"
option.
public final SortOptionSet_bcdfhmru h
"h"
: Sort numerically, first by numeric sign (negative, zero, or
positive); then by SI suffix (either empty, or 'k' or 'K', or one
of 'MGTPEZY', in that order); and finally by numeric value. For
example, '1023M' sorts before '1G' because 'M' (mega) precedes 'G'
(giga) as an SI suffix.
This option sorts values that are consistently scaled to the nearest
suffix, regardless of whether suffixes denote powers of 1000 or
1024, and it therefore sorts the output of any single invocation of
the ls
command that are invoked with the humanreadable
option.
The syntax for numbers is the same as for the
numericSort (n)
option; the SI suffix must immediately
follow the number.
(This option is ignored if a comparator operand is present).
The option "h"
is equivalent to the "
humanNumericSort
"
option.
public final SortOptionSet_bcdfhmru humanNumericSort
"humanNumericSort"
: Sort numerically, first by numeric sign (negative, zero, or
positive); then by SI suffix (either empty, or 'k' or 'K', or one
of 'MGTPEZY', in that order); and finally by numeric value. For
example, '1023M' sorts before '1G' because 'M' (mega) precedes 'G'
(giga) as an SI suffix.
This option sorts values that are consistently scaled to the nearest
suffix, regardless of whether suffixes denote powers of 1000 or
1024, and it therefore sorts the output of any single invocation of
the ls
command that are invoked with the humanreadable
option.
The syntax for numbers is the same as for the
numericSort (n)
option; the SI suffix must immediately
follow the number.
(This option is ignored if a comparator operand is present).
The option "humanNumericSort"
is equivalent to the "
h
"
option.
public final SortOptionSet_MVbcdfghmnru f
"f"
: Consider all lowercase characters that have uppercase equivalents to
be the uppercase equivalent for the purposes of comparison.
(This option is ignored if a comparator operand is present).
The option "f"
is equivalent to the "
ignoreCase
"
option.
public final SortOptionSet_MVbcdfghmnru ignoreCase
"ignoreCase"
: Consider all lowercase characters that have uppercase equivalents to
be the uppercase equivalent for the purposes of comparison.
(This option is ignored if a comparator operand is present).
The option "ignoreCase"
is equivalent to the "
f
"
option.
public final SortOptionSet_MVbcdfghmnru b
"b"
: Ignore leading blanks.
(This option is ignored if a comparator operand is present).
The option "b"
is equivalent to the "
ignoreLeadingBlanks
"
option.
public final SortOptionSet_MVbcdfghmnru ignoreLeadingBlanks
"ignoreLeadingBlanks"
: Ignore leading blanks.
(This option is ignored if a comparator operand is present).
The option "ignoreLeadingBlanks"
is equivalent to the "
b
"
option.
public final SortOptionSet_MVbdfghmnru m
"m"
: Merge only; the input file are assumed to be already sorted.
The option "m"
is equivalent to the "
merge
"
option.
public final SortOptionSet_MVbdfghmnru merge
"merge"
: Merge only; the input file are assumed to be already sorted.
The option "merge"
is equivalent to the "
m
"
option.
public final SortOptionSet_Mbcdfmru M
"M"
: An initial string, consisting of any amount of blanks, followed by a
month name abbreviation, is folded to UPPER case and compared in the
order: (unknown) < 'JAN' < ... < 'DEC'. The current locale
determines the month spellings.
The option "M"
is equivalent to the "
monthSort
"
option.
public final SortOptionSet_Mbcdfmru monthSort
"monthSort"
: An initial string, consisting of any amount of blanks, followed by a
month name abbreviation, is folded to UPPER case and compared in the
order: (unknown) < 'JAN' < ... < 'DEC'. The current locale
determines the month spellings.
The option "monthSort"
is equivalent to the "
M
"
option.
public final SortOptionSet_bcdfmnru n
"n"
: Sort numerically; the number begins each line and consists of
optional blanks, an optional minus sign, and zero or more digits
possibly separated by thousands separators, optionally followed by a
decimalpoint character and zero or more digits. An empty number is
treated as '0'. The current local specifies the decimalpoint
character and thousands separator.
Comparison is exact; there is no rounding error.
Neither a leading '+' nor exponential notation is recognized. To
compare such strings numerically, use the
genericNumericSort (g)
option.
(This option is ignored if a comparator operand is present).
The option "n"
is equivalent to the "
numericSort
"
option.
public final SortOptionSet_bcdfmnru numericSort
"numericSort"
: Sort numerically; the number begins each line and consists of
optional blanks, an optional minus sign, and zero or more digits
possibly separated by thousands separators, optionally followed by a
decimalpoint character and zero or more digits. An empty number is
treated as '0'. The current local specifies the decimalpoint
character and thousands separator.
Comparison is exact; there is no rounding error.
Neither a leading '+' nor exponential notation is recognized. To
compare such strings numerically, use the
genericNumericSort (g)
option.
(This option is ignored if a comparator operand is present).
The option "numericSort"
is equivalent to the "
n
"
option.
public final SortOptionSet_MVbcdfghmnru r
"r"
: Reverse the sense of comparisons.
The option "r"
is equivalent to the "
reverse
"
option.
public final SortOptionSet_MVbcdfghmnru reverse
"reverse"
: Reverse the sense of comparisons.
The option "reverse"
is equivalent to the "
r
"
option.
public final SortOptionSet_MVbcdfghmnru u
"u"
: Unique: suppress all but one in each set of lines having equal keys.
If used with the c
option, checks that there are no lines
with duplicate keys, in addition to checking that the input file is
sorted.
The option "u"
is equivalent to the "
unique
"
option.
public final SortOptionSet_MVbcdfghmnru unique
"unique"
: Unique: suppress all but one in each set of lines having equal keys.
If used with the c
option, checks that there are no lines
with duplicate keys, in addition to checking that the input file is
sorted.
The option "unique"
is equivalent to the "
u
"
option.
public final SortOptionSet_Vbcdfmru V
"V"
: Sort by version name and number. It behaves like a standard sort,
except that each sequence of decimal digits is treated numerically
as an index/version number.
(This option is ignored if a comparator operand is present).
The option "V"
is equivalent to the "
versionSort
"
option.
public final SortOptionSet_Vbcdfmru versionSort
"versionSort"
: Sort by version name and number. It behaves like a standard sort,
except that each sequence of decimal digits is treated numerically
as an index/version number.
(This option is ignored if a comparator operand is present).
The option "versionSort"
is equivalent to the "
V
"
option.
public SortOptionSets()
Copyright © 2022. All rights reserved.