EMMA Coverage Report (generated Wed Feb 13 07:49:24 ICT 2008)
[all classes][net.sourceforge.hiveboard]

COVERAGE SUMMARY FOR SOURCE FILE [Board.java]

nameclass, %method, %block, %line, %
Board.java100% (1/1)100% (34/34)99%  (247/250)99%  (77.9/79)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Board100% (1/1)100% (34/34)99%  (247/250)99%  (77.9/79)
equals (Object): boolean 100% (1/1)82%  (14/17)73%  (2.9/4)
Board (): void 100% (1/1)100% (16/16)100% (4/4)
copy (): Board 100% (1/1)100% (10/10)100% (3/3)
copy (Board, Board, boolean): void 100% (1/1)100% (74/74)100% (19/19)
getClosingDate (): Date 100% (1/1)100% (3/3)100% (1/1)
getCreationDate (): Date 100% (1/1)100% (3/3)100% (1/1)
getDescription (): String 100% (1/1)100% (3/3)100% (1/1)
getDiscriminator (): int 100% (1/1)100% (3/3)100% (1/1)
getHeight (): short 100% (1/1)100% (3/3)100% (1/1)
getId (): int 100% (1/1)100% (3/3)100% (1/1)
getInitiator (): int 100% (1/1)100% (3/3)100% (1/1)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
getParticipants (): Set 100% (1/1)100% (3/3)100% (1/1)
getPresents (): Set 100% (1/1)100% (3/3)100% (1/1)
getTokenSetter (): BoardTokenSetter 100% (1/1)100% (3/3)100% (1/1)
getVersion (): int 100% (1/1)100% (3/3)100% (1/1)
getWidth (): short 100% (1/1)100% (3/3)100% (1/1)
getWriter (): int 100% (1/1)100% (3/3)100% (1/1)
hashCode (): int 100% (1/1)100% (7/7)100% (1/1)
setClosingDate (Date): void 100% (1/1)100% (4/4)100% (2/2)
setCreationDate (Date): void 100% (1/1)100% (4/4)100% (2/2)
setDescription (String): void 100% (1/1)100% (4/4)100% (2/2)
setDiscriminator (int): void 100% (1/1)100% (4/4)100% (2/2)
setHeight (short): void 100% (1/1)100% (4/4)100% (2/2)
setId (int): void 100% (1/1)100% (4/4)100% (2/2)
setInitiator (int): void 100% (1/1)100% (4/4)100% (2/2)
setName (String): void 100% (1/1)100% (4/4)100% (2/2)
setParticipants (Set): void 100% (1/1)100% (4/4)100% (2/2)
setPresents (Set): void 100% (1/1)100% (4/4)100% (2/2)
setTokenSetter (BoardTokenSetter): void 100% (1/1)100% (4/4)100% (2/2)
setVersion (int): void 100% (1/1)100% (4/4)100% (2/2)
setWidth (short): void 100% (1/1)100% (4/4)100% (2/2)
setWriter (int): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (28/28)100% (6/6)

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.hiveboard;
16 
17import java.util.Date;
18import java.util.HashSet;
19import java.util.Set;
20 
21import org.apache.hivemind.util.ToStringBuilder;
22 
23public class Board
24{
25        public Board        copy()
26        {
27                Board clone = new Board();
28                copy(this, clone, true);
29                return clone;
30        }
31        
32        static public void        copy(Board from, Board to, boolean deep)
33        {
34                to._id                                = from._id;
35                to._name                        = from._name;
36                to._discriminator        = from._discriminator;
37                to._description                = from._description;
38                to._width                        = from._width;
39                to._height                        = from._height;
40                to._tokenSetter                = from._tokenSetter;
41                to._initiator                = from._initiator;
42                to._writer                        = from._writer;
43                if (deep)
44                {
45                        to._participants        = new HashSet<Integer>(from._participants);
46                        to._presents                = new HashSet<Integer>(from._presents);
47                }
48                else
49                {
50                        to._participants        = from._participants;
51                        to._presents                = from._presents;
52                }
53                to._creationDate        = from._creationDate;
54                to._closingDate                = from._closingDate;
55                to._version                        = from._version;
56        }
57        
58        public void                setId(int id)
59        {
60                _id = id;
61        }
62        public int                getId()
63        {
64                return _id;
65        }
66        
67        public void                setName(String name)
68        {
69                _name = name;
70        }
71        public String         getName()
72        {
73                return _name;
74        }
75        
76        /**
77         * Discriminator is used to enable several accounts with the same visa but 
78         * only one in valid state.
79         * For a valid account, it is always 0; when an account is deactivated, this
80         * value will be set to <code>select max(discriminator) + 1 from accounts</code>.
81         */        
82        public void                setDiscriminator(int discriminator)
83        {
84                _discriminator = discriminator;
85        }
86        public int                 getDiscriminator()
87        {
88                return _discriminator;
89        }
90 
91        public void                setDescription(String description)
92        {
93                _description = description;
94        }
95        public String         getDescription()
96        {
97                return _description;
98        }
99        
100        public void                setWidth(short width)
101        {
102                _width = width;
103        }
104        public short        getWidth()
105        {
106                return _width;
107        }
108        
109        public void                setHeight(short height)
110        {
111                _height = height;
112        }
113        public short        getHeight()
114        {
115                return _height;
116        }
117        
118        public void                                setTokenSetter(BoardTokenSetter tokenSetter)
119        {
120                _tokenSetter = tokenSetter;
121        }
122        public BoardTokenSetter        getTokenSetter()
123        {
124                return _tokenSetter;
125        }
126        
127        public void                setInitiator(int initiator)
128        {
129                _initiator = initiator;
130        }
131        public int                getInitiator()
132        {
133                return _initiator;
134        }
135        
136        public void                setWriter(int writer)
137        {
138                _writer = writer;
139        }
140        public int                getWriter()
141        {
142                return _writer;
143        }
144        
145        public void                setParticipants(Set<Integer> participants)
146        {
147                _participants = participants;
148        }
149        public Set<Integer>                getParticipants()
150        {
151                return _participants;
152        }
153        
154        public void                setPresents(Set<Integer> presents)
155        {
156                _presents = presents;
157        }
158        public Set<Integer>                getPresents()
159        {
160                return _presents;
161        }
162        
163        public void                setCreationDate(Date creationDate)
164        {
165                _creationDate = creationDate;
166        }
167 
168        public Date                getCreationDate()
169        {
170                return _creationDate;
171        }
172        
173        public void                setClosingDate(Date closingDate)
174        {
175                _closingDate = closingDate;
176        }
177 
178        public Date                getClosingDate()
179        {
180                return _closingDate;
181        }
182        
183        public void                setVersion(int version)
184        {
185                _version = version;
186        }
187        public int                getVersion()
188        {
189                return _version;
190        }
191        
192        // CSOFF: MagicNumberCheck
193        @Override public int                hashCode()
194        {
195                return _id * 45621 + 5631;
196        }
197        // CSON: MagicNumberCheck
198        
199        @Override public boolean        equals(Object o)
200        {
201                if (!(o instanceof Board))
202                {
203                        return false;
204                }
205                Board that = (Board) o;
206                return (this.getId() == that.getId());
207        }
208        
209        @Override public String        toString()
210        {
211                ToStringBuilder builder = new ToStringBuilder(this);
212                builder.append("id", _id);
213                builder.append("name", _name);
214                builder.append("initiator", _initiator);
215                builder.append("writer", _writer);
216                return builder.toString();
217        }
218 
219        private int                                        _id;
220        private String                                _name;
221        private int                                        _discriminator;
222        private String                                _description;
223        private short                                _width;
224        private short                                _height;
225        private BoardTokenSetter        _tokenSetter = BoardTokenSetter.InitiatorOnly;
226        private int                                        _initiator;
227        private int                                        _writer;
228        private Set<Integer>                _participants = new HashSet<Integer>();
229        private Set<Integer>                _presents = new HashSet<Integer>();
230        private Date                                _creationDate;
231        private Date                                _closingDate;
232        private int                                        _version;
233}

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