Package bsh.util
Class NameCompletionTable
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
bsh.util.NameCompletionTable
- All Implemented Interfaces:
NameCompletion,Serializable,Cloneable,Iterable,Collection,List,RandomAccess,SequencedCollection
NameCompletionTable is a utility that implements simple name completion for
a collection of names, NameSources, and other NameCompletionTables.
This implementation uses a trivial linear search and comparison...
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(NameSource source) Add a NameSource which is monitored for names.voidadd(NameCompletionTable table) Add a NameCompletionTable, which is more optimized than the more general NameSourceString[]completeName(String part) Return an array containing a string element of the maximum unambiguous namespace completion or, if there is no common prefix, return the list of ambiguous names.protected voidgetMatchingNames(String part, List found) Add any matching names to list (including any from other tables)Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Constructor Details
-
NameCompletionTable
public NameCompletionTable()
-
-
Method Details
-
add
Add a NameCompletionTable, which is more optimized than the more general NameSource -
add
Add a NameSource which is monitored for names. Unimplemented - behavior is broken... no updates -
getMatchingNames
Add any matching names to list (including any from other tables) -
completeName
Description copied from interface:NameCompletionReturn an array containing a string element of the maximum unambiguous namespace completion or, if there is no common prefix, return the list of ambiguous names. e.g. input: "java.l" output: [ "java.lang." ] input: "java.lang." output: [ "java.lang.Thread", "java.lang.Integer", ... ] Note: Alternatively, make a NameCompletionResult object someday...- Specified by:
completeNamein interfaceNameCompletion
-