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

COVERAGE SUMMARY FOR SOURCE FILE [Participant.java]

nameclass, %method, %block, %line, %
Participant.java100% (1/1)100% (9/9)100% (82/82)100% (20/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Participant100% (1/1)100% (9/9)100% (82/82)100% (20/20)
Participant (Account, Board): void 100% (1/1)100% (14/14)100% (5/5)
getAccount (): Account 100% (1/1)100% (3/3)100% (1/1)
getBoard (): Board 100% (1/1)100% (3/3)100% (1/1)
isInitiator (): boolean 100% (1/1)100% (10/10)100% (1/1)
isPresent (): boolean 100% (1/1)100% (8/8)100% (1/1)
isRequester (): boolean 100% (1/1)100% (3/3)100% (1/1)
isWriter (): boolean 100% (1/1)100% (17/17)100% (4/4)
setRequester (): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (20/20)100% (4/4)

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.util;
16 
17import org.apache.hivemind.util.ToStringBuilder;
18 
19import net.sourceforge.hiveboard.Account;
20import net.sourceforge.hiveboard.Board;
21 
22public class Participant
23{
24        public Participant(Account account, Board board)
25        {
26                _account = account;
27                _board = board;
28                _id = _account.getId();
29        }
30 
31        public Account        getAccount()
32        {
33                return _account;
34        }
35        
36        public Board        getBoard()
37        {
38                return _board;
39        }
40        
41        public void                setRequester()
42        {
43                _requester = true;
44        }
45        public boolean        isRequester()
46        {
47                return _requester;
48        }
49        
50        public boolean        isInitiator()
51        {
52                return (_id == _board.getInitiator());
53        }
54        
55        public boolean        isWriter()
56        {
57                boolean writer = (_id == _board.getWriter());
58                if (writer)
59                {
60                        _requester = false;
61                }
62                return writer;
63        }
64        
65        public boolean        isPresent()
66        {
67                return (_board.getPresents().contains(_id));
68        }
69        
70        @Override public String        toString()
71        {
72                ToStringBuilder builder = new ToStringBuilder(this);
73                builder.append("account", _account.getId());
74                builder.append("board", _board.getId());
75                return builder.toString();
76        }
77 
78        final private Account        _account;
79        final private Board                _board;
80        final private int                _id;
81        private boolean                        _requester;
82}

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