Package jline.console.completer
Class AggregateCompleter
- java.lang.Object
-
- jline.console.completer.AggregateCompleter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AggregateCompleter.Completion
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Completer>
completers
-
Constructor Summary
Constructors Constructor Description AggregateCompleter()
AggregateCompleter(java.util.Collection<Completer> completers)
Construct an AggregateCompleter with the given collection of completers.AggregateCompleter(Completer... completers)
Construct an AggregateCompleter with the given completers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
complete(java.lang.String buffer, int cursor, java.util.List<java.lang.CharSequence> candidates)
Perform a completion operation across all aggregated completers.java.util.Collection<Completer>
getCompleters()
Retrieve the collection of completers currently being aggregated.java.lang.String
toString()
-
-
-
Field Detail
-
completers
private final java.util.List<Completer> completers
-
-
Constructor Detail
-
AggregateCompleter
public AggregateCompleter()
-
AggregateCompleter
public AggregateCompleter(java.util.Collection<Completer> completers)
Construct an AggregateCompleter with the given collection of completers. The completers will be used in the iteration order of the collection.- Parameters:
completers
- the collection of completers
-
AggregateCompleter
public AggregateCompleter(Completer... completers)
Construct an AggregateCompleter with the given completers. The completers will be used in the order given.- Parameters:
completers
- the completers
-
-
Method Detail
-
getCompleters
public java.util.Collection<Completer> getCompleters()
Retrieve the collection of completers currently being aggregated.- Returns:
- the aggregated completers
-
complete
public int complete(java.lang.String buffer, int cursor, java.util.List<java.lang.CharSequence> candidates)
Perform a completion operation across all aggregated completers.- Specified by:
complete
in interfaceCompleter
- Parameters:
buffer
- The buffercursor
- The current position of the cursor in the buffercandidates
- TheList
of candidates to populate- Returns:
- the highest completion return value from all completers
- See Also:
Completer.complete(String, int, java.util.List)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representing the aggregated completers
-
-