Move from list to linked set for order conservation and use efficiency
This commit is contained in:
parent
438727e7b9
commit
f8da1c0119
@ -35,8 +35,8 @@ package net.bigeon.gclc.command;
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
* #L%
|
||||
*/
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.bigeon.gclc.exception.CommandRunException;
|
||||
import net.bigeon.gclc.exception.InvalidCommandName;
|
||||
@ -52,13 +52,16 @@ public class CommandProvider implements ICommandProvider {
|
||||
private static final String MINUS = "-"; //$NON-NLS-1$
|
||||
/** The space character. */
|
||||
private static final String SPACE = " "; //$NON-NLS-1$
|
||||
/** The commands map. */
|
||||
protected final List<ICommand> commands;
|
||||
/** The commands set.
|
||||
* <p>
|
||||
* The insertion order is conserved through the use of a
|
||||
* {@link LinkedHashSet}. */
|
||||
protected final Set<ICommand> commands;
|
||||
|
||||
/** Create a command provider. */
|
||||
public CommandProvider() {
|
||||
super();
|
||||
commands = new ArrayList<>();
|
||||
commands = new LinkedHashSet<>();
|
||||
}
|
||||
|
||||
/** Test the command name validity.
|
||||
|
Loading…
Reference in New Issue
Block a user