Commit 0c5dfa58 authored by manohar's avatar manohar

java-doc comments added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102134 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d859dbbe
...@@ -16,6 +16,14 @@ public class UtilMethods { ...@@ -16,6 +16,14 @@ public class UtilMethods {
return new UtilMethods(); return new UtilMethods();
} }
/**
* Returns Relative date as java.sql.Timestamp
*
* @param baseDate Timestamp for which the relative date is to be returned
* @param noOfDays Number of days as int
* @return Relative date as java.sql.Timestamp
* @exception none
*/
public java.sql.Timestamp RelativeDate(java.sql.Timestamp baseDate, int noOfDays) public java.sql.Timestamp RelativeDate(java.sql.Timestamp baseDate, int noOfDays)
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -26,6 +34,14 @@ public class UtilMethods { ...@@ -26,6 +34,14 @@ public class UtilMethods {
return java.sql.Timestamp.valueOf(sdt.format(newDate) + " 00:00:00.000"); return java.sql.Timestamp.valueOf(sdt.format(newDate) + " 00:00:00.000");
} }
/**
* Returns Relative date as java.util.Date
*
* @param baseDate java.util.Date for which the relative date is to be returned
* @param noOfDays Number of days as int
* @return Relative date as java.util.Date
* @exception none
*/
public Date RelativeDate(Date baseDate, int noOfDays) public Date RelativeDate(Date baseDate, int noOfDays)
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -34,6 +50,14 @@ public class UtilMethods { ...@@ -34,6 +50,14 @@ public class UtilMethods {
Date newDate = cal.getTime(); Date newDate = cal.getTime();
return newDate; return newDate;
} }
/**
* Returns java.util.Date after adding specified months
*
* @param baseDate java.util.Date for which the specified months to be added
* @param noOfMonths Number of months as int
* @return date as java.util.Date
* @exception none
*/
public Date AddMonths(Date baseDate, int noOfMonths) public Date AddMonths(Date baseDate, int noOfMonths)
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -42,6 +66,14 @@ public class UtilMethods { ...@@ -42,6 +66,14 @@ public class UtilMethods {
java.util.Date newDate = cal.getTime(); java.util.Date newDate = cal.getTime();
return newDate; return newDate;
} }
/**
* Returns java.sql.Timestamp after adding specified months
*
* @param baseDate java.sql.Timestamp for which the specified months to be added
* @param noOfMonths Number of months as int
* @return date as java.sql.Timestamp
* @exception none
*/
public java.sql.Timestamp AddMonths(java.sql.Timestamp baseDate, int noOfMonths) public java.sql.Timestamp AddMonths(java.sql.Timestamp baseDate, int noOfMonths)
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -53,6 +85,14 @@ public class UtilMethods { ...@@ -53,6 +85,14 @@ public class UtilMethods {
} }
/**
* Returns elapsed days as long
*
* @param date1 java.sql.Timestamp 1st date
* @param date2 java.sql.Timestamp 2nd date
* @return Elapsed days as long
* @exception none
*/
public long DaysAfter(java.sql.Timestamp date1, java.sql.Timestamp date2) public long DaysAfter(java.sql.Timestamp date1, java.sql.Timestamp date2)
{ {
// 18-04-2007 manoharan to find the elapsed days // 18-04-2007 manoharan to find the elapsed days
...@@ -76,6 +116,14 @@ public class UtilMethods { ...@@ -76,6 +116,14 @@ public class UtilMethods {
return totDays; return totDays;
} }
/**
* Returns double formated to String with specified decimal places
*
* @param actVal The double value to be formated
* @param prec Number of decimal places
* @return Formated string
* @exception none
*/
public String getReqDecString(double actVal, int prec) public String getReqDecString(double actVal, int prec)
{ {
String fmtStr = "############0"; String fmtStr = "############0";
...@@ -87,6 +135,14 @@ public class UtilMethods { ...@@ -87,6 +135,14 @@ public class UtilMethods {
DecimalFormat decFormat = new DecimalFormat(fmtStr); DecimalFormat decFormat = new DecimalFormat(fmtStr);
return decFormat.format(actVal); return decFormat.format(actVal);
} }
/**
* Returns elapse months between to Timstamps
*
* @param date1 Thwe 1st Timestamp value
* @param date2 The 2nd Timestamp value
* @return Number of elapsed months as int
* @exception none
*/
public int MonthsBetween(java.sql.Timestamp date1, java.sql.Timestamp date2) public int MonthsBetween(java.sql.Timestamp date1, java.sql.Timestamp date2)
{ {
// 18-04-2007 manoharan to find the elapsed months // 18-04-2007 manoharan to find the elapsed months
...@@ -135,6 +191,14 @@ public class UtilMethods { ...@@ -135,6 +191,14 @@ public class UtilMethods {
return totMonths ; return totMonths ;
} }
/**
* Returns elapse time between 2 Timestamps
*
* @param date1 The 1st Timestamp value
* @param date2 The 2nd Timestamp value
* @return The time in hh.mm as double
* @exception none
*/
public double ElapsedTimeHHMM(java.sql.Timestamp date1, java.sql.Timestamp date2) public double ElapsedTimeHHMM(java.sql.Timestamp date1, java.sql.Timestamp date2)
{ {
// 19/01/2009 manoharan to find the elapsed time // 19/01/2009 manoharan to find the elapsed time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment