1 /*
2 * @(#)$Id: Statistic.java 689 2009-07-22 00:10:27Z bsigner $
3 *
4 * Author : Ueli Kurmann, igesture@uelikurmann.ch
5 *
6 * Purpose : Holds static information about a gesture class. Used
7 * by the BatchProcess.
8 *
9 * -----------------------------------------------------------------------
10 *
11 * Revision Information:
12 *
13 * Date Who Reason
14 *
15 * Dec 26, 2006 ukurmann Initial Release
16 * Mar 22, 2007 bsigner Cleanup
17 *
18 * -----------------------------------------------------------------------
19 *
20 * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
21 *
22 * This software is the proprietary information of ETH Zurich.
23 * Use is subject to license terms.
24 *
25 */
26
27
28 package org.ximtec.igesture.batch;
29
30 import org.ximtec.igesture.core.GestureClass;
31
32 /**
33 * Holds static information about a gesture class. Used by the BatchProcess.
34 *
35 * @version 1.0 Dec 2006
36 * @author Ueli Kurmann, igesture@uelikurmann.ch
37 * @author Beat Signer, signer@inf.ethz.ch
38 */
39 public class Statistic {
40
41 private int correct;
42
43 private int error;
44
45 private int rejectCorrect;
46
47 private int rejectError;
48
49 private GestureClass gestureClass;
50
51
52 /**
53 * Constructs a new class statistic.
54 *
55 * @param className the name of the gesture class
56 */
57 public Statistic(GestureClass gestureClass) {
58 this.gestureClass = gestureClass;
59 this.correct = 0;
60 this.error = 0;
61 this.rejectError = 0;
62 this.rejectCorrect = 0;
63 }
64
65
66 /**
67 * Increments the number of correctly recognised gestures.
68 *
69 */
70 public void incCorrect() {
71 this.correct++;
72 } // incCorrect
73
74
75 /**
76 * Returns the number of correctly recognised gestures.
77 *
78 * @return the number of correctly recognised gesture.
79 */
80 public int getCorrect() {
81 return correct;
82 } // getCorrect
83
84
85 /**
86 * Increments the number of errors.
87 *
88 */
89 public void incError() {
90 this.error++;
91 } // incError
92
93
94 /**
95 * Returns the number of errors.
96 *
97 * @return the number of errors.
98 */
99 public int getError() {
100 return error;
101 } // getError
102
103
104 /**
105 * Increments the number of wrongly rejected gestures.
106 *
107 */
108 public void incRejectError() {
109 this.rejectError++;
110 } // incRejectError
111
112
113 public int getRejectError() {
114 return rejectError;
115 } // getRejectError
116
117
118 /**
119 * Increments the number of correctly rejected gestured.
120 *
121 */
122 public void incRejectCorrect() {
123 this.rejectCorrect++;
124 } // incRejectCorrect
125
126
127 /**
128 * Returns the number of correctly rejected gestures.
129 *
130 * @return the number of correctly rejected gestures.
131 */
132 public int getRejectCorrect() {
133 return rejectCorrect;
134 } // getRejectCorrect
135
136
137 /**
138 * Returns the gesture class name.
139 *
140 * @return the gesture class name.
141 */
142 public String getClassName() {
143 return gestureClass.getName();
144 } // getClassName
145
146 }