-
Notifications
You must be signed in to change notification settings - Fork 173
/
IPokedex.java
55 lines (47 loc) · 1.48 KB
/
IPokedex.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package fr.univavignon.pokedex.api;
import java.util.Comparator;
import java.util.List;
/**
* IPokedex interface. An IPokedex aims to store all information about
* captured pokemon, as their default metadata as well.
*
* @author fv
*/
public interface IPokedex extends IPokemonMetadataProvider, IPokemonFactory {
/**
* Returns the number of pokemon this pokedex contains.
*
* @return Number of pokemon in this pokedex.
*/
int size();
/**
* Adds the given <tt>pokemon</tt> to this pokedex and returns
* it unique index.
*
* @param pokemon Pokemon to add to this pokedex.
* @return Index of this pokemon relative to this pokedex.
*/
int addPokemon(Pokemon pokemon);
/**
* Locates the pokemon identified by the given <tt>id</tt>.
*
* @param id Unique pokedex relative identifier.
* @return Pokemon denoted by the given identifier.
* @throws PokedexException If the given <tt>index</tt> is not valid.
*/
Pokemon getPokemon(int id) throws PokedexException;
/**
* Returns an unmodifiable list of all pokemons this pokedex contains.
*
* @return Unmodifiable list of all pokemons.
*/
List<Pokemon> getPokemons();
/**
* Returns an unmodifiable list of all pokemons this pokedex contains.
* The list view will be sorted using the given <tt>order</tt>.
*
* @param order Comparator instance used for sorting the created view.
* @return Sorted unmodifiable list of all pokemons.
*/
List<Pokemon> getPokemons(Comparator<Pokemon> order);
}