Shall we compare two elements in a collection

Dear all,
shall we compare two scuccessive elements in a collection
i am creating a type.and i am dumping the data into that type using bulk collect.now i need to compare the data in type (previous value and current value).
please suggest
Thank you.
Suresh

899511 wrote:
Dear all,
shall we compare two scuccessive elements in a collection
i am creating a type.and i am dumping the data into that type using bulk collect.now i need to compare the data in type (previous value and current value).
please suggest
Thank you.
SureshDon't do it in a collection. Use SQL.
SQL provides Lead and Lag analytical function that allow you to compare next/previous values.
e.g.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions070.htm
Loading the data into a collection in memory to do something that can be easily achieved in SQL is just wrong and uses expensive PGA memory unnecessarily.

Similar Messages

  • Failed to compare two elements in the array

    very often, I have the error "Failed to compare two elements in the array" in Exchange 2013 ECP. We are not running DAG. I google a bit but don't get a lot of result on this.
    I was trying to track mail from a user who send to DL group. Since I can't do in in ECP , how can I do it in EMS?

    I too have this issue.  I'm not sure how wide spread.  I know of one user who sends emails regularly to a DL named "All Users" which is a Security Group which we then add real users to and not just every mailbox.  When he sends the emails,
    from his perspective, everything is fine, meaning he gets to NDR or anything.  Also, when he adds the Dl in Outlook To field and expands it, all the correct users are there.  In fact, it tells him there are 203 addresses here.  However, only
    184 are actually getting the message.  When I try the EAC to view the tracking report, it will show the message, but if I click on the edit button, I get "Failed to compare two elements in the array".  If I try from EMC with search-messagetrackingreport
    -identity "recipient address" -sender "sender address" -bypassdelegatechecking and the recipient address is the group, it says it could not be found.  If I try with simply putting an email address of someone who is a member of that group, it says Warning:
    An unexpected error has occured and a Watson dump is being generated.  Failed to compare two elements in the array.  I don't know what else to try.  Anybody??

  • How to compare two elements?

    Hi Brothers,
    How can I compare two nodelements from different nodes if they have the same content?
    I tried
    boolean elementExists(IE_CustomerElement element){
           for (int i=0; i < wdContext.nodeChangedCustomerRows().size(); i++){
                if(element.equals(wdContext.nodeChangedCustomerRows().
                                    currentChangedCustomerRowsElement())){
                     return true;
           return false;
    But this doesn't work since element may be from a different node and thus is not equal to wdContext.nodeChangedCustomerRows().currentChangedCustomerRowsElement()
    Both elements have the same attributes, though...
    Any ideas? Thanks, Johannes

    Johannes,
    Object.equals method returns true only if both the arguments point to same object. So,
    element.equals(wdContext.nodeChangedCustomerRows().currentChangedCustomerRowsElement()
    will be true only if both element and nodeChangedCustomerRows().currentChangedCustomerRowsElement() refer to same object, which is not the case here.
    You'll need to do attribute comparison to see if the elements are equal. Something like this might work for you.
    boolean elementExists(IE_CustomerElement element)
           for (int i=0; i < wdContext.nodeChangedCustomerRows().size(); i++)
                if((element.Attribute1.equalsIgnoreCase(wdContext.nodeChangedCustomerRows().currentChangedCustomerRowsElement().Attribute1))&&
                   (element.Attribute2.equalsIgnoreCase(wdContext.nodeChangedCustomerRows().currentChangedCustomerRowsElement().Attribute2))&&
                   (element.Attribute3.equalsIgnoreCase(wdContext.nodeChangedCustomerRows().currentChangedCustomerRowsElement().Attribute3))
                          & so on....
                     return true;
           return false;
    There might be better ways to do this, let me know if you come across one.
    Hope this helps.
    Vishwas.

  • SCCM 2007 Query to compare two machines and their collections

    I need a query/report in sccm to run against two machines.  One has the base image and standard applications, the other will have the base image plus additional applications installed from the RAP menu.  I'd like to query the two and find the difference
    between their add/remove programs, and also add the Package ID.  
    I found this query below, but it doesnt display the Package ID, which I'd like to have as well.
    Ultimately, I'd love the result to filter out the common aplications and only show what's missing from the base machine Vs the full-blown machine.
    ************* SQL STATEMENT BELOW HERE ************
    SELECT     one.Computer1Name AS [Computer 1 Name], one.Computer1Display AS [Display Name], one.Version0, two.Computer2Name AS [Computer 2 Name], 
                          two.Computer2Display AS [Display Name], two.Version0
    FROM         (SELECT     v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 AS Computer1Display, v_R_System.Netbios_Name0 AS Computer1Name, 
                                                  v_GS_ADD_REMOVE_PROGRAMS.Version0, v_GS_ADD_REMOVE_PROGRAMS.InstallDate0
                           FROM          v_GS_ADD_REMOVE_PROGRAMS INNER JOIN
                                                  v_R_System ON v_GS_ADD_REMOVE_PROGRAMS.ResourceID = v_R_System.ResourceID
                           WHERE      (v_R_System.Netbios_Name0 = @Computer1) AND (v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 IS NOT NULL)) 
                          AS one FULL OUTER JOIN
                              (SELECT     v_GS_ADD_REMOVE_PROGRAMS_1.DisplayName0 AS Computer2Display, v_R_System_1.Netbios_Name0 AS Computer2Name, 
                                                       v_GS_ADD_REMOVE_PROGRAMS_1.Version0, v_GS_ADD_REMOVE_PROGRAMS_1.InstallDate0
                                FROM          v_GS_ADD_REMOVE_PROGRAMS AS v_GS_ADD_REMOVE_PROGRAMS_1 INNER JOIN
                                                       v_R_System AS v_R_System_1 ON v_GS_ADD_REMOVE_PROGRAMS_1.ResourceID = v_R_System_1.ResourceID
                                WHERE      (v_R_System_1.Netbios_Name0 = @Computer2) AND (v_GS_ADD_REMOVE_PROGRAMS_1.DisplayName0 IS NOT NULL)) AS two ON 
                          one.Computer1Display = two.Computer2Display
    ORDER BY [Computer 1 Name], [Computer 2 Name]

    This is as close that I managed to get.....
    SELECT     one.Computer1Name AS [Computer 1 Name], one.Computer1Display AS [Display Name], two.Computer2Name AS [Computer 2 Name], 
                          two.Computer2Display AS [Display Name]
    FROM         (SELECT     v_Advertisement.PackageID, v_ClientAdvertisementStatus.AdvertisementID, v_R_System.Netbios_Name0 AS Computer1Name, 
                                                  v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 AS Computer1Display
                           FROM          v_R_System INNER JOIN
                                                  v_GS_ADD_REMOVE_PROGRAMS ON v_R_System.ResourceID = v_GS_ADD_REMOVE_PROGRAMS.ResourceID INNER JOIN
                                                  v_ClientAdvertisementStatus ON v_GS_ADD_REMOVE_PROGRAMS.ResourceID = v_ClientAdvertisementStatus.ResourceID
    INNER JOIN
                                                  v_Advertisement ON v_ClientAdvertisementStatus.AdvertisementID = v_Advertisement.AdvertisementID
                           WHERE      (v_R_System.Netbios_Name0 = @Computer1) AND (v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 IS NOT NULL)) AS one FULL OUTER JOIN
                              (SELECT     v_Advertisement_1.PackageID, v_ClientAdvertisementStatus_1.AdvertisementID, v_R_System_1.Netbios_Name0 AS Computer2Name, 
                                                       v_GS_ADD_REMOVE_PROGRAMS_1.DisplayName0 AS Computer2Display
                                FROM          v_R_System AS v_R_System_1 INNER JOIN
                                                       v_GS_ADD_REMOVE_PROGRAMS AS v_GS_ADD_REMOVE_PROGRAMS_1 ON 
                                                       v_R_System_1.ResourceID = v_GS_ADD_REMOVE_PROGRAMS_1.ResourceID INNER JOIN
                                                       v_ClientAdvertisementStatus AS v_ClientAdvertisementStatus_1 ON 
                                                       v_GS_ADD_REMOVE_PROGRAMS_1.ResourceID = v_ClientAdvertisementStatus_1.ResourceID
    INNER JOIN
                                                       v_Advertisement AS v_Advertisement_1 ON v_ClientAdvertisementStatus_1.AdvertisementID
    = v_Advertisement_1.AdvertisementID
                                WHERE      (v_R_System_1.Netbios_Name0 = @Computer2) AND (v_GS_ADD_REMOVE_PROGRAMS_1.DisplayName0 IS NOT NULL)) AS two ON 
                          one.Computer1Display = two.Computer2Display
    ORDER BY [Computer 1 Name], [Computer 2 Name]

  • How can I compare two collections at the same time? (View two grid views)

    I have two collections containing some of the same images. (My Nikon D70 did not put an end-of-file on some images. I recovered them into a different collection.) Now I want to display both collections side-by-side in grid view. I will select those images in the "recovered" collection that correspond to the bad images in the "main" collection, add the ratings etc, and move just these to another collection.
    It is extremely frustrating to have to bounce back and forth between collections, remembering each image one by one and selecting it in the "recovered" collection. (The image names are not preserved in the "recovered" collection -- I have to go by what the image looks like.)
    LightRoom allows me to compare photos in the compare view. I want to compare collections in two grid views.

    CaptureTheLight,
    you have ran into a situation when you have to compare two sets of images and now you're wondering how come Lightroom doesn't have such "obviously necessary" functionality? But you have to admit it, this is not such a common situation in a photographer's workflow recovers broken files and tries to compare them against themselves. I think it's a pretty specific feature you need. Still, Lightroom has enough powerful tools for editing and sorting images.
    For example...
    You could just put them all - "main" and "recovered" - into a single collection or into the Quick Collection. Label the entire "recovered" collection with, say, red and sort by capture time. Now you'll have everything side by side, ordered chronologically. The "recovered" images will stay next to the "main" images since their capture time will be the same, and they will also stand out since they have the red label.
    Make the thumbnails bigger and set up the grid view so it tints the thumbnail cell are tinted with the label color. Now, you can go quickly through them visually checking labeled vs unlabeled.

  • Compare two collection in sharepoint

    Hii
    I want to Compare to collection in sharepoint
    example:
    Collection 1: "A","B","C"
    Collection 2:"A","B","D","E"
    Result should be: "C"
    Like in C#  List<string> result = list1.Except(list2).ToList();
    I am new to programming Please help me..
    regards 
    sudeep

    http://stackoverflow.com/questions/3407356/comparing-two-collections
    check this example code below
    class CompareLists
    static void Main()
    // Create the IEnumerable data sources.
    string[] names1 = System.IO.File.ReadAllLines(@"../../../names1.txt");
    string[] names2 = System.IO.File.ReadAllLines(@"../../../names2.txt");
    // Create the query. Note that method syntax must be used here.
    IEnumerable<string> differenceQuery =
    names1.Except(names2);
    // Execute the query.
    Console.WriteLine("The following lines are in names1.txt but not names2.txt");
    foreach (string s in differenceQuery)
    Console.WriteLine(s);
    // Keep the console window open in debug mode.
    Console.WriteLine("Press any key to exit");
    Console.ReadKey();
    /* Output:
    The following lines are in names1.txt but not names2.txt
    Potra, Cristina
    Noriega, Fabricio
    Aw, Kam Foo
    Toyoshima, Tim
    Guy, Wey Yuan
    Garcia, Debra
    http://msdn.microsoft.com/en-us/library/bb397894.aspx
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • Performance issues comparing two vectors

    I need some advice on what is the fastest way to compare two vectors. My question is all about performance;
    I have two vectors one(Vect A) of which has more than 20000 string values and the other Vector B would hold typically around 200 strings.I compare them both to find out if Vector B has values in Vector A and remove those.
    I iterate thro each element in a loop from the smaller to the bigger vector comparing element by element.But it takes a long time.
    Is there any quick way to do this comparison and can I use contains/compare methods instead of iterating thro the vectors.will it speeden up things
    Arn

    first of all, you should probably examine your collection choice and make sure that java.util.Vector is your best option (assumming you can change the class). Do not use a Hashtable as the previous poster suggested- it doesn't sound like you have a key/value type relationship in your elements, making a Map implementation superflous. Will there be duplicate elements in either Collection? If you will not have duplicate elements, you should probably use a Set collection instead of a List. Does your collection have to be thread-safe? If not, one of the unsynchronized collections should give you better performance (e.g. ArrayList should be quicker then Vector). For the best possible performance, you could use an ordered collection and write your own comparator, so that it does not iterate beyond what ever element assurres that there is no match (i.e. if the first element is "fred" in an ordered collection, you know there will be no match for "adam"). Sun has some good tutorials on the java.util.Collection package that will help you understand the benefit of each implemenation...
    although, and I suppose this is neither here nor there, I wouldn't use java objects to sort through 20K string items- sounds like storing them in a database might be superior. Take care.

  • Functinality to compare two material price with reference to BOM in CO

    Hi All,
    Is there is any functionality in Controlling which can compare the costing for two FERT materials.
    or
    is there is  any functionality where we can compare two material price with reference to BOM in controlling
    Please help me to compare the material price with reference to BOM
    Regards
    nandu

    Hi,
    You can use this report to compare two itemizations. The report compares the characteristics item number, item category, cost element, resource, material, cost center, plant/work center, cost center/activity type, operation number, BOM item, assembly indicator, and cost component.
    You can access this report as follows:
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Material Costing ® Cost Estimate with Quantity Structure or Cost Estimate Without Quantity Structure ® Compare
    or
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Information System ® Object Comparisons ® For Material ® Itemization Comparison.
    For Detail Please reffer following link:
    http://help.sap.com/saphelp_46c/helpdata/en/56/abd108f1a611d28a950000e8214595/content.htm
    Thanks and Regards
    Binoj M D

  • How to compare two datetimes in BPEL?

    Hi, All,
    I need compare two datetimes in a switch activity, but can't find any function for it.
    My switch activity like this:
    case date1>date2:
    do something;
    otherwise:
    do something;
    There's no such function in "Date Functions" and can't find such function in xpath.
    BTY, there's no function to make a time duration(by minus one date from another?..so this back to the data compare issue ).
    Thanks.

    Hi,
    Logical function such as greater/less than function can be used to compare two dates as same as comapring two numbers.
    Ex: If your receive variables contains two data elements as date1 and date2 then you can use below format in switch condition.
    XpathXpression(date1) > XpathXpression(date2)
    hope it will help you.

  • Compare two text files for matching data

    HI
    I want to compare data in two separate spreadsheet files and store the matching data in another spreadsheet file.
    like
    1)reading data from two spread sheets
    2)compare the data of fist one with second
    3)writing the matched data to third one.
    I am find difficulty in combining them to sort string bu string
    pls help me in this
    thanks
    jyohti

    hi
    i am implementing the following logic
    1)  textfile1--------->string to array
    2)textfile 2--------->string to array
    3) compare the elements (substring) of one array to other using for loop
    4)append the match to an array every time you find a match betwwen two arrays
    5)wriitng the result in new file
    i am strugulling in with 3) i have finshed 1,2,4and 5 th part
    problelms are with indexing and loop conditions for me...
    anyways i am trying and feeling like i will finish and post that soon....

  • How to compare two XSD files programmatically

    Hi
    I want to compare two XSD files programmatically to find out whether one XSD is a sub set of another XSD(Means checking all the elements and attributes of one schema to be present in another schema).
    Please let me know how this can be done in an efficient way.
    Thanks in advance.
    Mithun K

    Or simply apply an oracle text index on your pdf column:
    SQL>  create table t (id integer primary key, bl blob)
    Table created.
    SQL>  declare
    bf bfile := bfilename('TEMP','b32001.pdf');
    bl blob;
    begin
    dbms_lob.createtemporary(bl,true);
    dbms_lob.open(bf,dbms_lob.lob_readonly);
    DBMS_LOB.LOADFROMFILE(bl, bf,dbms_lob.getlength(bf));
    insert into t values (1,bl);
    commit;
    dbms_lob.close(bf);
    dbms_lob.freetemporary(bl);
    end;
    PL/SQL procedure successfully completed.
    SQL>  create index t_idx on t (bl) indextype is ctxsys.context parameters ('filter ctxsys.auto_filter')
    Index created.
    SQL>  declare
       mklob   clob;
    begin
       ctx_doc.filter ('t_idx', '1', mklob, true);
       dbms_output.put_line (substr (mklob, 1, 250));
       dbms_lob.freetemporary (mklob);
    end;
    Oracle® Database
    Release Notes
    11
    g
    Release 1 (11.1) for Linux
    B32001-04
    November 2007
    This document contains important information that was not included in the
    platform-specific or product-specific documentation
    PL/SQL procedure successfully completed.This generates a text only version of your pdf and standard text comparison methods can be applied ....

  • Comparing two XML using DOM

    Hi All,
    I am comparing two XML nodes having same nodes using DOM parser.
    <?xml version="1.0"?>
    <compare value="xml1"/>
    < test name="java">
          <compare value="xml">
              <node>012</node>
    </compare>
    </test>
    < test name="java1">
          <compare value="xml2">
              <node>013</node>
          </compare>
          <compare value="xml3">
              <node>014</node>
         </compare>
    </test>I need to take <compare> and <node> present inside <test> tag.
    I am not getting the results properly if i am using the following code
    NodeList bList1 = doc.getElementsByTagName("compare");
                        for (int temp1 = 0; temp1 < bList.getLength(); temp1++) {
                          Node nNode = bList.item(temp1);
                          NamedNodeMap attributes = (NamedNodeMap)nNode.getAttributes();
                                          for (int g = 0; g < attributes.getLength(); g++) {
                                              Attr attribute = (Attr)attributes.item(g);
                                              System.out.println(" Attribute: " + attribute.getName() +
                                              " with value " +attribute.getValue());
                                           if (nNode.getNodeType() == Node.ELEMENT_NODE) {
                        Element eElement = (Element) nNode;
                                          NodeList nlList= eElement.getElementsByTagName("node").item(0).getChildNodes();
                    Node nValue = (Node) nlList.item(0);
                    String node = nValue.getNodeValue();
    }is there any possibility to get the <compare> and <node> tag present inside <test> tag...

    2nd xml
    <?xml version="1.0"?>
    <compare value="xml1"/>
    < test name="java">
          <compare value="xml">
              <node>012</node>
    </compare>
    </test>
    < test name="java1">
          <compare value="xml2">
              <node>015</node>
          </compare>
          <compare value="xml3">
              <node>016</node>
         </compare>
    </test>
    Map m1= new HashMap();
    NodeList bList1 = doc.getElementsByTagName("compare");
                        for (int temp1 = 0; temp1 < bList1.getLength(); temp1++) {
                          Node nNode = bList1.item(temp1);
                          NamedNodeMap attributes = (NamedNodeMap)nNode.getAttributes();
                                          for (int g = 0; g < attributes.getLength(); g++) {
                                              Attr attribute = (Attr)attributes.item(g);
    m1.put (attribute.getName(),attribute.getValue());
                                           if (nNode.getNodeType() == Node.ELEMENT_NODE) {
                        Element eElement = (Element) nNode;
                                          NodeList nlList= eElement.getElementsByTagName("node").item(0).getChildNodes();
                    Node nValue = (Node) nlList.item(0);
                    String node = nValue.getNodeValue();
    m1.put ("node");
    Map m2= new HashMap();
    NodeList bList2 = doc1.getElementsByTagName("compare");
                        for (int temp1 = 0; temp1 < bList2.getLength(); temp1++) {
                          Node nNode1 = bLis2.item(temp1);
                          NamedNodeMap attributes = (NamedNodeMap)nNode1.getAttributes();
                                          for (int g = 0; g < attributes.getLength(); g++) {
                                              Attr attribute = (Attr)attributes.item(g);
    m1.put (attribute.getName(),attribute.getValue());
                                           if (nNode1.getNodeType() == Node.ELEMENT_NODE) {
                        Element eElement = (Element) nNode1;
                                          NodeList nlList= eElement.getElementsByTagName("node").item(0).getChildNodes();
                    Node nValue = (Node) nlList.item(0);
                    String node = nValue.getNodeValue();
    m2.put ("node");
                        List<Map.Entry<String, String>> results =
                                new ArrayList<Map.Entry<String, String>>();
                        Set<Map.Entry<String, String>> s1 = m1.entrySet();
                        Set<Map.Entry<String, String>> s2 = m2.entrySet();
                            results =
                                                        new ArrayList<Map.Entry<String, String>>();
                        for (Map.Entry<String, String> entry : s1) {
                            if (!s2.contains(entry)) results.add(entry);
                        for (Map.Entry<String, String> entry : s2) {
                            if (!s1.contains(entry)) results.add(entry);
                        System.out.println(results);Like this I am comparing :
    I need to get the attribute value of <compare> and body value for
    <node> tag and need to compare the values in both XML.

  • Compare two XML files: Analysis and Design

    Hi, Java/XML/JDOM experts,
    I realised that an open source of Java utility to compare two XML is still missing. So I would like to write one for my JDOM excises.
    I plan to do it in three steps:
    1.Define the problem domain.
    2.Design the classes to be developed.
    3.Coding
    Below is the problem domain. Would you review it and tell me if it is fine?
    Best regards,
    AG
    Compare two XML files
    Schema assumption:
    The xml files used for the comparison must have the same schema.
    Definition:
    1. Two elements of simple type are said equal if their name and value are identical.
    2. Two elements of complex type are said comparable if their name, attributes are identical.
    3. Two elements of complex type are said equal if they are comparable and their children elements are identical.

    Hi,
    Thanks for reviewing my idea.
    The xml files used for the comparison must have the
    same schema.Including not having a schema at all? And if they do
    have a schema, must they be valid according to the
    schema?I will only support schema based xml files. To include a schema is a good practice. So I will valid them agaisnt schema (is this possible with JDOM? I am testing ...)
    >
    2. Two elements of complex type are said comparableif
    their name, attributes are identical.
    3. Two elements of complex type are said equal ifthey
    are comparable and their children elements are
    identical.Do you plan to require child elements to appear in the
    same order for the two documents to be equal? (Note
    that XML specifically says that the order of
    attributes is not significant.)No. The order is not significant as I use the attributes as the keys to find comparable element counterpart.
    Here is the sample code already tested. Any comments are welcome!
    The next step is to define the "delta xml schema" that will guide me to store the comparasion results. Do you have any suggestions?
    Regards.
    AG
    public static boolean comparable(Element element1, Element element2)
         boolean returnValue=false;
         if (element1.getName()!=element2.getName()) {
              return returnValue;
    } else {
              returnValue=true;
                        System.out.println ("place 2");
         List attributeList=element1.getAttributes();
         Iterator attributeIterator=attributeList.iterator();
         Attribute workingAttribute=null;
         while (attributeIterator.hasNext()) {
                             if (!workingAttribute.getValue().equals(
                             element2.getAttribute(workingAttribute.getName(), workingAttribute.getNamespace()).getValue()))
                                  returnValue=false;
                                  break;
         return returnValue;

  • Comparing two XML Schemas

    Hi All,
    I want to compare two versions of the same XML Schema. I am working with Oracle 10g XML DB. I think we have something in 11g but I am constrainted to 10g.
    Requirement:
    1. I start afresh and register the XML Schema and also insert XML documents compliant to that schema in my XMLTYPE table.
    2. Now after some time, I need to add a new element. So, I modify the XML Schema and write the XSLT for its addition to XML documents and do a CopyEvolve(). Let us assume, I have a script for this.
    3. Now if accidentally, I rerun the script, I may run into errors as the element is already there.
    So, I thought I should find the differences between the new version of the schema and the old version and if there are differences apply the XSLT and also evolve the schema. How do we do this?
    Also, Can we generate the XSLT automatically based on the two versions of XML Schema?
    Thanks
    Ramesh

    XML Schemas are just XML documents.
    Compare the XML Schemas using the XDK's XMLDiff class and generate the XSLT from the differences.
    http://www.devx.com/Java/Article/30943

  • Comparing two Objects

    Hi, I want to compare two objects
    using the formula below
    if((Integer)v.elementAt(i) == new Integer(comp.getCard(j).getValue())){but it doesn't work
    I am trying to compare an element in a vector which was of a type Integer
    key1 = new Integer(dk.getCard(f).getValue());note that key1 is actually a key used for a mapping
    can anyone tell me how I can compare the elements in vector and the other object was an int.

A: Comparing two Objects

Hello zainuluk,
You can not use '==' operator to compare to objects in Java, 'cause it just compare the reference of two oprands. You should use the "equals()" method, just like this:
if(Integer)v.elementAt(i).equals(new Integer(comp.getCard(j).getValue())){...}
Or you can get the int value of element in the vector to compare using '==' operator:
if(Integer)v.elementAt(i).intValue() == comp.getCard(j).getValue()){..}

Hello zainuluk,
You can not use '==' operator to compare to objects in Java, 'cause it just compare the reference of two oprands. You should use the "equals()" method, just like this:
if(Integer)v.elementAt(i).equals(new Integer(comp.getCard(j).getValue())){...}
Or you can get the int value of element in the vector to compare using '==' operator:
if(Integer)v.elementAt(i).intValue() == comp.getCard(j).getValue()){..}

Maybe you are looking for

  • Filling up a variable value from another variable

    Hi, I have two date fields, one calmonth characteristic ZCALMON (as char) and other calmonth charactaeristic 0CALMON as time dimension (standard bw). But at query level, I would like to user enter only one variable value 0PCALMON for 0CALMON (say onl

  • Flash with QT 7.3 works in Safari, but not in Firefox

    Like many others here, I have been having issues with the upgrade to QT 7.3 and Flash. I've followed a few different suggestions from here on the forums, but I've only been able to get Flash working in Safari; Firefox remains mysteriously broken. Has

  • Purchase order distrubution using EDI

    Hi, SAP gurus! I am trying to set up Purchase order distrubution using EDI. ORDERS idocs will be sent through middleware message broker. I added ORDERS idoc in LS partner profile outbound data and set up medium type 6 for PO output. Something else is

  • How to resolve a 'no sound' problem with UPI Grand Piano application?

    I have purchased the UPI piano from the AppStore, but am at a loss to know how to resolve the problem of a silent piano. I have entered the 'Audio & Midi Settings' zone within the application more times than I care to remember and need a wise owl to

  • I downloaded Google Earth for mac os X 10.6.8 but it wouldn't open.  Why not?

    Sarfari version is 5.1.5.  I got the Google Earth icon on the desktop, but wasn't sure I was installing it on the Mac Hard drive.  When I see the plus sign, does and then press enter, does that install where it's supposed to on the HD?