EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hivegui.table]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractDataListModel.java]

nameclass, %method, %block, %line, %
AbstractDataListModel.java0%   (0/1)0%   (0/8)0%   (0/103)0%   (0/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractDataListModel0%   (0/1)0%   (0/8)0%   (0/103)0%   (0/26)
AbstractDataListModel (): void 0%   (0/1)0%   (0/8)0%   (0/2)
addDataListModelListener (DataListModelListener): void 0%   (0/1)0%   (0/6)0%   (0/2)
fireModelReset (): void 0%   (0/1)0%   (0/15)0%   (0/4)
fireRowModified (int, int): void 0%   (0/1)0%   (0/17)0%   (0/4)
fireRowsAdded (int, int): void 0%   (0/1)0%   (0/17)0%   (0/4)
fireRowsModified (int, int): void 0%   (0/1)0%   (0/17)0%   (0/4)
fireRowsRemoved (int, int): void 0%   (0/1)0%   (0/17)0%   (0/4)
removeDataListModelListener (DataListModelListener): void 0%   (0/1)0%   (0/6)0%   (0/2)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hivegui.table;
16 
17import java.util.ArrayList;
18import java.util.List;
19 
20/**
21 * @author Jean-Francois Poilpret
22 */
23public abstract class AbstractDataListModel<T> implements DataListModel<T>
24{
25        public void                addDataListModelListener(DataListModelListener listener)
26        {
27                _listeners.add(listener);
28        }
29        
30        public void                removeDataListModelListener(DataListModelListener listener)
31        {
32                _listeners.remove(listener);
33        }
34 
35        protected void        fireModelReset()
36        {
37                for (DataListModelListener listener: _listeners)
38                {
39                        listener.modelReset();
40                }
41        }
42 
43        protected void        fireRowsAdded(int begin, int end)
44        {
45                for (DataListModelListener listener: _listeners)
46                {
47                        listener.rowsAdded(begin, end);
48                }
49        }
50 
51        protected void        fireRowsModified(int begin, int end)
52        {
53                for (DataListModelListener listener: _listeners)
54                {
55                        listener.rowsModified(begin, end);
56                }
57        }
58 
59        protected void        fireRowModified(int source, int destination)
60        {
61                // The order in which listeners are called must be guaranteed (ie, in
62                // the order of registration through addDataListModelListener())
63                for (DataListModelListener listener: _listeners)
64                {
65                        listener.rowModified(source, destination);
66                }
67        }
68 
69        protected void        fireRowsRemoved(int begin, int end)
70        {
71                for (DataListModelListener listener: _listeners)
72                {
73                        listener.rowsRemoved(begin, end);
74                }
75        }
76 
77        final protected List<DataListModelListener>        _listeners = 
78                                                                                        new ArrayList<DataListModelListener>();
79}

[all classes][net.sourceforge.hivegui.table]
EMMA 2.0.5312 (C) Vladimir Roubtsov