Search inside vector?

help please.
public class items
  String a;
  int b;
  Vector storageVector = new Vector();
public void wootwoot();
  items weee = new items();
  a=wootest;
  b=100;
  storageVector.add(weee);
public void search();
  //How could i search the content of 'string a' inside vector v?
  //In array, i could simply search for array[0].a but it's not compatible with vector.
}

_helloWorld_ wrote:
Loop over the Vector and use elementAt(). Then check the contents using the equals() method.Or just override the equals(Object) method in the items class(and preferably the hashCode() as well) and use Vector's get(Object) to get an item from your Vector.

Similar Messages

  • How 2 search inside a PDF document using the firefox internal PDF reader

    Cannot find any way to do a text search inside a PDF document when it is displayed by the builtin PDF player in Firefox.
    If there is a way, how is it done?
    If there isn't a way, it seems an obvious enhancement.

    son of a gun. I've always searched in firefox by hitting slash and typing the search term, but that doesn't seem to work in the pdf reader. I guess, if I had searched for key bindings I coulda figured that out for myself.
    thanks!

  • Cannot search inside pdf with Windows Explorer

    Win XP SP2
    Scanned document that has been paper-captured using Acrobat 8.1.2.
    I cannot use Windows Explorer to search for text inside this file.  For example, I search for the word "abstract" (it's a technical paper) which DOES show up when doing a Ctrl-F find inside Acrobat, and I get no results in the search.
    To test, I put one and only one file with that word in it in a new directory, then ran a standard search, using 'abstract' (without quotes) in the "A word or phrase in the file:" box.
    "Search is complete.  There are no results to display."
    Someone tell me why this isn't working?

    Since the search issue is coming up regularly, here is what I used some time back that helped me find a file I have lost a year earlier (OK, an organization problem on my part, but it is the question being asked). To search the interior of any file, not just the limited set of MS, follow the following directions (with warning) from Nick on Windows Vista Tips (for XP):
    "Warning Serious problems might occur if you modify the registry incorrectly
    by using Registry Editor or by using another method. These problems might
    require that you reinstall your operating system. Microsoft cannot guarantee
    that these problems can be solved. Modify the registry at your own risk.
    Network administrators can configure this setting by modifying the registry.
    To do this, set the FilterFilesWithUnknownExtensions DWORD value to 1 in the
    following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro  l\ContentIndex"
    The original link is http://www.winvistatips.com/search-inside-bas-and-frm-files-t570174.html.
    Bill

  • Searching a Vector of objects

    I'm embarassed to ask this question but I haven't figured out the answer myself yet so I need help.
    I need to be able to search a Vector (it could be an Array just as easily) by only certain parts of the objects in the vector. So for example I have vector v that contains 10 objects o. Objects o are a very small custom class that each have a name and a number. How do I search the vector for the object o that contains name x?
    I tried overriding the equals method of object o and using the IndexOf method of vector v but that did not work.

    I'm embarassed to ask this question but I haven't
    figured out the answer myself yet so I need help.
    I need to be able to search a Vector (it could be an
    Array just as easily) by only certain parts of the
    objects in the vector. So for example I have vector
    v that contains 10 objects o. Objects o are a very
    small custom class that each have a name and a
    number. How do I search the vector for the object o
    that contains name x?Iterate over the Vector and ask each element whether its name is x.
    I tried overriding the equals method of object o and
    using the IndexOf method of vector v but that did not
    work.What does "did not work" mean?

  • Formatted Search inside a Price List

    Hi,
    Is it possible to put a formatted search inside a Price List which will auto-update?
    I created a query which looks at Special Prices tables OSPP and put an FMS in Price List 10. However, this FMS does not auto-update - it only updates when I click the "magnifying glass" of the formatted search. It would be cumbersome to click all items one-by-one.
    Thanks,
    Ajay Audich

    Hi...
    I understand that your formatted search is applied to the price column in your list of Charges 10. You've proven that their execution is made when leaving the modified column "Manual"? ..
    This column can fill it with one and then clicking on the column header.
    Best regards,

  • Searchs in Portal doesn't search inside the document

    My searchs in oracle portal doesn't search inside the documents. It only works in txt documents, but not in word docuements, excel documents, etc...
    Patch 3.0.9.8.2 Database Oracle 9i 9.0.1.3.1

    I assume that you are using Oracle (Intermedia) Text functionality. Without this searching within documents is not supported anyway. In which case you need to make sure that your indexes are being syncronized regularly (see the configuration guide on how this is done) and that there are no indexing errors for your DOC index - WWSBR_DOC_CTX_INDX. To determine this, look at the the view CTX_USER_INDEX_ERRORS.

  • How to disable spotlight searches inside packages

    Hi,
    I tagged all my files inside my document folder, now I'd like to create and save a smart folder searching for all the untagged files, just in case I create or move a file to that folder without tagging it first.
    The problem is that I have several files, which are packages with other files in them (created with Scrivener, Devonthink, OmniOutliner...). These other files aren't tagged (and I don't need nor want to tag them) so they are showed in my spotlight search.
    I can't exclude the folders containing these files in spotlight preference, since there are a lot of them and I often create new files of these kinds.
    I would like to tell spotlight not to search inside packages. Is that possible?
    thanks in advance,
    pietro

    You can't remove it so as it is fixed in the OS of the phone.

  • Searching a vector

    Ok, second post. I gave up on the whole array idea and moved to vectors. I got it reading the text file and adding to the vector succesfully. Now I need to search that vector. The text file looks like this:
    9876543 9876543 Y
    0612207 0612207 N
    0123456 0123456 N
    1234567 1234567 Y
    Here's my code so far:
    import java.*;
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class EmailForms extends JFrame implements ActionListener {
         private JTextField jtfUserName;
         private JPasswordField jpfPassword;
         private JButton jbtLogin;
         private JButton jbtCancel;
         Vector LoginData = new Vector();
         public static void main (String[] args) {     
              EmailForms LoginFrame = new EmailForms();
              LoginFrame.setSize(200, 100);
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              int screenWidth = screenSize.width;
              int screenHeight = screenSize.height;
              Dimension frameSize = LoginFrame.getSize();
              int x = (screenWidth - frameSize.width)/2;
              int y = (screenHeight - frameSize.height)/2;
              LoginFrame.setLocation(x, y);
              LoginFrame.pack();
              LoginFrame.setVisible(true);     
         public EmailForms () {     
              try {     
                   String UP1Line;
                   FileInputStream fis = new FileInputStream("UP1.txt");
                  BufferedReader br = new BufferedReader(new InputStreamReader(fis));
                  while ((UP1Line = br.readLine()) != null) {
                        StringTokenizer st = new StringTokenizer(UP1Line, " ");
                        while (st.hasMoreTokens()) {
                          LoginData.addElement(st.nextToken());
                    br.close();
                    fis.close();
              catch (IOException ex){
                   JOptionPane.showMessageDialog(this, "Fatal Systems Error", "Email Forms: File Error 1",
                   JOptionPane.INFORMATION_MESSAGE);
                   System.exit(0);     
              catch (NullPointerException ex){
                   JOptionPane.showMessageDialog(this, "Fatal Systems Error", "Email Forms: File Error 2",
                   JOptionPane.INFORMATION_MESSAGE);
                   System.exit(0);     
              setTitle("E-Forms: Login");
              JPanel jpLoginLabels = new JPanel();
              jpLoginLabels.setLayout(new GridLayout(2, 1));
              jpLoginLabels.add(new JLabel("Username:"));
              jpLoginLabels.add(new JLabel("Password:"));
              JPanel jpLoginText = new JPanel();
              jpLoginText.setLayout(new GridLayout(2, 1));
              jpLoginText.add(jtfUserName = new JTextField(10));
              jpLoginText.add(jpfPassword = new JPasswordField(10));
              JPanel p1 = new JPanel();
              p1.setLayout(new BorderLayout());     
              p1.add(jpLoginLabels, BorderLayout.WEST);
              p1.add(jpLoginText, BorderLayout.CENTER);
              JPanel p2 = new JPanel();
              p2.setLayout(new FlowLayout(FlowLayout.CENTER));     
              p2.add(jbtLogin = new JButton("Login"));
              p2.add(jbtCancel = new JButton("Cancel"));     
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(p1, BorderLayout.CENTER);
              getContentPane().add(p2, BorderLayout.SOUTH);
              jbtLogin.addActionListener(this);
              jbtCancel.addActionListener(this);
         public void actionPerformed(ActionEvent e) {
              String arg = e.getActionCommand();
              int index = find(jtfUserName.getText().trim(), new String(jpfPassword.getPassword()));
              if (arg == "Cancel") {
                   System.exit(0);
                   arg = "";
              if (arg == "Login") {
                   if (index == -1) {
                        JOptionPane.showMessageDialog(this, "Username/Password Not Found", "Email Forms: Login Error",
                        JOptionPane.INFORMATION_MESSAGE);
                   else {
                        if (index == 1 ){
                             JOptionPane.showMessageDialog(this, "Username and Password Found: Admin", "Email Forms: Good",
                             JOptionPane.INFORMATION_MESSAGE);
                        else {
                             JOptionPane.showMessageDialog(this, "Username and Password Found: User", "Email Forms: Good",
                             JOptionPane.INFORMATION_MESSAGE);          
              arg = "";
         public int find(String UName, String PWord) {
              for (int i = 0; i < LoginData.size(); i++) {                                        
                   // if ((first.element.of.first.line.UName  == LoginData.elementAt(i)) && (second.element.of.first.line.PWord == LoginData(i))) {
                   //          if (third.element.of.first.line.yes or no admin == "Y") {
                   //               goto adminside;
                   //               return 1; }
                   //          else {
                   //               goto userside;
                   //               return 2;
              return -1;
    }Essentially this is a login method. The standard username and password. The kicker is the third entry in each line of the vector "Y" or "No". This entry denotes whether or not the user is an admin. If he/she is an admin, they go to an admin program else he/she is a regular user and goes to the user program. I've done some reading on searching vectors in this forum as well as others, but none have I have read have tackled this third entry. Can someone have a look and give me their opinion.
    Thanks in advance,
    Colin

    Here you go:
    1. Use a HashMap to look up credentials.
    2. Use regular expressions to check for certain values
    The code does what you need (just checked it), but you probably wouldn't save the credentials as a "String[]" array. So there's room for improvement ;)
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class EmailForms extends JFrame implements ActionListener {
         private static final long serialVersionUID = -6409081110711705001L;
         private JTextField jtfUserName;
         private JPasswordField jpfPassword;
         private JButton jbtLogin;
         private JButton jbtCancel;
         private HashMap<String, String[]> users;
         public static void main (String[] args) {     
              EmailForms LoginFrame = new EmailForms();
              LoginFrame.setSize(200, 100);
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              int screenWidth = screenSize.width;
              int screenHeight = screenSize.height;
              Dimension frameSize = LoginFrame.getSize();
              int x = (screenWidth - frameSize.width)/2;
              int y = (screenHeight - frameSize.height)/2;
              LoginFrame.setLocation(x, y);
              LoginFrame.pack();
              LoginFrame.setVisible(true);     
         public EmailForms () {     
              users = new HashMap<String, String[]>();
              try {     
                   String UP1Line;
                   FileInputStream fis = new FileInputStream("UP1.txt");
                  BufferedReader br = new BufferedReader(new InputStreamReader(fis));
                  while ((UP1Line = br.readLine()) != null) {
                       String [] items = UP1Line.split(" ", 4);     //max. 6 tokens, separated by semicolon
                       users.put(items[0], new String[] { items[1], items[2] });
                       if (items[2].matches("[Yy]"))
                            System.err.println("y");
                       else
                            System.err.println("n");
                    br.close();
                    fis.close();
              catch (IOException ex){
                   JOptionPane.showMessageDialog(this, "Fatal Systems Error", "Email Forms: File Error 1",
                   JOptionPane.INFORMATION_MESSAGE);
                   System.exit(0);     
              catch (NullPointerException ex){
                   JOptionPane.showMessageDialog(this, "Fatal Systems Error", "Email Forms: File Error 2",
                   JOptionPane.INFORMATION_MESSAGE);
                   System.exit(0);     
              setTitle("E-Forms: Login");
              JPanel jpLoginLabels = new JPanel();
              jpLoginLabels.setLayout(new GridLayout(2, 1));
              jpLoginLabels.add(new JLabel("Username:"));
              jpLoginLabels.add(new JLabel("Password:"));
              JPanel jpLoginText = new JPanel();
              jpLoginText.setLayout(new GridLayout(2, 1));
              jpLoginText.add(jtfUserName = new JTextField(10));
              jpLoginText.add(jpfPassword = new JPasswordField(10));
              JPanel p1 = new JPanel();
              p1.setLayout(new BorderLayout());     
              p1.add(jpLoginLabels, BorderLayout.WEST);
              p1.add(jpLoginText, BorderLayout.CENTER);
              JPanel p2 = new JPanel();
              p2.setLayout(new FlowLayout(FlowLayout.CENTER));     
              p2.add(jbtLogin = new JButton("Login"));
              p2.add(jbtCancel = new JButton("Cancel"));     
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(p1, BorderLayout.CENTER);
              getContentPane().add(p2, BorderLayout.SOUTH);
              jbtLogin.addActionListener(this);
              jbtCancel.addActionListener(this);
         public void actionPerformed(ActionEvent e) {
              String arg = e.getActionCommand();
              int index = find(jtfUserName.getText().trim(), new String(jpfPassword.getPassword()));
              if (arg == "Cancel") {
                   System.exit(0);
                   arg = "";
              if (arg == "Login") {
                   if (index == -1) {
                        JOptionPane.showMessageDialog(this, "Username/Password Not Found", "Email Forms: Login Error",
                        JOptionPane.INFORMATION_MESSAGE);
                   else {
                        if (index == 1 ){
                             JOptionPane.showMessageDialog(this, "Username and Password Found: Admin", "Email Forms: Good",
                             JOptionPane.INFORMATION_MESSAGE);
                        else {
                             JOptionPane.showMessageDialog(this, "Username and Password Found: User", "Email Forms: Good",
                             JOptionPane.INFORMATION_MESSAGE);          
              arg = "";
         public int find(String UName, String PWord) {
              String [] creds = users.get(UName);
              if (creds!=null && creds[0].matches(PWord)) {
                   System.out.println("ok");
                   if (creds[1].matches("[Yy]"))
                        return 1;
                   else
                        return 0;
              System.err.println("not ok");
              return -1;
    }

  • Search inside non-PDF attachment to Adobe acrobar documents

    I am not able to use the in-built SEARCH function of Adobe Acrobat to locate specific words inside non-PDF attachments (e.g Microsoft Word attachment) to the PDF document.

    Hi
    Is there an add-in or any other facility that could allow to search inside non-Adobe Acrobat files which are attached inside an Adobe Acrobat documents?
    Ashvin

  • How to search inside BLOB

    Hi,
    I need to search inside BLOB segment for specific string.
    I have tried two options , but non of them return row.
    select ...
    from ....
    where dbms_lob.instr(my_blob, utl_raw.cast_to_raw('/PROD-NP-2009Version/Shared/Connections/Database'))>0 
    select ...
    from ....
    where dbms_lob.instr(my_blob, utl_raw.cast_to_raw('/PROD-NP-2009Version/Shared/Connections/Database'),1,1)>0
    I am not sure that the string is exists , but would like to get your advise which option is should use future searches
    Thanks

    Wrong forum!
    This forum is ONLY for Sql Developer questions.
    Please mark your thread ANSWERED and repost it in the Sql and Pl/Sql forum
    PL/SQL
    BLOBs are OPAQUE - they contain binary data, not strings.
    You need to convert the BLOB to an appropriate datatype (e.g. CLOB) if you want to treat it as a 'string'. Repost in the other forum and you can get further help with your question.

  • Advanced Search inside iCal

    Hi there.
    I'm looking for advanced keywords to make complex search inside my calendars.
    I found the keywords AND and OR that enable me to find multiple events in a single search. Are there similar keywords to search only events until certain date and some more keywords?
    For example ... I need to find all events until 10/10/2009 (something like : * _UNITIL 10/10/2009_
    Thank you so much!
    Gabriele

    FaLc[ON]2,
    Welcome to Apple Discussions.
    Enter the " character in the iCal Search field. The results pane will have four columns at the top (Calendar/Date/Type/Title). Click on the "Date" column to see the results organized by specific dates.
    ;~)

  • Spotlight/Finder search inside bundles?

    I'm wondering how to search inside bundles (.app, .mpkg, etc...). When, for example, I do a search for "Kind: Applications" in the Finder, I get lots of results (including system files, which I added as a search attribute), but nothing inside another application or bundle. How do I do this?

    Hi L,
    Sorry for the missing bar for System!
    Strange behavior is what you got.
    Log in with you Admin account, you can do that in Terminal using the command line "login" when you will be prompted for user name and password (after finishing shell interaction, logout from Admin account with the command line "exit" - this logout is mean to be used as default for any shell interaction). As Admin try using the find without the sudo and the copy, like:
    find /Applications/ /Library/ /System/ /Users/ /Developer/ -name "*.icns"
    If you have items listed, even with some access denied messages, then append the copy instruction. Check the copied files existence, if they were there do the simple find again but insert the sudo - this should ask for your user password (not the root password); from here the same as before, getting listing append the copy instruction.
    If sudo do not work check for log entries in your /var/log/auth.log and bring those entries here.
    Good luck.

  • Flash - Search inside documents

    Hi,
    I'm developing one ebook, and i want to know if it's possible
    to make a search engine in flash that searches inside external
    documents, i would prefer in pdf documents since they are both from
    adobe, or is there any other format faster and easier to use in the
    documents (xml, doc)?
    Best regards and thanks

    I would also like to know if there is a tool to search for words inside .ai files. I have lots of .ai files and I need files containing specific words.
    Thank you,
    Filip.

  • Search inside threads

    hey all,
    i'm relatively new to this forum, but i oooften used it to solve issues i had relating arch.
    so here's what's really missing in this forum: you cannot search inside of threads.
    this feature would really make problem-solving related search much easier, especially in those huuuge threads.
    is this a feature that could be integrated?
    if yes: discuss.
    regrets

    lukrass wrote:is this a feature that could be integrated?
    We use vanilla FluxBB as provided by the upstream. We do not add any modifications/patches. So if you want any feature in the forum, you will likely have to contact the FluxBB devs.
    And as hauzer mentioned, google is available.

  • Search inside messeges

    i upgrated to ios7, and now i can't search inside the messeges. it doesn't show me any results.

    Hi morangol,
    One of the new features in iOS 7 is the way Spotlight Search works.
    You can access Spotlight Search from any of the Home screen.
    You can search for anything, and control what apps to search.
    See page 29 of the iPhone User Guide below:
    iPhone User Guide
    manuals.info.apple.com/MANUALS/1000/MA1565/en_US/iphone_user_guide.pdf
    Search iPhone.
    Drag down the middle of any Home screen to reveal the search field. Results
    occur as you type; to hide the keyboard and see more results on the screen, tap Search. Tap an
    item in the list to open it.
    Choose which apps and content are searched.
    Go to Settings > General > Spotlight Search. You can also change the search order.
    Cheers,
    - Judy

Maybe you are looking for

  • Replacing WS_DOWNLOAD with CL_GUI_FRONTEND_SERVICES= GUI_DOWNLOAD

    Hi Guys,    I'm currently changing the programs that uses the obsolete function WS_DOWNLOAD with CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD, and I just want to ask what are the valid FILETYPE for GUI_DOWNLOAD and how can I use a WK1, XLS and DAT filetype

  • How to display Hierarchy in WDA Search help

    Hello Experts, Please let me know if i can display hierarchy (tree like structure) in WD ABAP search help,i am quite new to WD ABAP. Any suggestions and inputs would be very helpful. Thanks & Regards, Siddharth

  • Spotlight keeps indexing

    hi, The Time Capsule at work stopped taking backups of my machine on July,1. For my colleagues, it still works fine. I also noticed spotlight keeps trying to index the disk. As a solution I removed the latest backup (indicated with 'inProgress' and I

  • 10.4.4 and 10.4.5 issues with Displays

    My system use to detect my Viewsonic VA2012w on 10.4.3. Since I've updated to 10.4.4 and 10.4.5, it no longer detects my monitor. Any clues? MacMini   Mac OS X (10.4.5)  

  • Please help!! x100e blue screen issue

    Hey everyone, I'm new on here, trying to help out my sister who's in school and so far failing miserably! She has a x100e and developed the blue screen issue.  I did a bunch of reading on it- but have never seen an error message. I formatted the hard