1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.caleigo.core;
20
21 import java.util.*;
22
23 /*** IEntityPool defines the interface to an entity collection class that can
24 * store zero or more IEntity objects. The entities stored in an IEntityPool
25 * are not type specified and does not have to be defined by a single
26 * IEntityDescriptor. IEntityPool is not ordered and should not accept
27 * duplicates effectively makeing it at a "Set".
28 *
29 * @author Dennis Zikovic
30 * @version 1.00
31 *
32 *//*
33 *
34 * WHEN WHO WHY & WHAT
35 * ------------------------------------------------------------------------------
36 * 2001-10-10 Dennis Zikovic Creation
37 */
38 public interface IEntityPool extends java.io.Serializable
39 {
40
41
42 /*** Return true if any (one or more) of the collections's contained
43 * entities has the DIRTY flag set to true that is have unsaved changes.
44 */
45 public boolean isDirty();
46
47 /*** Stores all contained entities that have the DIRTY flag set to true.
48 * The entities are stored in a single transaction meaning that if one
49 * store fails then all fails.
50 */
51 public void storeAll();
52
53 /*** Deletes all contained entities. The entities are deleted in a single
54 * transaction meaning that if one delete fails then all fails.
55 * USE THIS METHOD WITH CAUTION!
56 */
57 public void deleteAll();
58
59 /*** Performs a refresh on all contained entities. The refresh is batched
60 * to save performance.
61 */
62 public void refreshAll();
63
64
65 public boolean addEntity(IEntity entity);
66 public boolean removeEntity(IEntity entity);
67 public Iterator iterator();
68 public void clear();
69
70 public int size();
71 public boolean isEmpty();
72
73
74 public boolean contains(IEntity entity);
75 public boolean doesAccept(IEntity entity);
76
77 public Set asSet();
78 }