Names Based On A Counter

I have a programme which utilises several "for" loops.
In one case I create a varying number of objects based on user input. For this I use a "for" to assist in naming each object. The start of this code is as follows.
for(int counter=0; counter<numPoints; counter++)
Column pointcounter= new Column(tempX,tempY);
this works fine and names the objects point1,point2 etc.
I'm now trying to use the same method to indicate which method I want to use in a class. The glass has three get methods getR1, getR2 & getR3. I'm trying to use a similar loop to indicate which method I want to call. This is the code I'm using
for (int counter=1;counter<4;counter++)
tempTotal=tempTotal+(matrix1[counter1].getRcounter()*arrayWorkingPoints[counter2].getRcounter());
I'm using .getRcounter to indicate whether it is getR1, getR2 or getR3 I want to call. This however throws an error stating that the method getcounter cannot be found in the class.
Why is that? why will it work fine in the first instance I have described but not the second?
TIA
Curlydog

I have a programme which utilises several "for"
loops.
In one case I create a varying number of objects based
on user input. For this I use a "for" to assist in
naming each object. The start of this code is as
follows.
for(int counter=0; counter<numPoints; counter++)
Column pointcounter= new
ounter= new Column(tempX,tempY);
this works fine and names the objects point1,point2
etc.How did you verify that this works fine? To the best of my knowledge this will not do what you want it to. This will create a new Column object referenced by pointcounter for each cycle.
>
I'm now trying to use the same method to indicate
which method I want to use in a class. The glass has
three get methods getR1, getR2 & getR3. I'm trying to
use a similar loop to indicate which method I want to
call. This is the code I'm using
for (int counter=1;counter<4;counter++)
tempTotal=tempTotal+(matrix1[counter1].getRcounter()*a
rayWorkingPoints[counter2].getRcounter());
I'm using .getRcounter to indicate whether it is
getR1, getR2 or getR3 I want to call. This however
throws an error stating that the method getcounter
cannot be found in the class.Use the Reflection API to get a Method object. You can find more information here.
http://java.sun.com/docs/books/tutorial/reflect/index.html
>
Why is that? why will it work fine in the first
instance I have described but not the second?
TIA
Curlydog

