public class NamedObjectRepository<T extends NamedObject> extends Object
| Constructor and Description |
|---|
NamedObjectRepository()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(T t)
Adds an object to this repository.
|
void |
clear()
Clear this repository.
|
boolean |
contains(String objName) |
T |
get(String objName) |
void |
remove(String objName)
Removes an object with given name from this repository.
|
public void add(T t) throws IllegalArgumentException, DuplicateException
t - object to be addedIllegalArgumentException - if given object is null or given object haves an empty/null nameDuplicateException - if an object with the same name was already added to this repositorypublic void remove(String objName) throws IllegalArgumentException
objName - name of the object to be removed. If there is no such object, nothing happens.IllegalArgumentException - if objName is null or emptypublic T get(String objName) throws IllegalArgumentException
objName - name of the object to be returned. If there is no such object, returns null.IllegalArgumentException - if objName is null or emptypublic void clear()
public boolean contains(String objName)
objName - object nameCopyright © 2015 Agapsys Tecnologia Ltda-ME. All rights reserved.