Last change
on this file since 25 was 25, checked in by bart, 4 years ago |
- party capabilities now include profile information. Existing parties may need small fix * plot layout shows accepts * VotingEvaluator use group power instead of group size * runsession you can now also select MOPAC-only parties
|
File size:
1.2 KB
|
Line | |
---|
1 | package geniusweb.partiesserver.repository;
|
---|
2 |
|
---|
3 | import java.util.Collection;
|
---|
4 | import java.util.Collections;
|
---|
5 | import java.util.HashMap;
|
---|
6 | import java.util.Map;
|
---|
7 |
|
---|
8 | import tudelft.utilities.listener.DefaultListenable;
|
---|
9 | import tudelft.utilities.repository.Repository;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Stores all currently available parties that can be run.
|
---|
13 | */
|
---|
14 | public class AvailablePartiesRepo extends DefaultListenable<String>
|
---|
15 | implements Repository<String, AvailableParty> {
|
---|
16 | private static final AvailablePartiesRepo instance = new AvailablePartiesRepo();
|
---|
17 |
|
---|
18 | private Map<String, AvailableParty> availableParties = new HashMap<>();
|
---|
19 |
|
---|
20 | private AvailablePartiesRepo() {
|
---|
21 | }
|
---|
22 |
|
---|
23 | public static AvailablePartiesRepo instance() {
|
---|
24 | return instance;
|
---|
25 | }
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public Collection<AvailableParty> list() {
|
---|
29 | return Collections.unmodifiableCollection(availableParties.values());
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Override
|
---|
33 | public AvailableParty get(String id) {
|
---|
34 | return availableParties.get(id);
|
---|
35 | }
|
---|
36 |
|
---|
37 | @Override
|
---|
38 | public void put(AvailableParty entity) {
|
---|
39 | availableParties.put(entity.getID(), entity);
|
---|
40 | notifyListeners(entity.getID());
|
---|
41 | }
|
---|
42 |
|
---|
43 | @Override
|
---|
44 | public void remove(String id) {
|
---|
45 | availableParties.remove(id);
|
---|
46 | notifyListeners(id);
|
---|
47 | }
|
---|
48 |
|
---|
49 | @Override
|
---|
50 | public void replace(AvailableParty entity) {
|
---|
51 | put(entity);
|
---|
52 | }
|
---|
53 |
|
---|
54 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.