Commit 38ff2c69 authored by smanohar's avatar smanohar

missing javadoc comments updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216656 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5fc928fd
......@@ -11,6 +11,14 @@ import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.utility.ITMException;
import org.w3c.dom.*;
/**
* @author base
*
*/
/**
* @author base
*
*/
public class UtilMethods {
public UtilMethods(){
......@@ -255,6 +263,9 @@ public class UtilMethods {
}
//***** Modified by Vishal on 23/06/2017.Start
/**
* @return current date
*/
public Date today()
{
Calendar rightNow = Calendar.getInstance();
......@@ -265,17 +276,28 @@ public class UtilMethods {
Date today = rightNow.getTime();
return today;
}
/**
* @return current data
*/
public java.sql.Date todaySqlDate()
{
java.sql.Date today = new java.sql.Date(System.currentTimeMillis());
return today;
}
/**
* @return Current Time
*/
public java.sql.Time now()
{
return new java.sql.Time(System.currentTimeMillis());
}
/**
* @param Timestamp
* @return java.sqlDate
* @throws ITMException
*/
public java.sql.Date getSqlDate(java.sql.Timestamp ts1) throws ITMException
{
java.sql.Date sd = null;
......@@ -290,6 +312,11 @@ public class UtilMethods {
return sd;
}
/**
* @param Timestamp
* @return java.sqlDate
* @throws ITMException
*/
public java.sql.Date date(java.sql.Timestamp ts1) throws ITMException
{
java.sql.Date sd = null;
......@@ -304,6 +331,13 @@ public class UtilMethods {
return sd;
}
/**
* @param year
* @param month
* @param day
* @return java.sql.Date
* @throws ITMException
*/
public java.sql.Date getSqlDate(int year, int month, int day) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -327,6 +361,13 @@ public class UtilMethods {
return today;
}
/**
* @param year
* @param month
* @param day
* @return java.sql.Date
* @throws ITMException
*/
public java.sql.Date date(int year, int month, int day) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -351,6 +392,11 @@ public class UtilMethods {
}
/**
* @param java.sql.Date
* @return year
* @throws ITMException
*/
public int year(java.sql.Date sd) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -367,6 +413,11 @@ public class UtilMethods {
return year;
}
/**
* @param java.util.Date
* @return year
* @throws ITMException
*/
public int year(java.util.Date sd) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -383,6 +434,11 @@ public class UtilMethods {
return year;
}
/**
* @param Timestamp
* @return year
* @throws ITMException
*/
public int year(java.sql.Timestamp st) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -399,6 +455,11 @@ public class UtilMethods {
return year;
}
/**
* @param java.sql.Date
* @return month as int
* @throws ITMException
*/
public int month(java.sql.Date sd) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -415,6 +476,11 @@ public class UtilMethods {
return month;
}
/**
* @param java.util.Date
* @return int month
* @throws ITMException
*/
public int month(java.util.Date sd) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -431,6 +497,11 @@ public class UtilMethods {
return month;
}
/**
* @param Timestamp
* @return int month
* @throws ITMException
*/
public int month(java.sql.Timestamp st) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -447,6 +518,11 @@ public class UtilMethods {
return month;
}
/**
* @param java.sql.Date
* @return int day
* @throws ITMException
*/
public int day(java.sql.Date sd) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -463,6 +539,11 @@ public class UtilMethods {
return day;
}
/**
* @param java.util.Date
* @return int day
* @throws ITMException
*/
public int day(java.util.Date sd) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -479,6 +560,11 @@ public class UtilMethods {
return day;
}
/**
* @param Timestamp
* @return int day
* @throws ITMException
*/
public int day(java.sql.Timestamp st) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -495,6 +581,11 @@ public class UtilMethods {
return day;
}
/**
* @param java.util.Date
* @return java.util.Date
* @throws ITMException
*/
public java.util.Date getUtilDate(java.util.Date date) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -515,6 +606,11 @@ public class UtilMethods {
return today;
}
/**
* @param java.util.Date
* @return java.util.Date
* @throws ITMException
*/
public java.util.Date date(java.util.Date date) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -535,6 +631,11 @@ public class UtilMethods {
return today;
}
/**
* @param java.util.Date
* @return Timestamp
* @throws ITMException
*/
public java.sql.Timestamp dateTime(java.util.Date ud) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -557,6 +658,11 @@ public class UtilMethods {
return ts;
}
/**
* @param java.util.Date
* @return Timestamp
* @throws ITMException
*/
public java.sql.Timestamp dateTime(java.sql.Date sd) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -580,6 +686,12 @@ public class UtilMethods {
}
/**
* @param java.sql.Date
* @param java.sql.Time
* @return Timestamp
* @throws ITMException
*/
public java.sql.Timestamp dateTime(java.sql.Date sd, java.sql.Time sqlTime) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -608,6 +720,12 @@ public class UtilMethods {
return ts;
}
/**
* @param java.util.Date
* @param java.sql.Time
* @return Timestamp
* @throws ITMException
*/
public java.sql.Timestamp dateTime(java.util.Date ud, java.sql.Time sqlTime) throws ITMException
{
Calendar rightNow = Calendar.getInstance();
......@@ -638,11 +756,22 @@ public class UtilMethods {
/**
* @param double
* @param double
* @return double
*/
public double mod(double value1 , double value2)
{
return value1 % value2;
}
/**
* @param double
* @param Double
* @return double
* @throws ITMException
*/
public double mod(double value1 , Double value2) throws ITMException
{
double d1 = 0;
......@@ -657,11 +786,22 @@ public class UtilMethods {
return d1;
}
/**
* @param double
* @param int
* @return double
*/
public double mod(double value1 , int value2)
{
return value1 % value2;
}
/**
* @param double
* @param Integer
* @return double
* @throws ITMException
*/
public double mod(double value1 , Integer value2) throws ITMException
{
double d1 = 0;
......@@ -676,11 +816,22 @@ public class UtilMethods {
return d1;
}
/**
* @param int
* @param int
* @return double
*/
public double mod(int value1 , int value2)
{
return value1 % value2;
}
/**
* @param int
* @param Integer
* @return double
* @throws ITMException
*/
public double mod(int value1 , Integer value2) throws ITMException
{
double d1 = 0;
......@@ -695,12 +846,23 @@ public class UtilMethods {
return d1;
}
/**
* @param int
* @param double
* @return double
*/
public double mod(int value1 , double value2)
{
return value1 % value2;
}
/**
* @param int
* @param Double
* @return double
* @throws ITMException
*/
public double mod(int value1 , Double value2) throws ITMException
{
double d1 = 0;
......@@ -715,6 +877,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Integer
* @param Integer
* @return double
* @throws ITMException
*/
public double mod(Integer value1 , Integer value2) throws ITMException
{
double d1 = 0;
......@@ -729,6 +897,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Integer
* @param int
* @return double
* @throws ITMException
*/
public double mod(Integer value1 , int value2) throws ITMException
{
double d1 = 0;
......@@ -743,6 +917,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Integer
* @param double
* @return double
* @throws ITMException
*/
public double mod(Integer value1 , double value2) throws ITMException
{
double d1 = 0;
......@@ -757,6 +937,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Integer
* @param Double
* @return double
* @throws ITMException
*/
public double mod(Integer value1 , Double value2) throws ITMException
{
double d1 = 0;
......@@ -771,6 +957,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Double
* @param Double
* @return double
* @throws ITMException
*/
public double mod(Double value1 , Double value2) throws ITMException
{
double d1 = 0;
......@@ -785,6 +977,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Double
* @param double
* @return double
* @throws ITMException
*/
public double mod(Double value1 , double value2) throws ITMException
{
double d1 = 0;
......@@ -799,6 +997,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Double
* @param int
* @return double
* @throws ITMException
*/
public double mod(Double value1 , int value2) throws ITMException
{
double d1 = 0;
......@@ -813,6 +1017,12 @@ public class UtilMethods {
return d1;
}
/**
* @param Double
* @param Integer
* @return double
* @throws ITMException
*/
public double mod(Double value1 , Integer value2) throws ITMException
{
double d1 = 0;
......@@ -843,6 +1053,13 @@ public class UtilMethods {
return str1;
}
*/
/**
* @param String
* @param int
* @param int
* @return String
* @throws ITMException
*/
public String mid( String lsStr, int start, int liColWidth ) throws ITMException
{
String str1 = null;
......@@ -876,6 +1093,12 @@ public class UtilMethods {
return str1;
}
/**
* @param String
* @param int
* @return String
* @throws ITMException
*/
public String mid( String lsStr, int start ) throws ITMException
{
String str1 = null;
......@@ -895,6 +1118,12 @@ public class UtilMethods {
return str1;
}
/**
* @param String
* @param int
* @return String
* @throws ITMException
*/
public String left( String src, int size ) throws ITMException
{
String str1 = null;
......@@ -913,6 +1142,12 @@ public class UtilMethods {
return str1;
}
/**
* @param String
* @param int
* @return String
* @throws ITMException
*/
public String right( String src, int size ) throws ITMException
{
String str1 = null;
......@@ -934,6 +1169,12 @@ public class UtilMethods {
return str1;
}
/**
* @param String
* @param searchChar
* @return int
* @throws ITMException
*/
public int pos( String str, String searchChar ) throws ITMException
{
int i1 = 0;
......@@ -956,6 +1197,13 @@ public class UtilMethods {
return i1;
}
/**
* @param String
* @param String
* @param int
* @return int
* @throws ITMException
*/
public int pos( String str, String searchChar, int position ) throws ITMException
{
int i1 = 0;
......@@ -970,6 +1218,10 @@ public class UtilMethods {
return i1 ;
}
/**
* @param noOfSpaces
* @return String
*/
public String space( int noOfSpaces )
{
String blankStr = null;
......@@ -981,6 +1233,12 @@ public class UtilMethods {
return blankStr;
}
/**
* @param dom
* @param formNo
* @return int
* @throws ITMException
*/
public int getRowCount( Document dom, int formNo ) throws ITMException
{
int rowCount = 0;
......@@ -999,6 +1257,10 @@ public class UtilMethods {
return rowCount;
}
/**
* @param str
* @return boolean
*/
public boolean isnumber( String str )
{
int val;
......@@ -1016,6 +1278,11 @@ public class UtilMethods {
}
/**
* @param str
* @return String
* @throws ITMException
*/
public String leftTrim(String str) throws ITMException
{
String returnStr = null;
......@@ -1046,6 +1313,11 @@ public class UtilMethods {
return returnStr;
}
/**
* @param str
* @return String
* @throws ITMException
*/
public String rightTrim(String str) throws ITMException
{
String returnStr = null;
......@@ -1076,6 +1348,11 @@ public class UtilMethods {
return returnStr;
}
/**
* @param int
* @return String
* @throws ITMException
*/
public String convertToString(int ival) throws ITMException
{
String returnStr = null;
......@@ -1090,6 +1367,11 @@ public class UtilMethods {
return returnStr;
}
/**
* @param double
* @return String
* @throws ITMException
*/
public String convertToString(double dval) throws ITMException
{
String returnStr = null;
......@@ -1104,6 +1386,11 @@ public class UtilMethods {
return returnStr;
}
/**
* @param Integer
* @return String
* @throws ITMException
*/
public String convertToString(Integer ival) throws ITMException
{
String returnStr = null;
......@@ -1119,6 +1406,12 @@ public class UtilMethods {
}
/**
* @param Date
* @param Date
* @return int
* @throws ITMException
*/
public int DaysAfter(Date d1, Date d2) throws ITMException
{
int noDays = 0;
......@@ -1136,6 +1429,12 @@ public class UtilMethods {
return noDays;
}
/**
* @param java.sql.Date
* @param java.sql.Date
* @return int
* @throws ITMException
*/
public int DaysAfter(java.sql.Date d1, java.sql.Date d2) throws ITMException
{
int noDays = 0;
......@@ -1150,6 +1449,11 @@ public class UtilMethods {
return noDays;
}
/**
* @param int
* @return double
* @throws ITMException
*/
public double convertMinutesToHours(int min) throws ITMException
{
double hrs = 0d, dReminder = 0d;
......@@ -1175,6 +1479,11 @@ public class UtilMethods {
return (hrs * iSign);
}
/**
* @param double
* @return int
* @throws ITMException
*/
public int convertTimeInMin(double dTime) throws ITMException
{
double dReminder = 0d;
......@@ -1199,6 +1508,11 @@ public class UtilMethods {
return (min * iSign);
}
/**
* @param str
* @return java.sql.Time
* @throws ITMException
*/
public java.sql.Time stringToTime(String str) throws ITMException
{
java.sql.Time sTime = null;
......@@ -1223,6 +1537,11 @@ public class UtilMethods {
}
/**
* @param String[]
* @return int
* @throws ITMException
*/
public int upperBound(String strArr[]) throws ITMException
{
int iLength = 0;
......@@ -1236,6 +1555,11 @@ public class UtilMethods {
}
}
/**
* @param int[]
* @return int
* @throws ITMException
*/
public int upperBound(int intArr[]) throws ITMException
{
int iLength = 0;
......@@ -1249,6 +1573,11 @@ public class UtilMethods {
}
}
/**
* @param Timestamp[]
* @return int
* @throws ITMException
*/
public int upperBound(java.sql.Timestamp tsArr[]) throws ITMException
{
int iLength = 0;
......@@ -1262,6 +1591,11 @@ public class UtilMethods {
}
}
/**
* @param java.sql.Date[]
* @return int
* @throws ITMException
*/
public int upperBound(java.sql.Date sdArr[]) throws ITMException
{
int iLength = 0;
......@@ -1277,6 +1611,11 @@ public class UtilMethods {
/**
* @param java.sql.Time
* @return int
* @throws ITMException
*/
public int convertTimeInMin(java.sql.Time sqlTime) throws ITMException
{
String timeStr = "";
......@@ -1294,6 +1633,11 @@ public class UtilMethods {
}
return (min * iSign);
}
/**
* @param int
* @return int
* @throws ITMException
*/
public int abs(int intVal) throws ITMException
{
try
......@@ -1309,6 +1653,11 @@ public class UtilMethods {
}
return intVal;
}
/**
* @param double
* @return double
* @throws ITMException
*/
public double abs(double dblVal) throws ITMException
{
try
......@@ -1328,6 +1677,13 @@ public class UtilMethods {
//***** Modified by Vishal on 23/06/2017.End
//.........Modified by Rohini T on [12/07/09] [Start].........
/**
* @param String
* @param int
* @param int
* @return boolean
* @throws ITMException
*/
public boolean isChar(String inputStr,int start,int lengthStr ) throws ITMException
{
boolean result = false;
......@@ -1364,10 +1720,11 @@ public class UtilMethods {
/**
* Returns error message
*
* @param trace trace for error description
* @param Code Error code message
* @return conn connection for method
* @exception none
* @param String trace for error description
* @param String Error code message
* @param conn connection for method
* @return String
* @exception ITMException
*/
//added by manish mhatre on 7-feb-2019
//start manish
......
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