Results 1 to 2 of 2

Thread: fetch method

  1. #1
    mwimpelberg is offline Member
    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0

    Default fetch method

    I have a data Structure called UOAUtilities and this is the method.

    Java Code:
    	public StudentListings fetch (String targetKey)
    	{
    		StudentListings StudentListings;
    		StudentListings temp;
    		int i=0;
    		while(i < next && !(data[i].compareTo(targetKey) == 0))
    		{
    			i++;
    		}
    		if(i == next)
    			return null;
    		StudentListings = data[i].deepCopy();
    		if (i!=0)
    		{
    			temp = data[i - 1];
    			data[i - 1] = data[i];
    			data[i] = temp;
    		}
    		return StudentListings;
    	}
    My question is, how can I fetch a studentlisting which holds string,int,float with just a string?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: fetch method

    Check if the Strings are equal rather than checking that the String equals a StudentListing.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Fetch Source Code
    By ujjwal in forum New To Java
    Replies: 7
    Last Post: 02-08-2011, 04:22 PM
  2. hibernate association fetch
    By enggvijaysingh@gmail.com in forum Advanced Java
    Replies: 1
    Last Post: 12-03-2010, 09:30 PM
  3. Fetch files over web server
    By Juuno in forum Networking
    Replies: 3
    Last Post: 02-19-2009, 02:02 PM
  4. Fetch Webpage - not working
    By jodyflorian in forum New To Java
    Replies: 5
    Last Post: 10-10-2008, 02:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •