Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
BeanCollection |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport | |
3 | * (http://www.vbs.admin.ch) | |
4 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
5 | * All rights reserved. | |
6 | * | |
7 | * Licensed under the Open Permis License which accompanies this distribution, | |
8 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
9 | */ | |
10 | package org.openpermis.policy.bean; | |
11 | ||
12 | import java.util.Iterator; | |
13 | import java.util.List; | |
14 | ||
15 | ||
16 | /** | |
17 | * A collection of part beans. | |
18 | * @param <P> type parameter. | |
19 | * @since 0.3.0 | |
20 | */ | |
21 | public interface BeanCollection<P extends PartBean> | |
22 | extends PartBean, Iterable<P> | |
23 | { | |
24 | ||
25 | //---- Methods | |
26 | ||
27 | /** | |
28 | * Returns an iterator. | |
29 | * @return an iterator. | |
30 | * @since 0.3.0 | |
31 | */ | |
32 | Iterator<P> iterator (); | |
33 | ||
34 | /** | |
35 | * Returns a modifiable list of part beans. Changes in this list are not reflected in this | |
36 | * collection. | |
37 | * @return a modifiable list of part beans. | |
38 | * @since 0.3.0 | |
39 | */ | |
40 | List<P> toList (); | |
41 | ||
42 | /** | |
43 | * Returns a new bean collection containing the list. | |
44 | * @param list a {@link List}. | |
45 | * @return a new bean collection containing the list. | |
46 | */ | |
47 | BeanCollection<P> create (List<P> list); | |
48 | ||
49 | } |