What does this do exactly?

Hi,
I have this piece of code:
      // create a buffered text file stream
      BufferedReader inFile = new BufferedReader(new FileReader(args[0]));
      // data and maintenance variables
      AirlineTicket[] data = new AirlineTicket[10];
      String dataString;
      String inSeat, inName;
      double inPrice;
      // cycle through each element of the array
      for (int i = 0; i < data.length; i++)
         // read a line from the file
         dataString = inFile.readLine();
         // read and tokenise string
         StringTokenizer tokens = new StringTokenizer(dataString, ":");
         // create instance from data tokens
         inSeat = tokens.nextToken();
         inName = tokens.nextToken();
         inPrice = Double.valueOf(tokens.nextToken()).doubleValue();
         String inOrigin = "";
         if (tokens.hasMoreTokens())inOrigin = tokens.nextToken();
         // put the data into data[i]
         data[i] = new AirlineTicket(inSeat, inName, inPrice);
      }and I'm wondering how this works. Does it put inSeat, inName, and inPrice in data? How on earth does it do that? How would you access the individual seat numbers, prices, and names through that?
Regards,
Platinum

Hi,
All it does is go through data at j, using this method to print out the seat, name, and price:
   // displayTicket(): display an airline ticket
   private static void displayTicket(AirlineTicket in)
      // create a currency formatter for Australian English
      NumberFormat cash = NumberFormat.getCurrencyInstance(new Locale("en", "AU"));
      // display seat and name
      System.out.print(in.getSeat() + "\t" + in.getName() + "\t");
      // display costs
      System.out.println(cash.format(in.getExTaxCost()) + "\t" + cash.format(in.getIncTaxCost()));
   }It uses this code to go through each iteration of j:
               // run through array and print all data
               for (int i = 0; i < counter; i++)
                  AirlineTicket aTicket = data;
displayTicket(aTicket);
System.out.println();
I'm sorry I messed the code tag in that last post,
Platinum

