1 /*
2 * Created on Sep 15, 2005 by turadg
3 *
4 * Copyright (c) 2005 Regents of the University of California (Regents). Created
5 * by TELS, Graduate School of Education, University of California at Berkeley.
6 *
7 * This software is distributed under the GNU Lesser General Public License, v2.
8 *
9 * Permission is hereby granted, without written agreement and without license
10 * or royalty fees, to use, copy, modify, and distribute this software and its
11 * documentation for any purpose, provided that the above copyright notice and
12 * the following two paragraphs appear in all copies of this software.
13 *
14 * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE. THE SOFTWAREAND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
17 * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
18 * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
19 *
20 * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
21 * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
22 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
23 * REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26 package net.sf.sail.core.entity;
27
28 /**
29 * @author turadg
30 */
31 public class MismatchedAgentSetSizeException extends Exception {
32
33 private static final long serialVersionUID = 1L;
34
35 private int actual;
36
37 private int expected;
38
39 /**
40 * @param expected
41 * Size of the AgentSet that the context was expecting
42 * @param actual
43 * Size of the AgentSet in actuality
44 */
45 public MismatchedAgentSetSizeException(int expected, int actual) {
46 this.expected = expected;
47 this.actual = actual;
48 }
49
50 @Override
51 public String toString() {
52 return "Mismatched agent size (" + actual + " instead of " + expected
53 + ")";
54 }
55
56 }