⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 recordtypecode.java

📁 gcc的组建
💻 JAVA
字号:
/* RecordTypeCode.java --   Copyright (C) 2005 Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package gnu.CORBA.typecodes;import gnu.CORBA.CorbaList;import org.omg.CORBA.Any;import org.omg.CORBA.StructMember;import org.omg.CORBA.TCKind;import org.omg.CORBA.TypeCode;import org.omg.CORBA.TypeCodePackage.BadKind;import org.omg.CORBA.TypeCodePackage.Bounds;import org.omg.CORBA.UnionMember;import org.omg.CORBA.ValueMember;/** * The type code that also has the member property getters * supported. * * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */public class RecordTypeCode  extends GeneralTypeCode{  /**    * Use serialVersionUID for interoperability.    */  private static final long serialVersionUID = 1;    /**   * The individual field of the record.   */  public static class Field  {    /**     * The record label.     */    public Any label;    /**     * The record name.     */    public String name;    /**     * The record type.     */    public TypeCode type;    /**     * The record visibility.     */    public int visibility = UNSET;  }  /**   * The members of this data structure.   */  protected CorbaList members = new CorbaList();  private TypeCode discriminator_type;  private int default_index = UNSET;  /**   * Creates the type code of the given kind.   */  public RecordTypeCode(TCKind a_kind)  {    super(a_kind);  }  /**   * Set the default index.   */  public void setDefaultIndex(int a_default_index)  {    this.default_index = a_default_index;  }  /**   * Set the discriminator type.   */  public void setDiscriminator_type(TypeCode a_discriminator_type)  {    this.discriminator_type = a_discriminator_type;  }  public Field getField(int p)  {    return (Field) members.get(p);  }  public void add(Field field)  {    members.add(field);  }  /**   * Adds a new field, taking values from the passed   * {@link StructMember}.   */  public void add(StructMember m)  {    Field f = field();    f.name = m.name;    f.type = m.type;  }  /**   * Adds a new field, taking values from the passed   * {@link ValueMember}.   */  public void add(ValueMember m)  {    Field f = field();    f.name = m.name;    f.type = m.type;    f.visibility = m.access;      }  /**   * Adds a new field, taking values from the passed   * {@link UnionMember}.   */  public void add(UnionMember m)  {    Field f = field();    f.name = m.name;    f.type = m.type;    f.label = m.label;  }  public int default_index()                    throws BadKind  {    if (default_index != UNSET)      return default_index;    throw new BadKind();  }  public TypeCode discriminator_type()                              throws BadKind  {    if (discriminator_type != null)      return discriminator_type;    throw new BadKind();  }  /**   * Creates, adds and returns new field.   */  public Field field()  {    Field f = new Field();    members.add(f);    return f;  }  /** {@inheritDoc} */  public int member_count()  {    return members.size();  }  /** {@inheritDoc} */  public Any member_label(int index)                   throws BadKind, Bounds  {    Field f = getField(index);    if (f.label != null)      {        return f.label;      }    else      throw new BadKind();  }  /** {@inheritDoc} */  public String member_name(int index)                     throws BadKind  {    Field f = getField(index);    if (f.name != null)      {        return f.name;      }    else      throw new BadKind();  }  /** {@inheritDoc} */  public TypeCode member_type(int index)                       throws BadKind, Bounds  {    Field f = getField(index);    if (f.type != null)      {        return f.type;      }    else      throw new BadKind();  }  /** {@inheritDoc} */  public short member_visibility(int index)                          throws BadKind, Bounds  {    Field f = getField(index);    if (f.visibility != UNSET)      {        return (short) f.visibility;      }    else      throw new BadKind();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -