| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.security.SecureRandom; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Calendar; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.SecretKey; |
| | |
| | | return temp; |
| | | } |
| | | |
| | | public static boolean isDigital(String str) { |
| | | String regx= "^\\d+"; |
| | | return str.matches(regx); |
| | | } |
| | | // public static boolean isDigital(String str) { |
| | | // String regx= "^\\d+"; |
| | | // return str.matches(regx); |
| | | // } |
| | | |
| | | // public static void main(String []args){ |
| | | // String str = "EB00020000031420010000000400A5"; |
| | |
| | | Point p1 = new Point(2.55,1.0); |
| | | Point p2 = new Point(1.55,1.0); |
| | | System.out.println(Calc3Point(p1,p2,1.0).toString()); |
| | | System.out.println( isDigital("2003233d")); |
| | | System.out.println( isDigital("d2003233")); |
| | | System.out.println( dateToLongSec("20200330101455")); |
| | | |
| | | |
| | | |
| | | ; |
| | | } |
| | | |
| | | public static Point Calc3Point(Point p1,Point p2,double L ){ |
| | |
| | | |
| | | return simpleDateFormat.format(begin_time); |
| | | } |
| | | |
| | | public static boolean isDigital(String str){ |
| | | String regx = "^[0-9]*$"; |
| | | Pattern pattern = Pattern.compile(regx); |
| | | Matcher matcher = pattern.matcher(str); |
| | | return matcher.matches(); |
| | | } |
| | | |
| | | public static long dateToLongSec(String utc) { |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Date date = null; |
| | | try { |
| | | date = simpleDateFormat.parse(utc); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return date.getTime()/1000; |
| | | } |
| | | } |