001: /**
002: * Copyright (C) 2001-2004 France Telecom R&D
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */package org.objectweb.speedo.genclass.collection;
018:
019: import org.objectweb.jorm.type.api.PExceptionTyping;
020: import org.objectweb.speedo.genclass.GenClassAccessor;
021: import org.objectweb.speedo.genclass.GenClassElement;
022:
023: /**
024: *
025: * @author Sebastien Chassande-Barrioz
026: */
027: public class SetElem extends CollectionElem {
028:
029: public SetElem(GenClassAccessor gca) {
030: super (gca);
031: }
032:
033: public GenClassElement cloneGCE() {
034: return cloneGCE(new SetElem(gca));
035: }
036:
037: /**
038: * The error message thrown when an accessor method associated to an index
039: * is called. Indeed a set does not need index because all element must be
040: * unique and they are not ordered.
041: */
042: public final static String ERROR_MESSAGE_NO_INDEX = "A set has no index";
043:
044: // ---------------------------------------------------------------------------
045: // Overriden methods
046: // ---------------------------------------------------------------------------
047:
048: public void pieSetByteIndexField(String fn, byte value)
049: throws PExceptionTyping {
050: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
051: }
052:
053: public void pieSetCharIndexField(String fn, char value)
054: throws PExceptionTyping {
055: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
056: }
057:
058: public void pieSetShortIndexField(String fn, short value)
059: throws PExceptionTyping {
060: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
061: }
062:
063: public void pieSetIntIndexField(String fn, int value)
064: throws PExceptionTyping {
065: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
066: }
067:
068: public void pieSetLongIndexField(String fn, long value)
069: throws PExceptionTyping {
070: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
071: }
072:
073: public void pieSetStringIndexField(String fn, String value)
074: throws PExceptionTyping {
075: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
076: }
077:
078: public short pieGetShortIndexField(String fn)
079: throws PExceptionTyping {
080: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
081: }
082:
083: public long pieGetLongIndexField(String fn) throws PExceptionTyping {
084: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
085: }
086:
087: public int pieGetIntIndexField(String fn) throws PExceptionTyping {
088: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
089: }
090:
091: public String pieGetStringIndexField(String fn)
092: throws PExceptionTyping {
093: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
094: }
095:
096: public byte pieGetByteIndexField(String fn) throws PExceptionTyping {
097: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
098: }
099:
100: public char pieGetCharIndexField(String fn) throws PExceptionTyping {
101: throw new PExceptionTyping(ERROR_MESSAGE_NO_INDEX);
102: }
103: }
|