blob: ad11c85a4480d268fb9be0b772a94fc5ffe7db50 (
plain)
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
56
57
58
59
60
61
|
package net.miz_hi.smileessence.model.statuslist;
import net.miz_hi.smileessence.model.status.IStatusModel;
import net.miz_hi.smileessence.statuslist.StatusListManager;
import java.util.ArrayList;
public abstract class StatusList
{
private final ArrayList<IStatusModel> list = new ArrayList<IStatusModel>();
public synchronized void addToTop(IStatusModel status)
{
list.add(0, status);
}
public synchronized void addToBottom(IStatusModel status)
{
list.add(list.size(), status);
}
public synchronized IStatusModel getStatus(int index)
{
return list.get(index);
}
public synchronized int getStatusIndex(IStatusModel status)
{
return list.indexOf(status);
}
public synchronized void remove(int index)
{
list.remove(index);
}
public synchronized void remove(IStatusModel status)
{
list.remove(status);
}
public synchronized IStatusModel[] getStatusList()
{
return list.toArray(new IStatusModel[list.size()]);
}
public synchronized void apply()
{
StatusListManager.getAdapter(this).notifyAdapter();
}
public synchronized void applyForce()
{
StatusListManager.getAdapter(this).forceNotifyAdapter();
}
public abstract boolean checkStatus(IStatusModel status);
}
|