guestin loy

Greenhorn
+ Follow
since Oct 09, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by guestin loy

i tried by giving class name also. but it is still not invoking that.

#!/bin/sh
path/to/java test


its giving error as :
path/to/java: not found

could you suggest on this?
Regards.
16 years ago
Hi,

How can i exceute a java program using shellscript.
tried like :
#!bin/sh
path/to/java test.java


but its not invoking the program.

could you please suggest me on this?

Regards.
16 years ago
i mistakenly give some other variable name. i correctd the same in bold.
i'm initializing it with the very firts record.
min_time = Array[0].getMillisecond ;max_time =Array[0].getMillisecond;
for (int i = 0; i < Array.length; i++)
{
if (Array[i].getMillisecond < min_time)
{
min_time = Array[i].getMillisecond;
}
else {
if (Array[i].getMillisecond > max_time)
{
max_time = Array[i].getMillisecond; }

as per your suggestion, i can take the Index where the min time and max time is present and then can retrive that element from the array list by avoidign sorting.

Could you please suggest any other inbuilt function to get the sort for the list?
Please note that the list here is JAXB generated list.
16 years ago
Thank you all.
few things are there in my arraylit object.
Array list is defined in some object say (objDepartmentDetails).
and that Arraylist (say alDept) contains Department objects.The Department object has the fields DeptNo and DeptDate.The getter method for DeptNo is getDeptNum and for the DeptDate is getDeptDate.

and i calling this object(objDepartmentDetails) from other class.
I tried few things.
1. I converted date to Milisecond and then used this
min_time = Array[0].getMillisecond ;max_time =Array[0].getMillisecond;
for (int i = 0; i < Array.length; i++)
{
if (Array[i].getMillisecond < min_score)
{
min_time = Array[i].getMillisecond;
}
else {
if (Array[i].getMillisecond > max_score)
{
max_time = Array[i].getMillisecond; }


but i want to use if any already defined method is available 'cos i have to use the similar logic for 4-5 methods so,
2. I thought of using Collections.sort(); but its not accepting my Arraylist.

2. Then i tried with
getSortedList(ArrayList alObject, String getMethod,String dataType,char order)
but its not recognising the getDeptDate().

i am now clueless.Could you correct me and help in giving me right direction?

Regards.
16 years ago
Hi,
I have an arraylist. now i want to get the record with the oldest timestamp from all the records present in the arraylist.
example:
arraylist[]
record1 : Thu Oct 09 20:51:03 GMT+05:30 2008
record2: Fri Oct 09 20:51:03 GMT+05:30 2009
record3: Thu Oct 10 20:51:03 GMT+05:30 2008
record4: Thu Dec 09 20:51:03 GMT+05:30 2006

The required output should be record4:Thu Dec 09 20:51:03 GMT+05:30 2006.
could you please suggest any solution for this?

Regards
16 years ago