Similar Messages

  • Only Update Checked Songs ??? What does this mean?

    Hi, I was looking at my iPod preferences, and see the option "Only Update Checked Songs" What does this mean exactly? Has anyone figured it out yet?
    I searched the iTunes help file and it just listed stuff about Podcasts.
    Thanks in advance for your answers.
    D

    OK, my daughter and me both have iPods and only 1 computer to update them, I don't like alot of her music, I was hoping for a way to keep the automatically update setting on my iPod - so when new music was added to my library it would automatically copy those songs to my iPod, but if I didn't like them I could uncheck the songs and after the next update those songs wouldn't be on my iPod anymore.
    When we became a two iPod family, I did use the manual update on my iPod for awhile but it became a pain to remember which songs I just added to the library and copy those songs to my iPod.

  • I am trying to update itunes to 11.1.1.11 and i keep getting 'erreo writing to file : C\ : Config.Ms\301ded48.rfb.Verify that you have access to that directory'. What does this mean and how can i fix it?

    I am trying to update itunes to 11.1.1.11 and keep getting message at the end ' error writing to file :c:\Config.Msi\301ded48.rbf.Verify that you have access to that directory'. What does this mean and how do I fix it?

    I had this exact same problem just now, trying to upgrade to 10.7.
    I even got that error msg when trying to UNINSTALL iTunes!
    After hours of frustration trying everyone's different suggestions, I downloaded Revo Uninstaller http://www.cnet.com.au/apps/revo-uninstaller-10610875/ which solved the problem.
    Use it to help uninstall iTunes and related software components in the following order and then restart your computer:
    1. iTunes
    2. QuickTime
    3. Apple Software Update
    4. Apple Mobile Device Support
    5. Bonjour
    6. Apple Application Support (iTunes 9 or later)
    Then you can install iTunes from scratch.
    Good luck

  • TS1702 I purchased an app and got a 'waiting' message on my itouch screen.  What does this mean?

    I purchased an app and got a 'waiting' messae on the itouch screen.  What does this mean?

    You have a router that assigns IP addresses in sequential order. 
    Always turn your devices on in the exact same order and you will avoid the message.
    It is not a serious problem.
    If your router supports DHCP reservations based on MAC address of the devices that will resolve the problem.

  • What does this error2 mean and how do I fix it?

    What does this error mean and how do I fix it?  I am trying to reinstall CS4 on my Windows 8.1 machine. 
    Adobe Flash Player 10 ActiveX
    Error:
    Error 2.
    Here is the initial error: http://s29.postimg.org/wqy2ju8iv/Untitled.png
    Here is a screenshot when I click the "More Information" button: http://s27.postimg.org/bugb7rx7n/Untitled2.png
    And here is the screenshot when I click the "Get Support" button: http://s4.postimg.org/c2ynvhmvx/Untitled3.png
    I'm stumped.

    Hi there I've just installed CS4 Pro on Windows 7 64bit and got exactly the same result as you. Did you manage to find anything out, because the thing that bothered me was the limited functionality (what ever that is). Is it just a case of Windows 7 having a newer version of ActiveX already installed?

  • My phone says my cdma service not available what does this mean

    my phone says cdma service not available what does this mean

    This has just happened to me. My phone (Samsung Intensity) worked great on Sunday. Sent and received several texts while at home on Sun during Steeler football game. Monday night, while sitting outside of my home in my driveway, could not make a call. Message said CDMA SERVICE NOT AVAILABLE. On the front of my phone it says Searching SVC. No bars. Icon of a cell phone with a diagonal line through it. Tuesday night, same. Didn't think about trying it at my office. Tried the dialing *228 send option 2 but that doesn't exactly work when the phone doesn't work. My husband's phone (Casio GZOne) also not working at our house.

  • HT201210 Trying to update my new phone to iOS6. It say my phone is in recovery mode what does this mean. And how do I solve it?

    Trying to update my new phone 4s to iOS6. It says my phone is in recovery mode what does this mean. And how do I solve it please?

    It means exactly what it says.
    Connect the device to iTunes and restore.

  • I keep getting an error code while trying to import a cd to my itunes: Error occurred while converting the file. The disc you are attempting to use is full. removing files and emptying the recycle bin will free up additional space.  What does this mean?

    I keep getting this error code while trying to import a cd to my itunes: "Error occurred while converting the file. The disc you are attempting to use is full. removing files and emptying the recycle bin will free up additional space."  What does this mean?

    Well it probably means exactly what it says... How much free space is there on your hard drive where the iTunes Media folder resides? I believe there is also an obscure bug that can occur when software doesn't read the true value of the free space properly, and the workaround is, perversely, to duplicate some content so that with less actual free space the software in question perceives it as more. I've no idea if iTunes is affected by such a bug.
    tt2

  • HT1222 I received message: cannot download, select tools, download only and download manually (something like that). Please help, what does this mean?

    I received message: cannot download, select tools, download only and download manually (something like that). Please help, what does this mean?

    Exactly what it says.
    Do as the message says.

  • Wl6 Admin - Cluster - Cluster Address - What does this tab represent?

    In the WL6.0Sp1 Admin Console, at cluster creation time, a Cluster address
              is required. What does this cluster address represent?
              Heres what WL6 documentation says
              (http://edocs.beasys.com/wls/docs60/ConsoleHelp/cluster.html#create_cluster)
              Cluster Address - This attribute returns the address to be used by clients
              to connect to this cluster. This address may be either a DNS host name that
              maps to multiple IP addresses or a comma separated list of single address
              host names or IP addresses.
              We created a cluster of 4 WL6 servers, 3 on Multi-homed Win2K with static
              ip's and one on a single-homed Win2k m/c. Our Enterprise appplication (ear)
              is targetted at the cluster only, not individual m/c's in the cluster.
              Initially, the Cluster Address was specified as all the ip addresses. Then
              we specified only one ip address in the Cluster Address tab. Yet, in both
              the above cases, we were able to access our application by hitting any of
              the 4 ip's in the cluster. The clustering algorithm was set to
              "Round-Robin".
              And in both cases (single ip address and 4 ip addresses in Cluster address
              tab), the cluster monitor on the Admin console was showing all four WL6
              server instances participating in the cluster! We also tried a DNS name that
              mapped to the Ip addresses and again all 4 instances were shown to be
              participating in the cluster.
              I have two questions
              1) What exactly is the significance of the Cluster Address tab?
              2) How do we know which WL6 server instance is being accessed at which
              client request. With round robin, will each of the 4 WL6 instances be
              accessed once every 4 requests? How do we monitor/verify this, either via
              console or via log files?
              Thanks in advance for help/clarifications.
              Regards,
              Nitin
              

    thank you thank you for taking an interest. this is so frustrating.
    i only have apple keyboard, mighty mouse, and 20 inch cinema display connected. this morning took out memory and tried to boot up with individual pairs in the first bank. first the (2)256, the (2) 1g, and then the other (2) 1g modules. everytime I get the weird fuzzy wheel under the logo after a while, black screen flashes, then grey apple logo fuzzy screen then black forever.
    I ran tiger updates this morn. still will only boot to safe mode. then tried to run leopard disk to install it
    will not boot from leopard disk.
    tried safe boot, then doulble click install leopard, restart, then the saga repeats with the pixely red square around the wheel.
    these are fresh drives with only what came on instll disk loaded.
    thanks again for taking an interest.
    i love this system(well at least i did). I want to install leopard on my powerbook too but am terrified to do so right now since it is working and I have work to do. Can't afford to have no computer to do my work on...self employment is great?!
    This is making me crazy. I anxiously await your words of wisdom.

  • HT1420 Hi all, when I try to purchase items in a game on my iPad it comes up with a message saying contact iTunes support to complete this transaction? What does this mean and why is it doing this?

    Hi all, when I try to purchase items in a game on my iPad it comes up with a message saying contact iTunes support to complete this transaction? What does this mean and why is it doing this?

    It means exactly what it says:
    Contact itunes support
    It is saying this because you need to contact itunes support.
    Have you considered doing what it told you to do?  contact itunes support

  • The apple icon appears every 15 seconds but the iPhone never boots. What does this mean?

    The iphone 3GS was in an otter box--in a pocket--and went in a mudbath for a couple of minutes.  Yes, really.  None of the water sensors turned pink on the phone and now, two days later, the apple icon pulses on and off every 15 seconds when the phone is hooked into a USB cable to charge.  What does this mean and what should I do?

    It looks as if there's a problem with your GPU. With a Retina machine, that would mean replacement of just about everything, except, perhaps, the flash storage drive.
    Print you kernel panic when you go to your Apple Store appointment. I'm betting that it's a faulty GPU but they will be able to diagnose exactly where the problem lies.
    Good luck,
    Clinton

  • What does this button on my keyboard do?

    There is a button on my computer keyboard; at the top-left of the numeric keypad, just below the reduce-volume button; it's like a parallelogram with a big cross (X) through it. - What does this button do? - I can't seem to find a use for it.
    Also, while we're talking buttons, the buttons above the arrow keys seem to correspond to Home, End, Page Up, and Page Down on PC's, but they seem (annoyingly) to perform slightly different functions. - Any explanations?
    And finally, I know you can get a hash symbol using various modifier-key combinations, but it's so much simpler on a PC when you can see it above the 3 number. (Especially on a music computer when you need it frequently as the sharp sign).

    I've found it interesting to learn that on some Apple keyboards, the button in question has the word "clear" marked on it (and nothing else).
    My button doesn't have 'clear' on it, or any words, just this symbol of a crossed-out parallelogram. (It's in exactly the same place as the 'clear' key, but performs no delete function that I can tell).
    I can't find a good picture, but you can sort of make it out here:
    http://homepage.mac.com/noodlenick/GarageSaleImages/GarageSale_116276558123051.jpg
    Doesn't anyone know what it does?

  • I just purchased FormsCentral but according to your site it is going to be closed on June 22. What does this mean for what I paid? Do you have an alternative program to use? Do I receive my money back?

    I just purchased FormsCentral but according to your site it is going to be closed on June 22. What does this mean for what I paid? Do you have an alternative program to use? Do I receive my money back?

    Kim,
    When you say you just purchased Formscentral exactly what do you mean? Formscentral has not been sold as a stand alone product in a while due to the decision to close the service. If you got Formscentral as part of a Acrobat subscription then you need to know that that part of the subscription will go away partially in June and fully in July. If you have indeed managed to purchase Formscentral standalone recently can you please give me the information about your purchase such as the date of purchase and link to the site from which you purchased. Refunds are available to customers who are not able to use the service though their contract period.
    Andrew

  • My computer won't fully load without turning back off completely. What does this mean or what should i do?

    My computer won't fully load without turning back off completely. I also tried plugging it in to the charger but it still did not work. What does this mean? What should i do?

    It looks as if there's a problem with your GPU. With a Retina machine, that would mean replacement of just about everything, except, perhaps, the flash storage drive.
    Print you kernel panic when you go to your Apple Store appointment. I'm betting that it's a faulty GPU but they will be able to diagnose exactly where the problem lies.
    Good luck,
    Clinton

