public class Candidate extends Object implements Comparable<Candidate>
Constructor and Description |
---|
Candidate(String value)
Simple constructor with only a single String as an argument.
|
Candidate(String value,
String displ,
String group,
String descr,
String suffix,
String key,
boolean complete)
Constructs a new Candidate.
|
Candidate(String value,
String displ,
String group,
String descr,
String suffix,
String key,
boolean complete,
int sort)
Constructs a new Candidate.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Candidate o) |
boolean |
complete()
Boolean indicating whether this candidate is complete or
if the completer may further expand the candidate value
after this candidate has been selected.
|
String |
descr()
Description of this candidate, usually a small help message
to understand the meaning of this candidate.
|
String |
displ()
The string that will be displayed to the user.
|
boolean |
equals(Object o) |
String |
group()
The group name for this candidate.
|
int |
hashCode() |
String |
key()
Candidates which have the same key will be merged together.
|
int |
sort()
Integer used to override default sort logic.
|
String |
suffix()
The suffix is added when this candidate is displayed.
|
String |
toString() |
String |
value()
The value that will be used for the actual completion.
|
public Candidate(String value)
value
- the candidatepublic Candidate(String value, String displ, String group, String descr, String suffix, String key, boolean complete, int sort)
value
- the valuedispl
- the display stringgroup
- the groupdescr
- the descriptionsuffix
- the suffixkey
- the keycomplete
- the complete flagsort
- the sort flagpublic Candidate(String value, String displ, String group, String descr, String suffix, String key, boolean complete)
value
- the valuedispl
- the display stringgroup
- the groupdescr
- the descriptionsuffix
- the suffixkey
- the keycomplete
- the complete flagpublic String value()
public String displ()
public String group()
LineReader.Option.GROUP
,
LineReader.Option.AUTO_GROUP
public String descr()
public String suffix()
LineReader.Option.AUTO_REMOVE_SLASH
,
LineReader.REMOVE_SUFFIX_CHARS
public String key()
public boolean complete()
public int sort()
public int compareTo(Candidate o)
compareTo
in interface Comparable<Candidate>