• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PrimitiveEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.tools.corba.se.idl.PrimitiveEntry的典型用法代码示例。如果您正苦于以下问题:Java PrimitiveEntry类的具体用法?Java PrimitiveEntry怎么用?Java PrimitiveEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PrimitiveEntry类属于com.sun.tools.corba.se.idl包,在下文中一共展示了PrimitiveEntry类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: streamableRead

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
protected void streamableRead (String entryName, SymtabEntry entry, PrintWriter stream)
{
  Vector vMembers = ( (ValueBoxEntry) entry ).state ();
  TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry;
  SymtabEntry mType = member.type ();
  if (mType instanceof PrimitiveEntry || mType instanceof SequenceEntry || mType instanceof TypedefEntry ||
      mType instanceof StringEntry || !member.arrayInfo ().isEmpty ())
  {
    SymtabEntry mEntry = (SymtabEntry) ((InterfaceState) vMembers.elementAt (0)).entry;
    ((JavaGenerator)member.generator ()).read (0, "    ", entryName + ".value", member, stream);
  }
  else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry)
    stream.println ("    " + entryName + ".value = (" + Util.javaQualifiedName (mType) + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName(mType, true) + ".get_instance ());"); // <d60929> // <d61056>
  else
    stream.println ("    " + entryName + ".value = " + Util.helperName (mType, true) + ".read (istream);"); // <d61056>
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ValueBoxGen.java