Maybe you are looking for

  • Imac second monitor compatibility

    Hey, Im thinking of adding a HD monitor to my computer, How can i tell if my computer is able to do that? And if it was able to, how would i do it?

  • JHeadstart not showing in Tools/Preferences

    JHeadstart not showing in Tools/Preferences. I have done exact as in instructions.: Unzip JHeadstart10.1.2.0.x.zip (using folder names) to a folder of your choice, >>for example C:\JHeadstart (in the next steps referred to as <JHeadstartHome>). I hav

  • Awful sound, super quiet and fuzzy from S750

    I have a new S750 system that I just received today. I plugged it in and while all the speakers worked, it turned my CD audio into something that sounded like an 32k mp3 - in other words, absolutely terrible. The sound card is not the problem, it was

  • Hw to debug outbound function module

    Hi, I know how to debug inbound idoc using WE19 can sum1 tell how can i debug outbound function module. i want to debug to see as to why certain segments are not being updated in IDOC PORDCR1.PORDCR102. even though i put an external break-point it do

  • Congratulations Adobe on GPU identification in 8.1.0.81

    Guess what is new in Premiere CC 2014 8.1 release? No more "cuda_supported_cards.txt" or "opencl_supported_cards.txt" files! Both this laptop and my main editing computer with so called "unsupported" GPU's (GTX 765M and GTX970) are working fine and e