java class diagram tool

Alibabacloud.com offers a wide variety of articles about java class diagram tool, easily find your java class diagram tool information here online.

Conversion tool class between Long, String, date types in Java

Importjava.text.*;ImportJava.util.*; Public classDateFormat {/*** Format output of date type *@paramDate *@return */ Public StaticString DateFormat (date date) {SimpleDateFormat formatter=NewSimpleDateFormat ("Yyyy-mm-dd HH:mm:ss"); String datestring=Formatter.format (date); returndatestring; } /*** Convert "2015-08-31-21:08:06" string to date *@paramSTR *@return * @throwsparseexception*/ Public StaticDate stringtodate (String str)throwsparseexception{SimpleDateFormat Formatte

Writing a Java tool class that implements a connection to an Oracle database and returns a Connection object

Label:Just to implement a function, so write only one method, for easy invocation, set as static method 1 Packagecom.jv;2 3 Importjava.sql.Connection;4 ImportJava.sql.DriverManager;5 6 Public classLianjie {7 8 //static method Gets the Connection object 9 Public StaticConnection Getlianj ()throwsExceptionTen { One AClass.forName ("Oracle.jdbc.driver.OracleDriver"); - -String url = "Jdbc:oracle:thin: @localhost: 1521:orcl"; the -Connection conn = driv

Java htmlemail Send mail tool class

Package Com.sh.xrsite.common.utils;import Java.io.file;import Java.util.hashmap;import java.util.Locale;import Java.util.map;import Java.util.regex.matcher;import Java.util.regex.pattern;import Org.apache.commons.mail.htmlemail;import Org.springframework.ui.freemarker.freemarkertemplateutils;import Freemarker.template.configuration;import freemarker.template.template;/** * Send email */public class SendMailUtil {//PRI vate static final String smtph

Java Concurrency tool Class (III) Semaphore to control the number of concurrent threads

} - - Threadpool.shutdown (); - } -}In the code, although there are 30 threads executing, only 10 concurrent executions are allowed. The semaphore method Semaphore (int permits) accepts an integer number that represents the number of licenses available. Semaphore (10) indicates that 10 threads are allowed to obtain a license, that is, the maximum number of concurrent is 10. The use of semaphore is also simple, with the first thread using Semaphore's acquire () to obtain a license,

Java Date Tool class

* DATETIMESTR must be in the form of FORMATSTR * @param datetimestr * @param formatstr * @return */public static Date getDate (String datetimestr, String formatstr) {try {if (Datetimestr = = NULL | | datetimestr.equals ("")) {return null; } dateformat sdf = GetDateFormat (FORMATSTR); Java.util.Date d = sdf.parse (DATETIMESTR); return D; } catch (ParseException e) {throw new RuntimeException (e); }}/** * Converts YYYYMMDD to a date date * @pa

Java Date Tool class

public class MyDate {public static String GETDATECN () {SimpleDateFormat format = new SimpleDateFormat ("YYYY year mm month DD Day HH : Mm:ss "); String date = Format.format (new date (System.currenttimemillis ())), return date;//October 03, 2012 23:41:31}public Static String Getdateen () {SimpleDateFormat format1 = new SimpleDateFormat ("Yyyy-mm-dd HH:mm:ss"); String date1 = Format1.format (New Date (System.currenttimemillis ())); return date1;//201

Java Date Formatting Tool class

= calendar.getinstance (). GetTime (). GetTime ();Calendar C = calendar.getinstance ();C.settime (Parse (date));Long T1 = C.gettime (). GetTime ();return (int) (t/1000-t1/1000)/3600/24; } /*** by user format string distance today's days * * @param date* Date String* @param format* Date Format* @return */public static int countdays (string date, string format) {Long T = calendar.getinstance (). GetTime (). GetTime ();Calendar C = calendar.getinstance ();C.settime (Parse (date, format));Long T1

Java Time Tool Class (Project utility)

Package Com.eabax.plugin.yundada.utils;import Java.text.parseexception;import Java.text.simpledateformat;import Java.util.arraylist;import Java.util.calendar;import Java.util.date;import Java.util.gregoriancalendar;import Java.util.linkedhashmap;public class Timeutil {/** * resolves all months between a date * * @param begindatestr * @param enddatestr * @return */public static arraylist  Java Time

Java Response Result Tool class, customizable response code, content, Response message

/*** Response Structure* @author Yliu*/public class ResultutilResponding to business statusPrivate Integer status;Response messagePrivate String msg;Data in the responsePrivate T data;Public Integer GetStatus () {return status;}public void SetStatus (Integer status) {This.status = status;}Public String getmsg () {return msg;}public void Setmsg (String msg) {this.msg = msg;}Public T GetData () {return data;}public void SetData (T data) {This.data = dat

Empty Tool class--java

CodeImport java.util.collection;/** * */public class Emptyutil {/** * Determines whether a string is empty and a length of 0 is considered an empty string. * * @param str * @return */public static Boolean isEmpty (String str) {if (str! = null) { Return Str.trim (). Length () = = 0; } else {return true; }}/** * To determine if a string is empty, the string is truncated before and after it is truncated, and a length of 0 is

Java background parsing Excel upload Data tool class

){ returnCellvalue; } //read the number as a string to avoid 1 Read 1.0 if(Cell.getcelltype () = =cell.cell_type_numeric) {Cell.setcelltype (cell.cell_type_string); } //determine the type of data Switch(Cell.getcelltype ()) { CaseCell.cell_type_numeric://DigitalCellvalue =string.valueof (Cell.getnumericcellvalue ()); Break; CaseCell.cell_type_string://stringCellvalue =string.valueof (Cell.getstringcellvalue ()); Break; CaseCell.cell_type_bo

5 Java Sort Algorithm Rollup tool class _java

The Tool class summarizes the rapid ordering of Java in simple and straightforward way. Hill sort, insert sort, heap sort, merge sort five sort algorithms, the code does not have a description of these sorts of algorithms, about the thought part wants to check the relevant instructions, here is only a summary of these algorithms for everyone to use. publi

Java HTTP Request Tool class code (HTTPS supported)

(); if(Params! =NULL) { for(EntryE:params.entryset ()) {Parambbuilder.append (E.getkey ()). Append ("="). Append (Urlencoder.encode (string.valueof (E.getvalue ()), "UTF-8")). Append (""); } Parambbuilder.deletecharat (Parambbuilder.length ()-1); } //Dataoutputstream.writebytes writes a 16-bit Unicode character in a string as a 8-bit character in the streamout.writebytes (parambbuilder.tostring ()); Out.flush (); Reader=NewBufferedReader (NewInp

Java MD5 Encryption Tool class

1 ImportJava.math.BigInteger;2 Importjava.security.MessageDigest;3 Importjava.security.NoSuchAlgorithmException;4 5 Public classMd5utils {6 /**7 * encryption using MD5 algorithm8 */9 Public Staticstring MD5 (string plaintext) {Ten byte[] Secretbytes =NULL; One Try { ASecretbytes = messagedigest.getinstance ("MD5"). Digest ( - plaintext.getbytes ()); -}Catch(nosuchalgorithmexception e) { the Throw NewRuntimeException ("No MD5 this algorithm!") "); -

Java determines the current number of users and the number of users currently logged on-session principle of tool class

") Public voidsessiondestroyed (Httpsessionevent event) {HttpSession session=event.getsession (); ServletContext Application=Session.getservletcontext (); HashSet Sessions= (HashSet) application.getattribute ("Sessions"); //the destroyed session is removed from the hashset set.Sessions.remove (session); } /*** Access to the number of online users and number of users logged in *@paramrequest current Requested Object *@paramflag=1 Current Online users flag=2 number of currently logged on u

Java Time Tool class usage

1. Get timestamp of N days ago1 Calendar cl = calendar.getinstance (); 2 Cl.add (Calendar.day_of_year,-7); 3 Date date = cl.gettime (); 4 long time = date.gettime (); 5 New Timestamp (time);2. Program start current time and task execution time1 /*2 Delegate Time3 */4String time= "20:00";5 6 /*7 SimpleDateFormat can parse string to Date, format Date to string8 */9DateFormat DateFormat =NewSimpleDateFormat ("Yy-mm-dd hh:mm");TenDateFormat DayFormat =NewSimpleDateFormat ("Yy-mm-dd"); One ADate cur

Java tool class for reading properties Propertiesutil

=NewProperties (); $InputStream is =NULL; $ Try { -is = Propertiesutil.class. getClassLoader (). getResourceAsStream ( - properiesname); the P.load (IS); -}Catch(IOException e) {Wuyi //TODO auto-generated Catch block the e.printstacktrace (); -}finally { Wu Try { - is.close (); About}Catch(IOException e) { $ //TODO auto-generated Catch block - e.printstacktrace (); - } - } A returnp; + } the - Public voidWrite

Java: Collection, Collections Tool class usage

Reference:Http://www.cnblogs.com/nayitian/p/3269585.htmlpublic static void Main (string[] args) {TODO auto-generated Method StublistPokerlist.add (13);Pokerlist.add (14);Pokerlist.add (3);System.out.println ("Far Order:" + pokerlist);1) sort (from small to large)Collections.sort (pokerlist);System.out.println ("Sort after order:" + pokerlist);2) Invert/invertCollections.reverse (pokerlist);System.out.println ("Reverse after Order:" + pokerlist);3) sort (from big to small)Collections.sort (Pokerl

Java QR Code tool class

Private StaticFinalintBLACK =0xff000000; Private StaticFinalintWhite =0xFFFFFFFF; PrivateMatrixtoimagewriter () {} Public Staticbufferedimage tobufferedimage (Bitmatrix matrix) {intwidth =matrix.getwidth (); intHeight =matrix.getheight (); BufferedImage Image=Newbufferedimage (width, height, bufferedimage.type_int_rgb); for(intx =0; x ) { for(inty =0; Y {Image.setrgb (x, y, matrix).Get(x, y)?black:white); } } returnimage; } Public Static voidWriteToFile (Bitmatrix matrix

A Java Jenkinsutil tool class that creates, deletes, and constructs functions like Jenkins.

); Client.getstate (). SetCredentials (Authscope.any,creds); Client.getparams (). Setauthenticationpreemptive (true); Postmethod Post=NewPostmethod (jenkinsbaseurl+ "/job/" +jobname+ "/api/json"); Post.setdoauthentication (true); Client.executemethod (POST); String result=post.getresponsebodyasstring (); intBuildNumber = with (result). Get ("Lastbuild.number"); Postmethod stopjenkinsrequest=NewPostmethod (jenkinsbaseurl+ "/job/" +jobname+ "/" +buildnumber+ "/stop");

Total Pages: 15 1 .... 11 12 13 14 15 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.