nazeer hussain

Greenhorn
+ Follow
since Feb 06, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nazeer hussain

Hi

I have a code to sort the object list by a specific attribute as follows.

public GenericComparator(String field, String order) {
super();
this.fieldName=field;
if (order == null || order.equals(ASC)){
this.sortOrder=ASC;
} else if (order.equals(DESC)){
this.sortOrder=DESC;
}

}

public int compare(Object o1, Object o2) {
Object value1;
Object value2;
try{
Field f = this.getAccessibleField(o1);

if (f == null) return 0;

if (this.sortOrder.equals(ASC)){
value1 = f.get(o1);
value2 = f.get(o2);
} else {
value2 = f.get(o1);
value1 = f.get(o2);

}

return this.compareField( value1, value2);
}catch (Exception nsfe){
System.out.println(nsfe);
return 0;
}

}


But I want to sort the objects after calculating a ratio of two different attributes in the objects in object list.

Please give me an idea.

Thanks in advance

Nazeer
16 years ago
Thank you guys for your reply. Got the solution.
16 years ago
Hi Guys

Can anyone knows the code to Sort the collection of objects, having two integer data types say a,b and assume the object is POJO which will not be implemented with any interface(Serializable/Comparator/..). Requirement is as follows.

Arraylist
- POJO
- int a = 100
- int b = 150
- POJO
- int a = 75
- int b = 125
-
5 items


list Ordered by asc based a values

list Ordered by asc based b values

using Comparator
-----------------------------

Thanks
Nazeer

:roll:
17 years ago
hi

all you need is a 100% hike in your current salary. everything else is already yours.


17 years ago


hay sumit congrats. your most of the comments on bangalore are true and that will be vanished once you realize the truth in the long run.

17 years ago
wipro > infy & infy > satyam ==> wipro > satyam
17 years ago
you can write a mail saying that your current company contract/role is
extended for one more year providing you with the good exposure in onsite and perks. and in desparately your project manager needs your service and not willing to release you from the project in the near vicinity. hence in no other way,im forcible and regret to reject your offer letter. thanks for your valuable time.
17 years ago
I want to close this thread as the question is not meaningful.
i have heard from my america friend that the companies there wont
entertain such cheer ups in the weekends for the employees. i dont know whether that may happen on the occassions.


but to cheer up ourselves we should find out our own ways, like meeting in a particular place such as temples or get-together of region people of the country like 'bihar people in india'.


better to find out some buddy colleague to enjoy in his/her house enjoying hot food.
17 years ago
is it a drawback of working for many companies in less time say 3 companies in 3 years. will the employer perspective in recruitment differs with this?


and someone says that working in the same company for long time gives you more higher level roles while changing the company.


can u give me some ideas on this.

17 years ago
DataWareHousing is the better taking.
17 years ago
after working 2+ years for satyam, normally everyone gets bored.

and SAP is worth a company to join for to get a good exposure.

17 years ago
now in india all tier-1 cities (delhi,pune,mumbai,calcutta,bangalore,hyderabad,chennai) are the destinations for most of the IT companies. and the cost of
living differs from city to city. i think bangalore is in number one
position for better living conditions. i think culcutta is not much
focussed in the picture. salary wise, it depends on the company and
our demand as per our experience and skills.
17 years ago
can anyone tell me how to deploy a web application in weblogic server 6.0?
i have ejbs in my application, where and all my .java,.xml,.jar files sits
and need directory structure for the application.

thanks n regards
hussain
17 years ago