Variable name for an ArrayList

is there any way of giving an Arraylist a variable name if it was to be in some kind of loop eg:
int index = 0;
while(index < 10) {
String name = "Array" + index;
Arraylist value of name = new ArrayList();
index++;
which would produce 10 arrays with name, Array0, Array1, ..., Array9.
is that possible?
Thanks

sorry, i managed to post this twice so please ignore this one.
thanks

Similar Messages

  • Dynamic Variable name (for int/long) from a String variable

    Hi,
    I want to give a int/long variable name from a String.
    for ex.
    String str = lookup + "Id";
    lookup is a String variable coming from XML. Now, for instance lookup="name". So str = "nameId".
    Now I want to create a int/long variable by nameId.
    Could anybody tell me the way how to do. Please don't tell to use MAP.
    Edited by: Shah on Dec 5, 2007 3:26 PM

    Well you can't. Use a Map.
    The compiler translates variable names into slot numbers, either within an object or withing the local "stack frame" and these slot numbers are assigned names at compile time. No new slots can be created at run time. Java is not Basic.
    Reflection allows you to find existing field names and methods (not local variables), so it's possible to map, for example, XML attribute names to field names or setters in an object but the names have to be known at compile time.

  • Need Selection variable name for "System Year - 1"

    Hi All,
    I have Fiscal Year field in the selection screen of a custom program. The value of this field comes from system variable.
    I need to create a variant where this fiscal year should have the value "Current year - 1".
    This has to be done using Selection Variable. Currently there is no such variable in the F4 help (TVARV table).
    Please tell me if there is a way to get such a selection variable...

    Hi Tolga,
    The selection screen parameter is defined as:
    parameters: p_gjahr        type gjahr obligatory memory id gjr,
    I cannot use the FM in the AT SELECTION SCREEN ON VALUE-REQUEST.
    When you create a variant for the program.. click button "Variant Attributes" - Here the checkbox for Selection variable is ticked for this field. Now click "Selection Variables". here we can provide the variable name which comes from TVARV table.
    I need this Selection variable. I am not allowed to do any program changes.

  • Using variable name for Netstream Publish() (actionscript)

    Relatively new to Actionscript.  In the netstream publish() or play() methods, can I pass variable names to the methods instead of hard-coding the stream name?
    Example:
    private function publishLiveStream():void
                ns = new NetStream(nc);
                ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                ns.client = this;
              // blah blah other stuff...
               ns.publish("thefilename", "record");
    I want to replace "thefilename" with a value passed from an input box or use dynamic naming (i.e. current date & time).

    you can use in procedure using sunopisis technology
    OdiExportMaster "-TODIR=/temp/" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    or you can use (unix System)
    OdiExportMaster "-TODIR=/#v_FileName" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    Hope it will work
    Thanks

  • System variable name for email field.

    Hi
    Can anyone give me the system name for the email field,
    eg username is &APP_USER.
    Thanks
    Fiona

    Fiona - John's suggestion is to use a PL/SQL API call to get the email_address attribute from the wwv_flow_users record for a user account. There is no corresponding substitution string but you could create an item in your application and set it using this API. Keep in mind that this applies only to APEX user accounts, i.e., if you're using other authentication methods such as LDAP, SSO, Database Account, or custom tables, then the email_address will not be accessible using the API.
    Scott

  • Using variable names for object names

    Is there any way you can use a String variable to name an object? I.e., something like:
    String name = "objectName";
    \\ create an Image object named objectName
    Image (name.valueOf()) = new Image();
    This code obviously does not work, but I'm working on a map applet which uses a map composed of thousands of tiles, and then shows only a portion of the map by drawing the appropriate tiles into the window using the x/y coordinates and a nested for loop to determine which tiles to draw. However, unless I want to manually declare and then call each of these Image objects, I need to have a way to have the actual name of each image object be a reference to a variable, which I will then initalize according to the name of the tile I'm using. Does that make sense at all? Anyway, I was just wondering if anyone knows of any way to do this. Thanks.
    -Ari

    Typically this is done using a Collection, for example:
    Image[] img = new Image[100];
    for (int i=0; i<img.length;i++)
      img[i] = new Image();... Sort of thing.

  • Using variable name for target dir in OdiExportMaster tool

    Hi
    I am using OdiExportMaster tool to export master repo on daily basis as backup. But for the target directory option in the tool, I am not able to use a variable (variable fetches the directory path from a pl/sql table).
    Please provide a solution for this.
    Thanks,
    Divya

    you can use in procedure using sunopisis technology
    OdiExportMaster "-TODIR=/temp/" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    or you can use (unix System)
    OdiExportMaster "-TODIR=/#v_FileName" "-ZIPFILE_NAME=export.zip" "-XML_CHARSET=ISO-8859-1" "-JAVA_CHARSET=ISO8859_1" "-EXPORT_VERSIONS=YES"
    Hope it will work
    Thanks

  • Variable name for Internal table

    Hi Folks,
    For a report i am passing a parameter. This parameter name is then used to read data using "IMPORT from database" statement from cluster.
    Now I need to copy this data into another internal table. How do I do that? e.g. what would be the syntax?
    Thanks...
    Munish

    Hi Rainer,
    Thanks for replying!
    I was passing a parameter (no-display) to a report from another report.
    I am using field-symbol and it solved the problem.
    Regards,
    Munish

  • Need help generating variable name for timeout object

    Below is a function I am using to scale an object down and
    then hide it. It works fine on just one object, but if I try to run
    it on multiple objects at the same time, only the last object gets
    scaled down. I believe this is because the timeout list only ever
    has a single item in it, “ShrinkTimeOut”.
    Does each entity in the timeout list need a distinct name?
    And if so, how would I dynamically generate a name and save it so I
    can kill the timeout object once the object has scaled down fully?

    > Does it look like I am getting rid of the timeout object
    properly in my code?
    Now that you mention it, and I have a look, no - it doesn't:
    //not sure of the order of parameters here:
    function fShrinkLoop(mModel, aTimeout) {
    //Creates a variable that contains the vector value of the
    model's
    scale (vector( 1.0000, 1.0000, 1.0000 )).
    nScaleVector = mModel.getPropRef("transform").scale;
    //Checks to see if the model is 1% or less than its original
    size.
    if (nScaleVector[1]<=0.01) {
    //Makes the model invisible.
    mModel.visibility = symbol("none");
    //Kills the timeout object.
    aTimeout.forget();
    } else {
    //If it is not, we scale the model down further and allow
    the loop to
    repeat.
    mModel.scale(0.9);

  • Copy and paste without keeping variable names

    Is it possible to copy and paste frames without keeping the
    same variable names for pieces inside of those frames. something
    like replication without duplication

    isn't there a way to copy and paste text so that it takes the attributes of the recipient appThis is down to the "recipient app" to implement. For example, TextEdit has "Paste and Match Style" which does what you want. Microsoft Word has "Paste Special …" with various options. I don't know Filemaker, so don't know what is on the "Edit" menu.

  • Querying, then generating ArrayLists with variable names

    Hi, all:
    I have two problems: first, I want to run through an array list called nodeList containing Nodes, each of which possesses a 5-digit value called culture. I want each Node to try to find out whether or not there are any other Nodes that have the same culture value that it does, i.e. if Node i has culture value 74936 and there are 4 other Nodes with the same culture value, I need to find 5 total Nodes with culture value 74936.
      public void statistics(){
           for (int i = 0; i < nodeList.size (); i++) {
                Node node = (Node) nodeList.get (i);
                int cultSame = node.getCulture();
                boolean same = cultSame == next.cultSame;
                if (same == true){
                     arrayListCreator();
                     //generated Arraylist add.node;
      }I'm going astray at next.cultSame. I'm not sure how to structure the query to the ArrayList nodeList to find all the other Nodes with the same culture value.
    Second: I want to create a little method to generate ArrayLists with names based on the integers that will be stored in them. Here's the method so far:
      public void arrayListCreator () {
           String name = String.valueOf(cultSame);
           name = new Arraylist();
      }cultSame is a 5-digit integer. The ArrayLists will be used to store all the nodes with the same cultSame value, like 74936, or whatever. If the ArrayList is storing nodes with the cultSame value of 74936, I want the name of the ArrayList to be the string 74936. I want to call on this method (like you can see in the first method) to generate the ArrayList with its given name and then use it to store the nodes in it. Once I've done that, I can figure out the statistics stuff on my own, I think. I'm just not sure how to create the ArrayLists with a name that's a variable, i.e. "name" should be the string variable containing a 5-digit number.

    Nquirer101 wrote:
    I probably should have separated this out into two threads. First, I'd like to know what I'm doing wrong when I'm building that boolean query to find out in the nodeList if any of the other nodes have the same culture value as the node doing the querying.Then by all means do so, from the looks of it, the scope of the thngs that need to be discussed/addressed is too broad for one thread. First there's the issue of your erroneous understanding of variable, then there's the concept of the Map data structure, then the implementation of it in Java, along with the idea of interface

  • Variable subsitution for target file names

    Hi All,
    I am using variable subsitution for dynamic file names. I am using the multimapping for multiple files in the target.So i coluld not able to use the dynamic configuration for file names. Now i want to replace all the spaces in the filename to underscore.
    For example
    My payload filed value "file name in the target file".
    Now my filename  "file_name_in_the_target_file".
    How to achieve this using Variable subsitution.
    Regards,
    Ramalakshmi.G

    Use replaceString Function.
    file name
    Constant (" ")               --> replaceString -------> TargetField
    Constant ("_")
    Regards
    Ramesh

  • ORA-04054 : using variable substitution for the database link name

    Hi,
    I need to use variable substitution for the database link name.
    Here is my command :
    declare
    GET VARCHAR2(50);
    begin
    select OIA_GET_DESIGNATION into GET from INFODRI.OMA_IN_ARTICLES;
    for rec in (select * from [email protected]_GET_DESIGNATION)
    LOOP
    dbms_output.put_line('TEN_CODE vaut : '||rec.ten_code);
    END LOOP;
    exception
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERREUR ORACLE DETECTEE : '||rec.OIR_CUR);
    DBMS_OUTPUT.PUT_LINE('Message Erreur : '||SUBSTR(SQLERRM,1,245));
    :crd := -1;
    end;
    When I run this programm, I receive the error :
    ORA-04054: database link REC.OIA_GET_DESIGNATION does not exist
    When I replace :
    for rec in (select * from [email protected]_GET_DESIGNATION)
    by :
    for rec in (execute immediate 'select * from tensions@'||rec.OIA_GET_DESIGNATION)
    I receive the error :
    PLS-00103 : Encountered the symbol "IMMEDIATE" while parsing.
    What can I do to resolv my problem ?
    Regards,
    Rachel

    What is the name of the DB Link and the name of the object you are selecting
    from?
    I find it easier to create a view on the remote object then use that in selects.
    e.g,
    Link Name = MyLink
    Object_name = Addr_Loc
    create or replace VIEW Rem_Addr_Loc AS
    select * from addr_loc@mylink;
    In the code I then use the view
    begin
      for C_Rec in (select * from Rem_Addr_loc)
      loop
         dbms_output.put_line('Rec: '|| C_Rec.Col1);
      end loop;
    end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Using contents of a String as the name for a variable

    I'm trying to write code that will evaluate the contents of a String variable and then use the contents as the name for an object. For example, my program will create an unknown number of Student objects. I would like to name the Student objects student1, student2,... . In the code below, how do I get the last line of the method to create a new Student called something like "student3" instead of "varName"? Thanks, Julie
    int numberOfStudents= 0;
    public void createStudent()
       numberOfStudents++;
       String varName = "student" + numberOfStudents;
       Student varName = new Student();
    }

    The name of the reference variable is irrelevant to the functional aspect of the application. The 'Name' should be a property of the student class. EG
    class Student {
    private String name;
    public String getName() { return name; }
    public void setName() { this.name = name; }
    public Student() { this(null); }
    public Student(String name) { setName(name); }
    now your code becomes
    public void createStudent() {
    numberOfStudents++;
    Student newStudent =
    new Student("student"+numberOfStudents);
    // now do something with the new student...
    If you're expecting to use the 'Student' instance outside of this method you need to store a reference to it somewhere more accessible (like a field, in a list or an array) or return the reference from this method...

  • How to Search for Variable Name in an Apex Page

    Hi,
    Whenever I am writing code and I need to remove a reference to a variable name, I just to a search and replace on the source.
    With Apex, is there a way to do that on the Apex page definition? I have click on every validation, process, report to comb each region for the variable reference. Thanks.

    Hi Samuel,
    Have a look at the APEX views ( Utilities > APEX Views ).
    You can select most (all?) of the information associated with a page and then search the result set(s) for the variables you are looking for.
    I hope this helps.
    Cheers,
    Patrick Cimolini

Maybe you are looking for

  • How can I delete movies from my iPad that it thinks are in the cloud?

    I noticed that I was running out of space on my 32 GB iPad Air running iOS 7.1, so I looked at my pictures and moved them to iCloud and then deleted most of my un-used apps. This did not help in the gaining back a ton of space. So I looked at my vide

  • Printing with HP Laserjet 5L

    Cannot print more than 1 time with HP Laserjet 5L unless I reboot machine (which is very inconvenient). Additional print job(s) will queue up but will take forever to spool and eventually after about 30 minutes it quits trying. I know printer is old

  • Table data change logs

    Hi,    I have created a customer table. I want to log the data changes in the table. So in the technical settings of the table i have checked log data changes checkbox. When i tried to see the change logs using transaction SCU3, the logs are not avai

  • Work flow object  type for purchase requisition

    hello anji reddy    u asked me to create a Customer Task in PFTC and assign this object and a Method  and define a triggering event etc for the workflow to get triggered,but in the triggering events there is no create event in it,so how and where sho

  • ITunes always crashes on startup

    iTunes has recently started crashing whenever I start it up. I haven't made any changes to my system that I can think of, and I don't recall the last time I DLed and installed an iTunes application update. (I'm currently running iTunes 9.0.2.) So I'm