Source for gnu.CORBA.DynAn.UndivideableAny

   1: /* Undivideable.java --
   2:    Copyright (C) 2005 Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   6: GNU Classpath is free software; you can redistribute it and/or modify
   7: it under the terms of the GNU General Public License as published by
   8: the Free Software Foundation; either version 2, or (at your option)
   9: any later version.
  10: 
  11: GNU Classpath is distributed in the hope that it will be useful, but
  12: WITHOUT ANY WARRANTY; without even the implied warranty of
  13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14: General Public License for more details.
  15: 
  16: You should have received a copy of the GNU General Public License
  17: along with GNU Classpath; see the file COPYING.  If not, write to the
  18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  21: Linking this library statically or dynamically with other modules is
  22: making a combined work based on this library.  Thus, the terms and
  23: conditions of the GNU General Public License cover the whole
  24: combination.
  25: 
  26: As a special exception, the copyright holders of this library give you
  27: permission to link this library with independent modules to produce an
  28: executable, regardless of the license terms of these independent
  29: modules, and to copy and distribute the resulting executable under
  30: terms of your choice, provided that you also meet, for each linked
  31: independent module, the terms and conditions of the license of that
  32: module.  An independent module is a module which is not derived from
  33: or based on this library.  If you modify this library, you may extend
  34: this exception to your version of the library, but you are not
  35: obligated to do so.  If you do not wish to do so, delete this
  36: exception statement from your version. */
  37: 
  38: 
  39: package gnu.CORBA.DynAn;
  40: 
  41: import java.io.Serializable;
  42: 
  43: import org.omg.CORBA.Any;
  44: import org.omg.CORBA.ORB;
  45: import org.omg.CORBA.Object;
  46: import org.omg.CORBA.TypeCode;
  47: import org.omg.DynamicAny.DynAny;
  48: import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
  49: import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
  50: 
  51: /**
  52:  * Represent DynAny that has no internal components (DynEnum and so on). The
  53:  * methods, related to internal components, throw exceptions or return agreed
  54:  * values like null.
  55:  *
  56:  * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
  57:  */
  58: public abstract class UndivideableAny
  59:   extends AbstractAny
  60:   implements Serializable
  61: {
  62:   /**
  63:    * Use serialVersionUID for interoperability.
  64:    */
  65:   private static final long serialVersionUID = 1;
  66: 
  67:   /**
  68:    * Create a new instance with the given typecode.
  69:    */
  70:   public UndivideableAny(TypeCode oType, TypeCode aType,
  71:                          gnuDynAnyFactory aFactory, ORB anOrb)
  72:   {
  73:     super(oType, aType, aFactory, anOrb);
  74:   }
  75: 
  76:   /**
  77:    * There are no components.
  78:    *
  79:    * @return 0, always.
  80:    */
  81:   public int component_count()
  82:   {
  83:     return 0;
  84:   }
  85: 
  86:   /**
  87:    * There is no current component.
  88:    *
  89:    * @throws TypeMismatch, always.
  90:    */
  91:   public DynAny current_component()
  92:     throws TypeMismatch
  93:   {
  94:     throw new TypeMismatch("Not applicable");
  95:   }
  96: 
  97:   /**
  98:    * Returns without action.
  99:    */
 100:   public void destroy()
 101:   {
 102:   }
 103: 
 104:   /**
 105:    * Not in use.
 106:    */
 107:   public Any get_any()
 108:     throws TypeMismatch, InvalidValue
 109:   {
 110:     throw new TypeMismatch();
 111:   }
 112: 
 113:   /**
 114:    * Not in use.
 115:    */
 116:   public boolean get_boolean()
 117:     throws TypeMismatch, InvalidValue
 118:   {
 119:     throw new TypeMismatch();
 120:   }
 121: 
 122:   /**
 123:    * Not in use.
 124:    */
 125:   public char get_char()
 126:     throws TypeMismatch, InvalidValue
 127:   {
 128:     throw new TypeMismatch();
 129:   }
 130: 
 131:   /**
 132:    * Not in use.
 133:    */
 134:   public double get_double()
 135:     throws TypeMismatch, InvalidValue
 136:   {
 137:     throw new TypeMismatch();
 138:   }
 139: 
 140:   /**
 141:    * Not in use.
 142:    */
 143:   public DynAny get_dyn_any()
 144:     throws TypeMismatch, InvalidValue
 145:   {
 146:     throw new TypeMismatch();
 147:   }
 148: 
 149:   /**
 150:    * Not in use.
 151:    */
 152:   public float get_float()
 153:     throws TypeMismatch, InvalidValue
 154:   {
 155:     throw new TypeMismatch();
 156:   }
 157: 
 158:   /**
 159:    * Not in use.
 160:    */
 161:   public int get_long()
 162:     throws TypeMismatch, InvalidValue
 163:   {
 164:     throw new TypeMismatch();
 165:   }
 166: 
 167:   /**
 168:    * Not in use.
 169:    */
 170:   public long get_longlong()
 171:     throws TypeMismatch, InvalidValue
 172:   {
 173:     throw new TypeMismatch();
 174:   }
 175: 
 176:   /**
 177:    * Not in use.
 178:    */
 179:   public byte get_octet()
 180:     throws TypeMismatch, InvalidValue
 181:   {
 182:     throw new TypeMismatch();
 183:   }
 184: 
 185:   /**
 186:    * Not in use.
 187:    */
 188:   public Object get_reference()
 189:     throws TypeMismatch, InvalidValue
 190:   {
 191:     throw new TypeMismatch();
 192:   }
 193: 
 194:   /**
 195:    * Not in use.
 196:    */
 197:   public short get_short()
 198:     throws TypeMismatch, InvalidValue
 199:   {
 200:     throw new TypeMismatch();
 201:   }
 202: 
 203:   /**
 204:    * Not in use.
 205:    */
 206:   public String get_string()
 207:     throws TypeMismatch, InvalidValue
 208:   {
 209:     throw new TypeMismatch();
 210:   }
 211: 
 212:   /**
 213:    * Not in use.
 214:    */
 215:   public TypeCode get_typecode()
 216:     throws TypeMismatch, InvalidValue
 217:   {
 218:     throw new TypeMismatch();
 219:   }
 220: 
 221:   /**
 222:    * Not in use.
 223:    */
 224:   public int get_ulong()
 225:     throws TypeMismatch, InvalidValue
 226:   {
 227:     throw new TypeMismatch();
 228:   }
 229: 
 230:   /**
 231:    * Not in use.
 232:    */
 233:   public long get_ulonglong()
 234:     throws TypeMismatch, InvalidValue
 235:   {
 236:     throw new TypeMismatch();
 237:   }
 238: 
 239:   /**
 240:    * Not in use.
 241:    */
 242:   public short get_ushort()
 243:     throws TypeMismatch, InvalidValue
 244:   {
 245:     throw new TypeMismatch();
 246:   }
 247: 
 248:   /**
 249:    * Not in use.
 250:    */
 251:   public Serializable get_val()
 252:     throws TypeMismatch, InvalidValue
 253:   {
 254:     throw new TypeMismatch();
 255:   }
 256: 
 257:   /**
 258:    * Not in use.
 259:    */
 260:   public char get_wchar()
 261:     throws TypeMismatch, InvalidValue
 262:   {
 263:     throw new TypeMismatch();
 264:   }
 265: 
 266:   /**
 267:    * Not in use.
 268:    */
 269:   public String get_wstring()
 270:     throws TypeMismatch, InvalidValue
 271:   {
 272:     throw new TypeMismatch();
 273:   }
 274: 
 275:   /**
 276:    * Not in use.
 277:    */
 278:   public void insert_any(Any an_any)
 279:     throws TypeMismatch, InvalidValue
 280:   {
 281:     throw new TypeMismatch();
 282:   }
 283: 
 284:   /**
 285:    * Not in use.
 286:    */
 287:   public void insert_boolean(boolean a_x)
 288:     throws InvalidValue, TypeMismatch
 289:   {
 290:     throw new TypeMismatch();
 291:   }
 292: 
 293:   /**
 294:    * Not in use.
 295:    */
 296:   public void insert_char(char a_x)
 297:     throws InvalidValue, TypeMismatch
 298:   {
 299:     throw new TypeMismatch();
 300:   }
 301: 
 302:   /**
 303:    * Not in use.
 304:    */
 305:   public void insert_double(double a_x)
 306:     throws InvalidValue, TypeMismatch
 307:   {
 308:     throw new TypeMismatch();
 309:   }
 310: 
 311:   /**
 312:    * Not in use.
 313:    */
 314:   public void insert_dyn_any(DynAny insert_it)
 315:     throws TypeMismatch, InvalidValue
 316:   {
 317:     throw new TypeMismatch();
 318:   }
 319: 
 320:   /**
 321:    * Not in use.
 322:    */
 323:   public void insert_float(float a_x)
 324:     throws InvalidValue, TypeMismatch
 325:   {
 326:     throw new TypeMismatch();
 327:   }
 328: 
 329:   /**
 330:    * Not in use.
 331:    */
 332:   public void insert_long(int a_x)
 333:     throws InvalidValue, TypeMismatch
 334:   {
 335:     throw new TypeMismatch();
 336:   }
 337: 
 338:   /**
 339:    * Not in use.
 340:    */
 341:   public void insert_longlong(long a_x)
 342:     throws InvalidValue, TypeMismatch
 343:   {
 344:     throw new TypeMismatch();
 345:   }
 346: 
 347:   /**
 348:    * Not in use.
 349:    */
 350:   public void insert_octet(byte a_x)
 351:     throws InvalidValue, TypeMismatch
 352:   {
 353:     throw new TypeMismatch();
 354:   }
 355: 
 356:   /**
 357:    * Not in use.
 358:    */
 359:   public void insert_reference(Object a_x)
 360:     throws InvalidValue, TypeMismatch
 361:   {
 362:     throw new TypeMismatch();
 363:   }
 364: 
 365:   /**
 366:    * Not in use.
 367:    */
 368:   public void insert_short(short a_x)
 369:     throws InvalidValue, TypeMismatch
 370:   {
 371:     throw new TypeMismatch();
 372:   }
 373: 
 374:   /**
 375:    * Not in use.
 376:    */
 377:   public void insert_string(String a_x)
 378:     throws InvalidValue, TypeMismatch
 379:   {
 380:     throw new TypeMismatch();
 381:   }
 382: 
 383:   /**
 384:    * Not in use.
 385:    */
 386:   public void insert_typecode(TypeCode a_x)
 387:     throws InvalidValue, TypeMismatch
 388:   {
 389:     throw new TypeMismatch();
 390:   }
 391: 
 392:   /**
 393:    * Not in use.
 394:    */
 395:   public void insert_ulong(int a_x)
 396:     throws InvalidValue, TypeMismatch
 397:   {
 398:     throw new TypeMismatch();
 399:   }
 400: 
 401:   /**
 402:    * Not in use.
 403:    */
 404:   public void insert_ulonglong(long a_x)
 405:     throws InvalidValue, TypeMismatch
 406:   {
 407:     throw new TypeMismatch();
 408:   }
 409: 
 410:   /**
 411:    * Not in use.
 412:    */
 413:   public void insert_ushort(short a_x)
 414:     throws InvalidValue, TypeMismatch
 415:   {
 416:     throw new TypeMismatch();
 417:   }
 418: 
 419:   /**
 420:    * Not in use.
 421:    */
 422:   public void insert_val(Serializable a_x)
 423:     throws InvalidValue, TypeMismatch
 424:   {
 425:     throw new TypeMismatch();
 426:   }
 427: 
 428:   /**
 429:    * Not in use.
 430:    */
 431:   public void insert_wchar(char a_x)
 432:     throws InvalidValue, TypeMismatch
 433:   {
 434:     throw new TypeMismatch();
 435:   }
 436: 
 437:   /**
 438:    * Not in use.
 439:    */
 440:   public void insert_wstring(String a_x)
 441:     throws InvalidValue, TypeMismatch
 442:   {
 443:     throw new TypeMismatch();
 444:   }
 445: 
 446:   /**
 447:    * Not in use.
 448:    */
 449:   public boolean next()
 450:   {
 451:     return false;
 452:   }
 453: 
 454:   /**
 455:    * Not in use.
 456:    */
 457:   public void rewind()
 458:   {
 459:   }
 460: 
 461:   /**
 462:    * Not in use.
 463:    */
 464:   public boolean seek(int p)
 465:   {
 466:     return false;
 467:   }
 468: 
 469:   /**
 470:    * Get the typecode of this enumeration.
 471:    */
 472:   public TypeCode type()
 473:   {
 474:     return official_type;
 475:   }
 476: 
 477:   /**
 478:    * Compares with other DynAny for equality.
 479:    */
 480:   public boolean equals(java.lang.Object other)
 481:   {
 482:     if (other instanceof DynAny)
 483:       return equal((DynAny) other);
 484:     else
 485:       return false;
 486:   }
 487: 
 488:   /**
 489:    * This depends on an object.
 490:    */
 491:   public abstract boolean equal(DynAny other);
 492: 
 493: }