jline.console.completer
Class AggregateCompleter

java.lang.Object
  extended by jline.console.completer.AggregateCompleter
All Implemented Interfaces:
Completer

public class AggregateCompleter
extends Object
implements Completer

Completer which contains multiple completers and aggregates them together.

Since:
2.3
Author:
Jason Dillon

Constructor Summary
AggregateCompleter()
           
AggregateCompleter(Collection<Completer> completers)
          Construct an AggregateCompleter with the given collection of completers.
AggregateCompleter(Completer... completers)
          Construct an AggregateCompleter with the given completers.
 
Method Summary
 int complete(String buffer, int cursor, List<CharSequence> candidates)
          Perform a completion operation across all aggregated completers.
 Collection<Completer> getCompleters()
          Retrieve the collection of completers currently being aggregated.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregateCompleter

public AggregateCompleter()

AggregateCompleter

public AggregateCompleter(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 Collection<Completer> getCompleters()
Retrieve the collection of completers currently being aggregated.

Returns:
the aggregated completers

complete

public int complete(String buffer,
                    int cursor,
                    List<CharSequence> candidates)
Perform a completion operation across all aggregated completers.

Specified by:
complete in interface Completer
Parameters:
buffer - The buffer
cursor - The current position of the cursor in the buffer
candidates - The List of candidates to populate
Returns:
the highest completion return value from all completers
See Also:
Completer.complete(String, int, java.util.List)

toString

public String toString()
Overrides:
toString in class Object
Returns:
a string representing the aggregated completers


Copyright © 2013. All Rights Reserved.