Similar Messages

  • How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?

    Greetings all,
    I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
    We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
    The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
    For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
    There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
    I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
    PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
    var myPresets = app.pdfExportPresets.everyItem().name;
    myPresets.unshift("- Select Preset -");
    var myWin = new Window('dialog', 'PDF Export Presets');
    myWin.orientation = 'row';
    with(myWin){
        myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
        myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
        myWin.myPDFExport.selection = 0;
        myWin.btnOK = add('button', undefined, 'OK');
    myWin.center();
    var myWindow = myWin.show();
    if(myWindow == true && myWin.myPDFExport.selection.index != 0){
        var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
        myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
        if(myFile != null){
            app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
        }else{
            alert("No File selected");
    }else{
        alert("No PDF Preset selected");
    So far my code does the following:
    1) Runs the Multi-Page PDF Import Script
    2) Runs PDF Export Script Above
    3) Toggles the Template
    4) Runs #2 Again
    5) Deletes the imported PDF and all pages and toggles template again.
    It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
    Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!

    If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
    Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
    It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.

  • How to create folder names based on Excel values or Txt files?

    Hi there,
    I often need to create large numbers of folders based on names I have saved in an Excel spreadsheet. I know in windows there is a way to create a macro within excel that automatically generates folder names based on cell values.
    I was therefore wondering how to do the same on a Mac operating system. The main thing is to find a way to automate the process. I understand this may involve copying the values to a text file.
    Below is an example of the names I need to create folders for (copied from the excel spreadsheet):
    Wash Bowl Small 600
    Deck Mounted Wash Bowl 500
    Wash Basin - 866 - 2 Shelves
    Wash Bowl Large 800
    Built-In Wash Basin With 1-Taphole
    Deck Mounted Wash Bowl 625
    Would really appreciate a simple step by step approach to an explanation. As my understanding of using Automator, Apple Script, Terminal, etc, is extremely basic.
    Thanks and Best Wishes,
    Graham

    Hi Niel,
    Thanks again for another superb response. I have another question. Is it possible to automatically generate sub-folders along with the folder.
    For example:
    Folder                                                Subfolder
    Wash Bowl Small 600          >            2D CAD
                                                               3D CAD
                                                               BIM
                                                               Images
                                                               Brochures
                                                               Specifications
                                                               Technical
                                                               Case Studies
                                                               Operations
    Deck Mounted Wash Bowl 500    >   2D CAD
                                                              3D CAD
                                                              BIM
                                                              Images
                                                              Brochures
                                                              Specifications
                                                              Technical
                                                              Case Studies
                                                              Operations
    Above shows the 9 generic sub-folders I need to create within each folder that is generated.
    Best Wishes,
    Graham

  • Apache, name based virtual hosts and multiple servers.

    Hi,
    Ive been playing with Apache and name-based virtual hosts for a while now, but, ive been doing it with one single server... now i have the need to forward a name-based request to another server inside the intranet (wich doesnt have a public IP, but a private)...
    Something like this:
    internet -----> Webserver (name based vhosts) ----> intranet-webserver
    Where "webserver" has several domains resolved via name based virtual hosting, and one of those needs to be redirected (or forwarded) to another server on the LAN.
    Any ideas on how to do this? i tryed searching the web, but i dont know under which keywords, so i always end on single server virtual hosting help sites.
    thanks in advance!

    you need to define a virtual server for it..but inside that definition.. define a proxy.
    Then the middle webserver, will actually handle the request to the intranet server, on behalf of the internet client..and then pass the traffic to the internet client.
    this looks like a reasonable example..
    http://www.linuxfocus.org/English/March … le147.html
    namely, the section "Mapping Virtual Servers"

  • File name based routing

    Hello All,
    Here I have a scenario where based on the source file name PI should route it to corresponding Business system.
    There is no IR part as it is a pass through Interface. Instead of creating multiple channels can I check the condition(file name based condition) at Receiver determination level in ID part?
    Thanks,
    Regards,
    Moorthy

    Hello,
    There is no IR part as it is a pass through Interface. Instead of creating multiple channels can I check the condition(file name based condition) at Receiver determination level in ID part?
    Yes, you can use context objects and then select fileName, I'm not sure if you'll be able to use the extended xpath conditions. Probably that approach is limited to the approximately equals, equals, not equals condition.
    Corrections are welcome
    Hope this helps,
    Mark

  • Find the folder name based on the View Name

    Hi ,
    I need to find out a Folder name based on a View Name . Basically i know the view Name and want to find out the Folder that is created in Discovrer based out of that view.
    Does any one know of any EUL table that stores this relationship.
    Thanks in advance for your help
    Sunny

    Hi,
    Your requirement can be fulfilled using the following script:
    SELECT bas.ba_name,
    bas.ba_id,
    obj.obj_name folder,
    decode(obj.obj_type,
    'COBJ',
    'Complex',
    'SOBJ',
    'Simple',
    'CUO',
    'Custom',
    'Unknown') AS obj_type,
    decode(obj.obj_hidden,0,'Bare','Hidden') IS_HIDDEN,
    obj.sobj_ext_table folder_source_object
    FROM eul10g_us.eul5_ba_obj_links bol,
    eul10g_us.eul5_objs ; obj,
    eul10g_us.eul5_bas ; bas
    WHERE obj.obj_id = bol.bol_obj_id
    AND bas.ba_id = bol.bol_ba_id
    BUT
    As you can see from the SQL, only simple folders are mapped to objects.
    This means that if the object is used inside a custom folder or complex folder you will not see it.
    Tamir

  • How to change datasource name based on the partition in configplan

    Hi
    Can any one please give me some solutions regarding how to change datasource name based on the partition in
    configplan.
    can't we do this in configuration plan?

    If you want to change template based on parameter. you have to use below syntax
    v_layout boolean
    V_LAYOUT:= FND_SUBMIT.add_layout(template_appl_name => 'SQLAP' -- application short name
    ,template_code => 'HUBAPAPN' -- template name
    ,template_language => 'en'
    ,template_territory => '00'
    ,output_format => 'PDF');
    Above can be used in plsql stored procedure before submitting Concurrent Program (Bi Publisher report) or may be you can try to add this code in Oracle reports after report or before report trigger
    Thanks
    Kamalakar

  • Fetch the operating unit name based on the country name

    Hi all,
    I want to fetch the operating unit name based on the country name, there is no link between fnd_territories(_tl) and hr_all_organization_unis(_tl) tables.
    Can any one know how to get this thing.
    any help or idea is appreciable.
    Thanks,
    Giri

    Giri,
    I don't think you will find such a link. One country can be used by multiple operating units.
    Hope this helps,
    Sandeep Gandhi

  • Find Report Name based on Report ID

    How do I find out the report name based on the report id ('D12C939B-4309-4364-A025-BFDB5203EE0B')?

    Hi Sudhir,
    Based on my research, I find that the general properties of all the items (including Date Sources, Datasets and reports) on the report server will be stored in the Catalog table in ReportServer database. So that the report name (correspond to Name column)
    and report id (correspond to ItemID column) also be stored in the table. If we want to select the report name based on the report id, we can use the query below:
    use ReportServer
    select Name
    from dbo.Catalog
    where dbo.Catalog.ItemID='D12C939B-4309-4364-A025-BFDB5203EE0B'
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • SRM 7.0 , Get company name based on company code

    Hello friends,
    Is ther any function module or table to read company name based on company code in SRM 7.0 ?
    Kindly let me know your inputs.
    Thanks.
    Preethi.

    Hi,
    To find purchase group.
    BBP_OM_FIND_PURCH_GRPS_BEI
    To fund purchase org.
    BBP_OM_FIND_PURCH_ORGS_BEI
    To find company.
    BBP_OM_FIND_COMPANIES
    Regards,
    Pedro Marques

  • Dynamic display of the Company Name based on Org

    Hello All,
    I need to dynamically display the Company name based on the Org_id and the ORG is not being populated in the XML data file. How do i achieve this,please let me know.
    Thanks
    Rakesh

    Rakesh,
    It's like getting something from nothing (data template)... If you do not want to modify your report, then Vetri's option will be fine(your going to add not modify)...
    Or,. define a new Oracle report based on the seeded one then do modify...
    regards,
    Rownald

  • Name based routing capab

    Hi there, I"m new to the forums and I'm looking for routers capable of name based routing. Does Cisco provide any routers that have that capability? Essentially what I'm looking for is a router with a built-in functionality similar to virtual hosting by Apache.
    Any suggestions are appreciated

    Bennet,
    Nothing in the Small Business Product Line , I'm sure they have something under the Enterprise group line.
    You can post under the Enterprise support forum or call a Cisco representative @ 1-800-553-6387
    Thanks,
    Jasbryan

  • Find Userexit name based on Exit function module

    Hi All,
    Is there any way to find the userexit name based on the function module.
    My exit function module is EXIT_SAPLATPC_001. I want to find the exit name.
    Appreciate your help.
    Thanks,
    Jaffer Ali.S

    Hi
    This is the Exit Name: ATP00001 for the Exit FM you have given. I took the package name this exit FM is stored in the Attributes of FM in SE37. In the search criteria of SMOD,after hitting f4..and selecting Information System, I gave the package name...and it gave me the exit name.
    P.S: The above method may sometimes lead to giving in more than one exit as result.
    Vishwa.

  • Question: To derive Query technical name based on RSZCALC table.

    Hello All -
    Could you please kindly help to share your thought on Link of Query table. I am interested to see the list of Queries using Exception Aggregation against particular Characteristic.
    I use RSZCALC table to get Information about Exception Aggregation, however, I am not sure how to get Query technical name.
    Could you please kindly share your thought, what table I should use to get Query Technical name based on data from RSZCALC? And appreciate to share your thought what column that I should use to link between those tables.
    Looking forward your feedback on this, and appreciate much.
    Thanks,
    Cheers,

    Also Refer this Wiki  , For More information about bex  query  tables.
    Relation between between BEX Query DefinitionTables - SAP NetWeaver Business Warehouse - SCN Wiki

  • The table name or tcode to count the number of Dimensions and Key Figures

    Hi all,
    Do you have an idea about the table name or tcode to count the number of Dimensions and Key Figures of an Infocube WITHOUT installing the cube from Business Content?
    Thanks in adv.
    Ajay

    Hi,
    You can't do that because there's no active table in the system for the Business Content since it hasn't been installed yet...
    One thing you could do is go to the Business Content Tab, select "Infoproviders by InfoArea" on the left side, look for the Cube or DSO you want to check, right click on it and select "Display Description".
    On the window that opens you'll have a list of all InfoObjects and Key Figures. You also have the option to Display it as Start Schema, where you can see the Dimensions, etc.
    Hope this helps.
    Luis

Maybe you are looking for