Top Description Fields Constructors Methods
bsh.util

public Class NameCompletionTable

extends ArrayList
implements NameCompletion
Class Inheritance
All Implemented Interfaces
bsh.util.NameCompletion
Imports
java.util.*, bsh.StringUtil, .NameSource

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...

Field Summary

Modifier and TypeField and Description
pack-priv List<E>
pack-priv NameCompletionTable
table

Unimplemented - need a collection here

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(NameCompletionTable
element to be appended to this list
table
)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Add a NameCompletionTable, which is more optimized than the more general NameSource
public void
add(NameSource
element to be appended to this list
source
)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Add a NameSource which is monitored for names.
public String[]
completeName(String part)

Implements bsh.util.NameCompletion.completeName.

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 void
getMatchingNames(String part, List<E> found)

Add any matching names to list (including any from other tables)

Inherited from java.util.ArrayList:
addaddAlladdAlladdFirstaddLastclearclonecontainsensureCapacityequalsforEachgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveAllremoveFirstremoveIfremoveLastremoveRangereplaceAllretainAllsetsizesortspliteratorsubListtoArraytoArraytrimToSize

Field Detail

sourcesback to summary
pack-priv List<E> sources
tableback to summary
pack-priv NameCompletionTable table

Unimplemented - need a collection here

Constructor Detail

NameCompletionTableback to summary
public NameCompletionTable()

Method Detail

addback to summary
public void add(NameCompletionTable table)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Add a NameCompletionTable, which is more optimized than the more general NameSource

Parameters
table:NameCompletionTable

Doc from java.util.ArrayList.add.

element to be appended to this list

Returns:void

Doc from java.util.ArrayList.add.

true (as specified by Collection#add)

addback to summary
public void add(NameSource source)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Add a NameSource which is monitored for names. Unimplemented - behavior is broken... no updates

Parameters
source:NameSource

Doc from java.util.ArrayList.add.

element to be appended to this list

Returns:void

Doc from java.util.ArrayList.add.

true (as specified by Collection#add)

completeNameback to summary
public String[] completeName(String part)

Implements bsh.util.NameCompletion.completeName.

Doc from bsh.util.NameCompletion.completeName.

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. 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...

getMatchingNamesback to summary
protected void getMatchingNames(String part, List<E> found)

Add any matching names to list (including any from other tables)