How to compare 2 objects?

Hi! I guess some one can help me. The question may be silly but i need help, please.
Q: User has filled the form and submitted the values to server, they are not stored in database, but stored in an Object container. Then, before he logs out of application again the user wants to modify the values and click on that page link. The user will get all the values back into the fields. Now he may change the values or may not and submits the values to server again to store in an object container.
Now, before i store the updated values into the original object, How to check the object is modified or not?
Can i use the comparator interface for this? if so, how?
Note: I do not want to update the object if it has not modified, I use MQ in my application to make call to legacy system, so i store in an object.

Override the equals( Object ) method on your objects and then just compare the new objects to the old ones using the equals method.
if (!object1.equals( object2 ) )
// they are different
In the equals method you can do the comparison check.
Bryan

Similar Messages

  • How to compare objects between systems

    Hi,
    At the moment I am busy activating business content in BW for an SAP IS-U project. Here I encounter the following problem:
    In the past others have been activating business content objects and they have assigned a developer class to it. Then they decided they did not need those objects and they deleted their transports.
    Now when I want to transport objects to the acceptance environment quite often transports fail due to missing objects (which have never been transported). The automated activation does not include these dependent objects, as it thinks they are already available.
    Is there a way to compare two systems to see which objects are missing and need transporting (without sifting through each InfoObject/transfer rule etc by hand to check its existence)?
    Preferrably I would like to know table names so I can compare SE16 lists, but other suggestions are also more than welcome.
    Otherwise an easy way to see the technical names of those objects so that I can add them manually to a transport request?
    Thank you very much,
    Crispian

    Hi Crispian,
    Welcome to SDN!!
    You can use the following tables for comparing:
    RSDIOBJ - For info-objects
    RSDCUBE - For Cubes
    RSDAREA - InfoAreas
    RSDCHA - Characteristic Catalog
    RSDCUBEIOBJ - Objects per InfoCube (where-used list)
    RSDIOBC - InfoObject catalogs
    RSDIOBCIOBJ - InfoObjects in InfoObject catalogs
    RSDKYF - Key figures
    RSIS - InfoSource (transaction data)
    RSTSRULES - Transfer structure transfer rules
    RSDODSO - ODS
    Hope this helps.
    Bye
    Dinesh
    <i>Assigning point to the helpful answers is the way of saying thanks in SDN. you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.</i>
    Message was edited by: Dinesh Lalchand

  • How to compare an Object of type class?

    Hi,
    I got a generic array and want to check which class it contains.
    Now i tried to use
    Class c = T[0].getClass();and later
    if(c instanceof Float){
    }but this don't work.
    So how to compare two instances of Class?
    Maybe by looking for the name of the class and compare them?
    regards.
    Olek

    import java.util.*;
    public class WorksForMe {
        public static void main(String[] args) {
            List<Object> list = new ArrayList<Object>();
            list.add(Float.valueOf(17));
            Class<?> cls = list.get(0).getClass();
            System.out.println(Float.class.equals(cls)); //true
            System.out.println(Float.class == cls); //true
    }But again, it's best to avoid this kind of case analysis.

  • How to compare two Objects !!!!

    Hi All,
    I know that this question has been asked 100 times till now. But trust me I have checked all of them but couldn`t find answer. Here is my question:
    I have an objecs. In that object I am setting (Id,Name,DOJ). Now I want to check whether the object I am trying to save in database already exists or not. If exists then I need to check whether all the setters are same for the two objects. Now can anyone tell me ,how to compare two objects directly without comparing the setters individually.
    Thanks in advance.

    pavan13 wrote:
    That is pretty good idea. However I have a query. Does that code actually compare all the setters in a two beans. I don`t want to check each setter seperately.Well, it's pretty meaningless to talk about "comparing setters", setters are methods, they don't have values to compare. Because equals is inside the class, you can simply compare the fields that get set by the setters. "Properties" is probably a better name.
    In principal you could write something that tried to find all relevant fields and compare them, using reflection or bean info stuff. The resulting code would be about 50 times longer and take about 50 times longer to run. It's hardly asking a lot to put three comparisons between && operators.
    Remember, though, not to compare string fields with ==, you should call .equals on the string fields.
    p.s. don't let the bean terminology confuse you. Beans are just ordinary objects which follow a few rules. Personally I wish the term had never been coined.
    Edited by: malcolmmc on Dec 6, 2007 4:15 PM

  • How to compare two database objects?

    Hi,
    I need to compare two objects with embedded objects/collections in it to tell exact difference between the two.
    e.g.,
    create type t1 as object (name varchar2(10), age number);
    create type t2 as table of t1;
    create type t3 as object (user t1, family t2);
    ... and so on.. this type hirarechy is big in my case..
    I want a procedure/function which can tell me what and where is the difference.
    PROCEDURE (obj1 T1 , obj2 T1) IS
    BEGIN
    END;
    e.g., t1.name = 'John' and t2.name = 'Mich' then it should return t1.name etc..
    Is it possible?
    Thanks

    Why a new thread?
    how to read objects/collections dynamically?

  • How to compare 2 Objects( and )?

    Should I write an interface?

    Java has 2 interfaces that would be of interest to you.
    They both are designed to return an integer that describes the relationship between two objects.
    Suppose you have two objects: objectA and objectB
    The return value is as following:
    if (returnValue < 0) then objectA precedes objectB. (A < B)
    if (returnValue > 0) then objectA follows objectB. (A > B)
    if (returnValue == 0) then objectA and objectB are equivalent (A == B).
    It is up to you to do the comparing and determine which is the correct return value...
    Here are the two interfaces:
    1) Comparable interface (java.lang.Comparable)
    You would use this interface when you have a class that exhibits some natural order..
    You add this interface to the class, and, within the class, implement the following method:
       public int compareTo( Object obj )
       The variable obj in this case refers to the "other" object that you want to compare.
       public class MyClass implements Comparable // <--- notice the last two words!!
              other methods.
          public boolean isTallerThan( MyClass mc )
             // just some method i made up to compare...
          public int compareTo( Object objectB )
             // You are comparing "this" object with the "otherObject"...
             // Note that objectA is "this".
             MyClass otherObject = (MyClass)objectB;
             // Do whatever you need to compare the two.
             if (this.isTallerThan(otherObject) )
                 return -1;
             else if ( otherObject.isTallerThan(this) )
                 return +1;
             else
                 return 0; // they are of equal height...whatever...
       2) Comparator interface (java.util.Comparator)
    You could use this interface if you have a different set of standards with which to compare two different objects. Usually, it is it's own class, designed for only this purpose. You implement the following method:
       public int compare( Object objA, Object objB )
       Notice that in this case you have to explicitly pass in both objects to be compared, whereas in the Comparable interface, objA is implicitly assumed to be the object on which the method is called (or as I like to call it, this).
    Here is an example:
       public class MyComparator implements Comparator
          public int compare( Object objA, Object objB )
             do whatever comparisons you need to determine whether
             objA < objB (-1 is returned)
             objA > objB (+1 is returned)
             or
             objA == ObjB (0 is returned)

  • I can't seem to get individual elements when comparing 2 arrays using Compare-Object

    My backup software keeps track of servers with issues using a 30 day rolling log, which it emails to me once a week in CSV format. What I want to do is create a master list of servers, then compare that master list against the new weekly lists to identify
    servers that are not in the master list, and vice versa. That way I know what servers are new problem and which ones are pre-existing and which ones dropped off the master list. At the bottom is the entire code for the project. I know it's a bit much
    but I want to provide all the information, hopefully making it easier for you to help me :)
    Right now the part I am working on is in the Compare-NewAgainstMaster function, beginning on line 93. After putting one more (fake) server in the master file, the output I get looks like this
    Total entries (arrMasterServers): 245
    Total entries (arrNewServers): 244
    Comparing new against master
    There are 1 differences.
    InputObject SideIndicator
    @{Agent= Virtual Server in vCenterServer; Backupse... <=
    What I am trying to get is just the name of the server, which should be $arrDifferent[0] or possibly $arrDifferent.Client. Once I have the name(s) of the servers that are different, then I can do stuff with that. So either I am not accessing the array
    right, building the array right, or using Compare-Object correctly.
    Thank you!
    Sample opening lines from the report
    " CommCells > myComCellServer (Reports) >"
    " myComCellServer -"
    " 30 day SLA"
    CommCell Details
    " Client"," Agent"," Instance"," Backupset"," Subclient"," Reason"," Last Job Id"," Last Job End"," Last Job Status"
    " myServerA"," vCenterServer"," VMware"," defaultBackupSet"," default"," No Job within SLA Period"," 496223"," Nov 17, 2014"," Killed"
    " myServerB"," Oracle Database"," myDataBase"," default"," default"," No Job within SLA Period"," 0"," N/A"," N/A"
    Entire script
    # things to add
    # what date was server entered in list
    # how many days has server been on list
    # add temp.status = pre-existing, new, removed from list
    # copy sla_master before making changes. Copy to archive folder, automate rolling 90 days?
    ## 20150114 Created script ##
    #declare global variables
    $global:arrNewServers = @()
    $global:arrMasterServers = @()
    $global:countNewServers = 1
    function Get-NewServers
    Param($path)
    Write-Host "Since we're skipping the 1st 6 lines, create test to check for opening lines of report from CommVault."
    write-host "If not original report, break out of script"
    Write-Host ""
    #skip 5 to include headers, 6 for no headers
    (Get-Content -path $path | Select-Object -Skip 6) | Set-Content $path
    $sourceNewServers = get-content -path $path
    $global:countNewServers = 1
    foreach ($line in $sourceNewServers)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0].Substring(2, $tempLine[0].Length-3)
    $temp.Agent = $tempLine[1].Substring(2, $tempLine[1].Length-3)
    $temp.Backupset = $tempLine[3].Substring(2, $tempLine[3].Length-3)
    $temp.Reason = $tempLine[5].Substring(2, $tempLine[5].Length-3)
    #write temp object to array
    $global:arrNewServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countNewServers ++
    Write-Host ""
    $exportYN = Read-Host "Do you want to export new servers to new master list?"
    $exportYN = $exportYN.ToUpper()
    if ($exportYN -eq "Y")
    $exportPath = Read-Host "Enter full path to export to"
    Write-Host "Exporting to $($exportPath)"
    foreach ($server in $arrNewServers)
    $newtext = $Server.Client + ", " + $Server.Agent + ", " + $Server.Backupset + ", " + $Server.Reason
    Add-Content -Path $exportPath -Value $newtext
    function Get-MasterServers
    Param($path)
    $sourceMaster = get-content -path $path
    $global:countMasterServers = 1
    foreach ($line in $sourceMaster)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0]
    $temp.Agent = $tempLine[1]
    $temp.Backupset = $tempLine[2]
    $temp.Reason = $tempLine[3]
    #write temp object to array
    $global:arrMasterServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countMasterServers ++
    function Compare-NewAgainstMaster
    Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    Write-Host "Total entries (arrNewServers): $($countNewServers)"
    Write-Host "Comparing new against master"
    #Compare-Object $arrMasterServers $arrNewServers
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Write-Host "There are $($arrDifferent.Count) differences."
    foreach ($item in $arrDifferent)
    $item
    ## BEGIN CODE ##
    cls
    $getMasterServersYN = Read-Host "Do you want to get master servers?"
    $getMasterServersYN = $getMasterServersYN.ToUpper()
    if ($getMasterServersYN -eq "Y")
    $filePathMaster = Read-Host "Enter full path and file name to master server list"
    $temp = Test-Path $filePathMaster
    if ($temp -eq $false)
    Read-Host "File not found ($($filePathMaster)), press any key to exit script"
    exit
    Get-MasterServers -path $filePathMaster
    $getNewServersYN = Read-Host "Do you want to get new servers?"
    $getNewServersYN = $getNewServersYN.ToUpper()
    if ($getNewServersYN -eq "Y")
    $filePathNewServers = Read-Host "Enter full path and file name to new server list"
    $temp = Test-Path $filePathNewServers
    if ($temp -eq $false)
    Read-Host "File not found ($($filePath)), press any key to exit script"
    exit
    Get-NewServers -path $filePathNewServers
    #$global:arrNewServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrNewServers): $($countNewServers)"
    #Write-Host ""
    #$global:arrMasterServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    #Write-Host ""
    Compare-NewAgainstMaster

    do not do this:
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Try this:
    $arrDifferent = Compare-Object $arrMasterServers $arrNewServers -PassThru
    ¯\_(ツ)_/¯
    This is what made the difference. I guess you don't have to declare arrDifferent as an array, it is automatically created as an array when Compare-Object runs and fills it with the results of the compare operation. I'll look at that "pass thru" option
    in a little more detail. Thank you very much!
    Yes - this is the way PowerShell works.  You do not need to write so much code once you understand what PS can and is doing.
    ¯\_(ツ)_/¯

  • How to compare consecutive groups of numbers in arrays

    Hi
    I require to place the solution into a 1D array.
    I need to compare two arrays and save the same numbers that are in both arrays but also save groups of numbers that may be in only one of the two arrays being compared.
    In the example l have not been able to place all consecutive groups of numbers 8,9,10,11,12 into a 1D array.
    In the example l need to filter out the zeros and the number four.
    The numbers in both arrays are always in descending order however may not be in the order of index number of array. That is 15 = 15 index number
    A consecutive group of numbers in this example is a group that increase by a value of 1. E.g.. 8,9,0,22,23,24 are two consecutive groups of numbers.
    Thank  you
    Solved!
    Go to Solution.
    Attachments:
    Compare numbers and consecutive numbers in arrays.vi ‏17 KB

    Hi Lynn
    I did have a look at the consecutive array solution. I have looked and looked l thought l knew how it worked but after a number of separate evaluations with other code l have failed. I am just glad it works. With the consecutive array solution l tried today my own code but l lost either the first number of the last number of a consecutive group of numbers.
    I may have confused you but in doing so you have provided a real different view which l am very grateful. You have viewed the consecutive number problem as just a single 1D array problem. By doing this you have opened my eyes to another way to do the job and a way to handle this type of data. However l am also comparing two arrays. For example l have to pick up say two equal values in two columns that the consecutive array does not detect and then correctly locate a value in the final array if the value is not in the final array.
    What l have not told you is also l have to be able to identify groups of numbers in two 1D arrays. E.g... Array 1 has 1,2,9,10 next array has 9,10 the final array ends up 9,10 when l would like 0,9,10. When viewing numbers by rows later on l can then detect with a array length vi the length of the 1,2 groups of numbers over a large number of columns. If 9,10 jumps to the front it becomes a wrong length. This is actually my main problem which has caused me a large amount of extra programming. I have gone back to basics to see what l can do differently and you have provided the first clue with the consecutive array. I placed it in my main program today and it filtered a lot variable data which l could not remove without losing real data. The main data lost in your solution was the say 17 number in two columns which in an image is a horizontal line. I know what l have just provided you in this paragraph is all new information but it provides a background as to what l am up to. I am getting pixel data from a 2D array and comparing +1 index 1D array with a normal array. This way l can view the data of the next column to see if there is a pattern. I am actually trying to program an array as how humans view objects in images.
    I will have another go at integrating your solution next week
    Regards
    Michael

  • COmparing object using console...

    Hi ,
    I want to compare the objects in between the two db schemas. I am using Oracle enterprise console. Here when i am click the compare objects for the tables, i got the below error.
    Cannot perform operation for product"Oracle Change Manager" because another operation is already in progress for the product,or a previous ooperation on the product failed..
    I am getting the above errr. I need to compare the objects now. So how can remove the old operation on the product failes ,
    I am fist time using this console in comparing schems.
    My oracle client is 10.2 cleint ..
    please help me out in comparing the objects ...

    hi:
    Whether did you understand your stub that input by IDL compiler?
    Because the stub extends the org.omg.CORBA.portable.ObjectImpl and provide method _orb() to get current local ORB reference. you do so and repeat your steps in your text.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to compare all ABAP Programs (Workbench) between system?

    Hi BASIS Guru,
    Please kindly guide me How to compare all ABAP Programs (Workbench) between system?
    I have copy client (Export/Import) from PRD to DEV but I have some error about abap programs does not exist.
    For example COPA workbench object (Table and ABAP Program).
    Please kindly help.
    Thank you very much.
    Best Regards,
    Saiya

    Hi,
    You can use SE39 to compare your programs.
    Regards,
    Vijay

  • Help comparing objects

    Hi,
    My java app's purpose is to find out if I must update my simulated framework if the real framework has changed ( interfaces).
    My app loads two jar files ( real framework and simulated framwork) and use bcel to make an static analysis of the classes ( bcel created 'JavaClass' to describe the class).
    In order to determine if the classes are equal i create a 'DataClass' object with the following information:
    className
    Field [] fields (bcel 'Field' not java.lang.reflect.Field)
    Method [] methods (bcel 'Method' not java.lang.reflect.Method)
    I retrieve the information from JavaClass and put it in my 'DataClass'.
    This is the code I use to create a Vector for each framework ( Listing 1). This is where I store the data describing my classes in the api (Listing 2). Then I compare each 'DataClass' contained in the Vector.
    My intention is to compare the 'data' of the 'DataClass'. But since I get that all DataClass objects are NOT equal I guess I compare references. How can I do this.
    All hints are vey much welcome.
    cheers,
    //mikael
    Listing 1
    ==========
    Note: ClassSet is a 'Set' of JavaClass' objects.
    public static Vector makeDataObjects(ClassSet classes){
            Vector api = new Vector();
            JavaClass [] clazzes = classes.toArray();
            for (int i = 0; i < clazzes.length; i++) {
             JavaClass clazz = clazzes;
    DataClass dc = new DataClass();
    dc.setClassName(clazz.getClassName());
    Field [] fields = clazz.getFields();
    for(int j = 0; j < fields.length; j++){
    dc.setField(fields[j].toString());
    Method [] methods = clazz.getMethods();
    for (int k = 0; k < methods.length; k++) {
    dc.setMethod(methods[k].toString());
    api.add(dc);
    return api;
    Listing 2
    =========
    import java.util.ArrayList;
    public class DataClass implements Comparable{
        private String className = null;
        private ArrayList fields = new ArrayList();
        private ArrayList  methods = new ArrayList();
        public void setClassName(String className){
            this.className = className;
        public String getClassName(){
            return className;
        public void setField(String field){
            fields.add(field);
        public void setMethod(String method){
            methods.add(method);
        public int compareTo(Object o){
    }This is where I compare the content of my two api:s
    Listing 3
    =========
    public static void compare(Vector api1, Vector api2) {
    for (Iterator iter = api1.iterator(); iter.hasNext();) {
       DataClass clazz1 = (DataClass) iter.next();
       String className = (String) clazz1.getClassName();
       DataClass clazz2 = (DataClass) toBeCompared(className, api2);
       // compare object values
       System.out.println("clazz1 is " + clazz1.toString());
       System.out.println("clazz2 is " + clazz2.toString());
       if (clazz1.equals(clazz2)) {
        System.out.println("Objects are the SAME" + className);
       } else {
        System.out.println("Objects are NOT the same" + className);
    private static DataClass toBeCompared(String className, Vector api){
      DataClass dao = null;
      for (Iterator iter = api.iterator(); iter.hasNext();) {
        DataClass element = (DataClass) iter.next();
        String otherClassName = element.getClassName();
        if (className.equals(otherClassName)){
        dao = element;
    return dao;

    Your error is that you implement Comparable and the compareTo method instead of the equals method of Object class. Comparable is needed for ordering items. Equals instead is used to check if two objects are equal. Per convinience it is expected that there is no inconsistency if both equals and compateTo are implemented.
    So you should implement a method in DataClass:
    public boolean equals(Obejct o) {
      boolean result = false;
      if (o instanceof DataClass) {
        DataClass c = (DataClass) o;
        result = className.equals(c.className) &&
             fields.equals(c.fields) &&
             methods.equals(c.methods);
        // keep in mind here, that the arrays fields and
        // methods should be sorted / ordered. use Collections.sort(fields)
        // for this when you create or modify it
      return result;
    }You could also simplify the compare(Vector api1, Vector api2) method when you keep these Vectors sorted for className or use Set (what i dont recommand because of properbly performance drawbacks):
    public static void compare(Vector api1, Vector api2) {
      Collections.sort(api1, new ClassNameComparator());
      Collections.sort(api2, new ClassNameComparator());
      // you should possibly dont do this sorting here because the
      // method name does not state that the vectors are modified
      // but it's a precondition for make the following work properly:
      return api1.equals(api2);
    }i did not compile the code, so i hope i did not make many errors.
    regards
    Sven

  • Someone please help creating comparable objects

    I have been given a second part to an assignement that wants me to create a program for comparing student obejects. The assignment description and code are below. I can' t see how the find to method interlocks with the findsmallest because find smallest is already finding the smallest value. I also don't see where the new diffinitions for UMUC_Comparable goes.
    In the second part of this project, you will also find the smallest element in the array, but now the array will be of UMUC_Comparable objects. It will use the compareTo method to compare objects to find the smallest one. This method will also have the name findSmallest, but will take an array of UMUC_Comparable objects. This findSmallest method will have a definition as follows:
    UMUC_Comparable findSmallest(UMUC_Comparable[] array);
    The findSmallest method will use the compareTo method in the UMUC_Comparable interface. You will be using it with the Student objects from module V, section III, so you do not have to rewrite the compareTo method; you can simply use the one defined in the Student object in module V.
    For the second part of this project, you should:
    Create a main that creates an array of Student objects, as in section III of module V. You can use the same array as defined module V. You do not have to read these objects in from a file.
    Call the findSmallest method to find the smallest Student object.
    Use the getName and getAverage methods in the Student object to print out the smallest object.
    Note that the return from the method is a UMUC_Comparable object, not a Student object, so you must cast the returned object to a Student object before printing it out. You can do so as follows:
    Student[] students ....; // Fill in the declaration // of the student array.
    Student s = (Student)findSmallest(UMUC_Comparable[] array);
    /* File: Student.java
    * Author: Darrell Clark
    * Date: December 3, 2006
    * Purpose: Shows how to find the smallest Int value in an array
    import java.util.*;
    import java.io.*;
    public class Student {
    private int average;
    private String name;
    /* public constructor. Note that because no default
    * constructor exists, Student objects will always
    * be constructed with a name and an average.
    public Student(String name, int average) {
    this.average = average;
    this.name = name;
    } // end method
    * return name
    public String getName() {
    return name;
    } // end method
    * return average
    public int getAverage() {
    return average;
    } // end method
    * compare to method for locating smallest value
         public static int findSmallest(int[] array) {
              int min = Integer.MAX_VALUE;
              for (int i = 1; i < (array.length); i++) {
                   if (array[i] < min)
                        min = array;
              return min;
    * compare student value
    public int compareTo(Student student) {
    return (this.average - student.average);
    } // end method
         public static void main(String[] args) {
    Student[] studentArray = { new Student("Tom", 87),
    new Student("Cindy", 100),
    new Student("Pat", 75),
    new Student("Anne", 92),
    new Student("Matt", 82)};
    for (int i = 0; i < studentArray.length; i++) {
    System.out.println(studentArray[i].name + " " +
    studentArray[i].average);
    } // end for
    } // end method
    } // end class

    Were you given the UMUC_Comparable interface, or do you have to write it?
    (1) In the latter case, that is where to start. It includes the method
    compareTo(UMUC_Comparable). This will almost certainly return an
    int - check out the API documentatuon for the Comparable interface.
    (2) What I think the assignment is asking you to do is rewrite the Student
    class so that it implements UMUC_Comparable.
    Then you write the findSmallest(UMUC_Comparable[]) method. There is
    already a static method like this in the (existing) Student class. It's anybody's
    guess where this method is supposed to go - perhaps you could ask
    whoever gave you the assignment. The problem is that it can't go in
    UMUC_Comparable because that's an interface. And it doesn't really belong
    in Student because it is a sort of utility function that deals with any
    UNUC_Comparable array.
    (3) Let's assume that findSmallest(UMUC_Comparable[]) goes in the
    Student class. So you replace the existing findSmallest() with the new one.
    The new one goes through the array using the UMUC_Comparable's
    compareTo() method to find the smallest UMUC_Comparable.
    (4) Finally in main() you create a test array, use the newly rewritten
    findSmallest() to find the smallest Student, and print their name and
    average.

  • Comparing objects for equality with UDT's

    Hi.
    I was wondering how Oracle does comparison for equality of objects that contains parameters of user defined types.
    Suppose I have an object with a parameters whose types are:
    1) number,
    2) varchar2,
    3) nested table type,
    4) associative array
    and I want to compare two such objects for equality. Would Oracle compare all parameters of this 2 compared objects field-by-field (and dig recursive to "leafs"), or would it compare only 1), 2) and doas nothing with 3) and 4)?
    Must I declare an order method for such comparison?

    You didn't specify a version - this is correct for 10.2, I'm not sure if it has changed in 11g.
    By default it will compare for exact equality - i.e that every attribute is the same. You can also only do it in SQL, not PL/SQL. Also can only do = and <> - you cannot do < or > etc.
    You need to create a MAP or ORDER method on the type to do any more sophisticated comparison (Same as in most object oriented languages). Documentation is here http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14260/adobjbas.htm#sthref211

  • Compare objects in Trasnsport Request

    I would like to collect all the source system related objects from BW Development, and tranport it to BW QA client.
    In BW Development, I have collected all the source system related object, and transport is created.
    How can I compare and ensure that all the source system related objects are collected in the Transport request?
    In SE10 ->Display the Transport Request, I can see there are some 2000 objects, but how can compare and ensure that there is other objects is missing?
    please advise, thanks.

    for such a  huge package, this looks impossible to me. what you can do is use the transport connection, and collect your main objects (cube, queries,...). before and after as option. now when you have the list, you can check if there are still objects in $TMP or without a transport package...these objects are most likely not in your transport...
    however, from my experience, i would say to consider transport from dev to qual as a trial and error phase...import the TR...if something is missing it will dump, indicating in the log what is missing...create a new TR in dev for these objects, transport to qual and reimport the big one again...and so on...till everything is correctly imported...
    now execute process chains and afterwards reports to see that everything is running smoothly...
    you might have dumps because objects are not activated, so you need to reimport activation
    make sure you list the sequence of import...afterwards if you use the same sequence when going to prod, you should encounter no problem.
    M.

  • LSMW How to compare projects from 2 diffrent systeme ?

    Hello all,
    I need to know how to compare all the lsmw object from one systeme to another systeme,
    ex : form D01 (4.6) to DC1 ECC
    more information :
    this is the table which contain all information about lsmw :
    /SAPDMC/LSOINP
    thanks

    we know that LSMW will generate abapcode in step generate conversion program by using display conversion program notedown the program name: like that second one also and go for se39.
    and follow the steps to compare the program from one system to another system how just normal report we do.
    just have a try.
    All the best

  • How to compare two strings whether both are equal while ignoring the difference in special characters (example: & vs & and many others)?

    I attempted to compare two strings whether they are equal or not. They should return true if both are equal.
    One string is based on Taxonomy's Term (i.e. Term.Name) whereas other string is based on String object.
    The problem is that both strings which seem equal return false instead of true. Both string values have different special characters though their special characters are & and &
    Snapshot of different design & same symbols:
    Is it due to different culture or language?
    How to compare two strings whether both are equal while ignoring the difference in special characters (& vs &)?

    Hi Jerioon,
    If you have a list of possible ambiguous characters the job is going to be easy and if (& vs &) are the only charracters in concern awesome.
    You can use the below solution.
    Before comparing pass the variables through a replace function to standarize the char set.
    $Var = Replace($Var,"&","&")
    This is going to make sure you don't end up with ambiguous characters failing the comparison and all the char are "&" in this case.
    Similar technique is used to ignore Character Cases 'a' vs. 'A'
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

Maybe you are looking for

  • Error While Deploying ADF BC JSF Application on Oracle WebLogic Server 10.3

    Hi All, I am Deploying ADF BC JSF Application on Oracle WebLogic Server 10.3 My JDeveloper Version is - JDeveloper10.1.3.0.4 I followed Following Links for Deployment http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/wls/wls.html http://b

  • Flash 9 ActiveX error

    Since installing Flash 9 I am having a problem that seems to be ActiveX related. In Firefox, whenever I go to a page with Flash I get an ActiveX error box telling me: "Could not create control {00000000-0000-0000-0000-000000000000}. Check that it has

  • Section for multiple universe

    Hi Guys, I have 2 data sources in my Webi report  that have the same columns inserted in the form of a Section. The column names are - Employee Name & No. of Projects. No. of Projects = Count (Project Name). Project Name is a merged dimension. Projec

  • Install OBIEE Failed on Linux 64bit

    The install process was failed and the log shows oracle.as.provisioning.util.ConfigException: Error while starting the domain. Cause: An error occurred while starting the domain. Action: See logs for more details. at oracle.as.provisioning.util.Confi

  • Disappearing JButton text after showing another dialog?

    I have a pretty basic Swing application under 1.5.0_07 / Win2k which makes use of a few JButton's that can be disabled (which then appear with the grayed out text.) Everything was working great until I added a call to Apache FOP's AWTRenderer, which