Search:

Type: Posts; User: vysero

Page 1 of 3 1 2 3

Search: Search took 0.30 seconds.

  1. Replies
    4
    Views
    113

    Re: Having trouble working with files

    I actually wasn't given a csv file to begin with. I believe the program creates a csv file and populates the folder with it. Here is the whole program:


    package sortitout;

    import...
  2. Replies
    4
    Views
    113

    Re: Having trouble working with files

    Not exactly sure. The file is in:

    NetBeans->ProjectLibrary->SortTester->Files->sortTestResults.csv

    I don't understand why wouldn't have access it says I am the administrator.
  3. Replies
    4
    Views
    113

    Having trouble working with files

    So my teacher gave us some code and for some reason I am getting an error when trying to run the code:

    run:
    java.io.FileNotFoundException: Files\sortTestResults.csv (Access is denied)
    at...
  4. Replies
    20
    Views
    519

    Re: Making my class generic

    Okay so I was lost and decided to change back to an older version of my program. I changed the way I declare a few methods here is what it looks like now, driver hasn't changed:

    Queue:

    package...
  5. Replies
    20
    Views
    519

    Re: Making my class generic

    Okay so i'll show you the whole Queue method I fixed it so that it will allow me to enqueue but only once. I believe there is something wrong with my while loop but I am not sure what the null...
  6. Replies
    20
    Views
    519

    Re: Making my class generic

    So I am still having problems. My enqueue method isn't right but I am not sure what's wrong.


    public void enqueue(E e2) {
    Node eNode = new Node(e2);
    Node current = front;
    ...
  7. Replies
    20
    Views
    519

    Re: Making my class generic

    Okay so I think I figured that question out. I think this is would I should be writing or something similar:


    while(current != back && e2.compareTo(back.e1) <= 1){

    ...
  8. Replies
    20
    Views
    519

    Re: Making my class generic

    Ah okay, so I went with the ladder changing my Queue class. So why cant I say:


    while(current != back && eNode.compareTo(current) <= 1){}

    isn't eNode and current a person object?
  9. Replies
    20
    Views
    519

    Re: Making my class generic

    Okay yeah this works better I wasn't sure if I should just continue with this thread or not but I think I have got the generics worked out. Except the line in the driver I had originally written that...
  10. Replies
    20
    Views
    519

    Comparable trouble

    So I am having trouble with syntax and comparing objects. What I want to do is compare the longevity of one person vs the longevity of others so that I can en-queue them properly. I already tried...
  11. Replies
    20
    Views
    519

    Re: Making my class generic

    Okay so here is what I did:


    public E dequeue(){
    //E frontPerson = front.e1;
    //front = front.nextNode;
    //return frontPerson;
    E temp = front.e1;
    ...
  12. Replies
    20
    Views
    519

    Re: Making my class generic

    Okay so that was obviously incorrect, of course its not that easy lol. So here's where I am at now. I turned the old linked list into a doubly linked list (at least I attempted that). Everything...
  13. Replies
    20
    Views
    519

    Re: Making my class generic

    Excellent thank you! Also, I just started reading some stuff on queues trying to figure this out. I ran into whats called a doubly linked list. How do I turn my regular linked list into a doubly...
  14. Replies
    20
    Views
    519

    Re: Making my class generic

    Ah okay well that gets rid of the static error thank you. However, the two types are still incompatible, object cannot be converted to person. So it works but only if I cast personQueue.dequeue as a...
  15. Replies
    20
    Views
    519

    Making my class generic

    Hello so I am working on a queue that is implemented using a linked list. I have already built the queue and it works with person objects however now I want it to be generic. So I set about turning...
  16. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    Okay so I think I know what he wanted us to do for at least the extends part. I am not sure why I was trying to mess around with overriding the compareTo() method at all. Instead I am just going to...
  17. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    Depends on what fashion the queue has to be a linked list.
  18. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    Yes

    Driver:

    package priorityqueuestandby;

    import java.util.NoSuchElementException;
    import javax.swing.JOptionPane;
  19. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    Well currently I am not sure how to call the function. I am trying to call it like this:


    StandByPassenger.compareTo(standbypassengerReference);

    from my driver however, its not working like...
  20. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    Well I am not sure exactly. The code is coming from the link AGunner posted about how to use the Comparable class. I was assuming it somehow casted compareQuantity as an int so that it could be...
  21. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    The @Override annotation, you mean to my code or?


    For this declaration:


    public class StandByPassenger implements Comparable<StandByPassenger>

    I get the following error: "type comparable...
  22. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    We are suppose to have an interface and we are suppose to extend the Comparable class. What I don't understand is why we need to extend the Comparable class. Here is what I wrote last night:

    ...
  23. Replies
    17
    Views
    306

    Re: Using Comparable, extends Comparable

    Sorry I am still confused. So here is what I think this might look like:

    In my main in Case 0 (enqueue) just after I pass the values for a/an airline passenger I thought I would write:

    ...
  24. Replies
    17
    Views
    306

    Using Comparable, extends Comparable

    Hello okay so my assignment was to create a priority queue for Airline Passengers. Here is what I have done so far:

    //Driver

    package priorityqueuestandby;

    import...
  25. Replies
    3
    Views
    106

    Re: Comparing Strings

    Hey this is good thank you, however; I am still having issues. So I can get it to print like today's date:


    package testdates;
    import java.text.DateFormat;
    import java.util.Date;

    public...
Results 1 to 25 of 63
Page 1 of 3 1 2 3