org.jacorb.idl
Class SequenceType

java.lang.Object
  extended by org.jacorb.idl.runtime.symbol
      extended by org.jacorb.idl.IdlSymbol
          extended by org.jacorb.idl.TypeSpec
              extended by org.jacorb.idl.SimpleTypeSpec
                  extended by org.jacorb.idl.TemplateTypeSpec
                      extended by org.jacorb.idl.VectorType
                          extended by org.jacorb.idl.SequenceType

public class SequenceType
extends VectorType

IDL sequences.

Version:
$Id: SequenceType.java,v 1.43 2006/07/13 10:41:56 alphonse.bendt Exp $
Author:
Gerald Brose

Field Summary
 ConstExpr max
           
 
Fields inherited from class org.jacorb.idl.TemplateTypeSpec
typedefd
 
Fields inherited from class org.jacorb.idl.TypeSpec
alias
 
Fields inherited from class org.jacorb.idl.IdlSymbol
_id, enclosing_symbol, fileSeparator, included, inhibitionFlag, is_pseudo, omg_package_prefix, pack_name
 
Fields inherited from class org.jacorb.idl.runtime.symbol
parse_state, sym
 
Constructor Summary
SequenceType(int num)
           
 
Method Summary
 java.lang.String className()
           
 java.lang.Object clone()
           
 java.lang.String full_name()
           
static int getNumber()
           
 java.lang.String getTypeCodeExpression()
           
 java.lang.String helperName()
           
 java.lang.String holderName()
           
 int length()
           
 void parse()
          The parsing phase.
 void print(java.io.PrintWriter out)
           
 void printExtractResult(java.io.PrintWriter out, java.lang.String resultname, java.lang.String anyname, java.lang.String resulttype)
          Prints the java-commands to extract the contents of the Any anyname into a variable resultname with the type resulttype
 void printInsertIntoAny(java.io.PrintWriter out, java.lang.String anyname, java.lang.String varname)
          Prints the java-commands to insert the variable varname into the Any anyname
 java.lang.String printReadStatement(java.lang.String var_name, java.lang.String streamname)
          We have to distinguish between sequence types that have been explicitly declared as types with a typedef and those that are declared as anonymous types in structs or unions.
 java.lang.String printWriteStatement(java.lang.String var_name, java.lang.String streamname)
           
 void setEnclosingSymbol(IdlSymbol symbol)
           
 void setPackage(java.lang.String pkg)
           
 TypeSpec typeSpec()
          since the sequence type's name depends on a declarator given in the typedef, the name varilabe has to be set explicitly by the TypeDef object before this sequence type can be used.
 
Methods inherited from class org.jacorb.idl.VectorType
accept, elementTypeExpression, elementTypeName, elementTypeSpec, getTCKind, printReadExpression, setTypeSpec, toString, typeName
 
Methods inherited from class org.jacorb.idl.TemplateTypeSpec
basic, markTypeDefd
 
Methods inherited from class org.jacorb.idl.TypeSpec
getIDLTypeName, getJavaTypeName, getTypeCodeExpression, printExtractExpression, printInsertExpression, set_constr
 
Methods inherited from class org.jacorb.idl.IdlSymbol
addImportedAlias, addImportedName, addImportedName, addImportedNameHolder, deEscapeName, escapeName, generateIncluded, get_token, getEnclosingSymbol, getFullName, id, is_included, is_pseudo, isEscaped, name, new_num, omgPrefix, printClassComment, printIdMethod, printImport, set_name, set_pseudo, set_token, setPrintPhaseNames
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

max

public ConstExpr max
Constructor Detail

SequenceType

public SequenceType(int num)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class TypeSpec

setEnclosingSymbol

public void setEnclosingSymbol(IdlSymbol symbol)
Overrides:
setEnclosingSymbol in class TypeSpec

typeSpec

public TypeSpec typeSpec()
since the sequence type's name depends on a declarator given in the typedef, the name varilabe has to be set explicitly by the TypeDef object before this sequence type can be used.

Overrides:
typeSpec in class TypeSpec

setPackage

public void setPackage(java.lang.String pkg)
Overrides:
setPackage in class TypeSpec

length

public int length()
Specified by:
length in class VectorType
Returns:
the length of this array or sequence. For multi-dimensional vectors, this is the outermost dimension. For open sequences, this length is 0.

getTypeCodeExpression

public java.lang.String getTypeCodeExpression()
Overrides:
getTypeCodeExpression in class TypeSpec
Returns:
a string for an expression of type TypeCode that describes this type

getNumber

public static int getNumber()

printReadStatement

public java.lang.String printReadStatement(java.lang.String var_name,
                                           java.lang.String streamname)
We have to distinguish between sequence types that have been explicitly declared as types with a typedef and those that are declared as anonymous types in structs or unions. In the latter case, we have to generate marshalling code in-line because there are no helpers for anonymous types

Overrides:
printReadStatement in class TypeSpec

printWriteStatement

public java.lang.String printWriteStatement(java.lang.String var_name,
                                            java.lang.String streamname)
Overrides:
printWriteStatement in class TypeSpec

holderName

public java.lang.String holderName()
Specified by:
holderName in class VectorType

helperName

public java.lang.String helperName()
Specified by:
helperName in class VectorType

className

public java.lang.String className()

parse

public void parse()
The parsing phase.

Overrides:
parse in class TemplateTypeSpec

full_name

public java.lang.String full_name()
Returns:
fully scoped IDL identifier

print

public void print(java.io.PrintWriter out)
Overrides:
print in class TypeSpec

printInsertIntoAny

public void printInsertIntoAny(java.io.PrintWriter out,
                               java.lang.String anyname,
                               java.lang.String varname)
Description copied from class: TypeSpec
Prints the java-commands to insert the variable varname into the Any anyname

Overrides:
printInsertIntoAny in class VectorType
Parameters:
out - Stream, the commands shall be written to
anyname - Name of the Any into which the variable shall be inserted
varname - Name of the variable which shall be inserted

printExtractResult

public void printExtractResult(java.io.PrintWriter out,
                               java.lang.String resultname,
                               java.lang.String anyname,
                               java.lang.String resulttype)
Description copied from class: TypeSpec
Prints the java-commands to extract the contents of the Any anyname into a variable resultname with the type resulttype

Overrides:
printExtractResult in class VectorType
Parameters:
out - Stream, the commands shall be written to
resultname - Name of the result variable
anyname - Name of the Any holding the result
resulttype - Type of the result variable