public class CommandRegistryImpl<C extends Command> extends Object implements CommandRegistry<C>
Constructor and Description |
---|
CommandRegistryImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the registry.
|
boolean |
contains(C item) |
List<C> |
getCommandHistory()
Returns the registered commands, can be composite commands as well.
|
boolean |
isEmpty() |
C |
peek()
Peek the command from the registry.
|
C |
pop()
Peek and remove the command from the registry.
|
void |
register(C command)
Registers a single or more than one command/s.
|
boolean |
remove(C command) |
void |
setMaxSize(int size) |
public void setMaxSize(int size)
setMaxSize
in interface SizeConstrainedRegistry
public void register(C command)
CommandRegistry
register
in interface CommandRegistry<C extends Command>
register
in interface DynamicRegistry<C extends Command>
public boolean remove(C command)
remove
in interface DynamicRegistry<C extends Command>
public void clear()
CommandRegistry
clear
in interface CommandRegistry<C extends Command>
public boolean contains(C item)
public List<C> getCommandHistory()
CommandRegistry
getCommandHistory
in interface CommandRegistry<C extends Command>
public C peek()
CommandRegistry
peek
in interface CommandRegistry<C extends Command>
public C pop()
CommandRegistry
pop
in interface CommandRegistry<C extends Command>
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.