Arrays: Partial Search terms

Hello and thanks for taking the time to read this question!
I've been working on a simple college search program for my APCS class, a quick description of the program: Basically it takes a specially formated text file called collegeDatabase.dat and loads it into an array of blankCollege Objects (which extend collegeAbstract, code is below)
blankCollege
public class blankCollege extends collegeAbstract
     public blankCollege()
          super();
}collegeAbstract
//Abstract College Type
//Copyright aolszowka 2006
abstract public class collegeAbstract implements collegeInterface
     protected String collegeName;
     protected String collegeTypePP; //Private or Public?
     protected int collegeSize;
     protected String collegeMascot;
     protected String collegeCityType;
     protected int collegeCost;
     protected String collegeLocation;
     //DEBUG MODE?
     protected boolean debugMode = false;
     public collegeAbstract()
          collegeName = "null";
          collegeTypePP = "null"; //Private or Public?
          collegeSize = 0;
          collegeMascot = "null";
          collegeCityType = "null";
          collegeCost = 0;
          collegeLocation = "null";
     //College Constuctor
     public void setCollege(String college_Name, String college_Location, String college_TypePP, int college_Size, String college_Mascot, String college_CityType, int college_Cost)
          collegeName = college_Name;
          collegeTypePP = college_TypePP;
          collegeSize = college_Size;
          collegeMascot = college_Mascot;
          collegeCityType = college_CityType;
          collegeCost = college_Cost;
          collegeLocation = college_Location;
     //Recall Variables
       (edited out for space sake)
     //DEBUG GOODIES
     public String toStringDebug()
          return (collegeName+" "+collegeLocation+" "+collegeTypePP+" "+collegeSize+" "+collegeMascot+" "+collegeCityType+" "+collegeCost);
}Now I figured this would be the hardest part (but thanks to the power of google and the Java Docs it wasn't :D)! So at this point I can load the database and do basic seraches like this one
searchCollege
import java.util.ArrayList;
public class searchCollege
     collegeAbstract[] collegeArray = {null};
     public searchCollege(collegeAbstract[] collegeDatabase)
          collegeArray = collegeDatabase; //This is the Database loaded from loadColleges
     public String[] searchNames(String collegeName)
          //Create Search Array
          ArrayList<String> searchingColleges = new ArrayList<String>(0);
          int answerArraySize = 0;
          for(int i=0;i<collegeArray.length;i++)
               if((collegeArray.collegeName.toUpperCase()).equals(collegeName.toUpperCase()))
                    searchingColleges.add(answerArraySize,(collegeArray[i].collegeName));
                    answerArraySize++;
          //Create Return Array
          String[] foundColleges = (String[])searchingColleges.toArray(new String[searchingColleges.size()]);
          return foundColleges;
The problem with this is that the user needs to enter in the exact name of the college, is there a way to get partial matches? Now I found a previous post about partial matches @ http://forum.java.sun.com/thread.jspa?threadID=653541&messageID=3841115 but from my understanding the array needs to be sorted, and when I attempt to sort my collegeDatabase I can't, it throws the exception "ClassCastException" so I guess I can't perform a binary search (because the array cant be sorted)?
Once again thanks for taking the time to read my problem, if you need any more information (or the whole project file) just please request and I would be happy to post it.

I do not understand the use of an abstract class at
all. If the abstract class implements all the methods
of the interfaces it implements then why is it
abstract?Well one of two reasons, the project(Actually the teacher) calls for 4 parts:
1. Must have an Abstract Class
2. Must have an Interface
3. Must have a child class that extends the abstract class
4. Must have a child of a child class that extends the abstract class
The Second Reason is:
From my understanding of java I want to make abstract classes when I have a problem where the data is similar across all classes that require it, thus saving work, plus it would inherited the methods defined in the abstract class saving more typing. There is also a bit more to this program I have a few "static colleges" that each have extra methods, abstracting the general college template allowed me to simply extend it, and then add additional methods for those "static colleges".
From what I also understand (although I am very new to java and programming in general) the Interface is just a list of methods that at one point or another must be defined in the class that it interfaces with?
Your array should be of the interface type and not
the implementation type most likely.Im sorry, I don't understand what you mean by this, I want the array to be of colleges in which I've defined in the abstract class, but their values are modfied by another method which loads a database with that information in it.
Here is the code of the Interface class
interface collegeInterface
     String getCollegeName();
     String getCollegeTypePP(); //Private (p) or Public (u)?
     int getCollegeSize();
     String getCollegeMascot();
     String getCollegeCityType();
     int getCollegeCost();
     String getCollegeLocation();
You do not need to sort the array to search strings
for a substring. You don't even need regex for that.
You can just use String.indexOf(String str) for that.The Variable String in this case, what is it? Is it the Array of colleges? because it is storing more data than just the name of the college?
Im sorry if I've misunderstood your answer, please bear with me I want to learn :D

Similar Messages

  • Autocomplete in Google toolbar not working in FF 4.0. When I select a search term from drop down menu it doesn't load.

    As I said, when I type in a partial search term in the Google toolbar and the drop down list appears, if I click on a completed term, it will not autocomplete it.

    Mouse clicking wouldn't work for me either in the Google drop down box but up/down keys followed by enter do. I hope a quick fix is in order for this.

  • *BUG* Open Parameters Partial Search Does Not Work

    Similar question: http://forums.adobe.com/message/1773556
    Quite simply, using the open parameter #search=<keyword list> does not work at all if the search terms are partial matches.
    For example, if a document contains:
    abcdefg
    abcdef
    abcde
    abcd
    If I use the open parameter #search="abc", this will return ZERO results.
    If I use the open parameter #search="abcd", this will return ONE result.
    Is this intended? Is this a bug? Is Adobe going to respond to this?

    It isn't a bug. Read the documentation:
    http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

  • Duplicate check on search term for BP creation in CRM

    HI,
    I want to do a duplicate check on search term for BP creation in CRM.
    i found one BADI ADDRESS_SEARCH. But the method address_search is not getting called.
    Is there any other BADI available? how can I handle this issue?

    hello,
    BP is BDT (Business Data toolset) enabled (you can check it by adding break point in FM BUS_PBO and executing BP transaction). You can add your check directly to standard view (the check will be executed each time when user pushes enter) or you could add you check to appropriate action (during saving etc.) there are number of actions which you could use it depends on your requirements. You can find a lot of info about BDT (if you are not familiar) in Wiki.
    br,
    dez_

  • I am having a big problem with entering search terms in Google

    Here is the problem. I enter several search terms and do a search. So far, so good.
    After I am finished clicking on one or more links I return to the Google search page to do a new search.
    Since most of the words are the same, except the last one or two, I backspace over the old words and start entering the new ones.
    Then very strange things happen much of the time.
    1. It may restore the old words (the ones I already backspaced over and erased) and put my new words behind the old ones.
    2. It may just restore the old words, that had been backspaced over, completely removing the new words I had just typed in.
    Any ideas why this keeps happening? Is it Google or Firefox causing the problem?
    It seems very strange that words that had been backspaced over (erased) magically reappear as if I hadn't removed them.
    Thank you.

    What is the problem?
    Does send work?
    Receive?
    Error messages?
    Does the account work on other devices?
    DId it ever work on an iOS device?
    Did yo Google for the setting to use?
    DId you delete the account on the iPod and tried again?

  • Is there a way to block inappropiate search terms in Safari on an iphone or ipad?

    I want to block certain search terms on the iphone and ipad that my son uses. Is it possible to do this in Safari on these devices?

    Hi there Heather NY,
    You may find that the Parental Controls in iOS accomplish what you are looking to do. See the article below for more information.
    iOS: Understanding Restrictions (Parental Controls)
    http://support.apple.com/kb/HT4213
    -Griff W.

  • How do I link to a HelpID or a Search Term without any programming, through a URL?

    I have looked through the documentation, and it seems that every "possibility" to call either a search term or a HelpID/CHSID for my documentation is to use some sort of API.
    Is there a way to call the search function and CHSIDs directly by only typing a URL in a browser (or link from another page, or from an email, etc etc)?
    I'd actually like to know for all 3 outputs I am potentially going to be using: WebHelp, WebHelp Pro (RoboHelp Server 9) and HTML5, as I'm not sure yet which form it will take at the software release.
    Thanks!

    Hi OL-Lachance
    A couple of items I would add to Willam and Colum's comments.
    At the present time, WebHelp Pro (the Rh Server 9) does not support HTML5 output. WebHelp on a conventional web server is fine.
    In terms of the odd terminology for CSH, the term MAP Number or Map ID, generally refers to a unique number that is assigned to a topic so that it can be referred to in the application calling the help. The Topic ID is generally an alphanumeric string which is often the name of the topic title connected by underscores. Depending on the language of the application, sometimes only the Map number or sometimes only the Topic ID is used. Or, as you have learned, sometimes neither one is used and a URL is used instead!
    You and your developers may also find these topics helpful in the RoboHelp online help which can be downloaded here:
    http://help.adobe.com/en_US/robohelp/robohtml/robohelp_11_help.pdf
    Look at Chapter 11 for some interesting specifics on the many ways to call CSH. Of course the links mentioned in Willam's and Colum's posts are excellent as well.
    John Daigle
    Adobe Certified RoboHelp and Captivate Instructor
    Evergreen, Colorado
    www.showmethedemo.com

  • In a Google search, clicking on a search result causes the new page to open with the search terms highlighted in yellow -- how can I turn off th

    In a Google search within a Firefox session, clicking on a search result causes the new page to open with the search terms highlighted in yellow -- how can I turn off this highlighting?

    Try to clear the Google cookies and redo those Google options.
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"

  • BAPI to search for customer in CRM based on search terms

    Hi,
    Could anyone please tell me if there is a function module in CRM to search for BP's based on search terms. ( Just as we could enter '*' in search terms in transaction BP and get a list of customers ).
    Thanks in advance,
    Sahil

    Hi Sahil,
    You can make use of BAPI_BUPA_SEARCH.
    In the import parameter CENTRALDATA you can pass the
    search terms.
    Ranjit

  • "Search Term" fields in SU01

    Hi experts,
    Issue concerns my CRM 6.0 back end system. Here, I have a requirement to pull out a list of all users created without any value in field "Search Term 1"  under Adress tabI found an old thread from some years back which says this field is not part of any user tables as it fell under address management back then:
    SU01 Search Terms
    Does anyone have knowledge on how I can run this query? SUIM, change history etc has no option to do a user search on this field. I checked out most of the user tables (USR*) and none of them also have this field "Search term 1" in them.
    Also for some users on the same system this field is not visible alltogether (No header in SU01 --> Address which shows "Search terms" at all).
    I am a little confused. Any help would be great....
    Edited by: Soumya-Thomas on Mar 3, 2011 9:56 AM

    Hi Julius,
    Just noticed your answer to my thread, this is what I did:
    Table ADRP - got a list of all users (on field PERNR) with field value Search term1 (SORT1) against eahc user.
    Table USR21 - mapped the above PERNR value to user name here.
    Thus got a list of all usernames + Search Term1 (SORT1).
    Also, i didnt really use authority checks against the field Search Term.. may be it is used soemwhere, but i didnt get into that; since my mission was only to make sure that a set of users (as per our policy) were all created with specific reasons entered in "SU01 --> Search Term1" during user creation. For me it was a user master data updation task.
    Soumya

  • CRM 5.0 - IC WebClient - BP Search Term 1 - Method

    Hi Gurus
    Does anyone know of a SAP Standard Method to retrieve Search Term 1 for the Business Partner (Customer). I want to display the value in the Identify Account View
    Thanks
    Panduranga

    Here Are the steps which I did and tested the new QUERY in transcation GENIL_BOL_BROWSER, it is working fine. I am yet to change BSP level.
    I followed the instructions in the IMG(CRM> CRM Cross applicationComponents>GenIL > Component Specific> Extend Object model for business partner) to extend the search.
    To implement your own search, for example, new search parameters, or to filter the search results by your own criteria:
    1. Create a new structure ZCRMST_HEADER_SEARCH_BUIL   as copy of CRMST_HEADER_SEARCH_BUIL and add the new fields to the new structure.
    2. In Object Definition, define a name(ZBuilHeaderSearch) for the new search query and assign the new structure(ZCRMST_HEADER_SEARCH_BUIL) name to the new object, also enter ROOT object "BuilHeader".
    3. Create a class ZCL_BUIL_HEADER as subclass of CL_BUIL_HEADER.
    4. in IMG again assign this class to the external object name.
    5. Implement GET_RESULT_TABLE method in ZCL_BUIL_HEADER class with the following extra code apart from existing code in the super class.
      Data:   lv_sort1  type bu_sort1,
              lv_sort2  type bu_sort2.
      lv_sort1 = ls_header_search-search1.
      lv_sort2 = ls_header_search-search2.
    pass above two parameters to 'TREX_BUPA_SEARCH' Function module which is present in the GET_RESULE_TABLE method.
    6. Test your query in the GENIL_BOL_BROWSER.
    I am getting correct result.
    regards,
    Laxman

  • CRM - transaction BP - length of search term 1/2 (adress)

    Hey,
    I'm working on CRM, transaction BP. I've 2 roles for customer : person and organisation.
    Search term 1/2 is 20 caracters long.
    But, it seems to be possible to do customizing on search term. For example, in my environnemnent, customer person may have 20 caracters long search term ; but customer organisation must have less than 10 caracters (there is an error message if I put a more than 10 caracters search term).
    Could you tell me how in customizing I can control length of search term ?
    Thanks
    Baptiste

    Hi,
    I dont think there is any customizing for this change in length. You can instead to achcek of length in dchck event of BDT.
    Smita.

  • The boxes where I would type in search terms and URL are GONE! So is the BACK BUTTON. HELP!

    I downloaded software to convert jpg files to pdf's, and it worked. however, I think it installed Incredimail, and I suspect that it installed Ask.com - neither of which I wanted. It was just after that that my back arrow and my boxes where i type in search terms and urls DISAPPEARED! Firefox is compatible with some important websites and has features that i need. NEED.

    Make sure that you do not run Firefox in Full Screen mode with all toolbars hidden.
    * Press F11 to toggle full screen mode (Firefox/File > Full Screen)
    If the menu bar is hidden then press the F10 key or hold down the Alt key, that should make the menu bar appear.
    Make sure that toolbars like the "Navigation Toolbar" and the "Bookmarks Toolbar" are visible: "View > Toolbars"
    * If items are missing then open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout" (Linux, Windows)
    * If a missing item is in the toolbar palette then drag it back from the Customize window on the toolbar
    * If you do not see an item on a toolbar and in the toolbar palette then click the "Restore Default Set" button to restore the default toolbar set up.
    See also:
    * http://kb.mozillazine.org/Toolbar_customization
    * https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • Search Term in Search Help for SAP Users - su01

    Hello ,
    we want to use the search Term fields in the user data. (T-Code SU01)
    As I read in the F1 help, these Fields should be available in the F4 Matchcode for Users?
    But there is no field available? Any Ideas?
    SAP ECC6.0
    SP Stack 13
    Regards
    Tobias Werner

    When you open the User data with t-code su01 , there are 2 fields named "Search Term 1/ 2".
    huh?.... not really following you. when you open user data in SU01 you see well... the user data.
    Regards
    Juan

  • Search Term Issues when passed as Parameters in Opening a PDF file in Browser (Updated)

    Hi everyone,
    I am wondering if there is a solution to the following issue.
    We are working with PDF files that have been OCRed (invisible text layer). We use a search engine to search the PDFs for terms. We then pass the search terms as a parameter to the PDF when we are opening it in Acrobat or Reader in the browser. It brings up a list of instances and the context in which it is found -- much like the native search function -- but it is not possible to only search for the exact phrase when it is passed as a variable..
    In some cases, what we see are two lists -- so it has the filename with a list underneath that is expanded showing search results, and then a second instance of the file name after that list, but it is collapsed.
    Is there a way to just have one list or both lists expanded at the same time?
    Also, is there a way to ensure that it shows instances where more search keywords are found at the top of the list.
    For example, if we pass the search phrase "wanted to buy a car" it might show instances of "to" at the top of the list, but later on in the collapsed list it might show instances of "buy a car".  Again, is it possible to prioritize the results, or at the very least, expand everything? I am not sure what else we can try.
    thank you,
    Jeremy
    Follow up: I should note that some times the two lists appear to be the same or similar terms found twice. At the top it would say 2 documents with n instances (where n is the number of instances). I have noticed this when the search keyword count goes up.
    Follow up #2: It appears that this occurs more often when using more than 2 keywords, but I have seen it happen with only 2 words.

    There were documents available in the knowledgeable that I no longer have the urls for. I have had communication with Adobe Acrobat support personnel that have made the same statements. I do not have the habit  of asking official Adobe tech support people to prove their statements by providing documentation. I have also seen Adobe employees give presentations on computers that have had both installed. When they were asked about the incompatibility, they did say the equivalent of phooey. However, enough people on this forum have had their problems disappear when they have removed one of the two programs that I feel comfortable giving that advice. Yes some people have no problems running both until one of the programs or a system component gets updated and then things stop working. My advice is not to have both on the same computer. When two programs share system calls and can fight over who gets to handle the call it makes sense that it can cause a problem. It doesn't make a difference if it is Reader and Acrobat or any two other programs you run. If you are not having a problem with running both GREAT. However, if you are running both and have a problem, it is a simple step to eliminate one and see if the problem disappears.

Maybe you are looking for

  • How to install Adobe Primetime GMP Windows x86 Beta?

    I'm using Firefox Developer Edition 39.0a2 I've downloaded from here http://cdmdownload.adobe.com/firefox/win/x86/primetime_gmp_win_x86_beta_17005.zip but I don't know how to install that Thanks in advance

  • After upgrading firefox it gets hung up on checking for compatibility add-ons and won't run

    I still can't find an answer on any of the support forums and no one helped me when I asked yesterday, is there anyone that may have a clue as what I can do to fix this? I updated my fire fox on my MAC OS X to 3.6.6 version of firefox, everything wen

  • Upgrading to latest ios

    I recently upgraded my third gen iPad using the wireless option as I no longer have a PC. Upon downloading and installing the software, it is now asking me to connect it to iTunes. Is there a way around it?  I was under the impression that you only n

  • Archiving EBP Documents

    Hi, Could some body pl give pointers to material on EBP Documents archiving.  Espl Shipping Cards and Confirmations.  I want the checks carried out by program before documents are set to achievable status.  Thanks in Advance

  • SQL Developer 2.1: Poor performance on 11g

    We are experiencing poor response times for queries using sql developer 2.1 with our new 11g upgraded database (11.1.0.7). A bit of investigation has shown that a simple select 1 from dual; causes SELECT table_owner, table_name FROM all_synonyms WHER