KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > genclass > collection > SetElem


1 /**
2  * Copyright (C) 2001-2004 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package org.objectweb.speedo.genclass.collection;
19
20 import org.objectweb.jorm.type.api.PExceptionTyping;
21 import org.objectweb.speedo.genclass.GenClassAccessor;
22 import org.objectweb.speedo.genclass.GenClassElement;
23
24 /**
25  *
26  * @author Sebastien Chassande-Barrioz
27  */

28 public class SetElem extends CollectionElem {
29
30     public SetElem(GenClassAccessor gca) {
31         super(gca);
32     }
33     public GenClassElement cloneGCE() {
34         return cloneGCE(new SetElem(gca));
35     }
36
37     /**
38      * The error message thrown when an accessor method associated to an index
39      * is called. Indeed a set does not need index because all element must be
40      * unique and they are not ordered.
41      */

42     public final static String JavaDoc ERROR_MESSAGE_NO_INDEX =
43             "A set has no index";
44
45     // ---------------------------------------------------------------------------
46
// Overriden methods
47
// ---------------------------------------------------------------------------
48

49     public void pieSetByteIndexField(String JavaDoc fn, byte value) throws PExceptionTyping {
50         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
51     }
52
53     public void pieSetCharIndexField(String JavaDoc fn, char value) throws PExceptionTyping {
54         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
55     }
56
57     public void pieSetShortIndexField(String JavaDoc fn, short value) throws PExceptionTyping {
58         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
59     }
60
61     public void pieSetIntIndexField(String JavaDoc fn, int value) throws PExceptionTyping {
62         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
63     }
64
65     public void pieSetLongIndexField(String JavaDoc fn, long value) throws PExceptionTyping {
66         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
67     }
68
69     public void pieSetStringIndexField(String JavaDoc fn, String JavaDoc value) throws PExceptionTyping {
70         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
71     }
72
73     public short pieGetShortIndexField(String JavaDoc fn) throws PExceptionTyping {
74         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
75     }
76
77     public long pieGetLongIndexField(String JavaDoc fn) throws PExceptionTyping {
78         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
79     }
80
81     public int pieGetIntIndexField(String JavaDoc fn) throws PExceptionTyping {
82         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
83     }
84
85     public String JavaDoc pieGetStringIndexField(String JavaDoc fn) throws PExceptionTyping {
86         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
87     }
88
89     public byte pieGetByteIndexField(String JavaDoc fn) throws PExceptionTyping {
90         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
91     }
92
93     public char pieGetCharIndexField(String JavaDoc fn) throws PExceptionTyping {
94         throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
95     }
96 }
97
Popular Tags