• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

comparison between expected and Actual value

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have requirement to do comparison between expected and actual value. Below are the classes that shows the same.








I am facing problem like any mismatch is happen between expected and actual, I have to report particular key is not matching[including start position and end position range].

example : if student id is not matching then i have to show message like " student id is not matching from position 0 to 4"

Thanks
Gangadhar
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok but what exactly is your problem ?

By the way ... Putting constants into an interface is probably the worst way of all .... Either use a non-instantiable class or at best an enum.
 
Gangadhararao Bommasani
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sebastian,

I want to compare result between expected map & actual map mentioned in this thread. If any mistmatch happen in between expected and actual then i have to show message like " student id is not matching between expected and actual value from starting position 0 to 4.

Thanks for your help

thanks,
Gangadhar
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still, what is the problem you are facing ?

Are you having trouble doing the comparison ? How do you want to output the message ? System.out, logging ?
 
Gangadhararao Bommasani
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

How to implement logic for the same? I know how to put System.out.println()

Thanks
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I'm really having problems figuring out what exactly the problem is here. Maybe somebody else knows.
 
Gangadhararao Bommasani
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. not a problem. thanks for your quick reply.

Problem is simple.


Here two maps are there. One is expected Map and Actual Map. If any value is not matching between expected and actual then i have to report a message like " that particular key is not matching from starting position to end position"

Anybody please help me....

thanks in advance.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can you give us an example? Preferrably without using code... Something is definitely missing because, I too, don't have an idea of what you are talking about.

Henry
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Can you give us an example? Preferrably without using code... Something is definitely missing because, I too, don't have an idea of what you are talking about.

Henry



I'm happy that I'm not the only one. I almost thought I'm crazy.
 
Ranch Hand
Posts: 493
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gangadhararao Bommasani wrote:Ok. not a problem. thanks for your quick reply.

Problem is simple.


Here two maps are there. One is expected Map and Actual Map. If any value is not matching between expected and actual then i have to report a message like " that particular key is not matching from starting position to end position"

Anybody please help me....

thanks in advance.



So, the probelm you need to print this "that particular key is not matching from starting position to end position" if the 2 maps didnt match ??
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sherif Shehab wrote:
So, the probelm you need to print this "that particular key is not matching from starting position to end position" if the 2 maps didnt match ??



Hmmm... maybe it is as simple as interating through the keys of the maps, and reporting on values that are not equal. Regardless, the original poster should clarify.

Henry
 
Gangadhararao Bommasani
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Thank you for you reply. I have implemented code for the same.

Thank you so much.


Thanks,
Gangadhar
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic