Clear definition+examples- type variable, type parameter and type argument

I am trying to fully understand the terms like type variable, type parameter and type argument as they apply to generics. Can anyone please give the exact definition and example of each of these terms. Also how these terms relate to the classes/interfaces in language model APIs of Java 6.

http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html

Similar Messages

  • Object type variable - Help !

    Hi
    I want to achieve following outcome:
    Create a object type e.g.
    CREATE TYPE employees AS OBJECT (
    employee_id NUMBER(6),
    first_name VARCHAR2(20)
    Then create a table type e.g
    CREAT TYPE emp_table AS TABLE of employees;
    So far so good.
    Now I want to declare a variable of emp_table type in my
    procedure and then populate it using a select clause.
    Something like this:
    my_employees emp_table;
    insert into my_employees select id, name from table1 where id < 50;
    Where table1 is some permanent table in my database.
    I am not able to figure out how to achieve this.
    I dont want to create a permanent table in my database for this.
    I want to keep this table type variable in memory and discard it at the end
    of the procedure.
    Please help
    Regards
    Madhup

    BULK COLLECT INTO
    http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm#28329
    SQL> CREATE TYPE employees AS OBJECT (
      2  employee_id NUMBER(6),
      3  first_name VARCHAR2(20)
      4  );
      5  /
    Type created.
    SQL> CREATE TYPE emp_table AS TABLE of employees;
      2  /
    Type created.
    SQL> declare
      2   my_employees emp_table := emp_table();
      3  begin
      4   select employees(empno,ename) bulk collect into my_employees from emp;
      5  end;
      6  /
    PL/SQL procedure successfully completed.Rgds.

  • Lightroom 4, Suitcase and type management.

    Hello, all.
    I have started to use the new Lightroom 4 and the new book feature. Considering books use type for their design and type is also used when in the print module to print photos, how exactly does Lightroom manage fonts?
    The folks at Extensis (i.e. Suitcase) don't see to know too much about Lightroom and don't have a plug-in for it. I am currently running CS5 and Suitcase has plug-ins installed for Photoshop (extended, in my case), InDesign and Illustrator.
    Aside from manually activating the fonts I intend to use in Suitcase (which is a much less practical option when you have a large font library), is there another way to handle fonts in Lightroom 4?
    1. Can or does Lightroom use the same plug-in installed for Photoshop ?
    2. Can Lightroom be configured so that it points to the Photoshop plug-in in its native location?
    3. In this case, would the same plug-in used for Photoshop also work for Lightroom?
    4. Assuming the above would not work, could the Photoshop plug-in be copied to the location where the plug-ins for Lightroom as to be located and, in this case, would this plug-in work?
    Thank you in advance.

    Hi, Jim.
    Thanks for your help and reply to my post.
    As a long time user of Suitcase I was surprised to find out about this feature. What a good feature.  It is extremely useful and a way to have fonts activated according to the application you are using.
    In my case I have numerous fonts (certainly more than a thousand) so it isn't always easy to know ahead of time what fonts I will be using with a specific application or project. The auto-activation feature in Suitcase makes this process easy. Do you think Extensis may be releasing a plug-in for Lightroom 4 in the near future to allow this application to use its auto-activation feature ?
    Thank you again for your help and for letting me know about the Application Set feature.

  • The types of the parameter field and parameter field current values are not compatible.----

    HI,
    I am attempting to set report parameters in my .jsp code via URL parameters.
    I am able to set the report name, server connection dynamically however when attempting to set the Parameters I receive:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException: The types of the parameter field and parameter field current values are not compatible.---- Error code:-2147213303 Error code name:invalidParameterField
    The parameter on the report is a String Type, named for this example p1.
    The value that p1 represents is LERAD
    My code:
    String stringValue = request.getParameter("p1");
    CRJavaHelper.addDiscreteParameterValue( clientDoc, "","p1", stringvalue);
    returns the above mentioned error.
    I have tried:
    String stringValue = (String)request.getParameter("p1");
    which returns the above error
    And;
    String stringValue = new String(request.getParameter("p1")).toString();
    which returns
    java.lang.NullPointerException
    java.lang.String.<init>(Unknown Source)
    org.apache.jsp.callReport_jsp._jspService(callReport_jsp.java:105)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    I notice that the CRjavaHelper.java declares this addDiscreteParameterValue as accepting an Object type for the newValue.
    Any ideas???

    Hi,
    nevermind.
    case sensitivty strikes again.
    my URL param was P1 ( case sensitive)

  • [svn] 4136: Find loop variables initialized with "weak" types, e.g., NULL or VOID, and

    Revision: 4136
    Author: [email protected]
    Date: 2008-11-18 14:50:38 -0800 (Tue, 18 Nov 2008)
    Log Message:
    Find loop variables initialized with "weak" types, e.g., NULL or VOID, and
    use the variable type used within the loop to normalize the local's type.
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/adobe/abc/GlobalOptimizer.java

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • How can I have both date and time for a Date type variable?

    If I have a Date type variable: Date today=new Date(), Is it possible to also give the current time to "today" but still keep the type as Date?
    I mean , for exmaple I want to store this "today" to database as Date type, and the value in database is "2007-05-05 13:30:13". I do not want to use SimpleDateFormat to do that, because I want to use Date type not String. Is that possible? how to implement this?

    I'd say he means you should use Timestamp to store
    the time value, because that's what it's there for.
    Because java.sql.Date is defined not to store a
    time value.Correct. The OP should read the Javadoc for java.sql.Timestamp.

  • How can I copy and paste a local variable into a custom type?

    I have a container variable that I want to copy and paste into a custom data type. So I open TestStand's Type window, expand Custom Data Types then right click on <Right click to insert Type> and the Paste option in my popup menu is disabled. How do I get my exact data type there?
     

    Hi
    A workaround :
    Create a container type in the custom data types.
    Under that i could copy the container.
    Hope it helps.
    Ravi

  • How to access the Custom Data type variable given in Expression edit control To and From LabVIEW

    Hello, I would like to know how to access the custom data type variable given in the Espression Edit Control from LabVIEW and vice-versa
    Say, the FileGlobals.Reference_Handle (Custom Data Type Variable) contains the
    VISA I/O session (Which in turn contains VISA_DeviceName: String, Session: Number),
    Channel1: Number and
    Channel2: Number
    I am expecting the user to give FileGlobals.Reference_Handle as the input at the ExpressionEdit Control in the edit screen of the VI Call.
    I would like to know how to get the values of this custom data type to LabVIEW?
    Say, if I have the Cluster in LabVIEW like VISA I/O session (Deive Name and Session Number), Channel1 and Channel2
    how do i need to set this cluster to the Custom Data type variable in TestStand?
    Thanks and Regards
    Prakash 

    Hi,
    TestStand to LabVIEW: i didnt understand what you r trying to achieve. But if you are using references, Use Property nodes and Invoke nodes to achieve what you want in LabVIEW.
     LabVIEW to TestStand: check the image below: You need to click the button next to 'container'. I have used a cluster output in the VI.
    Hope this helps
    .......^___________________^
    ....../ '---_BOT ____________ ]
    ...../_==O;;;;;;;;_______.:/
    Attachments:
    1.JPG ‏187 KB

  • Why my iphone produces a bug after it renew for OS5.1.1. The bug is when I use message, type a Chinese word, and then using a releveant word, then the program automately closes. Every time I try the same procedure, it definitely closes.

    Why my iphone produces a bug after it renew for OS5.1.1. The bug is when I use message, type a Chinese word, and then using a releveant word, then the program automately closes. Every time I try the same procedure, it definitely closes.

    Nobody knows? Not even administrators?
    Please it would be really nice to have help on that to take all the benefit of the remote app.
    Thank you very much in advance.

  • Java and a double type variable

    Hello.
    I?m having problems with double type variables.
    code:
    public class Java{
    public static void main(String[] args){
    double s =0.00;
    for(int i=0; i<10; i++){
    s+=0.01;
    System.out.println(s);
    it prints the following
    0.01
    0.02
    0.03
    0.04
    0.05
    0.060000000000000005
    0.07
    0.08
    0.09
    0.09999999999999999
    dont get it why 0.05+0.01 = 0.060000000000000005 ?

    hightech wrote:
    is bug!?!!?!to the original poster, this answer is not only incorrect but it is quite possibly deliberately misleading from a known forum troll. Please ignore it.

  • Me and type ref

    hi all,
    i read the book written by dr horst keller and sascha kruger "abap objects" with confusion on the below script. really hope can get the help.
    1) confused 1, why creator has no create object and only create reference variable? why no need to create instance of client class?
    2) confused 2. why only me? me means everything(attribute/method) of client class? why not define as me->name just like in confused 4?
    3) why creator no create object also can creator->name?
    report self_reference.
    class client definition.
    public section.
    data name(10) type c value 'master' read-only.
    methods create_server.
    endclass.
    class server definition.
    public section.
    methods acknowledge importing creator type ref to client.  "confused 1
    private section.
    data name(10) type c value 'servant'.
    endclass.
    class client implementation.
    method create_server.
    data server_ref type ref to server.
    create object server_ref.
    call method server_ref->acknowledge exporting creator = me. "confused 2
    endmethod.
    endclass.
    class server implementation.
    method acknowledge.
    data name type string.
    name = creator->name.                   "confused 3
    write: me->name, 'created by', name.  "confused 4
    endmethod.
    endclass.
    data client_ref type ref to client.
    start-of-selection.
    create object client_ref.
    call method client_ref->create_server
    the output is "servant created by master".

    hi,
       i will explain your confusion along with your example...
    report self_reference.
    class client definition.
    public section.
    data name(10) type c value 'master' read-only.
    methods create_server.
    endclass.
    class server definition.
    public section.
    methods acknowledge importing creator type ref to client. "confused 1
    private section.
    data name(10) type c value 'servant'.
    endclass.
    class client implementation.
    method create_server.
    data server_ref type ref to server.
    create object server_ref.
    call method server_ref->acknowledge exporting creator = me. "confused 2
    endmethod.
    endclass.
    class server implementation.
    method acknowledge.
    data name type string.
    name = creator->name. "confused 3
    write: me->name, 'created by', name. "confused 4
    endmethod.
    endclass.
    data client_ref type ref to client.
    start-of-selection.
    create object client_ref.
    call method client_ref->create_server
    the output is "servant created by master".
    confusion 1:
    Normaly while creating an object we have to create a reference variable to class and then create the instance of the class with 'Create Objec' statement, but in this example we are passing a parameter creator of type client is sent to acknowledge method of server class. Here the parameter  creator is sent as an reference variable which means that the object is already created and just an reference to that variable is sent to the method acknowledge.
    confusion 2:
    here 'me' is a self reference variable of a class. It does not mean an attribute or methods of a class, it denotes the object of the class itself in which it is referenced. Normally the 'me' is used for self reference inside the class methods for refering to attributes or methods of the same class.
    eg: me->attrib1 or call method me->method1
    confusion 3:
    An ABAP class has two parts namely a defenition part and an implementaion part. The defenition part of the class contains all the attributes and declaration of the methods, whereas the implementation part contains the actual implementation of methods i.e., defenition of methods. In simple words, the defenition part of the class contains the methods name and what are the parameters like exporting, importing, changing,exceptions, etc., whereas the implementation part contains actual functionality of the method.
    As i have already stated that the parameter passed to the method are passed as reference variable, there is no need for creating object seperately and just an reference to already exisiting object is passed as parameter.
    so we can obtain the value of the attribute 'name' by means of the reference variable creator which gives the value of the client object.
    confusion 4:
    'me' is a self reference variable which is nothing but a reference to the same class, so me->name refers to the attribute name of the server class.

  • Determine class type of Generic Parameter (not via getGenericSuperclass()!)

    I need to know the class type of a generic Parameter. Please imagine this class:
    class MyGenericClass<T>
    }In cases where other classes derived from MyClass and defined the generic parameter (like MyDerivedClass extends MyGenericClass<String>),
    this snippets works just fine:
    (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];But now I have no inheritance but the definition of the type parameter via instantiation:
    MyGenericClass<String> entity = new MyGenericClass<String>();The method "getGenericSuperclass()" does not suit my needs because it does not target the actual class. Nor can "getTypeParameters() " help me...
    After countless trying to retrieved the type information, I still have no clue how to determine for that case that (in my example) the type parameter
    is a 'String'.
    Does anyone know the solution?

    Serethos_0 wrote:
    Sure I could pass the class type itself as parameter to be stored in 'exportClassType'. But I only tried to adapt the idea used e.g. in Generic DAOs
    as descibed here: [http://community.jboss.org/wiki/GenericDataAccessObjects]. The big difference is, that in the Generic DAO example the typed
    information is available within the class definition ..
    Besides that I am open for any other suggestion!I would recommend passing around the Class object as you say.
    Some might suggest that you make MyGenericClass abstract, forcing any instantiation to be like this:
    MyGenericClass<String> entity = new MyGenericClass<String>() {};That would indeed cause the String type parameter to be available at runtime, since you're creating an anonymous inner class. But it leads to a convoluted and extremely statically expensive instantiation pattern. Using the class object is a better solution IMO.

  • Splitting and type casting huge string into arrays

    Hello,
    I'm developing an application which is supposed to read measurement files. Files contain I16 and SGL data which is type casted into string. I16 data is data from analog input and SGL is from CAN-bus data in channel form. CAN and analog data is recorded using same scan rate.
    For example, if we have 6 analog channels and 2 CAN channels string will be (A represents analog and C represents CAN):
    A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 .... and so on
    Anyway, I have problems reading this data fast enough into arrays. Most obvious solution to me was to use shift registers and split string in for loop. I created a for loop with two inner for loops. Number of scans to read from string is wired to N terminal of the outermost loop. Shift register is initialized with string read from file.
    First of the inner loops reads analog input data. Number of analog channels is wired to its N terminal. It's using split string to read 2 bytes at a time and then type casts data to I16. Rest of the string is wired to shift register. When every I16 channel from scan is read, rest of the string is passed to shift register of the second for loop.
    Second loop is for reading CAN channels. It's similar to first loop except data is read 4 bytes at a time and type casted to SGL. When every CAN channel from scan is read, rest of the string is passed to shift register of the outermost loop. Outputs of type cast functions are tunneled out of loops to produce 2D arrays.
    This way reading about 500 KB of data can take for example tens of seconds depending on PC and number of channels. That's way too long as we want to read several megabytes at a time.
    I created also an example with one inner loop and all data is type casted to I16. That is extremely fast when compared to two inner loops!
    Then I also made a test with two inner loops where I replaced shift register and split string with string subset. That's also faster than two inner loops + shift register, but still not fast enough. Any improvement ideas are highly appreciated. Shift register example attached (LV 7.1)
    Thanks in advance,
    Jakke Palonen
    Attachments:
    String to I16 and SGL arrays.vi ‏39 KB

    OK, there is clearly room for improvement. I did some timing and my two above suggestions are already about 100x faster than yours. A few teeaks led to a version that is now over 500x faster than the original code.
    A few timings on my rather slow computer (1GHz PIII Laptop) are shown on the front panel. For example with 10000 scans (~160kB data as 6+2) my new fastest version (Reshape II) takes 14 ms versus the original 7200ms! It can do 100000 scans (1.6MB data) in under 200 ms and 1000000 scans (15MB data) in under 2 seconds.
    I am sure the code could be further improved. I recommend the Reshape II algoritm. It is fastest and can deal with variable channel counts. Modify as needed.
    Attached is a LabVIEW 7.1 version of the benchmarking code, containing all algorithms. I have verified that all algorithms produce the same result (with the limitation that the cluster version only works for 6*I16+2*SGL data, of course). Remember that the reshape function is extremely efficient, because it does not move the data in memory. I have some ideas for further improvements, but this should get you going.
    Message Edited by altenbach on 08-05-2005 03:06 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    StringI16SGLCastingTimer.png ‏48 KB
    StringtoI16andSGLArraysMODTimer.vi ‏120 KB

  • How can we execute a procedure with object type as its parameter, by passing partial elements.

    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.

    user13026549 wrote:
    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.
    It ISN'T possible. How could it be? Each attribute has to be set to something don't you think?
    A common way to handle that is to define a public package variable that is an instance of the object type and has ALL elements set to null. As Odie suggested a custom constructor function can be used for that.
    Then you create your procedure instance by starting with an instance of the package variable (where everything is null) and setting values for the attributes you need.

  • Dynamic type variables

    I have a function module that receives a table name, in a character variable.
    How do I create a variable, within the function, of the type of the parameter-passed table ?
    I've been trying with field-symbols and create data, but without success.
    Could anyone show me an example please?
    Thanks
    Avraham

    Hi Avraham,
    maybe this helps:
    data: lt_table type ref to data.
    create data lt_table type standard table of ('SFLIGHT').
    With create data you can achieve what you need.
    Then analyze the fields in the table and use it with that information.
    here you will want to look at classes cl_abap_typedescr, cl_abap_tabledescr and cl_abap_structdescr.
    Hope that helps,
    Lutz
    Edited by: Lutz Morrien on Oct 29, 2008 11:18 AM

Maybe you are looking for

  • How to migrate a suspended domain from one server to another?

    I am using oracle vm server 2.2.2 and i am trying to create the disaster recovery strategy for my environment Initially i have successfully paused the vm VM1 using the "xm save VM1 suspended_file " command and save the memory to a file named suspende

  • Creating a timed intro page

    Is it possible in dreamweaver to create a web page with a timer limit on it? Basically, I have a website, but I would like to create page, that when you enter a URL, it will go to this intro page, and then jump to the website after a certain time, or

  • Placing table in layout from the dynamically generted XML

    Hi          I have created an xml & Tags (for table, inside indesign dynamically), I want it should be converted to table when I place it in layout.When I try to place it on layout only tagged text is displayed no table is created. And when I export

  • Kann ich die Entwickelten RAW aus Ligtroom 5 in Photoshop Elements  11 weiter bearbeiten?

    Hallo, ich besitze bereits Elemnts 11 und überlege mir Lightroom 5 für die RAW Entwicklung zu kaufen. Kann ich die Entwickelten RAW ( NEF weil ich eine Nikon besitze) anschließend auch in Photoshop Elements 11  öffnen? In der Version Ligtroom 3 gab e

  • Raw images not working

    I just started shooting raw all the time, but I imported them, and aperture says that it is an unsupported file format. I have updates for everything, but it still wont work. Any ideas would be great! Thanks