示例2: readBranch

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
private int readBranch (int index, String indent, String name, String disName, TypedefEntry entry, PrintWriter stream)
{
    SymtabEntry type = entry.type ();
    Util.writeInitializer (indent, '_' + name, "", entry, stream);

    if (!entry.arrayInfo ().isEmpty () ||
        type instanceof SequenceEntry ||
        type instanceof PrimitiveEntry ||
        type instanceof StringEntry) {
        index = ((JavaGenerator)entry.generator ()).read (index, indent, '_' + name, entry, stream);
    } else {
        stream.println (indent + '_' + name + " = " + Util.helperName (type, true) + ".read (istream);");
    }

    stream.print (indent + "value." + name + " (");
    if( disName == "" )
        stream.println("_" + name + ");");
    else
        stream.println(disName + ", " + "_" + name + ");");

    return index;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:UnionGen.java


示例3: writeInsert

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 *
 **/
private void writeInsert (String indent, String target, String source, SymtabEntry type, PrintWriter stream)
{
  String typeName = type.name ();
  if (type instanceof PrimitiveEntry)
  {
    // RJB does something have to be done with TC offsets?
    if (typeName.equals ("long long"))
      stream.println (indent + source + ".insert_longlong (" + target + ");");
    else if (typeName.equals ("unsigned short"))
      stream.println (indent + source + ".insert_ushort (" + target + ");");
    else if (typeName.equals ("unsigned long"))
      stream.println (indent + source + ".insert_ulong (" + target + ");");
    else if (typeName.equals ("unsigned long long"))
      stream.println (indent + source + ".insert_ulonglong (" + target + ");");
    else
      stream.println (indent + source + ".insert_" + typeName + " (" + target + ");");
  }
  else if (type instanceof StringEntry)
    stream.println (indent + source + ".insert_" + typeName + " (" + target + ");");
  else
    stream.println (indent + Util.helperName (type, true) + ".insert (" + source + ", " + target + ");"); // <d61056>
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:MethodGen.java


示例4: writeExtract

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 *
 **/
private void writeExtract (String indent, String target, String source, SymtabEntry type, PrintWriter stream)
{
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      stream.println (indent + target + " = " + source + ".extract_longlong ();");
    else if (type.name ().equals ("unsigned short"))
      stream.println (indent + target + " = " + source + ".extract_ushort ();");
    else if (type.name ().equals ("unsigned long"))
      stream.println (indent + target + " = " + source + ".extract_ulong ();");
    else if (type.name ().equals ("unsigned long long"))
      stream.println (indent + target + " = " + source + ".extract_ulonglong ();");
    else
      stream.println (indent + target + " = " + source + ".extract_" + type.name () + " ();");
  }
  else if (type instanceof StringEntry)
    stream.println (indent + target + " = " + source + ".extract_" + type.name () + " ();");
  else
    stream.println (indent + target + " = " + Util.helperName (type, true) + ".extract (" + source + ");"); // <d61056>
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:MethodGen.java


示例5: writeInputStreamRead

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 *
 **/
private String writeInputStreamRead (String source, SymtabEntry type)
{
  String read = "";
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      read = source + ".read_longlong ()";
    else if (type.name ().equals ("unsigned short"))
      read = source + ".read_ushort ()";
    else if (type.name ().equals ("unsigned long"))
      read = source + ".read_ulong ()";
    else if (type.name ().equals ("unsigned long long"))
      read = source + ".read_ulonglong ()";
    else
      read = source + ".read_" + type.name () + " ()";
  }
  else if (type instanceof StringEntry)
    read = source + ".read_" + type.name () + " ()";
  else
    read = Util.helperName (type, true) + ".read (" + source + ')'; // <d61056>
  return read;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:MethodGen.java


示例6: javaQualifiedName

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 * Given a symtabEntry, return the name of this entry. This
 * method does not do any conversions like javaName does.
 **/
public static String javaQualifiedName (SymtabEntry entry)
{
  String name = "";
  if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
    name = "java.io.Serializable";
  else
  {
    SymtabEntry container = entry.container ();
    if (container != null)
      name = container.name ();
    if (name.equals (""))
      name = entry.name ();
    else
      name = containerFullName (entry.container ()) + '.' + entry.name ();
  }
  return name.replace ('/', '.');
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Util.java


示例7: writeMembers

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 *
 **/
protected void writeMembers ()
{
  // Write members and populate quality arrays
  int size = s.members ().size ();
  memberIsPrimitive = new boolean [size];
  memberIsInterface = new boolean [size];
  memberIsTypedef   = new boolean [size];
  for (int i = 0; i < s.members ().size (); ++i)
  {
    SymtabEntry member = (SymtabEntry)s.members ().elementAt (i);
    memberIsPrimitive[i] = member.type () instanceof PrimitiveEntry;
    memberIsInterface[i] = member.type () instanceof InterfaceEntry;
    memberIsTypedef[i]   = member.type () instanceof TypedefEntry;
    Util.fillInfo (member);
    // Transfer member comment to target <31jul1997>.
    if (member.comment () != null)
       member.comment ().generate ("  ", stream);
    Util.writeInitializer ("  public ", member.name (), "", member, stream);
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:StructGen.java


示例8: write

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  Vector vMembers = ( (ValueEntry) entry ).state ();
  TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry;
  SymtabEntry mType = member.type ();

  if (mType instanceof PrimitiveEntry || !member.arrayInfo ().isEmpty ())
    index = ((JavaGenerator)member.generator ()).write (index, indent, name + ".value", member, stream);
  else if (mType instanceof SequenceEntry || mType instanceof StringEntry || mType instanceof TypedefEntry || !member.arrayInfo ().isEmpty ())
    index = ((JavaGenerator)member.generator ()).write (index, indent, name, member, stream);
  else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry)
    stream.println (indent
                    + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value ((java.io.Serializable) value, " // <d60929>
                    +  Util.helperName (mType, true)  // <d61056>
                    + ".get_instance ());"); // <d61056>
  else
    stream.println (indent + Util.helperName (mType, true) + ".write (ostream, " + name + ");"); // <d61056>
  return index;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:ValueBoxGen.java


示例9: writeRead

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 * Generate the _read method.
 **/
protected void writeRead ()
{
  stream.println ("  public void _read (org.omg.CORBA.portable.InputStream i)");
  stream.println ("  {");
  if (entry instanceof ValueBoxEntry)
  {
    TypedefEntry member = ((InterfaceState) ((ValueBoxEntry) entry).state ().elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof StringEntry)
      stream.println ("    value = i.read_string ();");

    else if (mType instanceof PrimitiveEntry)
      stream.println ("    value = " + helperClass + ".read (i).value;");

    else
      stream.println ("    value = " + helperClass + ".read (i);");
  }
  else
    stream.println ("    value = " + helperClass + ".read (i);");
  stream.println ("  }");
  stream.println ();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Holder.java


示例10: init

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 * Initialize variables unique to this generator.
 **/
protected void init ()
{
  helperClass = entry.name () + "Helper";
  if (entry instanceof ValueBoxEntry)
  {
    ValueBoxEntry v = (ValueBoxEntry) entry;
    TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
    SymtabEntry mType =  member.type ();

    if (mType instanceof PrimitiveEntry)
      helperType = Util.javaName (entry);
    else
      helperType = Util.javaName (mType);
  }
  else
    helperType = Util.javaName (entry);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:Helper.java


示例11: read

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:UnionGen.java


示例12: writeConstValue

import com.sun.tools.corba.se.idl.PrimitiveEntry; //导入依赖的package包/类
/**
 * Write the constant's value according to its type.
 **/
private void writeConstValue (SymtabEntry type)
{
  if (type instanceof PrimitiveEntry)
    stream.println ('(' + Util.javaName (type) + ")(" + Util.parseExpression (c.value ()) + ");");
  else if (type instanceof StringEntry)
    stream.println (Util.parseExpression (c.value ()) + ';');
  else if (type instanceof TypedefEntry)
  {
    while (type instanceof TypedefEntry)
      type = type.type ();
    writeConstValue (type);
  }
  else
    stream.println (Util.parseExpression (c.value ()) + ';');
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:ConstGen.java



注:本文中的com.sun.tools.corba.se.idl.PrimitiveEntry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java QuorumPeerTestBase类代码示例发布时间:2022-05-22
下一篇:
Java Cache类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap