For each loop and modification of a LinkedList

When going thourhg my LinkedList with a for each loop, I want to do a modification. I just saw that it cast a ConcurrentModification Exception, so it seems I can't do that.
How should I do then? I don't want to go through all the list each time an object is removed, I want it to restart where it stopped.

Not the best solution but something like thisshould work:
if( linkedList.get(i) == "modification")No: don't compare Strings with the == operator.
http://access1.sun.com/FAQSets/newtojavatechfaq.html#9
You are correct, must be .equals() my bad.

Similar Messages

  • Loading accdb file using for each loop in to single target table

    I have 3 accdb file as below in single folder, in control flow I have created a for each loop to loop through all the below file.  In dataflow task I have created oledb source using connection manager to point to first file a1.accdb. I am trying
    to load all the file into single below mentioned target table, here It is only loading first file it is not looping through other two file.
    This I have tried to load .txt files and csv files it is working perfectly but similarly when I try to load access db file table it is not working, can any one of you help me?
    1. a1.accdb contains only one table  a1tab ( col1 col2 col3 )  
    2. a2.accdb  contains only one table  a2tab  ( col1 col2 col3 )
    3. a3.accdb  contains only one table  a3tab   ( col1 col2 col3 )
    I have a target table with similar structure as source
    Target table <TargetTable> Col1 Col2 Col3
    aak

    Thanks Arthur, please find below response
    How do you handle the different table names?  Cant we handle it in a similar manner, how we handle the .csv/.txt files with different name and similar structure for sources(multiple files) and target (single table)
    Is it good to drop the idea of for each loop and create a separate task for each accdb file? to be loaded to same target table( performance wise etc.. any justification would be helpful)
    You must handle the connection string dynamically?
    Can you help me with the logic for handling connection string dynamically
    aak

  • Inside for-each loop

    hi,
    I gave one for-each loop inside one row, the table which am using has three columns and two rows, at first row there are column headings and second row first column i started for-each loop and ended end for-each loop at third column. Now I am getting displayed multpile rows for each occurence of elements that is fine but How can I get rid of lines which is occuring between each rows. Is there any way to deal this.
    Thanks :)

    send me you template and xml to my id in profile.

  • How to use for each loop in XSLT when my source is a multilayout file and db

    How do I use a for each loop in XSLT when my source is multilayout file and db .
    My multilayout file is basically contain 2 kind of data one for employee and another for dependent.
    Now my requirement is I want to read each line of data whether it is it is employee or dependent do a join with db and write it in my target file.
    eg :  File content
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar 456782 BRO RichaKumari 311289 INDIA
    2 Ravi            456882 BRO RichaKumari 311289 INDIA
    eg : db Content
    311289 RichaKumari TCS INDIA Bangalore [email protected]
    Now in Final File I need something like this :
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar RichaKumari 311289 TCS INDIA
    2 Ravi            RichaKumari 311289 TCS INDIA
    here 1 and 2 are the identifier which will decide which layout to follow .

    Hi,
    I think you'll need two nested for-each's... Something like...
    <xsl:for-each select="$root/row[layout = 1]">
    <xsl:variable name="employee" select="."/>
    ... write employee ...
    <xsl:for-each select="$root/row[layout = 2 and dependentid = $employee/id]">
    ... write dependent ...
    </xsl:for-each>
    </xsl:for-each>
    Cheers,
    Vlad

  • For-each loop in OSB

    Hi,
    I have a senario where i have a varied length XMl is coming to me in response of a service callout, and I need to iterate over it to get the fieldvalue of a particular tag based on its fieldName(e.g FUNCTION_CODE) and assign to a tag of another xml for example
    THE XML Coming as response of service callout is
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <getDefaultValueResponse xmlns="http://data.transformation.nab.cz.fc.ofss.com">
    <getDefaultValueReturn>
    <fieldDefaultValue>F</fieldDefaultValue>
    <fieldName>FUNCTION_CODE</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>PAYMENT_TRANSACTION_ID</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>CHANNEL_ID</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>CR</fieldDefaultValue>
    <fieldName>CREDIT_DEBIT_FLAG</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>BRAND</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>001</fieldDefaultValue>
    <fieldName>ACCOUNT_STATUS</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>Mr</fieldDefaultValue>
    <fieldName>NAME_TITLE</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>Y</fieldDefaultValue>
    <fieldName>MAIL_RETURN_INDICATOR</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>ENTITY</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>TRANSACTION_CURRENCY</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>VERSION</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>TRANSACTION_RATE</fieldName>
    </getDefaultValueReturn>
    </getDefaultValueResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    and i want to assign that value to transactionType tag of
    <?xml version="1.0" encoding="UTF-8"?>
    <tns:sandstonetns xmlns:tns="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com Sandstone_Data_Transaction_History_Response.xsd ">
    <tns:listOfTransactions>
    <tns:transactions>
    <tns:clients>
    <tns:clientID>tns:clientID</tns:clientID>
    </tns:clients>
    <tns:timestamp>2001-12-31T12:00:00</tns:timestamp>
    <tns:sequenceNumber>tns:sequenceNumber</tns:sequenceNumber>
    <tns:description>tns:description</tns:description>
    <tns:amount>0</tns:amount>
    <tns:accountNumber>tns:accountNumber</tns:accountNumber>
    <tns:debitOrCreditFlag>tns:debitOrCreditFlag</tns:debitOrCreditFlag>
    <tns:*transactionType*>tns:transactionType</tns:transactionType>
    </tns:transactions>
    </tns:listOfTransactions>
    <tns:returnResponse>
    <tns:returnCode>0</tns:returnCode>
    <tns:returnDescription>tns:returnDescription</tns:returnDescription>
    </tns:returnResponse>
    </tns:sandstonetns>
    I want to achieve this using for-each loop...kindly help me as I dont have any idea about how to use for-each loop...

    i want to select a the tag fieldValue based on the data in tag fieldName for eg if i iterate over the whole response XML searching for fieldName=FUNCTION_CODE then I whuold get the value 'F' and then I would assign this value 'F' to the transactionType tag of the XML
    <?xml version="1.0" encoding="UTF-8"?>
    <tns:sandstonetns xmlns:tns="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com Sandstone_Data_Transaction_History_Response.xsd ">
    <tns:listOfTransactions>
    <tns:transactions>
    <tns:clients>
    <tns:clientID>tns:clientID</tns:clientID>
    </tns:clients>
    <tns:timestamp>2001-12-31T12:00:00</tns:timestamp>
    <tns:sequenceNumber>tns:sequenceNumber</tns:sequenceNumber>
    <tns:description>tns:description</tns:description>
    <tns:amount>0</tns:amount>
    <tns:accountNumber>tns:accountNumber</tns:accountNumber>
    <tns:debitOrCreditFlag>tns:debitOrCreditFlag</tns:debitOrCreditFlag>
    *<tns:transactionType>tns:transactionType</tns:transactionType>*
    </tns:transactions>
    </tns:listOfTransactions>
    <tns:returnResponse>
    <tns:returnCode>0</tns:returnCode>
    <tns:returnDescription>tns:returnDescription</tns:returnDescription>
    </tns:returnResponse>
    </tns:sandstonetns>

  • For Each Loop in Jdev 10.1.2.17.84

    Is there anyway of using a for each loop in Jdev 10.1.2.17.84? I get errors for the standard syntax:
    for (int item : numbers) {
    System.out.println("Count is: " + item); }
    Am i missing something?

    Okay, i'm on 10.1.3 now and the syntax:
    for (int item : numbers) {
    System.out.println("Count is: " + item); }
    still doesn't work. What am I missing now?
    On compile I'm getting:
    Error(41,23): ; expected
    for the line with for (int item : numbers) {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • For Each Loop for XML Task

    Hello Everyone,
    Please assist with a step by step guide on how to setup a For Each Loop for XML Task
    I'm trying to convert XML to XSLT
    I have tried more than 10 times and i just do not know what i am doing wrong - no error, my package just runs for a few seconds but nothing happens
    Thanks in advance
    Dee

    I managed to get my XML to XSLT to work but now when i run my package to import the data into SQL table,
    it stops after a few records, i get the following error: 
    [XML Source [1]] Error: The component "XML Source" (1) was unable to process the XML data. The element "Errors" cannot contain a child element. Content model is text only.
    Please assist
    Check this:
    http://social.msdn.microsoft.com/Forums/en-US/80726e0c-9e85-43ca-87bc-7cf90fd7fb31/xml-source-data-flow-throws-cannot-contain-a-child-element-content-model-is-text-only-error?forum=sqlintegrationservices
    Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
    The climb is all there is.

  • For Each Loop

    As we know that For Each loop is more easy to use and iterate. I want to ask, is it possible to run for each loop in reverse order?
    Please help.
    I will be very much thank ful to you.

    Sure. did you notice that it's you who defines the
    running condition, the initial value and the
    (positive or negative) increment?He's talking about the new for loop.
    The for-each loop can't do everything the old one can. Try reading this explanation.
    http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html

  • "for each" loop - under the hood question

    Question about the for each loop. Is it optomized? I think this is a poor use of memory management -
    for (int i = 0; i < stop; i++) {
    Object obj = new Object();
    doSomething(obj);
    }And this is the ideal, using the same object -
    Object obj = new Object();
    for (int i = 0; i < stop; i++) {
    doSomething(obj);
    }So underneath the hood, which is the for each loop comparable to? I love the syntax, it's very clean-looking in the code, but at the same time I don't want to hurt performance.

    Question about the for each loop. Is it optomized? I
    think this is a poor use of memory management -
    for (int i = 0; i < stop; i++) {
    Object obj = new Object();
    doSomething(obj);
    }And this is the ideal, using the same object -
    Object obj = new Object();
    for (int i = 0; i < stop; i++) {
    doSomething(obj);
    }So underneath the hood, which is the for each loop
    comparable to? I love the syntax, it's very
    clean-looking in the code, but at the same time I
    don't want to hurt performance.That depends on YOU. You CANNOT write a for-each loop for the code you provided. A for-each loop requires an Iterable. (I think that's what it requires--it at least requires something to iterate over, not just an index variable as you have.)
    Consider the following, however:
    Object o1 = new Object();
    for (Foo foo : fooList) {
        Object o2 = new Object();
         foo.doStuff(o1, o2);
    } It will be equivalent to this:Object o1 = new Object();
    for (Iterator iter = foo.iterator(); iter.hasNext();) {
        Foo foo = (Foo)iter.next();
        Object o2 = new Object();
        foo.doStuf(o1, o2);
    } How could it be any different? It has to keep the behvior of the "old fashioned" iteration.

  • For-each loops

    while working in jbuilder2005 i want to use for-each loops i see following error;
    " for-each loops are not supported in -source 1.2 (try -source 1.5 to enable for-each loops) "
    i configured the jdk libraries source to jdk1.5 even then i found problem
    do any body know
    Message was edited by:
    citymodel

    What it says: Java 1.2 does not have for-each loops. You configured it to use 1.5, but you also configured the compiler to check for 1.2-code compliance. Read the JBuilder manual or help about how to find and change the setting. It's probably somewhere in the project settings.

  • For Each Loop - Urgent

    Hi,
    I am trying to use a For each loop:
    FE Agreement_No
    Customer
    0.00
    0.00<?end for-each?>
    This does not work. Does the code FE need to be grouped?
    Can anyone help?
    Thanks

    Hi,
    I have created a repeating group:
    <?for-each-group:ROW;./Agreement_No?>
    This places an F in front of agreement_no field
    and places E in front of the following field customer.
    I would also like to add a condition where installment = 'Under 1'
    Would that be <?for-each-group:ROW;./Agreement_No[../Installments='Under 1']?>

  • For Each Loop Load Dynamic Excel Files

    Hi All,
    SSIS 2005
    I want to load excel file .xls one at a time files that have different names without having to select the file in the connection manager, every time. So a user can easily place the excel file in the folder and right the sql job and it loads the file data.
    The data flow tasks all work when I manually select the excel file, but I am unable to get this to work dynamically.
    I have setup a for each loop with multiples data flow tasks and sql tasks to load my data from file.
    Variables:
    @filename d:\new file\*.xls
    For Each Loop:
    ForEachFile Enumerator
    Folder: d:\new file\
    Files: *.xls
    Retrieve File Name: Fully Qualified
    Variable Mappings:
    User::filename (index 0)
    Connection Managers:
    Excel Connection Manager: Expressions, ConnectionString @[User::filename]
    Error Message: Error at new buyer(package name) the connection string format is not valid. it must consist of one or more components of the form X=Y, seperated by semicolons.
    Can anyone assist thanks.

    You still need the file name variable.
    ExcelFilePath is the fully qualified file name of your Excel file. ie. it contains both the path and file name.
    e.g. D:\inbox\myExcelFile.xls
    All the steps you mentioned are correct, except you need to set the property of ExcelFilePath of the Excel connection to the variable that you map to in the ForEach Loop:
    Connection Managers:
    Excel Connection Manager: Expressions, ExcelFilePath @[User::filename]
    Hope this helps.
    ~ J.

  • For Each Loop: Enumerator Configuration In the For each loop Editor Help needed

    Hi All,
    I have a package that runs and updates a table with everytime someone adds a flat file in the source folder. One of the requirement is to upload files with the following
    ACA Flat files will have a naming convention of “ACA_ccyy_<julian date>”  : How can I add this?
    Under Files this is how I have setup the qualifies "ACA_*.*"
    Is there anyway to pass the entire naming convention in the file section? If so how can I ?
    Please help?
    FM

    As you have ACA_*.* set in Files Filter, it will return all the files from the folder which start with ACA_.
    You can have one dummy Sequence Container inside FE Loop Container. Connect it to your starting task and do right click on Precedence Constraint and write the expression the way you want by using SSIS functions. If the expression is evaluated to True only
    then it will go to the next task.
    In this way you can skip Non-ACA files.
    Please refer:
    SSIS Skip Certain Files in a For Each Loop
    - Vaibhav

  • For Each Loop Issue In SSIS

    Hi All,
    I have a SSIS Package which unzips the folder and then imports the files and then moves *.zip folders into processed location. If this task is executed as a part of total package its not moving the *.zip folders into processed location, but when we execute
    for each loop alone this *.zip folders are moved into processed location. I am unable to figure out the issue here.
    ZippedFile variable holds fully qualified file name..
    Rohan
    Rohan

    Can you put a OnPreExec breakpoint on the file system task (Right click on the file system task > Edit Breakpoint... > Select the first (OnPreExec breakpoint) and when the pkg pauses @ the breakpoint, chk the value of the ZippedFle and FilePathDestination
    variable values in your Local window (should be available at the bottom of the SSIS window as one of the tabs and you will need to expand the variable tree and find these two variables and their values). Are you seeing the appropriate values here?

  • SQL Agent Permssions With SSIS for each loop not looping through files

    Hi I am Having trouble getting a ssis package to iterate through a file directory using a proxy account set up in Sql Server.
    So I have a package that loops over csv files. If I run the package manually or set the sql agent job to run as Sysadmin the pakage runs fine all files are processed.
    However if I use the proxy account. the package completes but no files are processed. there are no failures, there is no error handling set up in the control flow. the for each loop container simply does not recognise any files when run under a proxy.
    Note: the proxy is set up with credentials to access the folder. the credential is also set up with the server admin server role... still nothing
    i'm not sure is this is a ssis or permissions problem?
    Any comments will be appreciated

    Can you check this and see if you've configured all the steps correctly
    http://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/
    Also enable logging in package and see if you're getting any error messages obtained in output table/file based on the logging option you chose.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • How can i transfer my ipod music to a new pc

    My PC crashed and i lost my itunes.  Most of it was recorded music of my CD;s but some had been downloaded.  I downloaded a new version of itunes onto my new laptop but when i try to psync it with my ipod it tells me it will wipe what is on there.  I

  • How to view / play old Director / Projector presentation files?

    I have a multimedia presentation on CD from 1997 with both Windows and Mac versions of the presentation, including Quicktime 3 installation, and numerous .dir files as well as the Projector version 6.0.2.  I am running on Windows XP, would also like

  • Error message when updating Sales Orders

    Hi Experts Following an issue over the weekend when I was forced to perform a  hard reset we are now experiencing error message when trying to update some sales orders.  This entry already exists in the following tables " ADO1 (ODBC - 2035) [Message

  • TRFC's in Error Status in P54 (SNC) System

    Hi SNC experts, Lots of tRFC are in error status when i am  executing Sm58 Transaction. The error text is  "RFC destination A1PCLNT001 does not exist ". Please guide me on this.. is there any SAP note relevant to this...so that these tRFC can be corr

  • How do I capture a peice of sound from a project, save it to a file, use it later.

    I want to capture or copy sound from a project in Elements 8, save it to a file, and use it later in the project.  Adeoby help is no help.