blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
82f83558047f0728afa9fea13b8365e9e57803a7 | 416610367839b29d420520c7e1f99fa07e010ba2 | /ebank/target/tmp/jsp/org/apache/jsp/WEB_002dINF/jsp/transfer/applyProcess_jsp.java | 2663a0eb7236bf3a93af85f9301959d5d0e2bf88 | [] | no_license | TMbasama/springmvc_shiro | 0a1a65f6126e01b62be9edc118139caec26b1341 | 489e53db249a312444eaae5d9d4d07622c0a8e8a | refs/heads/master | 2021-01-15T19:17:42.280931 | 2017-08-09T14:25:38 | 2017-08-09T14:25:38 | 99,815,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,428 | java | package org.apache.jsp.WEB_002dINF.jsp.transfer;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class applyProcess_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("<meta name=\"viewport\"\r\n");
out.write("\tcontent=\"width=device-width, initial-scale=1, maximum-scale=1\">\r\n");
out.write("<link rel=\"shortcut icon\"\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/img/ebank_icons_57x57.png\"\r\n");
out.write("\ttype=\"image/x-icon\">\r\n");
out.write("<title>EBank</title>\r\n");
out.write("<link href=\"http://fonts.googleapis.com/css?family=Roboto:400,300,300italic,100,400italic,700,500,900\" rel=\"stylesheet\" type=\"text/css\">\r\n");
out.write("<link\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/fonts/font_1.css\"\r\n");
out.write("\trel=\"stylesheet\" type=\"text/css\">\r\n");
out.write("<link rel=\"stylesheet\"\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/css/bootstrap.min.css\"\r\n");
out.write("\ttype=\"text/css\" media=\"all\" />\r\n");
out.write("<link rel=\"stylesheet\"\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/css/theme.css\"\r\n");
out.write("\ttype=\"text/css\" media=\"all\" />\r\n");
out.write("<link rel=\"stylesheet\"\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/css/revslider.css\"\r\n");
out.write("\ttype=\"text/css\" media=\"all\" />\r\n");
out.write("<link rel=\"stylesheet\"\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/css/custom.css\"\r\n");
out.write("\ttype=\"text/css\" media=\"all\" />\r\n");
out.write("<!-- DataTables -->\r\n");
out.write(" <link rel=\"stylesheet\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/plugins/datatables/dataTables.bootstrap.css\">\t\r\n");
out.write(" <link rel=\"stylesheet\"\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/font-awesome/css/font-awesome.css\"\r\n");
out.write("\ttype=\"text/css\" media=\"all\" />\r\n");
out.write(" <link rel=\"stylesheet\"\r\n");
out.write("\thref=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/common/ebank/ebank.css\"\r\n");
out.write("\ttype=\"text/css\" media=\"all\" />\r\n");
out.write("<title>Insert title here</title>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../common/header.jsp", out, false);
out.write("\r\n");
out.write(" <div class=\"breadcrumbs\">\r\n");
out.write(" \t<div class=\"container\">\r\n");
out.write(" \t<a href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("\">首页</a><span>/</span><a href=\"javascript:void(0);\">转账汇款</a><span>/</span>转账进度查询\r\n");
out.write(" <!-- <h1 class=\"title-page\">基金列表</h1> -->\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" <table id=\"financeProd\" class=\"table table-bordered table-striped\">\r\n");
out.write(" </table>\r\n");
out.write("\r\n");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../common/footer.jsp", out, false);
out.write("\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/plugins/guide/jquery-1.11.0.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/plugins/datatables/jquery.dataTables.min.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/static/plugins/datatables/dataTables.bootstrap.min.js\"></script>\r\n");
out.write("<!-- page script -->\r\n");
out.write("<script>\r\n");
out.write(" $(function () {\r\n");
out.write(" /* $(\"#example1\").DataTable({\r\n");
out.write(" \t\r\n");
out.write(" }); */\r\n");
out.write(" var dataTable=$('#financeProd').DataTable({\r\n");
out.write("\t\t\"bLengthChange\" : false,\r\n");
out.write("\t\t\"bPaginate\" : true, //翻页功能\r\n");
out.write("\t\t\"bFilter\" : true,\r\n");
out.write("\t\t//保存状态到cookie *************** 很重要 , 当搜索的时候页面一刷新会导致搜索的消失。使用这个属性就可避免了\r\n");
out.write("\t\t//\"bStateSave\" : true,\r\n");
out.write("\t\t//改变每页显示数据数量\r\n");
out.write("\t\t\"bLengthChange\" : false,\r\n");
out.write("\t\t\"bSort\" : true,\r\n");
out.write("\t\t\"iDisplayLength\" : 10,\r\n");
out.write("\t\t\"sPaginationType\" : \"full_numbers\",\r\n");
out.write("\t\t\"bProcessing\" : true,\r\n");
out.write("\t\t\"bServerSide\" : true,\r\n");
out.write("\t\t\"searching\" : false,\r\n");
out.write("\t\t\"sAjaxSource\" : \"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("/transfer/queryAcctLst\",\r\n");
out.write("\t\t/* \"fnServerParams\" : function(aoData) {\r\n");
out.write("\t\t\tfor (var i = 0; i < searchData.length; i++) {\r\n");
out.write("\t\t\t\taoData.push(searchData[i]);\r\n");
out.write("\t\t\t}\r\n");
out.write("\t\t}, */\r\n");
out.write("\t\t\"sServerMethod\" : \"POST\",\r\n");
out.write("\t\t\"data\" : null,\r\n");
out.write("\t\t \"aaSorting\": [[4, \"desc\"]],\r\n");
out.write("\t\t//列的定义\r\n");
out.write("\t\t\"aoColumns\" : [ {\r\n");
out.write("\t\t\t\"data\" : \"from_acct_id\",\r\n");
out.write("\t\t\t\"sTitle\" : \"付款账号\"\r\n");
out.write("\t\t}, {\r\n");
out.write("\t\t\t\"data\" : \"to_acct_id\",\r\n");
out.write("\t\t\t\"sTitle\" : \"收款账号\"\r\n");
out.write("\t\t}, {\r\n");
out.write("\t\t\t\"data\" : \"to_acct_name\",\r\n");
out.write("\t\t\t\"sTitle\" : \"收款人名\"\r\n");
out.write("\t\t}, {\r\n");
out.write("\t\t\t\"data\" : \"trans_amount\",\r\n");
out.write("\t\t\t\"sTitle\" : \"转账金额\"\r\n");
out.write("\t\t} ,{\r\n");
out.write("\t\t\t\"data\" : \"create_time\",\r\n");
out.write("\t\t\t\"sTitle\" : \"申请时间\"\r\n");
out.write("\t\t} ,{\r\n");
out.write("\t\t\t\"data\" : \"status\",\r\n");
out.write("\t\t\t\"sTitle\" : \"申请状态\"\r\n");
out.write("\t\t} \r\n");
out.write("\t\t],\r\n");
out.write("\t//visible-设置列不可见\t\t\r\n");
out.write("\t \"columnDefs\": [\r\n");
out.write("\t\t\t {\r\n");
out.write("\t\t\t \"render\": function ( data, type, row ) {\r\n");
out.write("\t\t\t \t if(data==1){\r\n");
out.write("\t\t\t \t\t return \"审核中\";\r\n");
out.write("\t\t\t \t }else if(data==2){\r\n");
out.write("\t\t\t \t\t return \"已到账\";\r\n");
out.write("\t\t\t \t }else if(data==0){\r\n");
out.write("\t\t\t \t\t return \"转账失败\";\r\n");
out.write("\t\t\t \t }\r\n");
out.write("\t\t\t },\r\n");
out.write("\t\t\t \"targets\": [5]\r\n");
out.write("\t\t\t },\r\n");
out.write("\t\t\t ],\r\n");
out.write("\t\t\"language\" : {\r\n");
out.write("\t\t\t\"processing\" : \"处理中...\",\r\n");
out.write("\t\t\t\"lengthMenu\" : \"显示 _MENU_ 项结果\",\r\n");
out.write("\t\t\t\"zeroRecords\" : \"没有匹配结果\",\r\n");
out.write("\t\t\t\"info\" : \"显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项\",\r\n");
out.write("\t\t\t\"infoEmpty\" : \"显示第 0 至 0 项结果,共 0 项\",\r\n");
out.write("\t\t\t\"infoFiltered\" : \"(由 _MAX_ 项结果过滤)\",\r\n");
out.write("\t\t\t\"infoPostFix\" : \"\",\r\n");
out.write("\t\t\t\"search\" : \"搜索:\",\r\n");
out.write("\t\t\t\"searchPlaceholder\" : \"搜索...\",\r\n");
out.write("\t\t\t\"url\" : \"\",\r\n");
out.write("\t\t\t\"emptyTable\" : \"表中数据为空\",\r\n");
out.write("\t\t\t\"loadingRecords\" : \"载入中...\",\r\n");
out.write("\t\t\t\"infoThousands\" : \",\",\r\n");
out.write("\t\t\t\"paginate\" : {\r\n");
out.write("\t\t\t\t\"first\" : \"首页\",\r\n");
out.write("\t\t\t\t\"previous\" : \"上页\",\r\n");
out.write("\t\t\t\t\"next\" : \"下页\",\r\n");
out.write("\t\t\t\t\"last\" : \"末页\"\r\n");
out.write("\t\t\t},\r\n");
out.write("\t\t\t\"aria\" : {\r\n");
out.write("\t\t\t\tpaginate : {\r\n");
out.write("\t\t\t\t\tfirst : '首页',\r\n");
out.write("\t\t\t\t\tprevious : '上页',\r\n");
out.write("\t\t\t\t\tnext : '下页',\r\n");
out.write("\t\t\t\t\tlast : '末页'\r\n");
out.write("\t\t\t\t},\r\n");
out.write("\t\t\t\t\"sortAscending\" : \": 以升序排列此列\",\r\n");
out.write("\t\t\t\t\"sortDescending\" : \": 以降序排列此列\"\r\n");
out.write("\t\t\t},\r\n");
out.write("\t\t\t\"decimal\" : \"-\",\r\n");
out.write("\t\t\t\"thousands\" : \".\"\r\n");
out.write("\t\t}\r\n");
out.write("\t});\r\n");
out.write(" });\r\n");
out.write("</script>\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"TMbasama@163.com"
] | TMbasama@163.com |
75b19f41bdd292b3325d89863ccfb14240760a39 | c48d5ce22ee097fbca262db94d26ab05bfd13d8b | /AbstractAndInterface/Lesson5/src/check.java | 9284699a96152fea5f6c18f3e1b13c9da57a1d41 | [] | no_license | c4chu0jpr0/Module2 | 8b2ca1d2fe21c039dd44b6df3f426d59bf4dc39c | 471ee6a5fc10b9ac9fb124689a584099dabac288 | refs/heads/master | 2022-12-08T05:10:04.732752 | 2020-08-26T03:38:26 | 2020-08-26T03:38:26 | 284,930,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 465 | java | public class check {
public static void main(String[] args) {
Square[] squares = new Square[3];
squares[0]= new Square(3,"gold",true);
squares[1]= new Square(1,"green",false);
squares[2]= new Square(2,"blue", false);
for (Square square: squares){
if (square instanceof Colorable){
((Colorable) square).HowToColor();
System.out.println(square);
}
}
}
}
| [
"67448114+c4chu0jpr0@users.noreply.github.com"
] | 67448114+c4chu0jpr0@users.noreply.github.com |
d66a06fbf30a299df1f9da474a5c0454f1bab048 | e08ac5f39e8ea71df184fc60f4ef509cfbaccd58 | /spring-api/src/main/java/com/dao/IssueDaoFactory.java | 4fce0fc8a1e6874aafeff04fa2832a8739c6e1bc | [
"MIT"
] | permissive | DecanJones/task-dispatching | a5b916b5c79c917e72e4cb29a70589376e7542eb | 5dc91dd407185f5a7a90bccc15430983a97f0b68 | refs/heads/master | 2023-04-05T10:12:17.403289 | 2019-06-10T13:46:12 | 2019-06-10T13:46:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package com.dao;
import com.entity.Issue;
import java.util.List;
public interface IssueDaoFactory {
int addIssue(Issue issue);
Issue getIssue(int id);
List<Issue> getAllIssues();
void deleteIssue(int id);
}
| [
"miloszszwedo@gmail.com"
] | miloszszwedo@gmail.com |
7bf2f56f6c00bb22a845cc1522a11b55927d02b8 | e6167d474e70f86ba7671cc391d02261637f475b | /src/IfBlock.java | 2c63fb569aeea39eabcd133eee0f755259cb625d | [] | no_license | sozgat/JavaNotes | 2b8b12ae990b62f1125597fd8d53e56f34537daa | 1284df4e0ba894d855e069676d9fef65ab54b07d | refs/heads/master | 2023-07-14T10:09:27.895638 | 2021-08-28T20:49:47 | 2021-08-28T20:49:47 | 400,617,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | import java.util.Random;
public class IfBlock {
public static void main(String[] args) {
Random random = new Random();
int number = random.nextInt(11);
System.out.println("I picked a random number: " + number);
if (number < 5){
System.out.println("Number is smaller than 5");
}
}
}
| [
"said.ozgat@hotmail.com"
] | said.ozgat@hotmail.com |
a33d96726e6772bb847ffbc11543c377d826b8d8 | 2c1ebaf3fbe64a5ddccaf86c01b868aa27963b57 | /DailyTips/src/lv/eleonora/TestTips.java | 3764dfb304cc36c6631ecfca3613fa93af1b020c | [] | no_license | EleonoraSova/DailyTips | 52e558c646406822d4e3155b075b0d6bef7b49ec | 51f1146c52c3047b19ba01ecf6b384abd1be0149 | refs/heads/master | 2021-01-04T18:33:08.067793 | 2020-02-21T15:05:34 | 2020-02-21T15:05:34 | 240,710,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package lv.eleonora;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Random;
import java.util.Scanner;
public class TestTips {
public static void main(String[] args) {
try{
File files = new File("tips.txt");
int c=0;
Scanner scanner = new Scanner(files);
while (scanner.hasNextLine()) {
String l = scanner.nextLine();
c++;
Random random = new Random();
int r = random.nextInt(c);
System.out.println(c);
}
}catch (FileNotFoundException e) {
System.out.println("error, please insert the valid files");
}
}
}
| [
"diana.korovela@gmail.com"
] | diana.korovela@gmail.com |
e8d7fa6f8d0dcd9c8aa8de40e49b5b7efc199ef8 | f2671b99d19eab734d28ceda01ed1bd3d2847cd2 | /src/main/java/com/shuman/data/Contact.java | cef4ae4ec760a09fc66c7b846b3f6b7594351ef2 | [] | no_license | shumant/contactdb_test | 72a13f000f4f2d3998c4da2b2834b97a04b86002 | e814866d0108f5025825ad71a96c05ba0bd69c65 | refs/heads/master | 2021-01-10T03:16:35.888357 | 2016-03-21T15:57:44 | 2016-03-21T15:57:44 | 54,402,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 930 | java | package com.shuman.data;
import javax.persistence.*;
@Entity
@Table(name = "contacts")
public class Contact {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String uuid;
private String name;
private String tel;
private String email;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"a.shumskih@gmail.com"
] | a.shumskih@gmail.com |
eeacfdf4df077b0a519033702d213c428508472c | 4eb3f1bc58c99f9d5225512ef96ee90f81471268 | /plugin/src/main/java/org/graylog/plugins/sample/SPLResource.java | b090e1cd1d51d254515f1e656b65cde4e56d4a61 | [] | no_license | DevOpsStudio/graylog-sample-plugin | 1b2a6b11442312de2114c3ec5c8190e5646b7505 | fb7974bfbfed087337959f6ef20e47d845b3a5b8 | refs/heads/master | 2020-12-30T11:03:20.982085 | 2017-07-31T07:42:19 | 2017-07-31T07:42:19 | 98,846,721 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 441 | java | package org.graylog.plugins.sample;
import org.graylog2.plugin.rest.PluginRestResource;
import org.graylog2.shared.plugins.PluginRestResourceClasses;
import java.util.Map;
import java.util.Set;
/**
* Created by kira on 17/7/15.
*/
public class SPLResource extends PluginRestResourceClasses {
public SPLResource(Map<String, Set<Class<? extends PluginRestResource>>> pluginRestResources) {
super(pluginRestResources);
}
}
| [
"529280602@qq.com"
] | 529280602@qq.com |
025f52152e4150f7813ecc32a6a78de871f86778 | 8916d7002d5f576ab2be2dd21b069ecc5ebf428d | /SafeFood_gj_2_SBH_KJY/src/main/java/com/safefood/service/AllergyServiceImpl.java | e5fe79f5fda5d3ee02073b27c92e2da28d309182 | [] | no_license | songbyeongha/safefood | 97a00ca9e52c0eb40e8a75f81318d987a9edf8a5 | 7562fca72efdd0b3f9fa5fa6fd5399c8298536be | refs/heads/master | 2022-06-16T23:51:16.398093 | 2019-11-03T13:02:24 | 2019-11-03T13:02:24 | 208,724,361 | 0 | 0 | null | 2022-05-20T21:09:21 | 2019-09-16T06:18:42 | Java | UTF-8 | Java | false | false | 766 | java | package com.safefood.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.safefood.repository.AllergyMapper;
@Service
public class AllergyServiceImpl implements AllergyService{
@Autowired
AllergyMapper mapper;
@Override
public int insert(String id, String name) {
return mapper.insert(id, name);
}
@Override
public int delete(String id) {
return mapper.delete(id);
}
@Override
public String select(String id, String name) {
return mapper.select(id, name);
}
@Override
public List<String> selectId(String id) {
return mapper.selectId(id);
}
@Override
public List<String> selectid(String id) {
return mapper.selectid(id);
}
}
| [
"qudgk0006@naver.com"
] | qudgk0006@naver.com |
6f841c50617e08e773794ffc3f76c3ad4d145f7b | 93d81a3c486902c2d7d85efcba42f4dbee4730f0 | /Control/ControleTransferencia.java | feb8f5775acec2d0ebab054d1bd07d05c01be1f6 | [] | no_license | lucanc3/ARQDESIS | d5e95b856f98f66f89de25dfcb0a3a8313895835 | cf93a27fc0f46ef160dd50e391c04e656d629b29 | refs/heads/Projeto_Servlet | 2021-01-17T13:18:50.850056 | 2016-10-24T23:45:13 | 2016-10-24T23:45:13 | 57,620,655 | 0 | 0 | null | 2016-06-23T18:02:46 | 2016-05-01T15:39:34 | Java | UTF-8 | Java | false | false | 1,332 | java | package Control;
/*
* Decompiled with CFR 0_114.
*/
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ResourceBundle;
import javax.swing.JOptionPane;
public class ControleTransferencia
extends ViewTransferencia {
protected Conta conta;
public ControleTransferencia(ResourceBundle bnn, Conta conta) {
super(bnn);
this.conta = conta;
this.addVoltarListener(new VoltarListener());
this.addTransferirListener(new TransferirListener());
}
class TransferirListener
extends MouseAdapter
implements MouseListener {
TransferirListener() {
}
@Override
public void mouseClicked(MouseEvent e) {
JOptionPane.showMessageDialog(null, ControleTransferencia.this.bn.getString("transferenciaControle.message.transferido"));
}
}
class VoltarListener
extends MouseAdapter
implements MouseListener {
VoltarListener() {
}
@Override
public void mouseClicked(MouseEvent e) {
ControleTransferencia.this.dispose();
ControleMenuCliente app = new ControleMenuCliente(ControleTransferencia.this.bn, ControleTransferencia.this.conta);
app.setDefaultCloseOperation(3);
}
}
}
| [
"lucanc3@gmail.com"
] | lucanc3@gmail.com |
481ee9a8833a35ad66f165f4bd8e4b04cd8a99a7 | ff0ba67c9c043c137a0552b80f24519a6a3ba833 | /TICKETS/src/gui/panel/AddReview.java | c4c6c2ce56102b1c33aa9b373656465572b63acb | [] | no_license | kroell/hsrm-mi-3semester-db | b688ff884b20c969f42a5cfd3f603038c7abded4 | fe39d9038626bc714e68adcdfeaa397b3ccba4f5 | refs/heads/master | 2016-09-06T03:54:07.460232 | 2012-07-04T13:24:21 | 2012-07-04T13:24:21 | 4,884,689 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,708 | java | package gui.panel;
import database.Database;
import gui.MainFrame;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Image;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
/**
*
* Panel zum Hinzufuegen eines einer Bewertung
*
*
* @author Soeren Kroell, Mareike Schulz, Sebastian Fuchs
* @version 28.02.2012
*/
public class AddReview extends javax.swing.JPanel {
private Database db;
private MainFrame mF;
private String coverUrl;
private String titel;
private String fsk;
private String filmstart;
private String inhalt;
private String genre;
private String laenge;
private String jahr;
private String land;
private String darsteller;
private String regisseur;
private String film_id;
private String kommentar;
// Default Konstruktor
public AddReview() {
initComponents();
}
// Angepasster Konstruktor
public AddReview(MainFrame mF, Database db) throws SQLException {
initComponents();
this.mF = mF;
this.db = db;
jScrollPane1.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
jScrollPane2.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
// Windows GUI Anpassungen
saveButton.setOpaque(false);
saveButton.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
saveButton.setContentAreaFilled(false);
saveButton.setBackground(new Color(0, 0, 0, 0));
filmprogrammButton.setOpaque(false);
filmprogrammButton.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
filmprogrammButton.setContentAreaFilled(false);
filmprogrammButton.setBackground(new Color(0, 0, 0, 0));
}
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
filmprogrammButton = new javax.swing.JButton();
coverLabel = new javax.swing.JLabel();
lineTitel = new javax.swing.JLabel();
filmtitelLabel = new javax.swing.JLabel();
regisseurLabel = new javax.swing.JLabel();
darstellerLabel = new javax.swing.JLabel();
laengeLabel = new javax.swing.JLabel();
landLabel = new javax.swing.JLabel();
genreLabel = new javax.swing.JLabel();
fskAlterLabel = new javax.swing.JLabel();
datumLabel = new javax.swing.JLabel();
kommentarLabel = new javax.swing.JLabel();
lineKommentar = new javax.swing.JLabel();
lineSterne = new javax.swing.JLabel();
sterneHeadLabel = new javax.swing.JLabel();
sterneLabel = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
reviewField = new javax.swing.JTextArea();
sterneDropdown = new javax.swing.JComboBox();
jScrollPane2 = new javax.swing.JScrollPane();
inhaltLabel = new javax.swing.JTextArea();
saveButton = new javax.swing.JButton();
gelbeBlase = new javax.swing.JLabel();
bemerkungLabel = new javax.swing.JLabel();
shadowLabel = new javax.swing.JLabel();
setBackground(new java.awt.Color(255, 255, 255));
setMinimumSize(new java.awt.Dimension(980, 620));
setSize(new java.awt.Dimension(980, 620));
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
update(evt);
}
});
setLayout(null);
filmprogrammButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/kunde/filmuebersicht_button.png"))); // NOI18N
filmprogrammButton.setBorder(null);
filmprogrammButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/kunde/filmuebersicht_button_h.png"))); // NOI18N
filmprogrammButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
filmprogrammButtonActionPerformed(evt);
}
});
add(filmprogrammButton);
filmprogrammButton.setBounds(600, 10, 150, 20);
coverLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/empty2.png"))); // NOI18N
add(coverLabel);
coverLabel.setBounds(0, 0, 180, 270);
lineTitel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/kunde/movieDetailTopLine.png"))); // NOI18N
add(lineTitel);
lineTitel.setBounds(190, 30, 540, 20);
filmtitelLabel.setFont(new java.awt.Font("Futura", 0, 28));
filmtitelLabel.setForeground(new java.awt.Color(238, 162, 35));
filmtitelLabel.setText("FILMTITEL"); // NOI18N
add(filmtitelLabel);
filmtitelLabel.setBounds(190, -10, 430, 50);
regisseurLabel.setFont(new java.awt.Font("Arial", 0, 13));
regisseurLabel.setText("Name");
add(regisseurLabel);
regisseurLabel.setBounds(790, 200, 150, 22);
darstellerLabel.setFont(new java.awt.Font("Arial", 0, 13));
darstellerLabel.setText("Hauptdarsteller");
add(darstellerLabel);
darstellerLabel.setBounds(790, 160, 160, 22);
laengeLabel.setFont(new java.awt.Font("Arial", 0, 13));
laengeLabel.setText("Länge");
add(laengeLabel);
laengeLabel.setBounds(790, 120, 150, 22);
landLabel.setFont(new java.awt.Font("Arial", 0, 13));
landLabel.setText("Jahr Land");
add(landLabel);
landLabel.setBounds(790, 100, 140, 22);
genreLabel.setFont(new java.awt.Font("Arial", 0, 13));
genreLabel.setText("Genre");
add(genreLabel);
genreLabel.setBounds(790, 80, 140, 22);
fskAlterLabel.setFont(new java.awt.Font("Arial", 0, 13));
fskAlterLabel.setText("Alter");
add(fskAlterLabel);
fskAlterLabel.setBounds(790, 60, 140, 22);
datumLabel.setFont(new java.awt.Font("Arial", 1, 14));
datumLabel.setText("Datum");
add(datumLabel);
datumLabel.setBounds(790, 20, 150, 20);
kommentarLabel.setFont(new java.awt.Font("Futura", 0, 28));
kommentarLabel.setForeground(new java.awt.Color(238, 162, 35));
kommentarLabel.setText("DEIN KOMMENTAR"); // NOI18N
add(kommentarLabel);
kommentarLabel.setBounds(0, 300, 430, 40);
lineKommentar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/kunde/line_kurz.png"))); // NOI18N
add(lineKommentar);
lineKommentar.setBounds(0, 340, 480, 6);
lineSterne.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/kunde/line_kurz.png"))); // NOI18N
add(lineSterne);
lineSterne.setBounds(520, 340, 480, 6);
sterneHeadLabel.setFont(new java.awt.Font("Futura", 0, 28));
sterneHeadLabel.setForeground(new java.awt.Color(238, 162, 35));
sterneHeadLabel.setText("DEINE STERNE"); // NOI18N
add(sterneHeadLabel);
sterneHeadLabel.setBounds(520, 300, 430, 40);
sterneLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/kunde/sterne_blanko.png"))); // NOI18N
add(sterneLabel);
sterneLabel.setBounds(770, 360, 210, 50);
reviewField.setColumns(20);
reviewField.setLineWrap(true);
reviewField.setWrapStyleWord(true);
jScrollPane1.setViewportView(reviewField);
add(jScrollPane1);
jScrollPane1.setBounds(0, 360, 460, 230);
sterneDropdown.setFont(new java.awt.Font("Futura", 0, 12));
sterneDropdown.setForeground(new java.awt.Color(238, 162, 35));
sterneDropdown.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "STERNE", "1", "2", "3", "4" }));
sterneDropdown.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
sterneDropdownActionPerformed(evt);
}
});
add(sterneDropdown);
sterneDropdown.setBounds(520, 360, 140, 27);
inhaltLabel.setColumns(20);
inhaltLabel.setLineWrap(true);
inhaltLabel.setRows(5);
inhaltLabel.setWrapStyleWord(true);
inhaltLabel.setBorder(null);
jScrollPane2.setViewportView(inhaltLabel);
add(jScrollPane2);
jScrollPane2.setBounds(190, 50, 540, 220);
saveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/mitarbeiter/speichern_button.png"))); // NOI18N
saveButton.setBorder(null);
saveButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/mitarbeiter/speichern_button_h.png"))); // NOI18N
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed(evt);
}
});
add(saveButton);
saveButton.setBounds(780, 550, 190, 49);
gelbeBlase.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/kunde/movieDetail_blase.png"))); // NOI18N
add(gelbeBlase);
gelbeBlase.setBounds(720, -10, 260, 290);
bemerkungLabel.setFont(new java.awt.Font("Arial", 1, 12));
bemerkungLabel.setForeground(new java.awt.Color(255, 255, 255));
bemerkungLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
bemerkungLabel.setText("Bemerkung");
add(bemerkungLabel);
bemerkungLabel.setBounds(740, 510, 220, 20);
shadowLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/data/pics/cover_shadow3.png"))); // NOI18N
add(shadowLabel);
shadowLabel.setBounds(0, 30, 190, 270);
}// </editor-fold>//GEN-END:initComponents
/*
* Karte movieDetail laden
*/
private void filmprogrammButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_filmprogrammButtonActionPerformed
CardLayout cL = (CardLayout) mF.getMainPanel().getLayout();
cL.show(mF.getMainPanel(), "movieDetail");
reviewField.setText("");
sterneDropdown.setSelectedIndex(0);
setMovieDetailsEmpty();
//CardLayout cL = (CardLayout) mF.getMainPanel().getLayout(); //cL.show(mF.getMainPanel(),"showEmployee");}//GEN-LAST:event_filmprogrammButtonActionPerformed
}
/*
* Bei Auswahl der Sternanzahl entsprechende Grafik anzeigen
*/
private void sterneDropdownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sterneDropdownActionPerformed
if (sterneDropdown.getSelectedItem().equals("STERNE")) {
sterneLabel.setIcon(new ImageIcon("src/data/pics/kunde/sterne_blanko.png"));
}
if (sterneDropdown.getSelectedItem().equals("1")) {
sterneLabel.setIcon(new ImageIcon("src/data/pics/kunde/einstern.png"));
}
if (sterneDropdown.getSelectedItem().equals("2")) {
sterneLabel.setIcon(new ImageIcon("src/data/pics/kunde/zweisterne.png"));
}
if (sterneDropdown.getSelectedItem().equals("3")) {
sterneLabel.setIcon(new ImageIcon("src/data/pics/kunde/dreisterne.png"));
}
if (sterneDropdown.getSelectedItem().equals("4")) {
sterneLabel.setIcon(new ImageIcon("src/data/pics/kunde/viersterne.png"));
}
// TODO add your handling code here:}//GEN-LAST:event_sterneDropdownActionPerformed
}
/*
* Bewertung in der Datenbank speichern
*/
private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
kommentar = reviewField.getText();
String sterne = (String) sterneDropdown.getSelectedItem();
try {
db.addReview(film_id, mF.getLoggedInKundenID(), sterne, kommentar, bemerkungLabel);
} catch (SQLException ex) {
Logger.getLogger(AddReview.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_saveButtonActionPerformed
/*
* Wird beim Laden des Panels ausgefuehrt
*/
private void update(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_update
try {
film_id = mF.getAktFilmID();
setMovieDetailsEmpty();
getMovieDetails();
setMovieDetails();
} catch (SQLException ex) {
Logger.getLogger(AddReview.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_update
/*
* Filminformationen aus der Datenbank laden
*/
public void getMovieDetails() throws SQLException {
ResultSet rs = db.showMovieByID(film_id);
while (rs.next()) {
coverUrl = rs.getString("cover_url");
titel = rs.getString("titel");
fsk = rs.getString("fsk");
filmstart = rs.getString("kinostart");
inhalt = rs.getString("inhalt");
genre = rs.getString("genre");
laenge = rs.getString("laenge");
jahr = rs.getString("jahr");
land = rs.getString("land");
}
ResultSet rs2 = db.showRegisseurByMovieID(film_id);
while (rs2.next()) {
regisseur = rs2.getString("name");
}
ResultSet rs3 = db.showDarstellerByMovieID(film_id);
while (rs3.next()) {
darsteller = rs3.getString("name");
}
}
/*
* Alle Filminformationen in der GUI setzen
*/
public void setMovieDetails() {
try {
// Create a URL for the image's location
URL url = new URL(coverUrl);
// Get the image
java.awt.Image image = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(url);
Image imageNewScale = image.getScaledInstance(178, 270, 270);
ImageIcon cover = new ImageIcon(imageNewScale);
coverLabel.setIcon(cover);
} catch (MalformedURLException e) {
} catch (IOException e) {
}
filmtitelLabel.setText(titel);
datumLabel.setText("Filmstart: " + filmstart);
inhaltLabel.setText(inhalt);
fskAlterLabel.setText("Ab " + fsk + " Jahre");
genreLabel.setText(genre);
laengeLabel.setText("Laufzeit: " + laenge + " Min");
landLabel.setText(land + " " + jahr);
darstellerLabel.setText(darsteller);
regisseurLabel.setText("Regie: " + regisseur);
shadowLabel.setIcon(new ImageIcon("src/data/pics/cover_shadow3.png"));
}
/*
* Reset des Panels
*/
private void setMovieDetailsEmpty() {
filmtitelLabel.setText("");
datumLabel.setText("");
inhaltLabel.setText("");
fskAlterLabel.setText("");
genreLabel.setText("");
laengeLabel.setText("");
landLabel.setText("");
darstellerLabel.setText("");
regisseurLabel.setText("");
coverLabel.setIcon(new ImageIcon(""));
shadowLabel.setIcon(new ImageIcon(""));
sterneLabel.setIcon(new ImageIcon(""));
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel bemerkungLabel;
private javax.swing.JLabel coverLabel;
private javax.swing.JLabel darstellerLabel;
private javax.swing.JLabel datumLabel;
private javax.swing.JButton filmprogrammButton;
private javax.swing.JLabel filmtitelLabel;
private javax.swing.JLabel fskAlterLabel;
private javax.swing.JLabel gelbeBlase;
private javax.swing.JLabel genreLabel;
private javax.swing.JTextArea inhaltLabel;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JLabel kommentarLabel;
private javax.swing.JLabel laengeLabel;
private javax.swing.JLabel landLabel;
private javax.swing.JLabel lineKommentar;
private javax.swing.JLabel lineSterne;
private javax.swing.JLabel lineTitel;
private javax.swing.JLabel regisseurLabel;
private javax.swing.JTextArea reviewField;
private javax.swing.JButton saveButton;
private javax.swing.JLabel shadowLabel;
private javax.swing.JComboBox sterneDropdown;
private javax.swing.JLabel sterneHeadLabel;
private javax.swing.JLabel sterneLabel;
// End of variables declaration//GEN-END:variables
}
| [
"kroell@idseven.de"
] | kroell@idseven.de |
3069bed49183e39139b598285a2f4b7ed3a13cc5 | 86d72eb692705a42a860c825a6a9dc79a8abb94e | /MethodDemo/src/com/deadpool/method/ClassDemo01.java | a41c997a1d3f6fdededea7fe92a7b4f89654b74e | [] | no_license | deadpool10086/love-java | 28437166d706d531297fb67e640f3ae9231e17fa | 9e295af927d7e8c627139403e3f53d62846ec977 | refs/heads/master | 2020-06-12T23:55:48.944009 | 2017-01-22T09:05:10 | 2017-01-22T09:05:10 | 75,476,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.deadpool.method;
class Person
{
String name;
int age;
public void tell()
{
System.out.println("姓名:"+name+" "+"性别:"+age);
}
}
public class ClassDemo01 {
public static void main(String[] args) {
Person person = null;
person = new Person();
Person per = new Person();
per.name = "张三";
per.age = 10;
per.tell();
person.tell();
}
}
| [
"zds19971227@126.com"
] | zds19971227@126.com |
06477551db59d73c423878e7902fdf91758bcd6e | 052980f85449c728ca8d245e92f65706c97a4105 | /java/util/Arrays.java | 287a94f894a44a2d80d976638378882d7701da2b | [] | no_license | Folgerjun/jdk1.8.0_162_src | 5592273ef81c4ff19003a4f6b3ddcc4b6f1bdde8 | 589ced78cfbac34395e3a71680efe91041cb6b1d | refs/heads/master | 2020-03-21T22:31:18.002129 | 2019-01-04T08:59:49 | 2019-01-04T08:59:49 | 139,131,641 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 228,163 | java | /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.util;
import java.lang.reflect.Array;
import java.util.concurrent.ForkJoinPool;
import java.util.function.BinaryOperator;
import java.util.function.Consumer;
import java.util.function.DoubleBinaryOperator;
import java.util.function.IntBinaryOperator;
import java.util.function.IntFunction;
import java.util.function.IntToDoubleFunction;
import java.util.function.IntToLongFunction;
import java.util.function.IntUnaryOperator;
import java.util.function.LongBinaryOperator;
import java.util.function.UnaryOperator;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
/**
* This class contains various methods for manipulating arrays (such as
* sorting and searching). This class also contains a static factory
* that allows arrays to be viewed as lists.
*
* <p>The methods in this class all throw a {@code NullPointerException},
* if the specified array reference is null, except where noted.
*
* <p>The documentation for the methods contained in this class includes
* briefs description of the <i>implementations</i>. Such descriptions should
* be regarded as <i>implementation notes</i>, rather than parts of the
* <i>specification</i>. Implementors should feel free to substitute other
* algorithms, so long as the specification itself is adhered to. (For
* example, the algorithm used by {@code sort(Object[])} does not have to be
* a MergeSort, but it does have to be <i>stable</i>.)
*
* <p>This class is a member of the
* <a href="{@docRoot}/../technotes/guides/collections/index.html">
* Java Collections Framework</a>.
*
* @author Josh Bloch
* @author Neal Gafter
* @author John Rose
* @since 1.2
*/
public class Arrays {
/**
* The minimum array length below which a parallel sorting
* algorithm will not further partition the sorting task. Using
* smaller sizes typically results in memory contention across
* tasks that makes parallel speedups unlikely.
*/
private static final int MIN_ARRAY_SORT_GRAN = 1 << 13;
// Suppresses default constructor, ensuring non-instantiability.
private Arrays() {}
/**
* A comparator that implements the natural ordering of a group of
* mutually comparable elements. May be used when a supplied
* comparator is null. To simplify code-sharing within underlying
* implementations, the compare method only declares type Object
* for its second argument.
*
* Arrays class implementor's note: It is an empirical matter
* whether ComparableTimSort offers any performance benefit over
* TimSort used with this comparator. If not, you are better off
* deleting or bypassing ComparableTimSort. There is currently no
* empirical case for separating them for parallel sorting, so all
* public Object parallelSort methods use the same comparator
* based implementation.
*/
static final class NaturalOrder implements Comparator<Object> {
@SuppressWarnings("unchecked")
public int compare(Object first, Object second) {
return ((Comparable<Object>)first).compareTo(second);
}
static final NaturalOrder INSTANCE = new NaturalOrder();
}
/**
* Checks that {@code fromIndex} and {@code toIndex} are in
* the range and throws an exception if they aren't.
*/
/**
* 判断验证
*/
private static void rangeCheck(int arrayLength, int fromIndex, int toIndex) {
if (fromIndex > toIndex) { // 起始下标大于结束下标
throw new IllegalArgumentException(
"fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
}
if (fromIndex < 0) { // 起始下标大于0
throw new ArrayIndexOutOfBoundsException(fromIndex);
}
if (toIndex > arrayLength) { // 结束下标大于长度
throw new ArrayIndexOutOfBoundsException(toIndex);
}
}
/*
* Sorting methods. Note that all public "sort" methods take the
* same form: Performing argument checks if necessary, and then
* expanding arguments into those required for the internal
* implementation methods residing in other package-private
* classes (except for legacyMergeSort, included in this class).
*/
/**
* Sorts the specified array into ascending numerical order.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
*/
public static void sort(int[] a) {
DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0);
}
/**
* Sorts the specified range of the array into ascending order. The range
* to be sorted extends from the index {@code fromIndex}, inclusive, to
* the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
* the range to be sorted is empty.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*/
public static void sort(int[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex); // 先进行判断验证
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
*/
public static void sort(long[] a) {
DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0);
}
/**
* Sorts the specified range of the array into ascending order. The range
* to be sorted extends from the index {@code fromIndex}, inclusive, to
* the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
* the range to be sorted is empty.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*/
public static void sort(long[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
*/
public static void sort(short[] a) {
DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0);
}
/**
* Sorts the specified range of the array into ascending order. The range
* to be sorted extends from the index {@code fromIndex}, inclusive, to
* the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
* the range to be sorted is empty.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*/
public static void sort(short[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
*/
public static void sort(char[] a) {
DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0);
}
/**
* Sorts the specified range of the array into ascending order. The range
* to be sorted extends from the index {@code fromIndex}, inclusive, to
* the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
* the range to be sorted is empty.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*/
public static void sort(char[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
*/
public static void sort(byte[] a) {
DualPivotQuicksort.sort(a, 0, a.length - 1);
}
/**
* Sorts the specified range of the array into ascending order. The range
* to be sorted extends from the index {@code fromIndex}, inclusive, to
* the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
* the range to be sorted is empty.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*/
public static void sort(byte[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1);
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>The {@code <} relation does not provide a total order on all float
* values: {@code -0.0f == 0.0f} is {@code true} and a {@code Float.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Float#compareTo}: {@code -0.0f} is treated as less than value
* {@code 0.0f} and {@code Float.NaN} is considered greater than any
* other value and all {@code Float.NaN} values are considered equal.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
*/
public static void sort(float[] a) {
DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0);
}
/**
* Sorts the specified range of the array into ascending order. The range
* to be sorted extends from the index {@code fromIndex}, inclusive, to
* the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
* the range to be sorted is empty.
*
* <p>The {@code <} relation does not provide a total order on all float
* values: {@code -0.0f == 0.0f} is {@code true} and a {@code Float.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Float#compareTo}: {@code -0.0f} is treated as less than value
* {@code 0.0f} and {@code Float.NaN} is considered greater than any
* other value and all {@code Float.NaN} values are considered equal.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*/
public static void sort(float[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>The {@code <} relation does not provide a total order on all double
* values: {@code -0.0d == 0.0d} is {@code true} and a {@code Double.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Double#compareTo}: {@code -0.0d} is treated as less than value
* {@code 0.0d} and {@code Double.NaN} is considered greater than any
* other value and all {@code Double.NaN} values are considered equal.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
*/
public static void sort(double[] a) {
DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0);
}
/**
* Sorts the specified range of the array into ascending order. The range
* to be sorted extends from the index {@code fromIndex}, inclusive, to
* the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
* the range to be sorted is empty.
*
* <p>The {@code <} relation does not provide a total order on all double
* values: {@code -0.0d == 0.0d} is {@code true} and a {@code Double.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Double#compareTo}: {@code -0.0d} is treated as less than value
* {@code 0.0d} and {@code Double.NaN} is considered greater than any
* other value and all {@code Double.NaN} values are considered equal.
*
* <p>Implementation note: The sorting algorithm is a Dual-Pivot Quicksort
* by Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. This algorithm
* offers O(n log(n)) performance on many data sets that cause other
* quicksorts to degrade to quadratic performance, and is typically
* faster than traditional (one-pivot) Quicksort implementations.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*/
public static void sort(double[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
}
/**
* Sorts the specified array into ascending numerical order.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(byte[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(byte[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param a the array to be sorted
*
* @since 1.8
*/
public static void parallelSort(byte[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, 0, n - 1);
else
new ArraysParallelSortHelpers.FJByte.Sorter
(null, a, new byte[n], 0, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified range of the array into ascending numerical order.
* The range to be sorted extends from the index {@code fromIndex},
* inclusive, to the index {@code toIndex}, exclusive. If
* {@code fromIndex == toIndex}, the range to be sorted is empty.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(byte[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(byte[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*
* @since 1.8
*/
public static void parallelSort(byte[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1);
else
new ArraysParallelSortHelpers.FJByte.Sorter
(null, a, new byte[n], fromIndex, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified array into ascending numerical order.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(char[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(char[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param a the array to be sorted
*
* @since 1.8
*/
public static void parallelSort(char[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, 0, n - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJChar.Sorter
(null, a, new char[n], 0, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified range of the array into ascending numerical order.
* The range to be sorted extends from the index {@code fromIndex},
* inclusive, to the index {@code toIndex}, exclusive. If
* {@code fromIndex == toIndex}, the range to be sorted is empty.
*
@implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(char[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(char[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*
* @since 1.8
*/
public static void parallelSort(char[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJChar.Sorter
(null, a, new char[n], fromIndex, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified array into ascending numerical order.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(short[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(short[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param a the array to be sorted
*
* @since 1.8
*/
public static void parallelSort(short[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, 0, n - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJShort.Sorter
(null, a, new short[n], 0, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified range of the array into ascending numerical order.
* The range to be sorted extends from the index {@code fromIndex},
* inclusive, to the index {@code toIndex}, exclusive. If
* {@code fromIndex == toIndex}, the range to be sorted is empty.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(short[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(short[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*
* @since 1.8
*/
public static void parallelSort(short[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJShort.Sorter
(null, a, new short[n], fromIndex, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified array into ascending numerical order.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(int[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(int[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param a the array to be sorted
*
* @since 1.8
*/
public static void parallelSort(int[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, 0, n - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJInt.Sorter
(null, a, new int[n], 0, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified range of the array into ascending numerical order.
* The range to be sorted extends from the index {@code fromIndex},
* inclusive, to the index {@code toIndex}, exclusive. If
* {@code fromIndex == toIndex}, the range to be sorted is empty.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(int[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(int[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*
* @since 1.8
*/
public static void parallelSort(int[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJInt.Sorter
(null, a, new int[n], fromIndex, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified array into ascending numerical order.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(long[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(long[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param a the array to be sorted
*
* @since 1.8
*/
public static void parallelSort(long[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, 0, n - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJLong.Sorter
(null, a, new long[n], 0, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified range of the array into ascending numerical order.
* The range to be sorted extends from the index {@code fromIndex},
* inclusive, to the index {@code toIndex}, exclusive. If
* {@code fromIndex == toIndex}, the range to be sorted is empty.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(long[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(long[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*
* @since 1.8
*/
public static void parallelSort(long[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJLong.Sorter
(null, a, new long[n], fromIndex, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>The {@code <} relation does not provide a total order on all float
* values: {@code -0.0f == 0.0f} is {@code true} and a {@code Float.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Float#compareTo}: {@code -0.0f} is treated as less than value
* {@code 0.0f} and {@code Float.NaN} is considered greater than any
* other value and all {@code Float.NaN} values are considered equal.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(float[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(float[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param a the array to be sorted
*
* @since 1.8
*/
public static void parallelSort(float[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, 0, n - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJFloat.Sorter
(null, a, new float[n], 0, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified range of the array into ascending numerical order.
* The range to be sorted extends from the index {@code fromIndex},
* inclusive, to the index {@code toIndex}, exclusive. If
* {@code fromIndex == toIndex}, the range to be sorted is empty.
*
* <p>The {@code <} relation does not provide a total order on all float
* values: {@code -0.0f == 0.0f} is {@code true} and a {@code Float.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Float#compareTo}: {@code -0.0f} is treated as less than value
* {@code 0.0f} and {@code Float.NaN} is considered greater than any
* other value and all {@code Float.NaN} values are considered equal.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(float[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(float[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*
* @since 1.8
*/
public static void parallelSort(float[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJFloat.Sorter
(null, a, new float[n], fromIndex, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified array into ascending numerical order.
*
* <p>The {@code <} relation does not provide a total order on all double
* values: {@code -0.0d == 0.0d} is {@code true} and a {@code Double.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Double#compareTo}: {@code -0.0d} is treated as less than value
* {@code 0.0d} and {@code Double.NaN} is considered greater than any
* other value and all {@code Double.NaN} values are considered equal.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(double[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(double[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param a the array to be sorted
*
* @since 1.8
*/
public static void parallelSort(double[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, 0, n - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJDouble.Sorter
(null, a, new double[n], 0, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified range of the array into ascending numerical order.
* The range to be sorted extends from the index {@code fromIndex},
* inclusive, to the index {@code toIndex}, exclusive. If
* {@code fromIndex == toIndex}, the range to be sorted is empty.
*
* <p>The {@code <} relation does not provide a total order on all double
* values: {@code -0.0d == 0.0d} is {@code true} and a {@code Double.NaN}
* value compares neither less than, greater than, nor equal to any value,
* even itself. This method uses the total order imposed by the method
* {@link Double#compareTo}: {@code -0.0d} is treated as less than value
* {@code 0.0d} and {@code Double.NaN} is considered greater than any
* other value and all {@code Double.NaN} values are considered equal.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(double[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(double[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element, inclusive, to be sorted
* @param toIndex the index of the last element, exclusive, to be sorted
*
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > a.length}
*
* @since 1.8
*/
public static void parallelSort(double[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
else
new ArraysParallelSortHelpers.FJDouble.Sorter
(null, a, new double[n], fromIndex, n, 0,
((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g).invoke();
}
/**
* Sorts the specified array of objects into ascending order, according
* to the {@linkplain Comparable natural ordering} of its elements.
* All elements in the array must implement the {@link Comparable}
* interface. Furthermore, all elements in the array must be
* <i>mutually comparable</i> (that is, {@code e1.compareTo(e2)} must
* not throw a {@code ClassCastException} for any elements {@code e1}
* and {@code e2} in the array).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(Object[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(Object[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted
*
* @throws ClassCastException if the array contains elements that are not
* <i>mutually comparable</i> (for example, strings and integers)
* @throws IllegalArgumentException (optional) if the natural
* ordering of the array elements is found to violate the
* {@link Comparable} contract
*
* @since 1.8
*/
@SuppressWarnings("unchecked")
public static <T extends Comparable<? super T>> void parallelSort(T[] a) {
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, 0, n, NaturalOrder.INSTANCE, null, 0, 0);
else
new ArraysParallelSortHelpers.FJObject.Sorter<T>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
0, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g, NaturalOrder.INSTANCE).invoke();
}
/**
* Sorts the specified range of the specified array of objects into
* ascending order, according to the
* {@linkplain Comparable natural ordering} of its
* elements. The range to be sorted extends from index
* {@code fromIndex}, inclusive, to index {@code toIndex}, exclusive.
* (If {@code fromIndex==toIndex}, the range to be sorted is empty.) All
* elements in this range must implement the {@link Comparable}
* interface. Furthermore, all elements in this range must be <i>mutually
* comparable</i> (that is, {@code e1.compareTo(e2)} must not throw a
* {@code ClassCastException} for any elements {@code e1} and
* {@code e2} in the array).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(Object[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(Object[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted
* @param fromIndex the index of the first element (inclusive) to be
* sorted
* @param toIndex the index of the last element (exclusive) to be sorted
* @throws IllegalArgumentException if {@code fromIndex > toIndex} or
* (optional) if the natural ordering of the array elements is
* found to violate the {@link Comparable} contract
* @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
* {@code toIndex > a.length}
* @throws ClassCastException if the array contains elements that are
* not <i>mutually comparable</i> (for example, strings and
* integers).
*
* @since 1.8
*/
@SuppressWarnings("unchecked")
public static <T extends Comparable<? super T>>
void parallelSort(T[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, fromIndex, toIndex, NaturalOrder.INSTANCE, null, 0, 0);
else
new ArraysParallelSortHelpers.FJObject.Sorter<T>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
fromIndex, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g, NaturalOrder.INSTANCE).invoke();
}
/**
* Sorts the specified array of objects according to the order induced by
* the specified comparator. All elements in the array must be
* <i>mutually comparable</i> by the specified comparator (that is,
* {@code c.compare(e1, e2)} must not throw a {@code ClassCastException}
* for any elements {@code e1} and {@code e2} in the array).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(Object[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(Object[]) Arrays.sort} method. The algorithm requires a
* working space no greater than the size of the original array. The
* {@link ForkJoinPool#commonPool() ForkJoin common pool} is used to
* execute any parallel tasks.
*
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted
* @param cmp the comparator to determine the order of the array. A
* {@code null} value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @throws ClassCastException if the array contains elements that are
* not <i>mutually comparable</i> using the specified comparator
* @throws IllegalArgumentException (optional) if the comparator is
* found to violate the {@link java.util.Comparator} contract
*
* @since 1.8
*/
@SuppressWarnings("unchecked")
public static <T> void parallelSort(T[] a, Comparator<? super T> cmp) {
if (cmp == null)
cmp = NaturalOrder.INSTANCE;
int n = a.length, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, 0, n, cmp, null, 0, 0);
else
new ArraysParallelSortHelpers.FJObject.Sorter<T>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
0, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g, cmp).invoke();
}
/**
* Sorts the specified range of the specified array of objects according
* to the order induced by the specified comparator. The range to be
* sorted extends from index {@code fromIndex}, inclusive, to index
* {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be sorted is empty.) All elements in the range must be
* <i>mutually comparable</i> by the specified comparator (that is,
* {@code c.compare(e1, e2)} must not throw a {@code ClassCastException}
* for any elements {@code e1} and {@code e2} in the range).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* @implNote The sorting algorithm is a parallel sort-merge that breaks the
* array into sub-arrays that are themselves sorted and then merged. When
* the sub-array length reaches a minimum granularity, the sub-array is
* sorted using the appropriate {@link Arrays#sort(Object[]) Arrays.sort}
* method. If the length of the specified array is less than the minimum
* granularity, then it is sorted using the appropriate {@link
* Arrays#sort(Object[]) Arrays.sort} method. The algorithm requires a working
* space no greater than the size of the specified range of the original
* array. The {@link ForkJoinPool#commonPool() ForkJoin common pool} is
* used to execute any parallel tasks.
*
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted
* @param fromIndex the index of the first element (inclusive) to be
* sorted
* @param toIndex the index of the last element (exclusive) to be sorted
* @param cmp the comparator to determine the order of the array. A
* {@code null} value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @throws IllegalArgumentException if {@code fromIndex > toIndex} or
* (optional) if the natural ordering of the array elements is
* found to violate the {@link Comparable} contract
* @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
* {@code toIndex > a.length}
* @throws ClassCastException if the array contains elements that are
* not <i>mutually comparable</i> (for example, strings and
* integers).
*
* @since 1.8
*/
@SuppressWarnings("unchecked")
public static <T> void parallelSort(T[] a, int fromIndex, int toIndex,
Comparator<? super T> cmp) {
rangeCheck(a.length, fromIndex, toIndex);
if (cmp == null)
cmp = NaturalOrder.INSTANCE;
int n = toIndex - fromIndex, p, g;
if (n <= MIN_ARRAY_SORT_GRAN ||
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, fromIndex, toIndex, cmp, null, 0, 0);
else
new ArraysParallelSortHelpers.FJObject.Sorter<T>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
fromIndex, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
MIN_ARRAY_SORT_GRAN : g, cmp).invoke();
}
/*
* Sorting of complex type arrays.
*/
/**
* Old merge sort implementation can be selected (for
* compatibility with broken comparators) using a system property.
* Cannot be a static boolean in the enclosing class due to
* circular dependencies. To be removed in a future release.
*/
static final class LegacyMergeSort {
private static final boolean userRequested =
java.security.AccessController.doPrivileged(
new sun.security.action.GetBooleanAction(
"java.util.Arrays.useLegacyMergeSort")).booleanValue();
}
/**
* Sorts the specified array of objects into ascending order, according
* to the {@linkplain Comparable natural ordering} of its elements.
* All elements in the array must implement the {@link Comparable}
* interface. Furthermore, all elements in the array must be
* <i>mutually comparable</i> (that is, {@code e1.compareTo(e2)} must
* not throw a {@code ClassCastException} for any elements {@code e1}
* and {@code e2} in the array).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* <p>Implementation note: This implementation is a stable, adaptive,
* iterative mergesort that requires far fewer than n lg(n) comparisons
* when the input array is partially sorted, while offering the
* performance of a traditional mergesort when the input array is
* randomly ordered. If the input array is nearly sorted, the
* implementation requires approximately n comparisons. Temporary
* storage requirements vary from a small constant for nearly sorted
* input arrays to n/2 object references for randomly ordered input
* arrays.
*
* <p>The implementation takes equal advantage of ascending and
* descending order in its input array, and can take advantage of
* ascending and descending order in different parts of the the same
* input array. It is well-suited to merging two or more sorted arrays:
* simply concatenate the arrays and sort the resulting array.
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
* TimSort</a>). It uses techniques from Peter McIlroy's "Optimistic
* Sorting and Information Theoretic Complexity", in Proceedings of the
* Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474,
* January 1993.
*
* @param a the array to be sorted
* @throws ClassCastException if the array contains elements that are not
* <i>mutually comparable</i> (for example, strings and integers)
* @throws IllegalArgumentException (optional) if the natural
* ordering of the array elements is found to violate the
* {@link Comparable} contract
*/
public static void sort(Object[] a) {
if (LegacyMergeSort.userRequested)
legacyMergeSort(a);
else
ComparableTimSort.sort(a, 0, a.length, null, 0, 0);
}
/** To be removed in a future release. */
private static void legacyMergeSort(Object[] a) {
Object[] aux = a.clone();
mergeSort(aux, a, 0, a.length, 0);
}
/**
* Sorts the specified range of the specified array of objects into
* ascending order, according to the
* {@linkplain Comparable natural ordering} of its
* elements. The range to be sorted extends from index
* {@code fromIndex}, inclusive, to index {@code toIndex}, exclusive.
* (If {@code fromIndex==toIndex}, the range to be sorted is empty.) All
* elements in this range must implement the {@link Comparable}
* interface. Furthermore, all elements in this range must be <i>mutually
* comparable</i> (that is, {@code e1.compareTo(e2)} must not throw a
* {@code ClassCastException} for any elements {@code e1} and
* {@code e2} in the array).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* <p>Implementation note: This implementation is a stable, adaptive,
* iterative mergesort that requires far fewer than n lg(n) comparisons
* when the input array is partially sorted, while offering the
* performance of a traditional mergesort when the input array is
* randomly ordered. If the input array is nearly sorted, the
* implementation requires approximately n comparisons. Temporary
* storage requirements vary from a small constant for nearly sorted
* input arrays to n/2 object references for randomly ordered input
* arrays.
*
* <p>The implementation takes equal advantage of ascending and
* descending order in its input array, and can take advantage of
* ascending and descending order in different parts of the the same
* input array. It is well-suited to merging two or more sorted arrays:
* simply concatenate the arrays and sort the resulting array.
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
* TimSort</a>). It uses techniques from Peter McIlroy's "Optimistic
* Sorting and Information Theoretic Complexity", in Proceedings of the
* Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474,
* January 1993.
*
* @param a the array to be sorted
* @param fromIndex the index of the first element (inclusive) to be
* sorted
* @param toIndex the index of the last element (exclusive) to be sorted
* @throws IllegalArgumentException if {@code fromIndex > toIndex} or
* (optional) if the natural ordering of the array elements is
* found to violate the {@link Comparable} contract
* @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
* {@code toIndex > a.length}
* @throws ClassCastException if the array contains elements that are
* not <i>mutually comparable</i> (for example, strings and
* integers).
*/
public static void sort(Object[] a, int fromIndex, int toIndex) {
rangeCheck(a.length, fromIndex, toIndex);
if (LegacyMergeSort.userRequested)
legacyMergeSort(a, fromIndex, toIndex);
else
ComparableTimSort.sort(a, fromIndex, toIndex, null, 0, 0);
}
/** To be removed in a future release. */
private static void legacyMergeSort(Object[] a,
int fromIndex, int toIndex) {
Object[] aux = copyOfRange(a, fromIndex, toIndex);
mergeSort(aux, a, fromIndex, toIndex, -fromIndex);
}
/**
* Tuning parameter: list size at or below which insertion sort will be
* used in preference to mergesort.
* To be removed in a future release.
*/
private static final int INSERTIONSORT_THRESHOLD = 7;
/**
* Src is the source array that starts at index 0
* Dest is the (possibly larger) array destination with a possible offset
* low is the index in dest to start sorting
* high is the end index in dest to end sorting
* off is the offset to generate corresponding low, high in src
* To be removed in a future release.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
private static void mergeSort(Object[] src,
Object[] dest,
int low,
int high,
int off) {
int length = high - low;
// Insertion sort on smallest arrays
if (length < INSERTIONSORT_THRESHOLD) {
for (int i=low; i<high; i++)
for (int j=i; j>low &&
((Comparable) dest[j-1]).compareTo(dest[j])>0; j--)
swap(dest, j, j-1);
return;
}
// Recursively sort halves of dest into src
int destLow = low;
int destHigh = high;
low += off;
high += off;
int mid = (low + high) >>> 1;
mergeSort(dest, src, low, mid, -off);
mergeSort(dest, src, mid, high, -off);
// If list is already sorted, just copy from src to dest. This is an
// optimization that results in faster sorts for nearly ordered lists.
if (((Comparable)src[mid-1]).compareTo(src[mid]) <= 0) {
System.arraycopy(src, low, dest, destLow, length);
return;
}
// Merge sorted halves (now in src) into dest
for(int i = destLow, p = low, q = mid; i < destHigh; i++) {
if (q >= high || p < mid && ((Comparable)src[p]).compareTo(src[q])<=0)
dest[i] = src[p++];
else
dest[i] = src[q++];
}
}
/**
* Swaps x[a] with x[b].
*/
private static void swap(Object[] x, int a, int b) {
Object t = x[a];
x[a] = x[b];
x[b] = t;
}
/**
* Sorts the specified array of objects according to the order induced by
* the specified comparator. All elements in the array must be
* <i>mutually comparable</i> by the specified comparator (that is,
* {@code c.compare(e1, e2)} must not throw a {@code ClassCastException}
* for any elements {@code e1} and {@code e2} in the array).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* <p>Implementation note: This implementation is a stable, adaptive,
* iterative mergesort that requires far fewer than n lg(n) comparisons
* when the input array is partially sorted, while offering the
* performance of a traditional mergesort when the input array is
* randomly ordered. If the input array is nearly sorted, the
* implementation requires approximately n comparisons. Temporary
* storage requirements vary from a small constant for nearly sorted
* input arrays to n/2 object references for randomly ordered input
* arrays.
*
* <p>The implementation takes equal advantage of ascending and
* descending order in its input array, and can take advantage of
* ascending and descending order in different parts of the the same
* input array. It is well-suited to merging two or more sorted arrays:
* simply concatenate the arrays and sort the resulting array.
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
* TimSort</a>). It uses techniques from Peter McIlroy's "Optimistic
* Sorting and Information Theoretic Complexity", in Proceedings of the
* Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474,
* January 1993.
*
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted
* @param c the comparator to determine the order of the array. A
* {@code null} value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @throws ClassCastException if the array contains elements that are
* not <i>mutually comparable</i> using the specified comparator
* @throws IllegalArgumentException (optional) if the comparator is
* found to violate the {@link Comparator} contract
*/
public static <T> void sort(T[] a, Comparator<? super T> c) {
if (c == null) {
sort(a);
} else {
if (LegacyMergeSort.userRequested)
legacyMergeSort(a, c);
else
TimSort.sort(a, 0, a.length, c, null, 0, 0);
}
}
/** To be removed in a future release. */
private static <T> void legacyMergeSort(T[] a, Comparator<? super T> c) {
T[] aux = a.clone();
if (c==null)
mergeSort(aux, a, 0, a.length, 0);
else
mergeSort(aux, a, 0, a.length, 0, c);
}
/**
* Sorts the specified range of the specified array of objects according
* to the order induced by the specified comparator. The range to be
* sorted extends from index {@code fromIndex}, inclusive, to index
* {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
* range to be sorted is empty.) All elements in the range must be
* <i>mutually comparable</i> by the specified comparator (that is,
* {@code c.compare(e1, e2)} must not throw a {@code ClassCastException}
* for any elements {@code e1} and {@code e2} in the range).
*
* <p>This sort is guaranteed to be <i>stable</i>: equal elements will
* not be reordered as a result of the sort.
*
* <p>Implementation note: This implementation is a stable, adaptive,
* iterative mergesort that requires far fewer than n lg(n) comparisons
* when the input array is partially sorted, while offering the
* performance of a traditional mergesort when the input array is
* randomly ordered. If the input array is nearly sorted, the
* implementation requires approximately n comparisons. Temporary
* storage requirements vary from a small constant for nearly sorted
* input arrays to n/2 object references for randomly ordered input
* arrays.
*
* <p>The implementation takes equal advantage of ascending and
* descending order in its input array, and can take advantage of
* ascending and descending order in different parts of the the same
* input array. It is well-suited to merging two or more sorted arrays:
* simply concatenate the arrays and sort the resulting array.
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
* TimSort</a>). It uses techniques from Peter McIlroy's "Optimistic
* Sorting and Information Theoretic Complexity", in Proceedings of the
* Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474,
* January 1993.
*
* @param <T> the class of the objects to be sorted
* @param a the array to be sorted
* @param fromIndex the index of the first element (inclusive) to be
* sorted
* @param toIndex the index of the last element (exclusive) to be sorted
* @param c the comparator to determine the order of the array. A
* {@code null} value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @throws ClassCastException if the array contains elements that are not
* <i>mutually comparable</i> using the specified comparator.
* @throws IllegalArgumentException if {@code fromIndex > toIndex} or
* (optional) if the comparator is found to violate the
* {@link Comparator} contract
* @throws ArrayIndexOutOfBoundsException if {@code fromIndex < 0} or
* {@code toIndex > a.length}
*/
public static <T> void sort(T[] a, int fromIndex, int toIndex,
Comparator<? super T> c) {
if (c == null) {
sort(a, fromIndex, toIndex);
} else {
rangeCheck(a.length, fromIndex, toIndex);
if (LegacyMergeSort.userRequested)
legacyMergeSort(a, fromIndex, toIndex, c);
else
TimSort.sort(a, fromIndex, toIndex, c, null, 0, 0);
}
}
/** To be removed in a future release. */
private static <T> void legacyMergeSort(T[] a, int fromIndex, int toIndex,
Comparator<? super T> c) {
T[] aux = copyOfRange(a, fromIndex, toIndex);
if (c==null)
mergeSort(aux, a, fromIndex, toIndex, -fromIndex);
else
mergeSort(aux, a, fromIndex, toIndex, -fromIndex, c);
}
/**
* Src is the source array that starts at index 0
* Dest is the (possibly larger) array destination with a possible offset
* low is the index in dest to start sorting
* high is the end index in dest to end sorting
* off is the offset into src corresponding to low in dest
* To be removed in a future release.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
private static void mergeSort(Object[] src,
Object[] dest,
int low, int high, int off,
Comparator c) {
int length = high - low;
// Insertion sort on smallest arrays
if (length < INSERTIONSORT_THRESHOLD) {
for (int i=low; i<high; i++)
for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
swap(dest, j, j-1);
return;
}
// Recursively sort halves of dest into src
int destLow = low;
int destHigh = high;
low += off;
high += off;
int mid = (low + high) >>> 1;
mergeSort(dest, src, low, mid, -off, c);
mergeSort(dest, src, mid, high, -off, c);
// If list is already sorted, just copy from src to dest. This is an
// optimization that results in faster sorts for nearly ordered lists.
if (c.compare(src[mid-1], src[mid]) <= 0) {
System.arraycopy(src, low, dest, destLow, length);
return;
}
// Merge sorted halves (now in src) into dest
for(int i = destLow, p = low, q = mid; i < destHigh; i++) {
if (q >= high || p < mid && c.compare(src[p], src[q]) <= 0)
dest[i] = src[p++];
else
dest[i] = src[q++];
}
}
// Parallel prefix
/**
* Cumulates, in parallel, each element of the given array in place,
* using the supplied function. For example if the array initially
* holds {@code [2, 1, 0, 3]} and the operation performs addition,
* then upon return the array holds {@code [2, 3, 3, 6]}.
* Parallel prefix computation is usually more efficient than
* sequential loops for large arrays.
*
* @param <T> the class of the objects in the array
* @param array the array, which is modified in-place by this method
* @param op a side-effect-free, associative function to perform the
* cumulation
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static <T> void parallelPrefix(T[] array, BinaryOperator<T> op) {
Objects.requireNonNull(op);
if (array.length > 0)
new ArrayPrefixHelpers.CumulateTask<>
(null, op, array, 0, array.length).invoke();
}
/**
* Performs {@link #parallelPrefix(Object[], BinaryOperator)}
* for the given subrange of the array.
*
* @param <T> the class of the objects in the array
* @param array the array
* @param fromIndex the index of the first element, inclusive
* @param toIndex the index of the last element, exclusive
* @param op a side-effect-free, associative function to perform the
* cumulation
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > array.length}
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static <T> void parallelPrefix(T[] array, int fromIndex,
int toIndex, BinaryOperator<T> op) {
Objects.requireNonNull(op);
rangeCheck(array.length, fromIndex, toIndex);
if (fromIndex < toIndex)
new ArrayPrefixHelpers.CumulateTask<>
(null, op, array, fromIndex, toIndex).invoke();
}
/**
* Cumulates, in parallel, each element of the given array in place,
* using the supplied function. For example if the array initially
* holds {@code [2, 1, 0, 3]} and the operation performs addition,
* then upon return the array holds {@code [2, 3, 3, 6]}.
* Parallel prefix computation is usually more efficient than
* sequential loops for large arrays.
*
* @param array the array, which is modified in-place by this method
* @param op a side-effect-free, associative function to perform the
* cumulation
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static void parallelPrefix(long[] array, LongBinaryOperator op) {
Objects.requireNonNull(op);
if (array.length > 0)
new ArrayPrefixHelpers.LongCumulateTask
(null, op, array, 0, array.length).invoke();
}
/**
* Performs {@link #parallelPrefix(long[], LongBinaryOperator)}
* for the given subrange of the array.
*
* @param array the array
* @param fromIndex the index of the first element, inclusive
* @param toIndex the index of the last element, exclusive
* @param op a side-effect-free, associative function to perform the
* cumulation
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > array.length}
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static void parallelPrefix(long[] array, int fromIndex,
int toIndex, LongBinaryOperator op) {
Objects.requireNonNull(op);
rangeCheck(array.length, fromIndex, toIndex);
if (fromIndex < toIndex)
new ArrayPrefixHelpers.LongCumulateTask
(null, op, array, fromIndex, toIndex).invoke();
}
/**
* Cumulates, in parallel, each element of the given array in place,
* using the supplied function. For example if the array initially
* holds {@code [2.0, 1.0, 0.0, 3.0]} and the operation performs addition,
* then upon return the array holds {@code [2.0, 3.0, 3.0, 6.0]}.
* Parallel prefix computation is usually more efficient than
* sequential loops for large arrays.
*
* <p> Because floating-point operations may not be strictly associative,
* the returned result may not be identical to the value that would be
* obtained if the operation was performed sequentially.
*
* @param array the array, which is modified in-place by this method
* @param op a side-effect-free function to perform the cumulation
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static void parallelPrefix(double[] array, DoubleBinaryOperator op) {
Objects.requireNonNull(op);
if (array.length > 0)
new ArrayPrefixHelpers.DoubleCumulateTask
(null, op, array, 0, array.length).invoke();
}
/**
* Performs {@link #parallelPrefix(double[], DoubleBinaryOperator)}
* for the given subrange of the array.
*
* @param array the array
* @param fromIndex the index of the first element, inclusive
* @param toIndex the index of the last element, exclusive
* @param op a side-effect-free, associative function to perform the
* cumulation
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > array.length}
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static void parallelPrefix(double[] array, int fromIndex,
int toIndex, DoubleBinaryOperator op) {
Objects.requireNonNull(op);
rangeCheck(array.length, fromIndex, toIndex);
if (fromIndex < toIndex)
new ArrayPrefixHelpers.DoubleCumulateTask
(null, op, array, fromIndex, toIndex).invoke();
}
/**
* Cumulates, in parallel, each element of the given array in place,
* using the supplied function. For example if the array initially
* holds {@code [2, 1, 0, 3]} and the operation performs addition,
* then upon return the array holds {@code [2, 3, 3, 6]}.
* Parallel prefix computation is usually more efficient than
* sequential loops for large arrays.
*
* @param array the array, which is modified in-place by this method
* @param op a side-effect-free, associative function to perform the
* cumulation
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static void parallelPrefix(int[] array, IntBinaryOperator op) {
Objects.requireNonNull(op);
if (array.length > 0)
new ArrayPrefixHelpers.IntCumulateTask
(null, op, array, 0, array.length).invoke();
}
/**
* Performs {@link #parallelPrefix(int[], IntBinaryOperator)}
* for the given subrange of the array.
*
* @param array the array
* @param fromIndex the index of the first element, inclusive
* @param toIndex the index of the last element, exclusive
* @param op a side-effect-free, associative function to perform the
* cumulation
* @throws IllegalArgumentException if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0} or {@code toIndex > array.length}
* @throws NullPointerException if the specified array or function is null
* @since 1.8
*/
public static void parallelPrefix(int[] array, int fromIndex,
int toIndex, IntBinaryOperator op) {
Objects.requireNonNull(op);
rangeCheck(array.length, fromIndex, toIndex);
if (fromIndex < toIndex)
new ArrayPrefixHelpers.IntCumulateTask
(null, op, array, fromIndex, toIndex).invoke();
}
// Searching
/**
* Searches the specified array of longs for the specified value using the
* binary search algorithm. The array must be sorted (as
* by the {@link #sort(long[])} method) prior to making this call. If it
* is not sorted, the results are undefined. If the array contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
*/
public static int binarySearch(long[] a, long key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array of longs for the specified value using the
* binary search algorithm.
* The range must be sorted (as
* by the {@link #sort(long[], int, int)} method)
* prior to making this call. If it
* is not sorted, the results are undefined. If the range contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(long[] a, int fromIndex, int toIndex,
long key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(long[] a, int fromIndex, int toIndex,
long key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
long midVal = a[mid];
if (midVal < key)
low = mid + 1;
else if (midVal > key)
high = mid - 1;
else
return mid; // key found
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array of ints for the specified value using the
* binary search algorithm. The array must be sorted (as
* by the {@link #sort(int[])} method) prior to making this call. If it
* is not sorted, the results are undefined. If the array contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
*/
public static int binarySearch(int[] a, int key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array of ints for the specified value using the
* binary search algorithm.
* The range must be sorted (as
* by the {@link #sort(int[], int, int)} method)
* prior to making this call. If it
* is not sorted, the results are undefined. If the range contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(int[] a, int fromIndex, int toIndex,
int key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(int[] a, int fromIndex, int toIndex,
int key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
int midVal = a[mid];
if (midVal < key)
low = mid + 1;
else if (midVal > key)
high = mid - 1;
else
return mid; // key found
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array of shorts for the specified value using
* the binary search algorithm. The array must be sorted
* (as by the {@link #sort(short[])} method) prior to making this call. If
* it is not sorted, the results are undefined. If the array contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
*/
public static int binarySearch(short[] a, short key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array of shorts for the specified value using
* the binary search algorithm.
* The range must be sorted
* (as by the {@link #sort(short[], int, int)} method)
* prior to making this call. If
* it is not sorted, the results are undefined. If the range contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(short[] a, int fromIndex, int toIndex,
short key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(short[] a, int fromIndex, int toIndex,
short key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
short midVal = a[mid];
if (midVal < key)
low = mid + 1;
else if (midVal > key)
high = mid - 1;
else
return mid; // key found
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array of chars for the specified value using the
* binary search algorithm. The array must be sorted (as
* by the {@link #sort(char[])} method) prior to making this call. If it
* is not sorted, the results are undefined. If the array contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
*/
public static int binarySearch(char[] a, char key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array of chars for the specified value using the
* binary search algorithm.
* The range must be sorted (as
* by the {@link #sort(char[], int, int)} method)
* prior to making this call. If it
* is not sorted, the results are undefined. If the range contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(char[] a, int fromIndex, int toIndex,
char key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(char[] a, int fromIndex, int toIndex,
char key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
char midVal = a[mid];
if (midVal < key)
low = mid + 1;
else if (midVal > key)
high = mid - 1;
else
return mid; // key found
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array of bytes for the specified value using the
* binary search algorithm. The array must be sorted (as
* by the {@link #sort(byte[])} method) prior to making this call. If it
* is not sorted, the results are undefined. If the array contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
*/
public static int binarySearch(byte[] a, byte key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array of bytes for the specified value using the
* binary search algorithm.
* The range must be sorted (as
* by the {@link #sort(byte[], int, int)} method)
* prior to making this call. If it
* is not sorted, the results are undefined. If the range contains
* multiple elements with the specified value, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(byte[] a, int fromIndex, int toIndex,
byte key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(byte[] a, int fromIndex, int toIndex,
byte key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
byte midVal = a[mid];
if (midVal < key)
low = mid + 1;
else if (midVal > key)
high = mid - 1;
else
return mid; // key found
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array of doubles for the specified value using
* the binary search algorithm. The array must be sorted
* (as by the {@link #sort(double[])} method) prior to making this call.
* If it is not sorted, the results are undefined. If the array contains
* multiple elements with the specified value, there is no guarantee which
* one will be found. This method considers all NaN values to be
* equivalent and equal.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
*/
public static int binarySearch(double[] a, double key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array of doubles for the specified value using
* the binary search algorithm.
* The range must be sorted
* (as by the {@link #sort(double[], int, int)} method)
* prior to making this call.
* If it is not sorted, the results are undefined. If the range contains
* multiple elements with the specified value, there is no guarantee which
* one will be found. This method considers all NaN values to be
* equivalent and equal.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(double[] a, int fromIndex, int toIndex,
double key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(double[] a, int fromIndex, int toIndex,
double key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
double midVal = a[mid];
if (midVal < key)
low = mid + 1; // Neither val is NaN, thisVal is smaller
else if (midVal > key)
high = mid - 1; // Neither val is NaN, thisVal is larger
else {
long midBits = Double.doubleToLongBits(midVal);
long keyBits = Double.doubleToLongBits(key);
if (midBits == keyBits) // Values are equal
return mid; // Key found
else if (midBits < keyBits) // (-0.0, 0.0) or (!NaN, NaN)
low = mid + 1;
else // (0.0, -0.0) or (NaN, !NaN)
high = mid - 1;
}
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array of floats for the specified value using
* the binary search algorithm. The array must be sorted
* (as by the {@link #sort(float[])} method) prior to making this call. If
* it is not sorted, the results are undefined. If the array contains
* multiple elements with the specified value, there is no guarantee which
* one will be found. This method considers all NaN values to be
* equivalent and equal.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
*/
public static int binarySearch(float[] a, float key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array of floats for the specified value using
* the binary search algorithm.
* The range must be sorted
* (as by the {@link #sort(float[], int, int)} method)
* prior to making this call. If
* it is not sorted, the results are undefined. If the range contains
* multiple elements with the specified value, there is no guarantee which
* one will be found. This method considers all NaN values to be
* equivalent and equal.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(float[] a, int fromIndex, int toIndex,
float key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(float[] a, int fromIndex, int toIndex,
float key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
float midVal = a[mid];
if (midVal < key)
low = mid + 1; // Neither val is NaN, thisVal is smaller
else if (midVal > key)
high = mid - 1; // Neither val is NaN, thisVal is larger
else {
int midBits = Float.floatToIntBits(midVal);
int keyBits = Float.floatToIntBits(key);
if (midBits == keyBits) // Values are equal
return mid; // Key found
else if (midBits < keyBits) // (-0.0, 0.0) or (!NaN, NaN)
low = mid + 1;
else // (0.0, -0.0) or (NaN, !NaN)
high = mid - 1;
}
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array for the specified object using the binary
* search algorithm. The array must be sorted into ascending order
* according to the
* {@linkplain Comparable natural ordering}
* of its elements (as by the
* {@link #sort(Object[])} method) prior to making this call.
* If it is not sorted, the results are undefined.
* (If the array contains elements that are not mutually comparable (for
* example, strings and integers), it <i>cannot</i> be sorted according
* to the natural ordering of its elements, hence results are undefined.)
* If the array contains multiple
* elements equal to the specified object, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws ClassCastException if the search key is not comparable to the
* elements of the array.
*/
public static int binarySearch(Object[] a, Object key) {
return binarySearch0(a, 0, a.length, key);
}
/**
* Searches a range of
* the specified array for the specified object using the binary
* search algorithm.
* The range must be sorted into ascending order
* according to the
* {@linkplain Comparable natural ordering}
* of its elements (as by the
* {@link #sort(Object[], int, int)} method) prior to making this
* call. If it is not sorted, the results are undefined.
* (If the range contains elements that are not mutually comparable (for
* example, strings and integers), it <i>cannot</i> be sorted according
* to the natural ordering of its elements, hence results are undefined.)
* If the range contains multiple
* elements equal to the specified object, there is no guarantee which
* one will be found.
*
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws ClassCastException if the search key is not comparable to the
* elements of the array within the specified range.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static int binarySearch(Object[] a, int fromIndex, int toIndex,
Object key) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key);
}
// Like public version, but without range checks.
private static int binarySearch0(Object[] a, int fromIndex, int toIndex,
Object key) {
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
@SuppressWarnings("rawtypes")
Comparable midVal = (Comparable)a[mid];
@SuppressWarnings("unchecked")
int cmp = midVal.compareTo(key);
if (cmp < 0)
low = mid + 1;
else if (cmp > 0)
high = mid - 1;
else
return mid; // key found
}
return -(low + 1); // key not found.
}
/**
* Searches the specified array for the specified object using the binary
* search algorithm. The array must be sorted into ascending order
* according to the specified comparator (as by the
* {@link #sort(Object[], Comparator) sort(T[], Comparator)}
* method) prior to making this call. If it is
* not sorted, the results are undefined.
* If the array contains multiple
* elements equal to the specified object, there is no guarantee which one
* will be found.
*
* @param <T> the class of the objects in the array
* @param a the array to be searched
* @param key the value to be searched for
* @param c the comparator by which the array is ordered. A
* <tt>null</tt> value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @return index of the search key, if it is contained in the array;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element greater than the key, or <tt>a.length</tt> if all
* elements in the array are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws ClassCastException if the array contains elements that are not
* <i>mutually comparable</i> using the specified comparator,
* or the search key is not comparable to the
* elements of the array using this comparator.
*/
public static <T> int binarySearch(T[] a, T key, Comparator<? super T> c) {
return binarySearch0(a, 0, a.length, key, c);
}
/**
* Searches a range of
* the specified array for the specified object using the binary
* search algorithm.
* The range must be sorted into ascending order
* according to the specified comparator (as by the
* {@link #sort(Object[], int, int, Comparator)
* sort(T[], int, int, Comparator)}
* method) prior to making this call.
* If it is not sorted, the results are undefined.
* If the range contains multiple elements equal to the specified object,
* there is no guarantee which one will be found.
*
* @param <T> the class of the objects in the array
* @param a the array to be searched
* @param fromIndex the index of the first element (inclusive) to be
* searched
* @param toIndex the index of the last element (exclusive) to be searched
* @param key the value to be searched for
* @param c the comparator by which the array is ordered. A
* <tt>null</tt> value indicates that the elements'
* {@linkplain Comparable natural ordering} should be used.
* @return index of the search key, if it is contained in the array
* within the specified range;
* otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
* <i>insertion point</i> is defined as the point at which the
* key would be inserted into the array: the index of the first
* element in the range greater than the key,
* or <tt>toIndex</tt> if all
* elements in the range are less than the specified key. Note
* that this guarantees that the return value will be >= 0 if
* and only if the key is found.
* @throws ClassCastException if the range contains elements that are not
* <i>mutually comparable</i> using the specified comparator,
* or the search key is not comparable to the
* elements in the range using this comparator.
* @throws IllegalArgumentException
* if {@code fromIndex > toIndex}
* @throws ArrayIndexOutOfBoundsException
* if {@code fromIndex < 0 or toIndex > a.length}
* @since 1.6
*/
public static <T> int binarySearch(T[] a, int fromIndex, int toIndex,
T key, Comparator<? super T> c) {
rangeCheck(a.length, fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key, c);
}
// Like public version, but without range checks.
private static <T> int binarySearch0(T[] a, int fromIndex, int toIndex,
T key, Comparator<? super T> c) {
if (c == null) {
return binarySearch0(a, fromIndex, toIndex, key);
}
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
T midVal = a[mid];
int cmp = c.compare(midVal, key);
if (cmp < 0)
low = mid + 1;
else if (cmp > 0)
high = mid - 1;
else
return mid; // key found
}
return -(low + 1); // key not found.
}
// Equality Testing
/**
* Returns <tt>true</tt> if the two specified arrays of longs are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
public static boolean equals(long[] a, long[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (a[i] != a2[i])
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of ints are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
public static boolean equals(int[] a, int[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (a[i] != a2[i])
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of shorts are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
public static boolean equals(short[] a, short a2[]) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (a[i] != a2[i])
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of chars are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
public static boolean equals(char[] a, char[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (a[i] != a2[i])
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of bytes are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
public static boolean equals(byte[] a, byte[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (a[i] != a2[i])
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of booleans are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
public static boolean equals(boolean[] a, boolean[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (a[i] != a2[i])
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of doubles are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* Two doubles <tt>d1</tt> and <tt>d2</tt> are considered equal if:
* <pre> <tt>new Double(d1).equals(new Double(d2))</tt></pre>
* (Unlike the <tt>==</tt> operator, this method considers
* <tt>NaN</tt> equals to itself, and 0.0d unequal to -0.0d.)
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
* @see Double#equals(Object)
*/
public static boolean equals(double[] a, double[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (Double.doubleToLongBits(a[i])!=Double.doubleToLongBits(a2[i]))
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of floats are
* <i>equal</i> to one another. Two arrays are considered equal if both
* arrays contain the same number of elements, and all corresponding pairs
* of elements in the two arrays are equal. In other words, two arrays
* are equal if they contain the same elements in the same order. Also,
* two array references are considered equal if both are <tt>null</tt>.<p>
*
* Two floats <tt>f1</tt> and <tt>f2</tt> are considered equal if:
* <pre> <tt>new Float(f1).equals(new Float(f2))</tt></pre>
* (Unlike the <tt>==</tt> operator, this method considers
* <tt>NaN</tt> equals to itself, and 0.0f unequal to -0.0f.)
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
* @see Float#equals(Object)
*/
public static boolean equals(float[] a, float[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++)
if (Float.floatToIntBits(a[i])!=Float.floatToIntBits(a2[i]))
return false;
return true;
}
/**
* Returns <tt>true</tt> if the two specified arrays of Objects are
* <i>equal</i> to one another. The two arrays are considered equal if
* both arrays contain the same number of elements, and all corresponding
* pairs of elements in the two arrays are equal. Two objects <tt>e1</tt>
* and <tt>e2</tt> are considered <i>equal</i> if <tt>(e1==null ? e2==null
* : e1.equals(e2))</tt>. In other words, the two arrays are equal if
* they contain the same elements in the same order. Also, two array
* references are considered equal if both are <tt>null</tt>.<p>
*
* @param a one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
*/
public static boolean equals(Object[] a, Object[] a2) {
if (a==a2)
return true;
if (a==null || a2==null)
return false;
int length = a.length;
if (a2.length != length)
return false;
for (int i=0; i<length; i++) {
Object o1 = a[i];
Object o2 = a2[i];
if (!(o1==null ? o2==null : o1.equals(o2)))
return false;
}
return true;
}
// Filling
/**
* Assigns the specified long value to each element of the specified array
* of longs.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(long[] a, long val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified long value to each element of the specified
* range of the specified array of longs. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
public static void fill(long[] a, int fromIndex, int toIndex, long val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified int value to each element of the specified array
* of ints.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(int[] a, int val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified int value to each element of the specified
* range of the specified array of ints. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
public static void fill(int[] a, int fromIndex, int toIndex, int val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified short value to each element of the specified array
* of shorts.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(short[] a, short val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified short value to each element of the specified
* range of the specified array of shorts. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
public static void fill(short[] a, int fromIndex, int toIndex, short val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified char value to each element of the specified array
* of chars.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(char[] a, char val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified char value to each element of the specified
* range of the specified array of chars. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
/*
* 数组里元素都是一个值
*/
public static void fill(char[] a, int fromIndex, int toIndex, char val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified byte value to each element of the specified array
* of bytes.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(byte[] a, byte val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified byte value to each element of the specified
* range of the specified array of bytes. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
public static void fill(byte[] a, int fromIndex, int toIndex, byte val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified boolean value to each element of the specified
* array of booleans.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(boolean[] a, boolean val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified boolean value to each element of the specified
* range of the specified array of booleans. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
public static void fill(boolean[] a, int fromIndex, int toIndex,
boolean val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified double value to each element of the specified
* array of doubles.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(double[] a, double val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified double value to each element of the specified
* range of the specified array of doubles. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
public static void fill(double[] a, int fromIndex, int toIndex,double val){
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified float value to each element of the specified array
* of floats.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
*/
public static void fill(float[] a, float val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified float value to each element of the specified
* range of the specified array of floats. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
*/
public static void fill(float[] a, int fromIndex, int toIndex, float val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
/**
* Assigns the specified Object reference to each element of the specified
* array of Objects.
*
* @param a the array to be filled
* @param val the value to be stored in all elements of the array
* @throws ArrayStoreException if the specified value is not of a
* runtime type that can be stored in the specified array
*/
public static void fill(Object[] a, Object val) {
for (int i = 0, len = a.length; i < len; i++)
a[i] = val;
}
/**
* Assigns the specified Object reference to each element of the specified
* range of the specified array of Objects. The range to be filled
* extends from index <tt>fromIndex</tt>, inclusive, to index
* <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
* range to be filled is empty.)
*
* @param a the array to be filled
* @param fromIndex the index of the first element (inclusive) to be
* filled with the specified value
* @param toIndex the index of the last element (exclusive) to be
* filled with the specified value
* @param val the value to be stored in all elements of the array
* @throws IllegalArgumentException if <tt>fromIndex > toIndex</tt>
* @throws ArrayIndexOutOfBoundsException if <tt>fromIndex < 0</tt> or
* <tt>toIndex > a.length</tt>
* @throws ArrayStoreException if the specified value is not of a
* runtime type that can be stored in the specified array
*/
public static void fill(Object[] a, int fromIndex, int toIndex, Object val) {
rangeCheck(a.length, fromIndex, toIndex);
for (int i = fromIndex; i < toIndex; i++)
a[i] = val;
}
// Cloning
/**
* Copies the specified array, truncating or padding with nulls (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>null</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
* The resulting array is of exactly the same class as the original array.
*
* @param <T> the class of the objects in the array
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with nulls
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
@SuppressWarnings("unchecked")
public static <T> T[] copyOf(T[] original, int newLength) {
return (T[]) copyOf(original, newLength, original.getClass());
}
/**
* Copies the specified array, truncating or padding with nulls (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>null</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
* The resulting array is of the class <tt>newType</tt>.
*
* @param <U> the class of the objects in the original array
* @param <T> the class of the objects in the returned array
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @param newType the class of the copy to be returned
* @return a copy of the original array, truncated or padded with nulls
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @throws ArrayStoreException if an element copied from
* <tt>original</tt> is not of a runtime type that can be stored in
* an array of class <tt>newType</tt>
* @since 1.6
*/
public static <T,U> T[] copyOf(U[] original, int newLength, Class<? extends T[]> newType) {
@SuppressWarnings("unchecked")
T[] copy = ((Object)newType == (Object)Object[].class)
? (T[]) new Object[newLength]
: (T[]) Array.newInstance(newType.getComponentType(), newLength);
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with zeros (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>(byte)0</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static byte[] copyOf(byte[] original, int newLength) {
byte[] copy = new byte[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with zeros (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>(short)0</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static short[] copyOf(short[] original, int newLength) {
short[] copy = new short[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with zeros (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>0</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static int[] copyOf(int[] original, int newLength) {
int[] copy = new int[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with zeros (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>0L</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static long[] copyOf(long[] original, int newLength) {
long[] copy = new long[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with null characters (if necessary)
* so the copy has the specified length. For all indices that are valid
* in both the original array and the copy, the two arrays will contain
* identical values. For any indices that are valid in the copy but not
* the original, the copy will contain <tt>'\\u000'</tt>. Such indices
* will exist if and only if the specified length is greater than that of
* the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with null characters
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static char[] copyOf(char[] original, int newLength) {
char[] copy = new char[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with zeros (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>0f</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static float[] copyOf(float[] original, int newLength) {
float[] copy = new float[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with zeros (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>0d</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with zeros
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static double[] copyOf(double[] original, int newLength) {
double[] copy = new double[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified array, truncating or padding with <tt>false</tt> (if necessary)
* so the copy has the specified length. For all indices that are
* valid in both the original array and the copy, the two arrays will
* contain identical values. For any indices that are valid in the
* copy but not the original, the copy will contain <tt>false</tt>.
* Such indices will exist if and only if the specified length
* is greater than that of the original array.
*
* @param original the array to be copied
* @param newLength the length of the copy to be returned
* @return a copy of the original array, truncated or padded with false elements
* to obtain the specified length
* @throws NegativeArraySizeException if <tt>newLength</tt> is negative
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static boolean[] copyOf(boolean[] original, int newLength) {
boolean[] copy = new boolean[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>null</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
* <p>
* The resulting array is of exactly the same class as the original array.
*
* @param <T> the class of the objects in the array
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with nulls to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
@SuppressWarnings("unchecked")
public static <T> T[] copyOfRange(T[] original, int from, int to) {
return copyOfRange(original, from, to, (Class<? extends T[]>) original.getClass());
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>null</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
* The resulting array is of the class <tt>newType</tt>.
*
* @param <U> the class of the objects in the original array
* @param <T> the class of the objects in the returned array
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @param newType the class of the copy to be returned
* @return a new array containing the specified range from the original array,
* truncated or padded with nulls to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @throws ArrayStoreException if an element copied from
* <tt>original</tt> is not of a runtime type that can be stored in
* an array of class <tt>newType</tt>.
* @since 1.6
*/
public static <T,U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
@SuppressWarnings("unchecked")
T[] copy = ((Object)newType == (Object)Object[].class)
? (T[]) new Object[newLength]
: (T[]) Array.newInstance(newType.getComponentType(), newLength);
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>(byte)0</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static byte[] copyOfRange(byte[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
byte[] copy = new byte[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>(short)0</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static short[] copyOfRange(short[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
short[] copy = new short[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>0</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static int[] copyOfRange(int[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
int[] copy = new int[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>0L</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static long[] copyOfRange(long[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
long[] copy = new long[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>'\\u000'</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with null characters to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static char[] copyOfRange(char[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
char[] copy = new char[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>0f</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static float[] copyOfRange(float[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
float[] copy = new float[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>0d</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with zeros to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static double[] copyOfRange(double[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
double[] copy = new double[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
/**
* Copies the specified range of the specified array into a new array.
* The initial index of the range (<tt>from</tt>) must lie between zero
* and <tt>original.length</tt>, inclusive. The value at
* <tt>original[from]</tt> is placed into the initial element of the copy
* (unless <tt>from == original.length</tt> or <tt>from == to</tt>).
* Values from subsequent elements in the original array are placed into
* subsequent elements in the copy. The final index of the range
* (<tt>to</tt>), which must be greater than or equal to <tt>from</tt>,
* may be greater than <tt>original.length</tt>, in which case
* <tt>false</tt> is placed in all elements of the copy whose index is
* greater than or equal to <tt>original.length - from</tt>. The length
* of the returned array will be <tt>to - from</tt>.
*
* @param original the array from which a range is to be copied
* @param from the initial index of the range to be copied, inclusive
* @param to the final index of the range to be copied, exclusive.
* (This index may lie outside the array.)
* @return a new array containing the specified range from the original array,
* truncated or padded with false elements to obtain the required length
* @throws ArrayIndexOutOfBoundsException if {@code from < 0}
* or {@code from > original.length}
* @throws IllegalArgumentException if <tt>from > to</tt>
* @throws NullPointerException if <tt>original</tt> is null
* @since 1.6
*/
public static boolean[] copyOfRange(boolean[] original, int from, int to) {
int newLength = to - from;
if (newLength < 0)
throw new IllegalArgumentException(from + " > " + to);
boolean[] copy = new boolean[newLength];
System.arraycopy(original, from, copy, 0,
Math.min(original.length - from, newLength));
return copy;
}
// Misc
/**
* Returns a fixed-size list backed by the specified array. (Changes to
* the returned list "write through" to the array.) This method acts
* as bridge between array-based and collection-based APIs, in
* combination with {@link Collection#toArray}. The returned list is
* serializable and implements {@link RandomAccess}.
*
* <p>This method also provides a convenient way to create a fixed-size
* list initialized to contain several elements:
* <pre>
* List<String> stooges = Arrays.asList("Larry", "Moe", "Curly");
* </pre>
*
* @param <T> the class of the objects in the array
* @param a the array by which the list will be backed
* @return a list view of the specified array
*/
/**
* 数组转集合 实质还是数组
*/
@SafeVarargs
@SuppressWarnings("varargs")
public static <T> List<T> asList(T... a) {
return new ArrayList<>(a);
}
/**
* @serial include
*/
private static class ArrayList<E> extends AbstractList<E>
implements RandomAccess, java.io.Serializable
{
private static final long serialVersionUID = -2764017481108945198L;
private final E[] a;
ArrayList(E[] array) {
a = Objects.requireNonNull(array);
}
@Override
public int size() {
return a.length;
}
@Override
public Object[] toArray() {
return a.clone();
}
@Override
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
int size = size();
if (a.length < size)
return Arrays.copyOf(this.a, size,
(Class<? extends T[]>) a.getClass());
System.arraycopy(this.a, 0, a, 0, size);
if (a.length > size)
a[size] = null;
return a;
}
@Override
public E get(int index) {
return a[index];
}
@Override
public E set(int index, E element) {
E oldValue = a[index];
a[index] = element;
return oldValue;
}
@Override
public int indexOf(Object o) {
E[] a = this.a;
if (o == null) {
for (int i = 0; i < a.length; i++)
if (a[i] == null)
return i;
} else {
for (int i = 0; i < a.length; i++)
if (o.equals(a[i]))
return i;
}
return -1;
}
@Override
public boolean contains(Object o) {
return indexOf(o) != -1;
}
@Override
public Spliterator<E> spliterator() {
return Spliterators.spliterator(a, Spliterator.ORDERED);
}
@Override
public void forEach(Consumer<? super E> action) {
Objects.requireNonNull(action);
for (E e : a) {
action.accept(e);
}
}
@Override
public void replaceAll(UnaryOperator<E> operator) {
Objects.requireNonNull(operator);
E[] a = this.a;
for (int i = 0; i < a.length; i++) {
a[i] = operator.apply(a[i]);
}
}
@Override
public void sort(Comparator<? super E> c) {
Arrays.sort(a, c);
}
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two <tt>long</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Long}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(long a[]) {
if (a == null)
return 0;
int result = 1;
for (long element : a) {
int elementHash = (int)(element ^ (element >>> 32));
result = 31 * result + elementHash;
}
return result;
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two non-null <tt>int</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Integer}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(int a[]) {
if (a == null)
return 0;
int result = 1;
for (int element : a)
result = 31 * result + element;
return result;
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two <tt>short</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Short}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(short a[]) {
if (a == null)
return 0;
int result = 1;
for (short element : a)
result = 31 * result + element;
return result;
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two <tt>char</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Character}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(char a[]) {
if (a == null)
return 0;
int result = 1;
for (char element : a)
result = 31 * result + element;
return result;
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two <tt>byte</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Byte}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(byte a[]) {
if (a == null)
return 0;
int result = 1;
for (byte element : a)
result = 31 * result + element;
return result;
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two <tt>boolean</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Boolean}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(boolean a[]) {
if (a == null)
return 0;
int result = 1;
for (boolean element : a)
result = 31 * result + (element ? 1231 : 1237);
return result;
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two <tt>float</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Float}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(float a[]) {
if (a == null)
return 0;
int result = 1;
for (float element : a)
result = 31 * result + Float.floatToIntBits(element);
return result;
}
/**
* Returns a hash code based on the contents of the specified array.
* For any two <tt>double</tt> arrays <tt>a</tt> and <tt>b</tt>
* such that <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is the same value that would be
* obtained by invoking the {@link List#hashCode() <tt>hashCode</tt>}
* method on a {@link List} containing a sequence of {@link Double}
* instances representing the elements of <tt>a</tt> in the same order.
* If <tt>a</tt> is <tt>null</tt>, this method returns 0.
*
* @param a the array whose hash value to compute
* @return a content-based hash code for <tt>a</tt>
* @since 1.5
*/
public static int hashCode(double a[]) {
if (a == null)
return 0;
int result = 1;
for (double element : a) {
long bits = Double.doubleToLongBits(element);
result = 31 * result + (int)(bits ^ (bits >>> 32));
}
return result;
}
/**
* Returns a hash code based on the contents of the specified array. If
* the array contains other arrays as elements, the hash code is based on
* their identities rather than their contents. It is therefore
* acceptable to invoke this method on an array that contains itself as an
* element, either directly or indirectly through one or more levels of
* arrays.
*
* <p>For any two arrays <tt>a</tt> and <tt>b</tt> such that
* <tt>Arrays.equals(a, b)</tt>, it is also the case that
* <tt>Arrays.hashCode(a) == Arrays.hashCode(b)</tt>.
*
* <p>The value returned by this method is equal to the value that would
* be returned by <tt>Arrays.asList(a).hashCode()</tt>, unless <tt>a</tt>
* is <tt>null</tt>, in which case <tt>0</tt> is returned.
*
* @param a the array whose content-based hash code to compute
* @return a content-based hash code for <tt>a</tt>
* @see #deepHashCode(Object[])
* @since 1.5
*/
public static int hashCode(Object a[]) {
if (a == null)
return 0;
int result = 1;
for (Object element : a)
result = 31 * result + (element == null ? 0 : element.hashCode());
return result;
}
/**
* Returns a hash code based on the "deep contents" of the specified
* array. If the array contains other arrays as elements, the
* hash code is based on their contents and so on, ad infinitum.
* It is therefore unacceptable to invoke this method on an array that
* contains itself as an element, either directly or indirectly through
* one or more levels of arrays. The behavior of such an invocation is
* undefined.
*
* <p>For any two arrays <tt>a</tt> and <tt>b</tt> such that
* <tt>Arrays.deepEquals(a, b)</tt>, it is also the case that
* <tt>Arrays.deepHashCode(a) == Arrays.deepHashCode(b)</tt>.
*
* <p>The computation of the value returned by this method is similar to
* that of the value returned by {@link List#hashCode()} on a list
* containing the same elements as <tt>a</tt> in the same order, with one
* difference: If an element <tt>e</tt> of <tt>a</tt> is itself an array,
* its hash code is computed not by calling <tt>e.hashCode()</tt>, but as
* by calling the appropriate overloading of <tt>Arrays.hashCode(e)</tt>
* if <tt>e</tt> is an array of a primitive type, or as by calling
* <tt>Arrays.deepHashCode(e)</tt> recursively if <tt>e</tt> is an array
* of a reference type. If <tt>a</tt> is <tt>null</tt>, this method
* returns 0.
*
* @param a the array whose deep-content-based hash code to compute
* @return a deep-content-based hash code for <tt>a</tt>
* @see #hashCode(Object[])
* @since 1.5
*/
public static int deepHashCode(Object a[]) {
if (a == null)
return 0;
int result = 1;
for (Object element : a) {
int elementHash = 0;
if (element instanceof Object[])
elementHash = deepHashCode((Object[]) element);
else if (element instanceof byte[])
elementHash = hashCode((byte[]) element);
else if (element instanceof short[])
elementHash = hashCode((short[]) element);
else if (element instanceof int[])
elementHash = hashCode((int[]) element);
else if (element instanceof long[])
elementHash = hashCode((long[]) element);
else if (element instanceof char[])
elementHash = hashCode((char[]) element);
else if (element instanceof float[])
elementHash = hashCode((float[]) element);
else if (element instanceof double[])
elementHash = hashCode((double[]) element);
else if (element instanceof boolean[])
elementHash = hashCode((boolean[]) element);
else if (element != null)
elementHash = element.hashCode();
result = 31 * result + elementHash;
}
return result;
}
/**
* Returns <tt>true</tt> if the two specified arrays are <i>deeply
* equal</i> to one another. Unlike the {@link #equals(Object[],Object[])}
* method, this method is appropriate for use with nested arrays of
* arbitrary depth.
*
* <p>Two array references are considered deeply equal if both
* are <tt>null</tt>, or if they refer to arrays that contain the same
* number of elements and all corresponding pairs of elements in the two
* arrays are deeply equal.
*
* <p>Two possibly <tt>null</tt> elements <tt>e1</tt> and <tt>e2</tt> are
* deeply equal if any of the following conditions hold:
* <ul>
* <li> <tt>e1</tt> and <tt>e2</tt> are both arrays of object reference
* types, and <tt>Arrays.deepEquals(e1, e2) would return true</tt>
* <li> <tt>e1</tt> and <tt>e2</tt> are arrays of the same primitive
* type, and the appropriate overloading of
* <tt>Arrays.equals(e1, e2)</tt> would return true.
* <li> <tt>e1 == e2</tt>
* <li> <tt>e1.equals(e2)</tt> would return true.
* </ul>
* Note that this definition permits <tt>null</tt> elements at any depth.
*
* <p>If either of the specified arrays contain themselves as elements
* either directly or indirectly through one or more levels of arrays,
* the behavior of this method is undefined.
*
* @param a1 one array to be tested for equality
* @param a2 the other array to be tested for equality
* @return <tt>true</tt> if the two arrays are equal
* @see #equals(Object[],Object[])
* @see Objects#deepEquals(Object, Object)
* @since 1.5
*/
public static boolean deepEquals(Object[] a1, Object[] a2) {
if (a1 == a2)
return true;
if (a1 == null || a2==null)
return false;
int length = a1.length;
if (a2.length != length)
return false;
for (int i = 0; i < length; i++) {
Object e1 = a1[i];
Object e2 = a2[i];
if (e1 == e2)
continue;
if (e1 == null)
return false;
// Figure out whether the two elements are equal
boolean eq = deepEquals0(e1, e2);
if (!eq)
return false;
}
return true;
}
static boolean deepEquals0(Object e1, Object e2) {
assert e1 != null;
boolean eq;
if (e1 instanceof Object[] && e2 instanceof Object[])
eq = deepEquals ((Object[]) e1, (Object[]) e2);
else if (e1 instanceof byte[] && e2 instanceof byte[])
eq = equals((byte[]) e1, (byte[]) e2);
else if (e1 instanceof short[] && e2 instanceof short[])
eq = equals((short[]) e1, (short[]) e2);
else if (e1 instanceof int[] && e2 instanceof int[])
eq = equals((int[]) e1, (int[]) e2);
else if (e1 instanceof long[] && e2 instanceof long[])
eq = equals((long[]) e1, (long[]) e2);
else if (e1 instanceof char[] && e2 instanceof char[])
eq = equals((char[]) e1, (char[]) e2);
else if (e1 instanceof float[] && e2 instanceof float[])
eq = equals((float[]) e1, (float[]) e2);
else if (e1 instanceof double[] && e2 instanceof double[])
eq = equals((double[]) e1, (double[]) e2);
else if (e1 instanceof boolean[] && e2 instanceof boolean[])
eq = equals((boolean[]) e1, (boolean[]) e2);
else
eq = e1.equals(e2);
return eq;
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements are
* separated by the characters <tt>", "</tt> (a comma followed by a
* space). Elements are converted to strings as by
* <tt>String.valueOf(long)</tt>. Returns <tt>"null"</tt> if <tt>a</tt>
* is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(long[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements are
* separated by the characters <tt>", "</tt> (a comma followed by a
* space). Elements are converted to strings as by
* <tt>String.valueOf(int)</tt>. Returns <tt>"null"</tt> if <tt>a</tt> is
* <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(int[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements are
* separated by the characters <tt>", "</tt> (a comma followed by a
* space). Elements are converted to strings as by
* <tt>String.valueOf(short)</tt>. Returns <tt>"null"</tt> if <tt>a</tt>
* is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(short[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements are
* separated by the characters <tt>", "</tt> (a comma followed by a
* space). Elements are converted to strings as by
* <tt>String.valueOf(char)</tt>. Returns <tt>"null"</tt> if <tt>a</tt>
* is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(char[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements
* are separated by the characters <tt>", "</tt> (a comma followed
* by a space). Elements are converted to strings as by
* <tt>String.valueOf(byte)</tt>. Returns <tt>"null"</tt> if
* <tt>a</tt> is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(byte[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements are
* separated by the characters <tt>", "</tt> (a comma followed by a
* space). Elements are converted to strings as by
* <tt>String.valueOf(boolean)</tt>. Returns <tt>"null"</tt> if
* <tt>a</tt> is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(boolean[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements are
* separated by the characters <tt>", "</tt> (a comma followed by a
* space). Elements are converted to strings as by
* <tt>String.valueOf(float)</tt>. Returns <tt>"null"</tt> if <tt>a</tt>
* is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(float[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* The string representation consists of a list of the array's elements,
* enclosed in square brackets (<tt>"[]"</tt>). Adjacent elements are
* separated by the characters <tt>", "</tt> (a comma followed by a
* space). Elements are converted to strings as by
* <tt>String.valueOf(double)</tt>. Returns <tt>"null"</tt> if <tt>a</tt>
* is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @since 1.5
*/
public static String toString(double[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the contents of the specified array.
* If the array contains other arrays as elements, they are converted to
* strings by the {@link Object#toString} method inherited from
* <tt>Object</tt>, which describes their <i>identities</i> rather than
* their contents.
*
* <p>The value returned by this method is equal to the value that would
* be returned by <tt>Arrays.asList(a).toString()</tt>, unless <tt>a</tt>
* is <tt>null</tt>, in which case <tt>"null"</tt> is returned.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @see #deepToString(Object[])
* @since 1.5
*/
/**
* 打印数组 不适用于嵌套数组
*/
public static String toString(Object[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(String.valueOf(a[i]));
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}
/**
* Returns a string representation of the "deep contents" of the specified
* array. If the array contains other arrays as elements, the string
* representation contains their contents and so on. This method is
* designed for converting multidimensional arrays to strings.
*
* <p>The string representation consists of a list of the array's
* elements, enclosed in square brackets (<tt>"[]"</tt>). Adjacent
* elements are separated by the characters <tt>", "</tt> (a comma
* followed by a space). Elements are converted to strings as by
* <tt>String.valueOf(Object)</tt>, unless they are themselves
* arrays.
*
* <p>If an element <tt>e</tt> is an array of a primitive type, it is
* converted to a string as by invoking the appropriate overloading of
* <tt>Arrays.toString(e)</tt>. If an element <tt>e</tt> is an array of a
* reference type, it is converted to a string as by invoking
* this method recursively.
*
* <p>To avoid infinite recursion, if the specified array contains itself
* as an element, or contains an indirect reference to itself through one
* or more levels of arrays, the self-reference is converted to the string
* <tt>"[...]"</tt>. For example, an array containing only a reference
* to itself would be rendered as <tt>"[[...]]"</tt>.
*
* <p>This method returns <tt>"null"</tt> if the specified array
* is <tt>null</tt>.
*
* @param a the array whose string representation to return
* @return a string representation of <tt>a</tt>
* @see #toString(Object[])
* @since 1.5
*/
/**
* Obj数组转为String 适用于数组里面嵌数组
*/
public static String deepToString(Object[] a) {
if (a == null)
return "null";
int bufLen = 20 * a.length;
if (a.length != 0 && bufLen <= 0)
bufLen = Integer.MAX_VALUE;
StringBuilder buf = new StringBuilder(bufLen);
deepToString(a, buf, new HashSet<Object[]>());
return buf.toString();
}
private static void deepToString(Object[] a, StringBuilder buf,
Set<Object[]> dejaVu) {
if (a == null) {
buf.append("null");
return;
}
int iMax = a.length - 1;
if (iMax == -1) {
buf.append("[]");
return;
}
dejaVu.add(a);
buf.append('[');
for (int i = 0; ; i++) {
Object element = a[i];
if (element == null) {
buf.append("null");
} else {
Class<?> eClass = element.getClass();
if (eClass.isArray()) {
if (eClass == byte[].class)
buf.append(toString((byte[]) element));
else if (eClass == short[].class)
buf.append(toString((short[]) element));
else if (eClass == int[].class)
buf.append(toString((int[]) element));
else if (eClass == long[].class)
buf.append(toString((long[]) element));
else if (eClass == char[].class)
buf.append(toString((char[]) element));
else if (eClass == float[].class)
buf.append(toString((float[]) element));
else if (eClass == double[].class)
buf.append(toString((double[]) element));
else if (eClass == boolean[].class)
buf.append(toString((boolean[]) element));
else { // element is an array of object references
if (dejaVu.contains(element))
buf.append("[...]");
else
deepToString((Object[])element, buf, dejaVu);
}
} else { // element is non-null and not an array
buf.append(element.toString());
}
}
if (i == iMax)
break;
buf.append(", ");
}
buf.append(']');
dejaVu.remove(a);
}
/**
* Set all elements of the specified array, using the provided
* generator function to compute each element.
*
* <p>If the generator function throws an exception, it is relayed to
* the caller and the array is left in an indeterminate state.
*
* @param <T> type of elements of the array
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static <T> void setAll(T[] array, IntFunction<? extends T> generator) {
Objects.requireNonNull(generator);
for (int i = 0; i < array.length; i++)
array[i] = generator.apply(i);
}
/**
* Set all elements of the specified array, in parallel, using the
* provided generator function to compute each element.
*
* <p>If the generator function throws an exception, an unchecked exception
* is thrown from {@code parallelSetAll} and the array is left in an
* indeterminate state.
*
* @param <T> type of elements of the array
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static <T> void parallelSetAll(T[] array, IntFunction<? extends T> generator) {
Objects.requireNonNull(generator);
IntStream.range(0, array.length).parallel().forEach(i -> { array[i] = generator.apply(i); });
}
/**
* Set all elements of the specified array, using the provided
* generator function to compute each element.
*
* <p>If the generator function throws an exception, it is relayed to
* the caller and the array is left in an indeterminate state.
*
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static void setAll(int[] array, IntUnaryOperator generator) {
Objects.requireNonNull(generator);
for (int i = 0; i < array.length; i++)
array[i] = generator.applyAsInt(i);
}
/**
* Set all elements of the specified array, in parallel, using the
* provided generator function to compute each element.
*
* <p>If the generator function throws an exception, an unchecked exception
* is thrown from {@code parallelSetAll} and the array is left in an
* indeterminate state.
*
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static void parallelSetAll(int[] array, IntUnaryOperator generator) {
Objects.requireNonNull(generator);
IntStream.range(0, array.length).parallel().forEach(i -> { array[i] = generator.applyAsInt(i); });
}
/**
* Set all elements of the specified array, using the provided
* generator function to compute each element.
*
* <p>If the generator function throws an exception, it is relayed to
* the caller and the array is left in an indeterminate state.
*
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static void setAll(long[] array, IntToLongFunction generator) {
Objects.requireNonNull(generator);
for (int i = 0; i < array.length; i++)
array[i] = generator.applyAsLong(i);
}
/**
* Set all elements of the specified array, in parallel, using the
* provided generator function to compute each element.
*
* <p>If the generator function throws an exception, an unchecked exception
* is thrown from {@code parallelSetAll} and the array is left in an
* indeterminate state.
*
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static void parallelSetAll(long[] array, IntToLongFunction generator) {
Objects.requireNonNull(generator);
IntStream.range(0, array.length).parallel().forEach(i -> { array[i] = generator.applyAsLong(i); });
}
/**
* Set all elements of the specified array, using the provided
* generator function to compute each element.
*
* <p>If the generator function throws an exception, it is relayed to
* the caller and the array is left in an indeterminate state.
*
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static void setAll(double[] array, IntToDoubleFunction generator) {
Objects.requireNonNull(generator);
for (int i = 0; i < array.length; i++)
array[i] = generator.applyAsDouble(i);
}
/**
* Set all elements of the specified array, in parallel, using the
* provided generator function to compute each element.
*
* <p>If the generator function throws an exception, an unchecked exception
* is thrown from {@code parallelSetAll} and the array is left in an
* indeterminate state.
*
* @param array array to be initialized
* @param generator a function accepting an index and producing the desired
* value for that position
* @throws NullPointerException if the generator is null
* @since 1.8
*/
public static void parallelSetAll(double[] array, IntToDoubleFunction generator) {
Objects.requireNonNull(generator);
IntStream.range(0, array.length).parallel().forEach(i -> { array[i] = generator.applyAsDouble(i); });
}
/**
* Returns a {@link Spliterator} covering all of the specified array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param <T> type of elements
* @param array the array, assumed to be unmodified during use
* @return a spliterator for the array elements
* @since 1.8
*/
public static <T> Spliterator<T> spliterator(T[] array) {
return Spliterators.spliterator(array,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a {@link Spliterator} covering the specified range of the
* specified array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param <T> type of elements
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return a spliterator for the array elements
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static <T> Spliterator<T> spliterator(T[] array, int startInclusive, int endExclusive) {
return Spliterators.spliterator(array, startInclusive, endExclusive,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a {@link Spliterator.OfInt} covering all of the specified array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param array the array, assumed to be unmodified during use
* @return a spliterator for the array elements
* @since 1.8
*/
public static Spliterator.OfInt spliterator(int[] array) {
return Spliterators.spliterator(array,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a {@link Spliterator.OfInt} covering the specified range of the
* specified array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return a spliterator for the array elements
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static Spliterator.OfInt spliterator(int[] array, int startInclusive, int endExclusive) {
return Spliterators.spliterator(array, startInclusive, endExclusive,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a {@link Spliterator.OfLong} covering all of the specified array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param array the array, assumed to be unmodified during use
* @return the spliterator for the array elements
* @since 1.8
*/
public static Spliterator.OfLong spliterator(long[] array) {
return Spliterators.spliterator(array,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a {@link Spliterator.OfLong} covering the specified range of the
* specified array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return a spliterator for the array elements
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static Spliterator.OfLong spliterator(long[] array, int startInclusive, int endExclusive) {
return Spliterators.spliterator(array, startInclusive, endExclusive,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a {@link Spliterator.OfDouble} covering all of the specified
* array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param array the array, assumed to be unmodified during use
* @return a spliterator for the array elements
* @since 1.8
*/
public static Spliterator.OfDouble spliterator(double[] array) {
return Spliterators.spliterator(array,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a {@link Spliterator.OfDouble} covering the specified range of
* the specified array.
*
* <p>The spliterator reports {@link Spliterator#SIZED},
* {@link Spliterator#SUBSIZED}, {@link Spliterator#ORDERED}, and
* {@link Spliterator#IMMUTABLE}.
*
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return a spliterator for the array elements
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static Spliterator.OfDouble spliterator(double[] array, int startInclusive, int endExclusive) {
return Spliterators.spliterator(array, startInclusive, endExclusive,
Spliterator.ORDERED | Spliterator.IMMUTABLE);
}
/**
* Returns a sequential {@link Stream} with the specified array as its
* source.
*
* @param <T> The type of the array elements
* @param array The array, assumed to be unmodified during use
* @return a {@code Stream} for the array
* @since 1.8
*/
public static <T> Stream<T> stream(T[] array) {
return stream(array, 0, array.length);
}
/**
* Returns a sequential {@link Stream} with the specified range of the
* specified array as its source.
*
* @param <T> the type of the array elements
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return a {@code Stream} for the array range
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static <T> Stream<T> stream(T[] array, int startInclusive, int endExclusive) {
return StreamSupport.stream(spliterator(array, startInclusive, endExclusive), false);
}
/**
* Returns a sequential {@link IntStream} with the specified array as its
* source.
*
* @param array the array, assumed to be unmodified during use
* @return an {@code IntStream} for the array
* @since 1.8
*/
public static IntStream stream(int[] array) {
return stream(array, 0, array.length);
}
/**
* Returns a sequential {@link IntStream} with the specified range of the
* specified array as its source.
*
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return an {@code IntStream} for the array range
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static IntStream stream(int[] array, int startInclusive, int endExclusive) {
return StreamSupport.intStream(spliterator(array, startInclusive, endExclusive), false);
}
/**
* Returns a sequential {@link LongStream} with the specified array as its
* source.
*
* @param array the array, assumed to be unmodified during use
* @return a {@code LongStream} for the array
* @since 1.8
*/
public static LongStream stream(long[] array) {
return stream(array, 0, array.length);
}
/**
* Returns a sequential {@link LongStream} with the specified range of the
* specified array as its source.
*
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return a {@code LongStream} for the array range
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static LongStream stream(long[] array, int startInclusive, int endExclusive) {
return StreamSupport.longStream(spliterator(array, startInclusive, endExclusive), false);
}
/**
* Returns a sequential {@link DoubleStream} with the specified array as its
* source.
*
* @param array the array, assumed to be unmodified during use
* @return a {@code DoubleStream} for the array
* @since 1.8
*/
public static DoubleStream stream(double[] array) {
return stream(array, 0, array.length);
}
/**
* Returns a sequential {@link DoubleStream} with the specified range of the
* specified array as its source.
*
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last index to cover
* @return a {@code DoubleStream} for the array range
* @throws ArrayIndexOutOfBoundsException if {@code startInclusive} is
* negative, {@code endExclusive} is less than
* {@code startInclusive}, or {@code endExclusive} is greater than
* the array size
* @since 1.8
*/
public static DoubleStream stream(double[] array, int startInclusive, int endExclusive) {
return StreamSupport.doubleStream(spliterator(array, startInclusive, endExclusive), false);
}
}
| [
"ffj0721@163.com"
] | ffj0721@163.com |
ea8f71c43153f7306d7665cce55ea094a219cd50 | f55e0f08bbbbde3bbf06b83c822a93d54819b1e8 | /livebody_verify_lib/src/main/java/com/jqsoft/livebody_verify_lib/certificateCamera/CameraPreview.java | 83e392e205ae6d2f93c1be2c2d377a43b02f779b | [] | no_license | moshangqianye/nursing | 27e58e30a51424502f1b636ae47b60b81a3b2ca0 | 20cd5aace59555ef9d708df0fb03639b2fc843d0 | refs/heads/master | 2020-09-08T13:39:55.939252 | 2020-03-20T09:55:34 | 2020-03-20T09:55:34 | 221,147,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,481 | java | package com.jqsoft.livebody_verify_lib.certificateCamera;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.hardware.Camera;
import android.os.Build;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import java.util.List;
/**
* Created by smartown on 2018/2/24 11:46.
* <br>
* Desc:
* <br>
* 相机预览封装
*/
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private static String TAG = CameraPreview.class.getName();
private Camera camera;
public CameraPreview(Context context) {
super(context);
init();
}
public CameraPreview(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public CameraPreview(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public CameraPreview(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init();
}
private void init() {
SurfaceHolder surfaceHolder = getHolder();
surfaceHolder.addCallback(this);
surfaceHolder.setKeepScreenOn(true);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
public void surfaceCreated(SurfaceHolder holder) {
camera = CameraUtils.openCamera();
if (camera != null) {
try {
camera.setPreviewDisplay(holder);
Camera.Parameters parameters = camera.getParameters();
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
//竖屏拍照时,需要设置旋转90度,否者看到的相机预览方向和界面方向不相同
camera.setDisplayOrientation(90);
parameters.setRotation(90);
} else {
camera.setDisplayOrientation(0);
parameters.setRotation(0);
}
Camera.Size bestSize = getBestSize(parameters.getSupportedPreviewSizes());
if (bestSize != null) {
parameters.setPreviewSize(bestSize.width, bestSize.height);
parameters.setPictureSize(bestSize.width, bestSize.height);
} else {
parameters.setPreviewSize(1920, 1080);
parameters.setPictureSize(1920, 1080);
}
camera.setParameters(parameters);
camera.startPreview();
focus();
} catch (Exception e) {
Log.d(TAG, "Error setting camera preview: " + e.getMessage());
try {
Camera.Parameters parameters = camera.getParameters();
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
//竖屏拍照时,需要设置旋转90度,否者看到的相机预览方向和界面方向不相同
camera.setDisplayOrientation(90);
parameters.setRotation(90);
} else {
camera.setDisplayOrientation(0);
parameters.setRotation(0);
}
camera.setParameters(parameters);
camera.startPreview();
focus();
} catch (Exception e1) {
e.printStackTrace();
camera = null;
}
}
}
}
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
//因为设置了固定屏幕方向,所以在实际使用中不会触发这个方法
}
public void surfaceDestroyed(SurfaceHolder holder) {
//回收释放资源
release();
}
/**
* Android相机的预览尺寸都是4:3或者16:9,这里遍历所有支持的预览尺寸,得到16:9的最大尺寸,保证成像清晰度
*
* @param sizes
* @return 最佳尺寸
*/
private Camera.Size getBestSize(List<Camera.Size> sizes) {
Camera.Size bestSize = null;
for (Camera.Size size : sizes) {
if ((float) size.width / (float) size.height == 16.0f / 9.0f) {
if (bestSize == null) {
bestSize = size;
} else {
if (size.width > bestSize.width) {
bestSize = size;
}
}
}
}
return bestSize;
}
/**
* 释放资源
*/
private void release() {
if (camera != null) {
camera.stopPreview();
camera.release();
camera = null;
}
}
/**
* 对焦,在CameraActivity中触摸对焦
*/
public void focus() {
if (camera != null) {
camera.autoFocus(null);
}
}
/**
* 开关闪光灯
*
* @return 闪光灯是否开启
*/
public boolean switchFlashLight() {
if (camera != null) {
try {
Camera.Parameters parameters = camera.getParameters();
if (TextUtils.equals(parameters.getFlashMode(),Camera.Parameters.FLASH_MODE_OFF)) {
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
camera.setParameters(parameters);
return true;
} else {
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
camera.setParameters(parameters);
return false;
}
}catch (Exception e){
e.printStackTrace();
}
}
return false;
}
/**
* 拍摄照片
*
* @param pictureCallback 在pictureCallback处理拍照回调
*/
public void takePhoto(Camera.PictureCallback pictureCallback) {
if (camera != null) {
camera.takePicture(null, null, pictureCallback);
}
}
public void startPreview() {
if (camera != null) {
camera.startPreview();
}
}
}
| [
"123456"
] | 123456 |
e89ca78f3ff20f0a9360382a3d6bc393b2b1196d | 5841ebcb90abaad976c31e1929f72de86a30397b | /likp_ai/trunk/webproject/src/main/java/com/lkp/dao/TlkUserwechatinfoEntityDao.java | ceec62215524900266cd4a5f58b6d37326401036 | [] | no_license | JustForMyDream/lkp_ai | 4e95a375f07449221ef0111e5cfa787d93800bfc | 96f8b24abe9fc6f67814a7eab2a139677df952e0 | refs/heads/master | 2021-07-09T12:24:47.790259 | 2017-10-08T08:57:29 | 2017-10-08T08:57:29 | 106,161,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 382 | java | package com.lkp.dao;
import com.lkp.entity.TlkUserwechatinfoEntity;
/**
*
* 用户微信信息dao
*/
public interface TlkUserwechatinfoEntityDao extends BaseDao<TlkUserwechatinfoEntity> {
/**
* 通过openid获取用户和微信信息的关联
* @param openid
* @return
*/
TlkUserwechatinfoEntity getTlkUserwechatinfoEntityByOpenid(String openid);
}
| [
"2589475332@qq.com"
] | 2589475332@qq.com |
15489022434614d9251baf3b9249eb231feabcd1 | 5d18b51594438f35d3d94d831a37f4c639520de8 | /ggitlab/src/main/java/ggitlab/utils/FindPasswordValidator.java | 0093841ab93bb4fa684d4c1e3a7db4b5e7119fa9 | [] | no_license | RokcSSGChae/authorization-service | 14da2e27f80d39c62ccb59011a2ff07203be86d0 | 732a670807d233232ab35677133d47d9c1c04d41 | refs/heads/main | 2023-02-08T07:36:06.724182 | 2020-12-31T00:52:21 | 2020-12-31T00:52:21 | 321,522,960 | 0 | 0 | null | 2020-12-21T03:08:26 | 2020-12-15T01:50:12 | Java | UTF-8 | Java | false | false | 1,000 | java | package ggitlab.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
import ggitlab.domain.FindPasswordRequest;
@Component
public class FindPasswordValidator implements Validator {
private static final String EMAIL_REGEX = "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$";
private Pattern emailPattern;
public FindPasswordValidator() {
emailPattern = Pattern.compile(EMAIL_REGEX, Pattern.CASE_INSENSITIVE);
}
@Override
public boolean supports(Class<?> clazz) {
return FindPasswordRequest.class.isAssignableFrom(clazz);
}
@Override
public void validate(Object target, Errors errors) {
FindPasswordRequest fpReq = (FindPasswordRequest) target;
Matcher matcher = emailPattern.matcher(fpReq.getEmail());
if (!matcher.matches()) {
errors.rejectValue("email", "bad", "Please provide a valid email address.");
}
}
}
| [
"seokcpark@smilegate.com"
] | seokcpark@smilegate.com |
8639766a7d6b138e8c0da54823772f19dff18d6e | 3964b3bf58055a48d08eefc9e140f5969ad5eef3 | /leyou/ly-sms/src/main/java/com/leyou/sms/utils/SmsUtil.java | 61a99dc30bcc82b36cf650f34bc4dbf0d86c4d1f | [] | no_license | Burden1/leyou | 9237fe6f224b89717748ad30517849069fb2efe3 | ee56e1d77985b6895525289faae89e06e12b063e | refs/heads/master | 2023-03-13T16:45:47.883219 | 2020-07-16T07:55:57 | 2020-07-16T07:55:57 | 207,065,620 | 1 | 0 | null | 2022-12-09T00:42:51 | 2019-09-08T05:20:01 | JavaScript | UTF-8 | Java | false | false | 4,923 | java | package com.leyou.sms.utils;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.leyou.sms.config.SmsProperties;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* 发送消息
*/
@Slf4j
@Component
@EnableConfigurationProperties(SmsProperties.class)
public class SmsUtil {
@Autowired
private SmsProperties prop;
@Autowired
private StringRedisTemplate redisTemplate;
private static final String KEY_PREFIX = "sms:phone";
private static final long SMS_MIN_INTERVAL_IN_MILLIS = 60000L;
//初始化ascClient需要的几个参数
final String product = "Dysmsapi";//短信API产品名称(短信产品名固定,无需修改)
final String domain = "dysmsapi.aliyuncs.com";//短信API产品域名(接口地址固定,无需修改)
public SendSmsResponse sendSms(String phoneNumber, String signName, String templateCode,
String templateParam) {
String key = KEY_PREFIX + phoneNumber;
// 读取时间
String lastTime = redisTemplate.opsForValue().get(key);
if (StringUtils.isNotBlank(lastTime)) {
Long last = Long.valueOf(lastTime);
if (System.currentTimeMillis() - last < SMS_MIN_INTERVAL_IN_MILLIS) {
log.info("[短信服务] 发送短信频率过高, 被拦截, 手机号码: {}", phoneNumber);
return null;
}
}
try {
// 设置超时时间-可自行调整
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//初始化ascClient,暂时不支持多region(请勿修改)
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", prop.getAccessKeyId(),
prop.getAccessKeySecret());
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain);
IAcsClient acsClient = new DefaultAcsClient(profile);
// 组装请求对象
SendSmsRequest request = new SendSmsRequest();
// 使用post提交
request.setMethod(MethodType.POST);
// 必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式;发送国际/港澳台消息时,接收号码格式为国际区号+号码,如“85200000000”
request.setPhoneNumbers(phoneNumber);
// 必填:短信签名-可在短信控制台中找到
request.setSignName(signName);
// 必填:短信模板-可在短信控制台中找到,发送国际/港澳台消息时,请使用国际/港澳台短信模版
request.setTemplateCode(templateCode);
// 可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
// 友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\\r\\n,否则会导致JSON在服务端解析失败
request.setTemplateParam(templateParam);
//请求失败这里会抛ClientException异常
SendSmsResponse resp = acsClient.getAcsResponse(request);
if (!"OK".equals(resp.getCode())) {
log.error("[短信服务] 发送短信失败, phoneNumber: {}, 原因: {}", phoneNumber, resp.getMessage());
}
log.info("[短信服务], 发送短信验证码, 手机号:{}", phoneNumber);
// 发送短信成功后, 写入redis, 指定生存时间为1分钟
// 写入发送该条短信的时间, 因为一分钟之内只能发一条短信
redisTemplate.opsForValue().set(key, String.valueOf(System.currentTimeMillis()), 1, TimeUnit.MINUTES);
return resp;
} catch (ClientException e) {
log.error("[短信服务] 发送短信异常, 手机号码:{}", phoneNumber, e);
}
return null;
}
} | [
"739313988@qq.com"
] | 739313988@qq.com |
b8a7ba99b860a3184b30f24aa0fd4125b7c8c2e8 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_5564d300d2506252c0e7d4e6a39939cc95580ca2/ConnectionServiceRequesterV2/3_5564d300d2506252c0e7d4e6a39939cc95580ca2_ConnectionServiceRequesterV2_t.java | 65767337762f53335c9c22915706b5690be17199 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 10,010 | java | /**
* Copyright (c) 2012, SURFnet BV
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.
* * Neither the name of the SURFnet BV nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package nl.surfnet.bod.nsi.v2;
import static com.google.common.collect.Lists.transform;
import static nl.surfnet.bod.nsi.v2.ConnectionsV2.toQuerySummaryResultType;
import static nl.surfnet.bod.nsi.v2.ConnectionsV2.toStpType;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import javax.annotation.Resource;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Holder;
import nl.surfnet.bod.domain.ConnectionV2;
import nl.surfnet.bod.domain.NsiRequestDetails;
import nl.surfnet.bod.repo.ConnectionV2Repo;
import nl.surfnet.bod.util.XmlUtils;
import org.joda.time.DateTime;
import org.ogf.schemas.nsi._2013._04.connection.requester.ConnectionRequesterPort;
import org.ogf.schemas.nsi._2013._04.connection.requester.ConnectionServiceRequester;
import org.ogf.schemas.nsi._2013._04.connection.requester.ServiceException;
import org.ogf.schemas.nsi._2013._04.connection.types.DataPlaneStatusType;
import org.ogf.schemas.nsi._2013._04.connection.types.DirectionalityType;
import org.ogf.schemas.nsi._2013._04.connection.types.LifecycleStateEnumType;
import org.ogf.schemas.nsi._2013._04.connection.types.PathType;
import org.ogf.schemas.nsi._2013._04.connection.types.ProvisionStateEnumType;
import org.ogf.schemas.nsi._2013._04.connection.types.QuerySummaryResultType;
import org.ogf.schemas.nsi._2013._04.connection.types.ReservationConfirmCriteriaType;
import org.ogf.schemas.nsi._2013._04.connection.types.ReservationStateEnumType;
import org.ogf.schemas.nsi._2013._04.connection.types.ScheduleType;
import org.ogf.schemas.nsi._2013._04.framework.headers.CommonHeaderType;
import org.ogf.schemas.nsi._2013._04.framework.types.TypeValuePairListType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Component;
import com.google.common.collect.ImmutableList;
@Component("connectionServiceRequesterV2")
public class ConnectionServiceRequesterV2 {
private static final String WSDL_LOCATION = "/wsdl/2.0/ogf_nsi_connection_requester_v2_0.wsdl";
private final Logger log = LoggerFactory.getLogger(ConnectionServiceRequesterV2.class);
@Resource private ConnectionV2Repo connectionRepo;
public void reserveConfirmed(Long connectionId, NsiRequestDetails requestDetails) {
ConnectionV2 connection = connectionRepo.findOne(connectionId);
connection.setReservationState(ReservationStateEnumType.RESERVE_HELD);
connectionRepo.save(connection);
log.info("Sending a reserveConfirmed on endpoint: {} for connectionId: {}", requestDetails.getReplyTo(), connection.getConnectionId());
ReservationConfirmCriteriaType criteria = new ReservationConfirmCriteriaType()
.withBandwidth(connection.getDesiredBandwidth())
.withPath(new PathType()
.withSourceSTP(toStpType(connection.getSourceStpId()))
.withDestSTP(toStpType(connection.getDestinationStpId()))
.withDirectionality(DirectionalityType.BIDIRECTIONAL))
.withSchedule(new ScheduleType()
.withEndTime(XmlUtils.toGregorianCalendar(connection.getEndTime().get()))
.withStartTime(XmlUtils.toGregorianCalendar(connection.getStartTime().get())))
.withServiceAttributes(new TypeValuePairListType())
.withVersion(0);
Holder<CommonHeaderType> headerHolder = createHeader(requestDetails, connection);
ConnectionRequesterPort port = createPort(requestDetails);
try {
port.reserveConfirmed(
connection.getConnectionId(),
connection.getGlobalReservationId(),
connection.getDescription(),
ImmutableList.of(criteria),
headerHolder);
} catch (ServiceException e) {
log.info("Sending reserve confirmed failed", e);
}
}
public void abortConfirmed(Long connectionId, NsiRequestDetails requestDetails) {
ConnectionV2 connection = connectionRepo.findOne(connectionId);
connection.setReservationState(ReservationStateEnumType.RESERVED);
connectionRepo.save(connection);
ConnectionRequesterPort port = createPort(requestDetails);
try {
port.reserveAbortConfirmed(connection.getConnectionId(), createHeader(requestDetails, connection));
} catch (ServiceException e) {
log.info("Sending Reserve Abort Confirmed failed", e);
}
}
public void terminateConfirmed(Long connectionId, NsiRequestDetails requestDetails) {
ConnectionV2 connection = connectionRepo.findOne(connectionId);
connection.setLifecycleState(LifecycleStateEnumType.TERMINATED);
connectionRepo.save(connection);
ConnectionRequesterPort port = createPort(requestDetails);
try {
port.terminateConfirmed(connection.getConnectionId(), createHeader(requestDetails, connection));
} catch (ServiceException e) {
log.info("Sending Terminate Confirmed failed", e);
}
}
public void reserveCommitConfirmed(Long connectionId, NsiRequestDetails requestDetails) {
ConnectionV2 connection = connectionRepo.findOne(connectionId);
connection.setReservationState(ReservationStateEnumType.RESERVED);
connection.setProvisionState(ProvisionStateEnumType.RELEASED);
connectionRepo.save(connection);
ConnectionRequesterPort port = createPort(requestDetails);
try {
port.reserveCommitConfirmed(connection.getConnectionId(), createHeader(requestDetails, connection));
} catch (ServiceException e) {
log.info("Sending Reserve Commit failed", e);
}
}
public void provisionConfirmed(Long connectionId, NsiRequestDetails requestDetails) {
ConnectionV2 connection = connectionRepo.findOne(connectionId);
connection.setProvisionState(ProvisionStateEnumType.PROVISIONED);
connectionRepo.save(connection);
ConnectionRequesterPort port = createPort(requestDetails);
try {
port.provisionConfirmed(connection.getConnectionId(), createHeader(requestDetails, connection));
} catch (ServiceException e) {
log.info("Sending Provision Confirmed failed", e);
}
}
public void dataPlaneActivated(Long connectionId, NsiRequestDetails requestDetails) {
ConnectionV2 connection = connectionRepo.findOne(connectionId);
DataPlaneStatusType dataPlaneStatus = new DataPlaneStatusType().withActive(true).withVersion(0).withVersionConsistent(true);
XMLGregorianCalendar timeStamp = XmlUtils.toGregorianCalendar(DateTime.now());
Holder<CommonHeaderType> header = createHeader(requestDetails, connection);
ConnectionRequesterPort port = createPort(requestDetails);
try {
port.dataPlaneStateChange(connection.getConnectionId(), dataPlaneStatus, timeStamp, header);
} catch (ServiceException e) {
log.info("Failed to send Data Plane State Change");
}
}
public void querySummaryConfirmed(List<ConnectionV2> connections, NsiRequestDetails requestDetails) {
List<QuerySummaryResultType> results = transform(connections, toQuerySummaryResultType);
ConnectionRequesterPort port = createPort(requestDetails);
try {
// FIXME requersterNsa and providerNsa, connection can be null
port.querySummaryConfirmed(results, createHeader(requestDetails, connections.get(0)));
} catch (ServiceException e) {
log.info("Failed to send query summary confirmed", e);
}
}
private Holder<CommonHeaderType> createHeader(NsiRequestDetails requestDetails, ConnectionV2 connection) {
return new Holder<>(new CommonHeaderType()
.withCorrelationId(requestDetails.getCorrelationId())
.withProtocolVersion("urn:2.0:FIXME")
.withProviderNSA(connection.getProviderNsa())
.withRequesterNSA(connection.getRequesterNsa()));
}
private ConnectionRequesterPort createPort(NsiRequestDetails requestDetails) {
ConnectionRequesterPort port = new ConnectionServiceRequester(wsdlUrl()).getConnectionServiceRequesterPort();
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestDetails.getReplyTo());
return port;
}
private URL wsdlUrl() {
try {
return new ClassPathResource(WSDL_LOCATION).getURL();
}
catch (IOException e) {
throw new RuntimeException("Could not find the requester wsdl", e);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
6f4d7a2057bdcfaee95214730ea9cef9a3761796 | ba2d191efc7f20d2da4d76c24a75b27078a3fdbe | /src/main/java/com/dakuupa/pulsar/annotations/DbIgnore.java | 1bd41f3e8fb26bfee9568255112b4228eee47b30 | [] | no_license | etwilliams/pulsar-db | a530b7ce80083c5c0aa5342cb10c7a5dfd30360f | 8a179829de2fec914d656300a4e82463f7a8c982 | refs/heads/master | 2020-09-25T03:02:12.910394 | 2019-07-24T15:36:17 | 2019-07-24T15:36:17 | 225,902,954 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.dakuupa.pulsar.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation to ignore field
* @author EWilliams
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface DbIgnore {
}
| [
"eric.williams@globalstar.com"
] | eric.williams@globalstar.com |
2ca7cc8043397e6d8a836092044b0b7293e68d51 | 8a19235027c244fd6faee1b95ea973a760c66ce8 | /src/main/java/water/exec/Exec2.java | 50ac00bf50622246dd4b13f1d8334242062a4636 | [
"Apache-2.0"
] | permissive | MaheedharGunturu/h2o | 8add64e44488260b43fbecdd8ceb4b90cd1ac2e1 | ff523036aed1c3060510c71bfe015b545870c0a7 | refs/heads/master | 2021-01-15T09:41:56.746708 | 2013-10-27T21:53:47 | 2013-10-27T21:57:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,877 | java | package water.exec;
import java.text.*;
import java.util.Arrays;
import java.util.HashMap;
import water.*;
import water.fvec.*;
/** Execute a generic R string, in the context of an H2O Cloud
* @author cliffc@0xdata.com
*/
public class Exec2 {
// Parse a string, execute it & return a Frame.
// Grammer:
// statements := cxexpr ; statements
// cxexpr := // COMPLEX expr
// key_slice = cxexpr // subset assignment; must be equal shapes
// id = cxexpr // temp typed assignment; dropped when scope exits
// expr
// expr op2 cxexpr // apply(op2,expr,cxexpr); ....optional INFIX notation
// expr0 ? expr : expr // exprs must have *compatible* shapes
// expr := // expr is a Frame, a 2-d table
// num // Scalars, treated as 1x1
// id // any visible var; will be typed
// key_slice // Rectangular R-value
// function(v0,v1,v2) { statements; ...v0,v1,v2... } // 1st-class lexically scoped functions
// ( cxexpr ) // Ordering evaluation
// ifelse(expr0,cxexpr,cxexpr) // exprs must have *compatible* shapes
// apply(op,cxexpr,...)// Apply function op to args
// key_slice :=
// key // A Frame, dimensions stored in K/V already
// key [expr1,expr1] // slice rows & cols by index
// key [expr1,expr1] // subset assignment of *same* shape
// key [,expr1] // subset assignment of *same* shape
// key [expr1,] // subset assignment of *same* shape
// key := any Key mapping to a Frame.
// func1:= {id -> expr0} // user function; id will be a scalar in expr0
// op1 := func1 sgn sin cos ...any unary op...
// func2:= {id,id -> expr0} // user reduction function; id will be a scalar in expr0
// op2 := func2 min max + - * / % & | ...any boolean op...
// func3:= {id -> expr1} // id will be an expr1
//
// same shape == same rows, same cols
// compatible shape == same shape, or (1 row x same cols), (same rows x 1 cols), or 1x1
//
// Example: Compute mean for each col:
// means = apply1(+,fr)/nrows(fr)
// Example: Replace NA's with 0:
// {x -> isna(x) ? 0 : x}(fr)
// Example: Replace NA's with mean:
// apply1({col -> mean=apply1(+,col)/nrows(col); apply1({x->isna(x)?mean:x},col) },fr)
public static Frame exec( String str ) throws IllegalArgumentException {
AST ast = new Exec2(str).parse();
System.out.println(ast.toString(new StringBuilder(),0).toString());
Vec.VectorGroup vg = new Vec.VectorGroup();
Exec2 res = ast.exec(vg);
if( res._fr != null ) return res._fr;
return new Frame(new String[]{"result"},
new Vec[]{new Vec(vg.addVecs(1)[0],res._d)});
}
private Exec2( String str ) { _str = str; _buf = str.toCharArray(); }
private Exec2( double d ) { _str=null; _buf=null; _d=d; }
private Exec2( Frame fr ) { _str=null; _buf=null; _fr=fr; }
// Simple parser state
final String _str;
final char _buf[];
int _x;
// Simple execution state
Frame _fr; // For Big Data
double _d; // For little Data
AST _fun; // 1st-class Function-as-data
private AST parse() {
AST ast = AST.parseCXExpr(this);
skipWS(); // No trailing crud
return _x == _buf.length ? ast : throwErr("Junk at end of line",_buf.length-1);
}
// --------------------------------------------------------------------------
private void skipWS() {
while( _x < _buf.length && _buf[_x] <= ' ' ) _x++;
}
// Skip whitespace.
// If c is the next char, eat it & return true
// Else return false.
private boolean peek(char c) {
if( _x ==_buf.length ) return false;
while( _buf[_x] <= ' ' )
if( ++_x ==_buf.length ) return false;
if( _buf[_x]!=c ) return false;
_x++;
return true;
}
// Same as peek, but throw if char not found
private AST xpeek(char c, int x, AST ast) { return peek(c) ? ast : throwErr("Missing '"+c+"'",x); }
// Return an ID string, or null if we get weird stuff or numbers. Valid IDs
// include all the operators, except parens (function application) and assignment.
// Valid IDs: + ++ <= > ! [ ] joe123 ABC
// Invalid : +++ 0joe ( = ) 123.45 1e3
private String isID() {
skipWS();
if( _x>=_buf.length ) return null; // No characters to parse
char c = _buf[_x];
// Fail on special chars in the grammer
if( isReserved(c) ) return null;
// Fail on leading numeric
if( isDigit(c) ) return null;
_x++; // Accept parse of 1 char
// If first char is letter, standard ID
if( isLetter(c) ) {
int x=_x-1; // start of ID
while( _x < _buf.length && isLetter2(_buf[_x]) )
_x++;
return _str.substring(x,_x);
}
// If first char is special, accept 1 or 2 special chars
if( _x>=_buf.length ) return _str.substring(_x-1,_x);
char c2=_buf[_x];
if( isDigit(c2) || isLetter(c2) || isWS(c2) || isReserved(c2) ) return _str.substring(_x-1,_x);
_x++;
return _str.substring(_x-2,_x);
}
private static boolean isDigit(char c) { return c>='0' && c<= '9'; }
private static boolean isWS(char c) { return c<=' '; }
private static boolean isReserved(char c) { return c=='(' || c==')' || c=='='; }
private static boolean isLetter(char c) { return (c>='a'&&c<='z') || (c>='A' && c<='Z'); }
private static boolean isLetter2(char c) {
if( c=='.' || c==':' || c=='\\' || c=='/' ) return true;
if( isDigit(c) ) return true;
return isLetter(c);
}
// --------------------------------------------------------------------------
abstract static private class AST implements Cloneable {
// Size, for compatible-shape checking.
final int _cols;
final long _rows;
AST( int cols, long rows ) { _cols=cols; _rows=rows; }
static AST parseCXExpr(Exec2 E ) {
AST ast2, ast = parseExpr(E);
if( ast == null ) return null;
// Can find an infix op between expressions
if( (ast2 = ASTOp.parseInfix(E,ast)) != null ) return ast2;
// Can find '=' between expressions
if( (ast2 = ASTAssign.parse (E,ast)) != null ) return ast2;
if( ast.isScalar() && E.peek('?') ) { throw H2O.unimpl(); } // infix trinary
return ast;
}
static AST parseExpr(Exec2 E ) {
AST ast;
// Simple paren expression
if( E.peek('(') ) return E.xpeek(')',E._x,parseCXExpr(E));
if( (ast = ASTKey.parse(E)) != null ) return ast;
if( (ast = ASTNum.parse(E)) != null ) return ast;
if( (ast = ASTOp .parsePrefix(E)) != null ) return ast;
return null;
}
protected StringBuilder indent( StringBuilder sb, int d ) {
for( int i=0; i<d; i++ ) sb.append(" ");
return sb.append(dimStr()).append(' ');
}
boolean isScalar() { return _cols==1 && _rows==1; }
abstract boolean isPure(); // Side-effect free
Exec2 exec(Vec.VectorGroup vg) {
System.out.println("Exec not impl for: "+getClass());
throw H2O.unimpl();
}
public StringBuilder toString( StringBuilder sb, int d ) { return indent(sb,d).append(this); }
public String dimStr() { return dimStr(_cols,_rows); }
public static String dimStr(int col, long row) {
if( col==0 && row==0 ) return "fun";
assert col >=1 && row >= 1;
return col+"x"+row;
}
}
// --------------------------------------------------------------------------
static private class ASTKey extends AST {
final Key _key;
final AST _colsel, _rowsel; // Row-selection, Col-selection
ASTKey( int cols, long rows, Key key, AST colsel, AST rowsel ) {
super(cols,rows);
_key=key;
_colsel = colsel; _rowsel = rowsel;
}
// Parse a valid H2O Frame Key, or return null;
static ASTKey parse(Exec2 E) {
int x = E._x;
String id = E.isID();
if( id == null ) return null;
Key key = Key.make(id);
Iced ice = UKV.get(key);
if( ice==null || !(ice instanceof Frame) ) { E._x = x; return null; }
Frame fr = (Frame)ice;
AST rows=null, cols=null;
if( E.peek('[') ) { // Subsets?
rows= E.xpeek(',',(x=E._x),parseCXExpr(E));
if( rows != null && rows._cols != 1 ) E.throwErr("Row select only a single column only",x);
cols= E.xpeek(']',(x=E._x),parseCXExpr(E));
if( cols != null && cols._cols != 1 ) E.throwErr("Col select only a single column only",x);
}
return new ASTKey(cols==null?fr.numCols():(int)cols._rows,
rows==null?fr.numRows(): rows._rows,
key,cols,rows);
}
boolean isPure() { return true; }
@Override public String toString() { return _key.toString(); }
@Override public StringBuilder toString( StringBuilder sb, int d ) {
indent(sb,d).append(this);
if( _colsel != null || _rowsel != null ) {
sb.append("[,]\n");
if( _rowsel == null ) indent(sb,d+1).append("all rows\n");
else _rowsel.toString(sb,d+1).append('\n');
if( _colsel == null ) indent(sb,d+1).append("all cols");
else _colsel.toString(sb,d+1);
}
return sb;
}
//@Override Exec2 exec(Vec.VectorGroup vg) {
// if( _colsel != null ) _ecol = _colsel.exec(vg);
// if( _rowsel != null ) _erow = _rowsel.exec(vg);
// if( _ecol == null && _erow == null )
// return new Exec2((Frame)(DKV.get(_key).get()));
// if( _ecol._fr==null && _erow._fr==null )
// throw H2O.unimpl();
// throw H2O.unimpl();
//}
}
// --------------------------------------------------------------------------
static private class ASTAssign extends AST {
final ASTKey _key;
final AST _eval;
ASTAssign( ASTKey key, AST eval ) {
super(key._cols,key._rows);
_key=key; _eval=eval;
}
// Parse a valid H2O Frame Key, or return null;
static ASTAssign parse(Exec2 E, AST ast) {
if( !(ast instanceof ASTKey) ) return null;
if( !E.peek('=') ) return null;
int x = E._x;
AST eval = parseCXExpr(E);
E.throwIfNotCompat(ast,eval,x);
return new ASTAssign((ASTKey)ast,eval);
}
boolean isPure() { return false; }
@Override public String toString() { return "="; }
@Override public StringBuilder toString( StringBuilder sb, int d ) {
indent(sb,d).append(this).append('\n');
_key.toString(sb,d+1).append('\n');
_eval.toString(sb,d+1);
return sb;
}
}
// --------------------------------------------------------------------------
static private class ASTNum extends AST {
static final NumberFormat NF = NumberFormat.getInstance();
static { NF.setGroupingUsed(false); }
final double _d;
ASTNum(double d ) { super(1,1); _d=d; }
// Parse a number, or throw a parse error
static ASTNum parse(Exec2 E) {
ParsePosition pp = new ParsePosition(E._x);
Number N = NF.parse(E._str,pp);
if( pp.getIndex()==E._x ) return null;
assert N instanceof Double || N instanceof Long;
E._x = pp.getIndex();
double d = (N instanceof Double) ? (double)(Double)N : (double)(Long)N;
return new ASTNum(d);
}
boolean isPure() { return true; }
@Override Exec2 exec(Vec.VectorGroup vg) { return new Exec2(_d); }
@Override public String toString() { return Double.toString(_d); }
@Override public StringBuilder toString( StringBuilder sb, int d ) { return indent(sb,d).append(this); }
}
// --------------------------------------------------------------------------
static private class ASTApply extends AST {
final AST _args[];
private ASTApply( AST args[], int cols, long rows ) { super(cols,rows); _args = args; }
// Wrap compatible but different-sized ops in reduce/bulk ops.
static ASTApply make(AST args[],Exec2 E, int x) {
//// 1-arg case; check for size-type operators
//if( args.length==1 ) {
// if( this instanceof ASTNrow || this instanceof ASTNcol ) {
// ASTOp op = make(args,1,1); // Result is always a scalar
// if( !op.isPure() ) E.throwErr("nrow and ncol expressions cannot have side effects",x);
// return op;
// }
//}
// 2-arg case; check for compatible row counts.
// Insert expansion operators as needed.
if( args.length==2 ) {
// if( args[0]._rows != args[1]._rows ) {
// if( args[0]._rows==1 ) args[0] = new ASTByRow(args[0],args[1]._rows);
// else if( args[1]._rows==1 ) args[1] = new ASTByRow(args[1],args[0]._rows);
// else E.throwErr("Mismatch rows: "+args[0]._rows+" and "+args[1]._rows,x);
// }
// if( args[0]._cols != args[1]._cols ) {
// if( args[0]._cols==1 ) args[0] = new ASTByCol(args[0],args[1]._cols);
// else if( args[1]._cols==1 ) args[1] = new ASTByCol(args[1],args[0]._cols);
// else E.throwErr("Mismatch cols: "+args[0]._cols+" and "+args[1]._cols,x);
// }
E.throwIfNotCompat(args[1],args[2],x);
}
ASTOp op = (ASTOp)args[0]; // Checked before I get here
for( int i=0; i<op._vcols.length; i++ )
if( op._vcols[i] != args[i+1]._cols ||
op._vrows[i] != args[i+1]._rows )
E.throwErr("Actual argument to '"+op._vars[i]+"' expected to be "+dimStr(op._vcols[i],op._vrows[i])+" but was "+args[i+1].dimStr(),x);
return new ASTApply(args,args[0]._cols,args[0]._rows);
}
boolean isPure() {
for( AST arg : _args )
if( !arg.isPure() ) return false;
return true;
}
@Override public String toString() { return _args[0].toString()+"()"; }
@Override public StringBuilder toString( StringBuilder sb, int d ) {
indent(sb,d).append("apply(").append(_args[0]).append(")\n");
for( int i=1; i<_args.length-1; i++ )
_args[i].toString(sb,d+1).append('\n');
return _args[_args.length-1].toString(sb,d+1);
}
//@Override Exec2 exec(Vec.VectorGroup vg) {
// _e2s = new Exec2[_args.length];
// for( int i=0; i<_args.length; i++ )
// _e2s[i] = _args[i].exec(vg);
// return null;
//}
}
// --------------------------------------------------------------------------
abstract static private class ASTOp extends AST {
static final HashMap<String,ASTOp> OPS = new HashMap();
static {
// Unary ops
put(new ASTIsNA());
put(new ASTSgn ());
put(new ASTNrow());
put(new ASTNcol());
// Binary ops
put(new ASTPlus());
put(new ASTSub ());
put(new ASTMul ());
put(new ASTDiv ());
put(new ASTMin ());
// Variable argcnt
put(new ASTCat ());
}
static private void put(ASTOp ast) { OPS.put(ast.opStr(),ast); }
// All fields are final, because functions are immutable
final String _vars[]; // Variable names
final int _vcols[]; // Every var is size-typed
final long _vrows[];
ASTOp( int cols, long rows, String vars[], int vcols[], long vrows[] ) {
super(cols,rows); // Result size
// The input args
_vars = vars; _vcols = vcols; _vrows = vrows;
}
abstract String opStr();
@Override boolean isPure() { return true; }
@Override public String toString() {
String s = opStr()+"(";
for( int i=0; i<_vars.length; i++ )
s += dimStr(_vcols[i],_vrows[i])+" "+_vars[i]+",";
s += ')';
return s;
}
@Override public StringBuilder toString( StringBuilder sb, int d ) {
return indent(sb,d).append(this);
}
// Parse an OP or return null.
private static ASTOp parse(Exec2 E) {
int x = E._x;
String id = E.isID();
if( id == null ) return null;
ASTOp op = OPS.get(id);
if( op != null ) return op;
E._x = x; // Roll back, no parse happened
return null;
}
// Parse a prefix operator
static AST parsePrefix(Exec2 E) {
throw H2O.unimpl();
//int x = E._x;
//ASTOp op = parse(E);
//if( op == null ) return null;
//// Fixed arg count
//if( op._args!=null ) {
// AST args[] = new AST[op._args.length];
// E.xpeek('(',x,null);
// for( int i=0; i<args.length-1; i++ )
// args[i] = E.xpeek(',',E._x,parseCXExpr(E));
// args[args.length-1]=parseCXExpr(E);
// return E.xpeek(')',E._x,op.make_rows(args,E,x));
//}
//// Variable arg cnt
//E.xpeek('(',x,null);
//AST args[] = new AST[2];
//int i=0;
//while( true ) {
// args[i++] = parseCXExpr(E);
// if( E.peek(')') ) break;
// E.xpeek(',',E._x,null);
// if( i==args.length ) args = Arrays.copyOf(args,args.length<<1);
//}
//return op.make(Arrays.copyOf(args,i),1,i);
}
// Parse an infix boolean operator
static ASTApply parseInfix(Exec2 E, AST ast) {
ASTOp op = parse(E);
if( op == null ) return null;
if( op._vars.length != 2 ) return null;
int x = E._x;
AST rite = parseCXExpr(E);
return ASTApply.make(new AST[]{op,ast,rite},E,x);
}
}
abstract static private class ASTUniOp extends ASTOp {
static final String VARS[] = new String[]{"x"};
static final int COLS[] = new int []{ 1 };
static final long ROWS[] = new long []{ 1 };
ASTUniOp( ) { super(1,1,VARS,COLS,ROWS); }
}
static private class ASTIsNA extends ASTUniOp { @Override String opStr() { return "isNA"; } }
static private class ASTSgn extends ASTUniOp { @Override String opStr() { return "sgn" ; } }
static private class ASTNrow extends ASTUniOp { @Override String opStr() { return "nrow"; } }
static private class ASTNcol extends ASTUniOp { @Override String opStr() { return "ncol"; } }
abstract static private class ASTBinOp extends ASTOp {
static final String VARS[] = new String[]{"x","y"};
static final int COLS[] = new int []{ 1 , 1 };
static final long ROWS[] = new long []{ 1 , 1 };
ASTBinOp( ) { super(1,1,VARS,COLS,ROWS); }
}
static private class ASTPlus extends ASTBinOp { @Override String opStr() { return "+" ; } }
static private class ASTSub extends ASTBinOp { @Override String opStr() { return "-" ; } }
static private class ASTMul extends ASTBinOp { @Override String opStr() { return "*" ; } }
static private class ASTDiv extends ASTBinOp { @Override String opStr() { return "/" ; } }
static private class ASTMin extends ASTBinOp { @Override String opStr() { return "min"; } }
// Variable length; instances will be created of required length
static private class ASTCat extends ASTOp {
@Override String opStr() { return "c"; }
ASTCat( ) { super(-1,-1,null,null,null); }
}
// --------------------------------------------------------------------------
private boolean throwIfNotCompat(AST l, AST r, int idx ) {
assert l._rows != -1 && r._rows != -1 && l._cols != -1 && r._cols != -1;
if( !(l._rows==1 || r._rows==1 || l._rows==r._rows) ||
!(l._cols==1 || r._cols==1 || l._cols==r._cols) )
throwErr("Frames not compatible: "+l.dimStr()+" vs "+r.dimStr(),idx);
return true;
}
// Nicely report a syntax error
private AST throwErr( String msg, int idx ) {
int lo = _x, hi=idx;
if( idx < _x ) { lo = idx; hi=_x; }
String s = msg+" @ "+lo;
if( lo != hi ) s += "-"+hi;
s += '\n'+_str+'\n';
int i;
for( i=0; i<lo; i++ ) s+= ' ';
s+='^'; i++;
for( ; i<hi; i++ ) s+= '-';
if( i<=hi ) s+= '^';
s += '\n';
throw new IllegalArgumentException(s);
}
}
| [
"cliffc@acm.org"
] | cliffc@acm.org |
192747d7e9a9d64f2b2f132a79896d57b0dfe7a6 | 5d5ec74c5f05a79049fafb4b16b04937016eba5e | /MathRace/app/src/androidTest/java/com/example/htanw/mathrace/ApplicationTest.java | 740d656cb47781de64ff3417978cb1c7c334933d | [] | no_license | htanwar/Android-Project | adc377fa1f59629218d6439ee0067222ea45e0c3 | 7d5e4cdf27530ab61b314389c3afcce847abe3bc | refs/heads/master | 2021-01-10T10:06:48.050211 | 2016-02-12T01:00:41 | 2016-02-12T01:00:41 | 51,557,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package com.example.htanw.mathrace;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"himanshu.tanwar80@myhunter.cuny.edu"
] | himanshu.tanwar80@myhunter.cuny.edu |
c96b3d12eb49ca5106edebbb2768da96a1beb6cc | 631749a5213636c09ba4434da0dd8683ac75e900 | /mybatis/dao/src/com/mybatis/po/User.java | c76b662b649684f0c42b34cd30ded8ca12e8ad04 | [] | no_license | xumingjie1658/java_practice | e3f2eb5c3730de5f2b659fef4b0974f98be64bae | efd83c325c89bed5e00c145456f165b08e81bf1d | refs/heads/master | 2021-01-10T01:18:14.803486 | 2015-10-04T13:24:00 | 2015-10-04T13:24:00 | 43,045,171 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 971 | java | package com.mybatis.po;
import java.util.Date;
/**
* Created by xumingjie on 15/9/30.
*/
public class User {
//属性名与数据库字段对应
private int id;
private String username;
private String sex;
private Date birthday;
private String address;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
| [
"flippyxu@gmail.com"
] | flippyxu@gmail.com |
198e609cdeaf577695e60de4eb6e66ad77c2b7f3 | 89b538997b7bd8f649c5dab72529dff0dc09d15b | /src/main/kotlin/hollow/generated/accessor/StringDataAccessor.java | 75682aa0b07a6d732d24b5c579ede991960ad2d1 | [] | no_license | yonatang/hollow-delta-bug | d01e4d132a2fdee3aac324875434b53538c0de1c | fe6d0b382de4b6712bbef51fb97e8dafc7130557 | refs/heads/master | 2023-04-04T03:05:47.937923 | 2021-02-24T06:18:54 | 2021-02-24T06:18:54 | 341,798,513 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,293 | java | package hollow.generated.accessor;
import hollow.generated.EntityApi;
import hollow.generated.core.*;
import com.netflix.hollow.api.consumer.HollowConsumer;
import com.netflix.hollow.api.consumer.data.AbstractHollowDataAccessor;
import com.netflix.hollow.core.index.key.PrimaryKey;
import com.netflix.hollow.core.read.engine.HollowReadStateEngine;
@SuppressWarnings("all")
public class StringDataAccessor extends AbstractHollowDataAccessor<HString> {
public static final String TYPE = "String";
private EntityApi api;
public StringDataAccessor(HollowConsumer consumer) {
super(consumer, TYPE);
this.api = (EntityApi)consumer.getAPI();
}
public StringDataAccessor(HollowReadStateEngine rStateEngine, EntityApi api) {
super(rStateEngine, TYPE);
this.api = api;
}
public StringDataAccessor(HollowReadStateEngine rStateEngine, EntityApi api, String ... fieldPaths) {
super(rStateEngine, TYPE, fieldPaths);
this.api = api;
}
public StringDataAccessor(HollowReadStateEngine rStateEngine, EntityApi api, PrimaryKey primaryKey) {
super(rStateEngine, TYPE, primaryKey);
this.api = api;
}
@Override public HString getRecord(int ordinal){
return api.getHString(ordinal);
}
} | [
"yonatan.graber@gmail.com"
] | yonatan.graber@gmail.com |
ba7c9ec8fa02e581648e924226c0a9a60aafa537 | cc35bbc9bda475fc3809c30b573ee2f0ffaeb06b | /EASy-Standalone/EASyCommandLine/src/de/uni_hildesheim/sse/easy/cmd/ModelLoadDefinition.java | a12ac08545c32a7687cef23ac8e8ba4cf7927cca | [
"Apache-2.0"
] | permissive | ahmedjaved2109/EASyProducer | 833afd006feb6d2a1f1fcc9eb82b79db2aa51ae7 | c08f831599a9f5993ed1bd144ccdadab3d1d97ed | refs/heads/master | 2021-01-18T11:09:08.843648 | 2016-03-17T20:29:40 | 2016-03-17T20:29:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,544 | java | package de.uni_hildesheim.sse.easy.cmd;
import de.uni_hildesheim.sse.utils.modelManagement.IModelData;
import de.uni_hildesheim.sse.utils.modelManagement.Version;
import de.uni_hildesheim.sse.utils.modelManagement.VersionFormatException;
/**
* Datatype for loading a IModel, i.e. a {@link de.uni_hildesheim.sse.model.varModel.Project}
* or {@link de.uni_hildesheim.sse.easy_producer.instantiator.model.buildlangModel.Script},
* while using only String parameters.
* @author El-Sharkawy
*
*/
public class ModelLoadDefinition implements IModelData {
private String modelName;
private Version version;
/**
* Sole constructor for this datatype.
* @param modelName The name of the IModel which shall be loaded (Must not be <tt>null</tt>).
* @param version The Version of the IModel, which shall be loaded (can be <tt>null</tt>).
* @throws VersionFormatException In case of format problems
* @throws NullPointerException If the modelName is <tt>null</tt>.
*/
public ModelLoadDefinition(String modelName, String version) throws VersionFormatException {
if (null == modelName) {
throw new NullPointerException("Model name must not be null");
}
this.modelName = modelName;
this.version = null != version ? new Version(version) : null;
}
@Override
public String getName() {
return modelName;
}
@Override
public Version getVersion() {
return version;
}
}
| [
"elscha@sse.uni-hildesheim.de"
] | elscha@sse.uni-hildesheim.de |
6dd30ac4dce5204c395f76ae9384d6cf837ae846 | 44143d87a2ea65867ff5579e99e1d690afac4875 | /mobile/src/main/java/com/collosteam/economist/StartActivity.java | 3afc2a4e19438d1ccb6dd4b96b6c4a1ae0f85e1c | [] | no_license | m1r0n41k/Economist | cf2cac60d97353a803593af7fbb4ee17ea0dbdc7 | 2ee5082829b49b47b1c727082cce3dea74ab0804 | refs/heads/master | 2016-09-09T17:09:21.005514 | 2015-01-02T19:11:49 | 2015-01-02T19:11:49 | 28,723,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,016 | java | package com.collosteam.economist;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;
public class StartActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_start, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_start, container, false);
return rootView;
}
}
}
| [
"miroshnychenkoandrew@gmail.com"
] | miroshnychenkoandrew@gmail.com |
b26699f81be457b3966bc1ff6b0cf614a2c2c12c | 2002a9d7d9ff1ea0f8242ce63bf4098fd1b53282 | /src/main/java/ua/epam/spring/hometask/aop/CounterAspect.java | 48ba888020271356d4c04ee9a760d2310bade11d | [] | no_license | piotr921/SpringTheatre | 618cfe117c92344bc5ef6ec453ad9ca3fd0e6186 | 850060ca4ab941700eb144b24c138e2f009cdf85 | refs/heads/master | 2021-01-19T07:28:42.788580 | 2017-09-03T23:22:59 | 2017-09-03T23:22:59 | 100,640,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,554 | java | package ua.epam.spring.hometask.aop;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
import ua.epam.spring.hometask.domain.Event;
import ua.epam.spring.hometask.domain.Ticket;
import ua.epam.spring.hometask.domain.User;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@Component
@Aspect
public class CounterAspect {
enum Operations {
GET_EVENT_BY_NAME,
QUERY_PRICE,
BOOK_TICKETS
}
private Map<Operations, Map<String, Integer>> methodCallCounter;
public CounterAspect() {
methodCallCounter = new HashMap<>();
methodCallCounter.put(Operations.GET_EVENT_BY_NAME, new HashMap<>());
methodCallCounter.put(Operations.QUERY_PRICE, new HashMap<>());
methodCallCounter.put(Operations.BOOK_TICKETS, new HashMap<>());
}
@Before("execution(* ua.epam.spring.hometask.service.EventService.getByName(..)) && args(name)")
public void countHowManyTimesEventAccessedByName(String name) {
incrementCounter(Operations.GET_EVENT_BY_NAME, name);
}
@Before("execution(* ua.epam.spring.hometask.service.BookingService.getTicketsPrice(..)) && args(event, dateTime, user, seats)")
public void countHowManyTimesEventPriceQueried(Event event, LocalDateTime dateTime, User user, Set<Long> seats) {
incrementCounter(Operations.QUERY_PRICE, event.getName());
}
@Before("execution(* ua.epam.spring.hometask.service.BookingService.bookTickets(..)) && args(tickets)")
public void countHowManyTimesTicketsForEventWereBooked(Set<Ticket> tickets) {
tickets.forEach(ticket -> incrementCounter(Operations.BOOK_TICKETS, ticket.getEvent().getName()));
}
private void incrementCounter(Operations operation, String methodName) {
Map<String, Integer> operationCounter = methodCallCounter.get(operation);
operationCounter.merge(methodName, 1, (key, value) -> value + 1);
methodCallCounter.put(operation, operationCounter);
}
public int getNoOfGetEventByNameOperations(String eventName) {
return methodCallCounter.get(Operations.GET_EVENT_BY_NAME).get(eventName);
}
public int getNoOfQueryPriceOperations(String eventName) {
return methodCallCounter.get(Operations.QUERY_PRICE).get(eventName);
}
public int getNoOfBookTicketsOperations(String eventName) {
return methodCallCounter.get(Operations.BOOK_TICKETS).get(eventName);
}
}
| [
"Piotr_Sekula@epam.com"
] | Piotr_Sekula@epam.com |
e9b56f2ad732b9b0744a99c3ea7e4236d09154e9 | 74e94b19b8a9748558bbaa2b86d4e7c6db835e2f | /core/redirector/src/com/comcast/redirector/core/balancer/serviceprovider/StaticServiceProviderFactory.java | 32dd9a8bd41c13fa5f179ecb81d21c5b54fe3dbe | [
"Apache-2.0"
] | permissive | Comcast/redirector | b236567e2bae687e0189c2cdc45731dd8c055a1a | 6770fe01383bc7ea110c7c8e14c137212ebc0ba1 | refs/heads/master | 2021-03-27T20:48:38.988332 | 2019-09-26T08:39:18 | 2019-09-26T08:39:18 | 80,451,996 | 10 | 13 | Apache-2.0 | 2019-09-26T08:39:19 | 2017-01-30T18:50:31 | Java | UTF-8 | Java | false | false | 6,650 | java | /**
* Copyright 2017 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @author Alexander Binkovsky (abinkovski@productengine.com)
*/
package com.comcast.redirector.core.balancer.serviceprovider;
import com.comcast.redirector.api.model.xrestack.HostIPs;
import com.comcast.redirector.api.model.xrestack.XreStackPath;
import com.comcast.tvx.cloud.MetaData;
import com.comcast.redirector.core.config.ZKConfig;
import com.comcast.redirector.core.balancer.serviceprovider.weight.InstanceWeigher;
import com.comcast.redirector.core.balancer.util.ServiceProviderUtils;
import org.apache.curator.x.discovery.*;
import org.apache.curator.x.discovery.details.InstanceProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.*;
class StaticServiceProviderFactory implements IStaticServiceProviderFactory {
private ProviderStrategy<MetaData> providerStrategy;
private ZKConfig config;
StaticServiceProviderFactory(ProviderStrategy<MetaData> providerStrategy, ZKConfig config) {
this.providerStrategy = providerStrategy;
this.config = config;
}
@Override
public IFilteredServiceProvider createServiceProvider(XreStackPath servicePath, List<HostIPs> hosts) {
return new StackServiceProvider(
new StaticServiceProvider(providerStrategy, servicePath.getServiceName(), hosts, config),
servicePath);
}
private static class StaticServiceProvider implements ServiceProvider<MetaData> {
private static Logger log = LoggerFactory.getLogger(StaticServiceProvider.class);
private final ProviderStrategy<MetaData> providerStrategy;
private final InstanceProvider<MetaData> instanceProvider;
/**
* @param providerStrategy strategy of selecting particular service instance (host)
* @param serviceName name of service served by the provider, e.g. xreGuide
* @param serviceInstances list of serviceInstances ([host]:[port]) running particular service
*/
StaticServiceProvider(ProviderStrategy<MetaData> providerStrategy, String serviceName,
List<HostIPs> serviceInstances, ZKConfig config) {
this.providerStrategy = providerStrategy;
this.instanceProvider = new StaticInstanceProvider(serviceName, serviceInstances, config);
}
@Override
public void start() throws Exception {
throw new UnsupportedOperationException("no need to start offline service provider");
}
@Override
public ServiceInstance<MetaData> getInstance() throws Exception {
return providerStrategy.getInstance(instanceProvider);
}
@Override
public Collection<ServiceInstance<MetaData>> getAllInstances() throws Exception {
return instanceProvider.getInstances();
}
@Override
public void noteError(ServiceInstance<MetaData> instance) {
throw new UnsupportedOperationException("noteError is not supported");
}
@Override
public void close() throws IOException {
try {
instanceProvider.getInstances().clear();
} catch (Exception e) {
log.error("Can't close provider ", e);
}
}
/**
* Provider holds static list {@link org.apache.curator.x.discovery.ServiceInstance} objects
*/
private static class StaticInstanceProvider implements InstanceProvider<MetaData> {
private final List<ServiceInstance<MetaData>> instances;
private final ZKConfig config;
private final InstanceWeigher weigher;
/**
* @param serviceName name of service served by the provider, e.g. xreGuide
* @param instances list of service ids this provider holds. Service id is [ip address]:[port]
*/
StaticInstanceProvider(String serviceName, List<HostIPs> instances, ZKConfig config) {
this.config = config;
this.instances = new ArrayList<>(getFinalInstancesSize(instances));
this.weigher = new InstanceWeigher(config);
try {
for (HostIPs instance : instances) {
ServiceInstanceBuilder<MetaData> builder = new LiteServiceInstanceBuilder();
ServiceInstance<MetaData> serviceInstance = builder.id(instance.getIpV4Address()) // id is <ip address>:<port>
.name(serviceName)
.address(instance.getIpV4Address()) // get address from instance id
.payload(ServiceProviderUtils.getMetaDataFromHost(instance))
.build();
int weight = weigher.getWeight(serviceInstance);
if (weight > 0) {
for (int i = 0; i < weight; i++) {
this.instances.add(serviceInstance);
}
}
else {
log.warn("No traffic will be sent to the host: IPv4={} IPv6={}, because its weight is {}, but should be above 0.",
String.valueOf(instance.getIpV4Address()), String.valueOf(instance.getIpV4Address()), instance.getWeight());
}
}
Collections.shuffle(this.instances, new Random(System.currentTimeMillis()));
} catch (Exception e) {
log.error("failed to build offline instance provider", e);
}
}
@Override
public List<ServiceInstance<MetaData>> getInstances() throws Exception {
return instances;
}
private int getFinalInstancesSize(List<HostIPs> instances) {
return instances.size() > 0 ? instances.size() * config.getDefaultWeightOfTheNode() : 0;
}
}
}
}
| [
"mailtojp@gmail.com"
] | mailtojp@gmail.com |
271b0ebc98cd72fd8761ee4970bd306641828d20 | 9fddb4ccce71e92fadebff4d37f63cf72e7ff9b0 | /src/main/java/guru/springfamework/controller/CategoryController.java | c827b31a0f2acf95e9ae46a22478c2a8030a2c8c | [] | no_license | mherb63/spring5-mvc-rest | b711da2f8691044698dc6a0511381d9bff26884a | 5058fc5e15d57d168f15358bee4411f9a099d5d9 | refs/heads/master | 2020-03-15T05:39:51.949521 | 2018-05-03T17:44:27 | 2018-05-03T17:44:27 | 131,992,286 | 0 | 0 | null | 2018-05-03T17:44:28 | 2018-05-03T12:33:01 | Java | UTF-8 | Java | false | false | 1,081 | java | package guru.springfamework.controller;
import guru.springfamework.dto.CategoryDTO;
import guru.springfamework.dto.CategoryListDTO;
import guru.springfamework.service.CategoryService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@Controller
public class CategoryController {
private final CategoryService categoryService;
public CategoryController(CategoryService categoryService) {
this.categoryService = categoryService;
}
@GetMapping("/categories")
public ResponseEntity<CategoryListDTO> getAllCategories() {
return new ResponseEntity<>(categoryService.getAllCategories(), HttpStatus.OK);
}
@GetMapping("categories/{name}")
public ResponseEntity<CategoryDTO> getCategoryByName(@PathVariable String name) {
return new ResponseEntity<>(categoryService.getCategoryByName(name), HttpStatus.OK);
}
}
| [
"mherb@ciena.com"
] | mherb@ciena.com |
030ba854007c672fa1929ed52d268f285a4d3cda | 6d15861ac333805ac43ba3fd10cd1e1d9896af72 | /kodilla-hibernate/src/test/java/com/kodilla/hibernate/invoice/dao/InvoiceDaoTestSuite.java | 873f58b69fed749f2a3896ce1d337b5124a946d9 | [] | no_license | blue0403/artur-lichaj-kodilla-java | a9501b32e3d1d7236bf90cbbad566cbd34e3c7a8 | a712b91c73a32182fd196ab4aa24c0835c99b8ed | refs/heads/master | 2021-01-25T14:34:42.889484 | 2018-08-22T13:29:58 | 2018-08-22T13:29:58 | 123,716,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,182 | java | package com.kodilla.hibernate.invoice.dao;
import com.kodilla.hibernate.invoice.Invoice;
import com.kodilla.hibernate.invoice.Item;
import com.kodilla.hibernate.invoice.Product;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.math.BigDecimal;
@RunWith(SpringRunner.class)
@SpringBootTest
public class InvoiceDaoTestSuite {
@Autowired
private ProductDao productDao;
@Autowired
private InvoiceDao invoiceDao;
@Test
public void testInvoiceDaoSave() {
//Given
Product smartphone = new Product("Smartphone Lenovo P2 Dual SIM");
Product headphones = new Product("Headphones Lenovo Original");
Product earphone = new Product("Samsung Bluetooth earphone");
Product speaker = new Product("JBC wireless speaker");
Product powerBank = new Product("Power bank ADATA 20000mAh");
productDao.save(smartphone);
int smartphoneId = smartphone.getId();
productDao.save(headphones);
int headphonesId = headphones.getId();
productDao.save(earphone);
int earphoneId = earphone.getId();
productDao.save(speaker);
int speakerId = speaker.getId();
productDao.save(powerBank);
int powerBankId = powerBank.getId();
Item item = new Item(new BigDecimal(1299.99), 1, new BigDecimal(1299.99));
Item item1 = new Item(new BigDecimal(14.99), 2, new BigDecimal(29.98));
Item item2 = new Item(new BigDecimal(49.99), 1, new BigDecimal(49.99));
Item item3 = new Item(new BigDecimal(339.49), 1, new BigDecimal(339.49));
Item item4 = new Item(new BigDecimal(99.89), 1, new BigDecimal(99.89));
smartphone.getItems().add(item);
headphones.getItems().add(item1);
earphone.getItems().add(item2);
speaker.getItems().add(item3);
powerBank.getItems().add(item4);
item.setProduct(smartphone);
item1.setProduct(headphones);
item2.setProduct(earphone);
item3.setProduct(speaker);
item4.setProduct(powerBank);
Invoice invoice = new Invoice("KODILLA/AL/2018/05/19");
invoice.getItems().add(item);
invoice.getItems().add(item1);
invoice.getItems().add(item2);
invoice.getItems().add(item3);
invoice.getItems().add(item4);
item.setInvoice(invoice);
item1.setInvoice(invoice);
item2.setInvoice(invoice);
item3.setInvoice(invoice);
item4.setInvoice(invoice);
//When
invoiceDao.save(invoice);
int invoiceId = invoice.getId();
//Then
Assert.assertNotEquals(0, invoiceId);
Assert.assertEquals(5, invoice.getItems().size());
//CleanUp
invoiceDao.delete(invoiceId);
productDao.delete(smartphoneId);
productDao.delete(headphonesId);
productDao.delete(earphoneId);
productDao.delete(speakerId);
productDao.delete(powerBankId);
}
}
| [
"artur.lichaj@gmail.com"
] | artur.lichaj@gmail.com |
923ff2692ffb77a5188d2a92af20b16fb689e104 | 3df51e60f6036e7ddf45e2a38f4bf1d67f8f12f0 | /maky/Project/src/com/maky/game/lines/view/menu/LinesGameMenuV1.java | d8367c3f0f8407f7a7d376b648a7f5e602273d96 | [] | no_license | maky1984/samples | 57bb1723a82f15ead8e91c79386fb2aa809bc2f6 | ab7b8052cfdf1a8a4b78560d4604caa833afdf49 | refs/heads/master | 2020-04-26T19:30:35.196134 | 2015-03-28T10:19:25 | 2015-03-28T10:19:25 | 13,567,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,069 | java | package com.maky.game.lines.view.menu;
import com.maky.app.controller.commander.UICommander;
import com.maky.app.resource.RImage;
import com.maky.app.resource.ResourceManager;
import com.maky.app.view.IScreen;
import com.maky.app.view.menu.Menu;
import com.maky.app.view.menu.MenuItem;
import com.maky.environment.AppGraphics;
import com.maky.environment.GraphicsConfig;
import com.maky.environment.IPaintable;
import com.maky.game.lines.LinesResources;
import com.maky.game.lines.controller.LinesCommand;
import com.maky.game.lines.view.LinesView;
public class LinesGameMenuV1 extends Menu implements IScreen {
private static final MenuItem ITEM_NEW = new MenuItem("NEW GAME", "Begin new game", LinesCommand.COMMAND_GAME_NEW);
private static final MenuItem ITEM_HIGHSCORE = new MenuItem("HIGHSCORE", "Highscore table",
LinesCommand.COMMAND_GAME_HIGHSCORE);
private static final MenuItem ITEM_EXIT = new MenuItem("EXIT", "Leave the game", LinesCommand.COMMAND_GAME_EXIT);
private RImage background = ResourceManager.getInstance().getImageResource(LinesResources.IMAGE_MENU_BACKGROUND);
private UICommander commander;
public LinesGameMenuV1(UICommander commander, LinesView view) {
super(MenuItem.getWidth(), MenuItem.getHeight() * 3, 0, view);
this.commander = commander;
}
protected void buildMenu() {
addItem(ITEM_NEW);
addItem(ITEM_HIGHSCORE);
addItem(ITEM_EXIT);
}
protected MenuItem getDefaultActiveItem() {
return ITEM_NEW;
}
/**
* This method is invoked when user selects menu item
*/
protected int itemSelected(MenuItem item) {
return commander.post(item.getCommandId());
}
public int getHeight() {
return GraphicsConfig.getCanvasHeight();
}
public int getWidth() {
return GraphicsConfig.getCanvasWidth();
}
/**
* {@link IScreen#dismiss()}
*/
public void dismiss() {
}
/**
* {@link IScreen#show()}
*/
public void show() {
}
/**
* {@link IPaintable#paint(AppGraphics)}
*/
public void paint(AppGraphics gr) {
gr.drawImage(background.getImage(), 0, 0, null);
super.paint(gr);
}
}
| [
"kotlyar.michael@gmail.com"
] | kotlyar.michael@gmail.com |
33441c8cda71fa449e5f1b2e8e5befb55d696abc | c2d90815239027482b90373b377816fdace82452 | /src/main/java/com/workpoint/icpak/server/navintegration/UpdateMultiple.java | 085d37fb9b261dfb546a7000b7123ff03d59d058 | [] | no_license | JPB117/flexiPayImprovement | 17389d74e72e3f496b5becfe26f939a2217fdb74 | 7deae86f7b68b100be0f998c7e1a66708d19a3f7 | refs/heads/master | 2021-01-01T04:02:54.366449 | 2017-07-11T21:23:23 | 2017-07-11T21:23:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,878 | java |
package com.workpoint.icpak.server.navintegration;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Online_Member_Payments_List" type="{urn:microsoft-dynamics-schemas/page/online_member_payments}Online_Member_Payments_List"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"onlineMemberPaymentsList"
})
@XmlRootElement(name = "UpdateMultiple")
public class UpdateMultiple {
@XmlElement(name = "Online_Member_Payments_List", required = true)
protected OnlineMemberPaymentsList onlineMemberPaymentsList;
/**
* Gets the value of the onlineMemberPaymentsList property.
*
* @return
* possible object is
* {@link OnlineMemberPaymentsList }
*
*/
public OnlineMemberPaymentsList getOnlineMemberPaymentsList() {
return onlineMemberPaymentsList;
}
/**
* Sets the value of the onlineMemberPaymentsList property.
*
* @param value
* allowed object is
* {@link OnlineMemberPaymentsList }
*
*/
public void setOnlineMemberPaymentsList(OnlineMemberPaymentsList value) {
this.onlineMemberPaymentsList = value;
}
}
| [
"tosh0948@gmail.com"
] | tosh0948@gmail.com |
ddb1a79e5c3b17fc222eb176024af149bc8e866c | 3035dd67f16d88ef7e3eda58f5cf0a4e446e05d0 | /target/classes/javax/annotation/PostConstruct.java | 4382b25c34661c97d2469e7a0aad2fb7d92ffb0e | [
"CDDL-1.0",
"CPL-1.0",
"Zlib",
"EPL-1.0",
"bzip2-1.0.6",
"LicenseRef-scancode-unknown-license-reference",
"LZMA-exception",
"Apache-2.0"
] | permissive | XingCheng901024/tomcat-856-src | 6fda6a949409fe075fe5951b16636b3eef99d0d2 | bfb9f0798934068500dcd9ad2c373c69b73b09b9 | refs/heads/master | 2022-01-27T11:53:01.817418 | 2019-12-08T17:23:53 | 2019-12-08T17:23:53 | 223,137,392 | 0 | 0 | Apache-2.0 | 2022-01-21T23:42:50 | 2019-11-21T09:30:33 | Java | UTF-8 | Java | false | false | 1,154 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package javax.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @since Common Annotations 1.0
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface PostConstruct {
// No attributes
}
| [
"1257060187@qq.com"
] | 1257060187@qq.com |
4b20a7752d74dd5eb7011b4c4bb3b283cd678595 | b0f93e92cf95da3d22a9a5d804218d2644f8c3cf | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/example/tdialog/R.java | 95d3de350ee14103e49da800a74fa93eab64b9ff | [] | no_license | LAIJIAN-YE/card | d4ec78a135860b593c9526e9be12fc64ce2e7215 | 33f0abba293c477a0c227ba66e1965655566c395 | refs/heads/master | 2020-06-25T08:15:27.979753 | 2019-08-05T15:55:32 | 2019-08-05T15:55:32 | 199,254,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 123,142 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package com.example.tdialog;
public final class R {
private R() {}
public static final class anim {
private anim() {}
public static final int abc_fade_in = 0x7f010000;
public static final int abc_fade_out = 0x7f010001;
public static final int abc_grow_fade_in_from_bottom = 0x7f010002;
public static final int abc_popup_enter = 0x7f010003;
public static final int abc_popup_exit = 0x7f010004;
public static final int abc_shrink_fade_out_from_bottom = 0x7f010005;
public static final int abc_slide_in_bottom = 0x7f010006;
public static final int abc_slide_in_top = 0x7f010007;
public static final int abc_slide_out_bottom = 0x7f010008;
public static final int abc_slide_out_top = 0x7f010009;
public static final int abc_tooltip_enter = 0x7f01000a;
public static final int abc_tooltip_exit = 0x7f01000b;
}
public static final class attr {
private attr() {}
public static final int actionBarDivider = 0x7f040000;
public static final int actionBarItemBackground = 0x7f040001;
public static final int actionBarPopupTheme = 0x7f040002;
public static final int actionBarSize = 0x7f040003;
public static final int actionBarSplitStyle = 0x7f040004;
public static final int actionBarStyle = 0x7f040005;
public static final int actionBarTabBarStyle = 0x7f040006;
public static final int actionBarTabStyle = 0x7f040007;
public static final int actionBarTabTextStyle = 0x7f040008;
public static final int actionBarTheme = 0x7f040009;
public static final int actionBarWidgetTheme = 0x7f04000a;
public static final int actionButtonStyle = 0x7f04000b;
public static final int actionDropDownStyle = 0x7f04000c;
public static final int actionLayout = 0x7f04000d;
public static final int actionMenuTextAppearance = 0x7f04000e;
public static final int actionMenuTextColor = 0x7f04000f;
public static final int actionModeBackground = 0x7f040010;
public static final int actionModeCloseButtonStyle = 0x7f040011;
public static final int actionModeCloseDrawable = 0x7f040012;
public static final int actionModeCopyDrawable = 0x7f040013;
public static final int actionModeCutDrawable = 0x7f040014;
public static final int actionModeFindDrawable = 0x7f040015;
public static final int actionModePasteDrawable = 0x7f040016;
public static final int actionModePopupWindowStyle = 0x7f040017;
public static final int actionModeSelectAllDrawable = 0x7f040018;
public static final int actionModeShareDrawable = 0x7f040019;
public static final int actionModeSplitBackground = 0x7f04001a;
public static final int actionModeStyle = 0x7f04001b;
public static final int actionModeWebSearchDrawable = 0x7f04001c;
public static final int actionOverflowButtonStyle = 0x7f04001d;
public static final int actionOverflowMenuStyle = 0x7f04001e;
public static final int actionProviderClass = 0x7f04001f;
public static final int actionViewClass = 0x7f040020;
public static final int activityChooserViewStyle = 0x7f040021;
public static final int alertDialogButtonGroupStyle = 0x7f040022;
public static final int alertDialogCenterButtons = 0x7f040023;
public static final int alertDialogStyle = 0x7f040024;
public static final int alertDialogTheme = 0x7f040025;
public static final int allowStacking = 0x7f040026;
public static final int alpha = 0x7f040027;
public static final int alphabeticModifiers = 0x7f040028;
public static final int arrowHeadLength = 0x7f040029;
public static final int arrowShaftLength = 0x7f04002a;
public static final int autoCompleteTextViewStyle = 0x7f04002b;
public static final int autoSizeMaxTextSize = 0x7f04002c;
public static final int autoSizeMinTextSize = 0x7f04002d;
public static final int autoSizePresetSizes = 0x7f04002e;
public static final int autoSizeStepGranularity = 0x7f04002f;
public static final int autoSizeTextType = 0x7f040030;
public static final int background = 0x7f040031;
public static final int backgroundSplit = 0x7f040032;
public static final int backgroundStacked = 0x7f040033;
public static final int backgroundTint = 0x7f040034;
public static final int backgroundTintMode = 0x7f040035;
public static final int barLength = 0x7f040036;
public static final int borderlessButtonStyle = 0x7f040040;
public static final int buttonBarButtonStyle = 0x7f04004e;
public static final int buttonBarNegativeButtonStyle = 0x7f04004f;
public static final int buttonBarNeutralButtonStyle = 0x7f040050;
public static final int buttonBarPositiveButtonStyle = 0x7f040051;
public static final int buttonBarStyle = 0x7f040052;
public static final int buttonGravity = 0x7f040053;
public static final int buttonIconDimen = 0x7f040054;
public static final int buttonPanelSideLayout = 0x7f040055;
public static final int buttonStyle = 0x7f040057;
public static final int buttonStyleSmall = 0x7f040058;
public static final int buttonTint = 0x7f040059;
public static final int buttonTintMode = 0x7f04005a;
public static final int checkboxStyle = 0x7f040063;
public static final int checkedTextViewStyle = 0x7f040068;
public static final int closeIcon = 0x7f04007c;
public static final int closeItemLayout = 0x7f040083;
public static final int collapseContentDescription = 0x7f040084;
public static final int collapseIcon = 0x7f040085;
public static final int color = 0x7f040088;
public static final int colorAccent = 0x7f040089;
public static final int colorBackgroundFloating = 0x7f04008a;
public static final int colorButtonNormal = 0x7f04008b;
public static final int colorControlActivated = 0x7f04008c;
public static final int colorControlHighlight = 0x7f04008d;
public static final int colorControlNormal = 0x7f04008e;
public static final int colorError = 0x7f04008f;
public static final int colorPrimary = 0x7f040090;
public static final int colorPrimaryDark = 0x7f040091;
public static final int colorSwitchThumbNormal = 0x7f040094;
public static final int commitIcon = 0x7f0400a1;
public static final int contentDescription = 0x7f0400a5;
public static final int contentInsetEnd = 0x7f0400a6;
public static final int contentInsetEndWithActions = 0x7f0400a7;
public static final int contentInsetLeft = 0x7f0400a8;
public static final int contentInsetRight = 0x7f0400a9;
public static final int contentInsetStart = 0x7f0400aa;
public static final int contentInsetStartWithNavigation = 0x7f0400ab;
public static final int controlBackground = 0x7f0400b2;
public static final int coordinatorLayoutStyle = 0x7f0400b3;
public static final int customNavigationLayout = 0x7f0400b9;
public static final int defaultQueryHint = 0x7f0400ba;
public static final int dialogCornerRadius = 0x7f0400bb;
public static final int dialogPreferredPadding = 0x7f0400bc;
public static final int dialogTheme = 0x7f0400bd;
public static final int displayOptions = 0x7f0400be;
public static final int divider = 0x7f0400bf;
public static final int dividerHorizontal = 0x7f0400c0;
public static final int dividerPadding = 0x7f0400c1;
public static final int dividerVertical = 0x7f0400c2;
public static final int drawableSize = 0x7f0400c5;
public static final int drawerArrowStyle = 0x7f0400c8;
public static final int dropDownListViewStyle = 0x7f0400c9;
public static final int dropdownListPreferredItemHeight = 0x7f0400ca;
public static final int editTextBackground = 0x7f0400cb;
public static final int editTextColor = 0x7f0400cc;
public static final int editTextStyle = 0x7f0400cd;
public static final int elevation = 0x7f0400ce;
public static final int expandActivityOverflowButtonDrawable = 0x7f0400d4;
public static final int fastScrollEnabled = 0x7f0400e3;
public static final int fastScrollHorizontalThumbDrawable = 0x7f0400e4;
public static final int fastScrollHorizontalTrackDrawable = 0x7f0400e5;
public static final int fastScrollVerticalThumbDrawable = 0x7f0400e6;
public static final int fastScrollVerticalTrackDrawable = 0x7f0400e7;
public static final int firstBaselineToTopHeight = 0x7f0400e8;
public static final int font = 0x7f0400ea;
public static final int fontFamily = 0x7f0400eb;
public static final int fontProviderAuthority = 0x7f0400ec;
public static final int fontProviderCerts = 0x7f0400ed;
public static final int fontProviderFetchStrategy = 0x7f0400ee;
public static final int fontProviderFetchTimeout = 0x7f0400ef;
public static final int fontProviderPackage = 0x7f0400f0;
public static final int fontProviderQuery = 0x7f0400f1;
public static final int fontStyle = 0x7f0400f2;
public static final int fontVariationSettings = 0x7f0400f3;
public static final int fontWeight = 0x7f0400f4;
public static final int gapBetweenBars = 0x7f0400f6;
public static final int goIcon = 0x7f0400f7;
public static final int height = 0x7f0400f9;
public static final int hideOnContentScroll = 0x7f0400fe;
public static final int homeAsUpIndicator = 0x7f040103;
public static final int homeLayout = 0x7f040104;
public static final int icon = 0x7f040106;
public static final int iconTint = 0x7f04010c;
public static final int iconTintMode = 0x7f04010d;
public static final int iconifiedByDefault = 0x7f04010e;
public static final int imageButtonStyle = 0x7f040111;
public static final int indeterminateProgressStyle = 0x7f040112;
public static final int initialActivityCount = 0x7f040113;
public static final int isLightTheme = 0x7f040115;
public static final int itemPadding = 0x7f04011c;
public static final int keylines = 0x7f040122;
public static final int lastBaselineToBottomHeight = 0x7f040124;
public static final int layout = 0x7f040125;
public static final int layoutManager = 0x7f040126;
public static final int layout_anchor = 0x7f040127;
public static final int layout_anchorGravity = 0x7f040128;
public static final int layout_behavior = 0x7f040129;
public static final int layout_dodgeInsetEdges = 0x7f040155;
public static final int layout_insetEdge = 0x7f04015e;
public static final int layout_keyline = 0x7f04015f;
public static final int lineHeight = 0x7f040164;
public static final int listChoiceBackgroundIndicator = 0x7f040166;
public static final int listDividerAlertDialog = 0x7f040167;
public static final int listItemLayout = 0x7f040168;
public static final int listLayout = 0x7f040169;
public static final int listMenuViewStyle = 0x7f04016a;
public static final int listPopupWindowStyle = 0x7f04016b;
public static final int listPreferredItemHeight = 0x7f04016c;
public static final int listPreferredItemHeightLarge = 0x7f04016d;
public static final int listPreferredItemHeightSmall = 0x7f04016e;
public static final int listPreferredItemPaddingLeft = 0x7f04016f;
public static final int listPreferredItemPaddingRight = 0x7f040170;
public static final int logo = 0x7f040171;
public static final int logoDescription = 0x7f040172;
public static final int maxButtonHeight = 0x7f040176;
public static final int measureWithLargestChild = 0x7f040178;
public static final int multiChoiceItemLayout = 0x7f040187;
public static final int navigationContentDescription = 0x7f040188;
public static final int navigationIcon = 0x7f040189;
public static final int navigationMode = 0x7f04018a;
public static final int numericModifiers = 0x7f04018c;
public static final int overlapAnchor = 0x7f04018d;
public static final int paddingBottomNoButtons = 0x7f04018e;
public static final int paddingEnd = 0x7f04018f;
public static final int paddingStart = 0x7f040190;
public static final int paddingTopNoTitle = 0x7f040191;
public static final int panelBackground = 0x7f040192;
public static final int panelMenuListTheme = 0x7f040193;
public static final int panelMenuListWidth = 0x7f040194;
public static final int popupMenuStyle = 0x7f04019a;
public static final int popupTheme = 0x7f04019b;
public static final int popupWindowStyle = 0x7f04019c;
public static final int preserveIconSpacing = 0x7f04019d;
public static final int progressBarPadding = 0x7f04019f;
public static final int progressBarStyle = 0x7f0401a0;
public static final int queryBackground = 0x7f0401a1;
public static final int queryHint = 0x7f0401a2;
public static final int radioButtonStyle = 0x7f0401a3;
public static final int ratingBarStyle = 0x7f0401a4;
public static final int ratingBarStyleIndicator = 0x7f0401a5;
public static final int ratingBarStyleSmall = 0x7f0401a6;
public static final int reverseLayout = 0x7f0401a7;
public static final int searchHintIcon = 0x7f0401ad;
public static final int searchIcon = 0x7f0401ae;
public static final int searchViewStyle = 0x7f0401af;
public static final int seekBarStyle = 0x7f0401b0;
public static final int selectableItemBackground = 0x7f0401b1;
public static final int selectableItemBackgroundBorderless = 0x7f0401b2;
public static final int showAsAction = 0x7f0401b3;
public static final int showDividers = 0x7f0401b4;
public static final int showText = 0x7f0401b6;
public static final int showTitle = 0x7f0401b7;
public static final int singleChoiceItemLayout = 0x7f0401b8;
public static final int spanCount = 0x7f0401be;
public static final int spinBars = 0x7f0401bf;
public static final int spinnerDropDownItemStyle = 0x7f0401c0;
public static final int spinnerStyle = 0x7f0401c1;
public static final int splitTrack = 0x7f0401c2;
public static final int srcCompat = 0x7f0401c3;
public static final int stackFromEnd = 0x7f0401c4;
public static final int state_above_anchor = 0x7f0401c5;
public static final int statusBarBackground = 0x7f0401ca;
public static final int subMenuArrow = 0x7f0401ce;
public static final int submitBackground = 0x7f0401cf;
public static final int subtitle = 0x7f0401d0;
public static final int subtitleTextAppearance = 0x7f0401d1;
public static final int subtitleTextColor = 0x7f0401d2;
public static final int subtitleTextStyle = 0x7f0401d3;
public static final int suggestionRowLayout = 0x7f0401d4;
public static final int switchMinWidth = 0x7f0401d5;
public static final int switchPadding = 0x7f0401d6;
public static final int switchStyle = 0x7f0401d7;
public static final int switchTextAppearance = 0x7f0401d8;
public static final int textAllCaps = 0x7f0401f3;
public static final int textAppearanceLargePopupMenu = 0x7f0401fe;
public static final int textAppearanceListItem = 0x7f0401ff;
public static final int textAppearanceListItemSecondary = 0x7f040200;
public static final int textAppearanceListItemSmall = 0x7f040201;
public static final int textAppearancePopupMenuHeader = 0x7f040203;
public static final int textAppearanceSearchResultSubtitle = 0x7f040204;
public static final int textAppearanceSearchResultTitle = 0x7f040205;
public static final int textAppearanceSmallPopupMenu = 0x7f040206;
public static final int textColorAlertDialogListItem = 0x7f040209;
public static final int textColorSearchUrl = 0x7f04020a;
public static final int theme = 0x7f04020e;
public static final int thickness = 0x7f04020f;
public static final int thumbTextPadding = 0x7f040210;
public static final int thumbTint = 0x7f040211;
public static final int thumbTintMode = 0x7f040212;
public static final int tickMark = 0x7f040213;
public static final int tickMarkTint = 0x7f040214;
public static final int tickMarkTintMode = 0x7f040215;
public static final int tint = 0x7f040216;
public static final int tintMode = 0x7f040217;
public static final int title = 0x7f040218;
public static final int titleMargin = 0x7f04021a;
public static final int titleMarginBottom = 0x7f04021b;
public static final int titleMarginEnd = 0x7f04021c;
public static final int titleMarginStart = 0x7f04021d;
public static final int titleMarginTop = 0x7f04021e;
public static final int titleMargins = 0x7f04021f;
public static final int titleTextAppearance = 0x7f040220;
public static final int titleTextColor = 0x7f040221;
public static final int titleTextStyle = 0x7f040222;
public static final int toolbarNavigationButtonStyle = 0x7f040224;
public static final int toolbarStyle = 0x7f040225;
public static final int tooltipForegroundColor = 0x7f040226;
public static final int tooltipFrameBackground = 0x7f040227;
public static final int tooltipText = 0x7f040228;
public static final int track = 0x7f040229;
public static final int trackTint = 0x7f04022a;
public static final int trackTintMode = 0x7f04022b;
public static final int ttcIndex = 0x7f04022c;
public static final int viewInflaterClass = 0x7f04022e;
public static final int voiceIcon = 0x7f04022f;
public static final int windowActionBar = 0x7f040230;
public static final int windowActionBarOverlay = 0x7f040231;
public static final int windowActionModeOverlay = 0x7f040232;
public static final int windowFixedHeightMajor = 0x7f040233;
public static final int windowFixedHeightMinor = 0x7f040234;
public static final int windowFixedWidthMajor = 0x7f040235;
public static final int windowFixedWidthMinor = 0x7f040236;
public static final int windowMinWidthMajor = 0x7f040237;
public static final int windowMinWidthMinor = 0x7f040238;
public static final int windowNoTitle = 0x7f040239;
}
public static final class bool {
private bool() {}
public static final int abc_action_bar_embed_tabs = 0x7f050000;
public static final int abc_allow_stacked_button_bar = 0x7f050001;
public static final int abc_config_actionMenuItemAllCaps = 0x7f050002;
}
public static final class color {
private color() {}
public static final int abc_background_cache_hint_selector_material_dark = 0x7f060013;
public static final int abc_background_cache_hint_selector_material_light = 0x7f060014;
public static final int abc_btn_colored_borderless_text_material = 0x7f060015;
public static final int abc_btn_colored_text_material = 0x7f060016;
public static final int abc_color_highlight_material = 0x7f060017;
public static final int abc_hint_foreground_material_dark = 0x7f060018;
public static final int abc_hint_foreground_material_light = 0x7f060019;
public static final int abc_input_method_navigation_guard = 0x7f06001a;
public static final int abc_primary_text_disable_only_material_dark = 0x7f06001b;
public static final int abc_primary_text_disable_only_material_light = 0x7f06001c;
public static final int abc_primary_text_material_dark = 0x7f06001d;
public static final int abc_primary_text_material_light = 0x7f06001e;
public static final int abc_search_url_text = 0x7f06001f;
public static final int abc_search_url_text_normal = 0x7f060020;
public static final int abc_search_url_text_pressed = 0x7f060021;
public static final int abc_search_url_text_selected = 0x7f060022;
public static final int abc_secondary_text_material_dark = 0x7f060023;
public static final int abc_secondary_text_material_light = 0x7f060024;
public static final int abc_tint_btn_checkable = 0x7f060025;
public static final int abc_tint_default = 0x7f060026;
public static final int abc_tint_edittext = 0x7f060027;
public static final int abc_tint_seek_thumb = 0x7f060028;
public static final int abc_tint_spinner = 0x7f060029;
public static final int abc_tint_switch_track = 0x7f06002a;
public static final int accent_material_dark = 0x7f06002b;
public static final int accent_material_light = 0x7f06002c;
public static final int background_floating_material_dark = 0x7f06002d;
public static final int background_floating_material_light = 0x7f06002e;
public static final int background_material_dark = 0x7f06002f;
public static final int background_material_light = 0x7f060030;
public static final int bright_foreground_disabled_material_dark = 0x7f060032;
public static final int bright_foreground_disabled_material_light = 0x7f060033;
public static final int bright_foreground_inverse_material_dark = 0x7f060034;
public static final int bright_foreground_inverse_material_light = 0x7f060035;
public static final int bright_foreground_material_dark = 0x7f060036;
public static final int bright_foreground_material_light = 0x7f060037;
public static final int button_material_dark = 0x7f06003c;
public static final int button_material_light = 0x7f06003d;
public static final int dim_foreground_disabled_material_dark = 0x7f060072;
public static final int dim_foreground_disabled_material_light = 0x7f060073;
public static final int dim_foreground_material_dark = 0x7f060074;
public static final int dim_foreground_material_light = 0x7f060075;
public static final int error_color_material_dark = 0x7f060076;
public static final int error_color_material_light = 0x7f060077;
public static final int foreground_material_dark = 0x7f060078;
public static final int foreground_material_light = 0x7f060079;
public static final int highlighted_text_material_dark = 0x7f060086;
public static final int highlighted_text_material_light = 0x7f060087;
public static final int material_blue_grey_800 = 0x7f060088;
public static final int material_blue_grey_900 = 0x7f060089;
public static final int material_blue_grey_950 = 0x7f06008a;
public static final int material_deep_teal_200 = 0x7f06008b;
public static final int material_deep_teal_500 = 0x7f06008c;
public static final int material_grey_100 = 0x7f06008d;
public static final int material_grey_300 = 0x7f06008e;
public static final int material_grey_50 = 0x7f06008f;
public static final int material_grey_600 = 0x7f060090;
public static final int material_grey_800 = 0x7f060091;
public static final int material_grey_850 = 0x7f060092;
public static final int material_grey_900 = 0x7f060093;
public static final int notification_action_color_filter = 0x7f0600ae;
public static final int notification_icon_bg_color = 0x7f0600af;
public static final int primary_dark_material_dark = 0x7f0600b1;
public static final int primary_dark_material_light = 0x7f0600b2;
public static final int primary_material_dark = 0x7f0600b3;
public static final int primary_material_light = 0x7f0600b4;
public static final int primary_text_default_material_dark = 0x7f0600b5;
public static final int primary_text_default_material_light = 0x7f0600b6;
public static final int primary_text_disabled_material_dark = 0x7f0600b7;
public static final int primary_text_disabled_material_light = 0x7f0600b8;
public static final int ripple_material_dark = 0x7f0600b9;
public static final int ripple_material_light = 0x7f0600ba;
public static final int secondary_text_default_material_dark = 0x7f0600bb;
public static final int secondary_text_default_material_light = 0x7f0600bc;
public static final int secondary_text_disabled_material_dark = 0x7f0600bd;
public static final int secondary_text_disabled_material_light = 0x7f0600be;
public static final int switch_thumb_disabled_material_dark = 0x7f0600bf;
public static final int switch_thumb_disabled_material_light = 0x7f0600c0;
public static final int switch_thumb_material_dark = 0x7f0600c1;
public static final int switch_thumb_material_light = 0x7f0600c2;
public static final int switch_thumb_normal_material_dark = 0x7f0600c3;
public static final int switch_thumb_normal_material_light = 0x7f0600c4;
public static final int tooltip_background_dark = 0x7f0600c5;
public static final int tooltip_background_light = 0x7f0600c6;
}
public static final class dimen {
private dimen() {}
public static final int abc_action_bar_content_inset_material = 0x7f070000;
public static final int abc_action_bar_content_inset_with_nav = 0x7f070001;
public static final int abc_action_bar_default_height_material = 0x7f070002;
public static final int abc_action_bar_default_padding_end_material = 0x7f070003;
public static final int abc_action_bar_default_padding_start_material = 0x7f070004;
public static final int abc_action_bar_elevation_material = 0x7f070005;
public static final int abc_action_bar_icon_vertical_padding_material = 0x7f070006;
public static final int abc_action_bar_overflow_padding_end_material = 0x7f070007;
public static final int abc_action_bar_overflow_padding_start_material = 0x7f070008;
public static final int abc_action_bar_stacked_max_height = 0x7f070009;
public static final int abc_action_bar_stacked_tab_max_width = 0x7f07000a;
public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f07000b;
public static final int abc_action_bar_subtitle_top_margin_material = 0x7f07000c;
public static final int abc_action_button_min_height_material = 0x7f07000d;
public static final int abc_action_button_min_width_material = 0x7f07000e;
public static final int abc_action_button_min_width_overflow_material = 0x7f07000f;
public static final int abc_alert_dialog_button_bar_height = 0x7f070010;
public static final int abc_alert_dialog_button_dimen = 0x7f070011;
public static final int abc_button_inset_horizontal_material = 0x7f070012;
public static final int abc_button_inset_vertical_material = 0x7f070013;
public static final int abc_button_padding_horizontal_material = 0x7f070014;
public static final int abc_button_padding_vertical_material = 0x7f070015;
public static final int abc_cascading_menus_min_smallest_width = 0x7f070016;
public static final int abc_config_prefDialogWidth = 0x7f070017;
public static final int abc_control_corner_material = 0x7f070018;
public static final int abc_control_inset_material = 0x7f070019;
public static final int abc_control_padding_material = 0x7f07001a;
public static final int abc_dialog_corner_radius_material = 0x7f07001b;
public static final int abc_dialog_fixed_height_major = 0x7f07001c;
public static final int abc_dialog_fixed_height_minor = 0x7f07001d;
public static final int abc_dialog_fixed_width_major = 0x7f07001e;
public static final int abc_dialog_fixed_width_minor = 0x7f07001f;
public static final int abc_dialog_list_padding_bottom_no_buttons = 0x7f070020;
public static final int abc_dialog_list_padding_top_no_title = 0x7f070021;
public static final int abc_dialog_min_width_major = 0x7f070022;
public static final int abc_dialog_min_width_minor = 0x7f070023;
public static final int abc_dialog_padding_material = 0x7f070024;
public static final int abc_dialog_padding_top_material = 0x7f070025;
public static final int abc_dialog_title_divider_material = 0x7f070026;
public static final int abc_disabled_alpha_material_dark = 0x7f070027;
public static final int abc_disabled_alpha_material_light = 0x7f070028;
public static final int abc_dropdownitem_icon_width = 0x7f070029;
public static final int abc_dropdownitem_text_padding_left = 0x7f07002a;
public static final int abc_dropdownitem_text_padding_right = 0x7f07002b;
public static final int abc_edit_text_inset_bottom_material = 0x7f07002c;
public static final int abc_edit_text_inset_horizontal_material = 0x7f07002d;
public static final int abc_edit_text_inset_top_material = 0x7f07002e;
public static final int abc_floating_window_z = 0x7f07002f;
public static final int abc_list_item_padding_horizontal_material = 0x7f070030;
public static final int abc_panel_menu_list_width = 0x7f070031;
public static final int abc_progress_bar_height_material = 0x7f070032;
public static final int abc_search_view_preferred_height = 0x7f070033;
public static final int abc_search_view_preferred_width = 0x7f070034;
public static final int abc_seekbar_track_background_height_material = 0x7f070035;
public static final int abc_seekbar_track_progress_height_material = 0x7f070036;
public static final int abc_select_dialog_padding_start_material = 0x7f070037;
public static final int abc_switch_padding = 0x7f070038;
public static final int abc_text_size_body_1_material = 0x7f070039;
public static final int abc_text_size_body_2_material = 0x7f07003a;
public static final int abc_text_size_button_material = 0x7f07003b;
public static final int abc_text_size_caption_material = 0x7f07003c;
public static final int abc_text_size_display_1_material = 0x7f07003d;
public static final int abc_text_size_display_2_material = 0x7f07003e;
public static final int abc_text_size_display_3_material = 0x7f07003f;
public static final int abc_text_size_display_4_material = 0x7f070040;
public static final int abc_text_size_headline_material = 0x7f070041;
public static final int abc_text_size_large_material = 0x7f070042;
public static final int abc_text_size_medium_material = 0x7f070043;
public static final int abc_text_size_menu_header_material = 0x7f070044;
public static final int abc_text_size_menu_material = 0x7f070045;
public static final int abc_text_size_small_material = 0x7f070046;
public static final int abc_text_size_subhead_material = 0x7f070047;
public static final int abc_text_size_subtitle_material_toolbar = 0x7f070048;
public static final int abc_text_size_title_material = 0x7f070049;
public static final int abc_text_size_title_material_toolbar = 0x7f07004a;
public static final int compat_button_inset_horizontal_material = 0x7f070064;
public static final int compat_button_inset_vertical_material = 0x7f070065;
public static final int compat_button_padding_horizontal_material = 0x7f070066;
public static final int compat_button_padding_vertical_material = 0x7f070067;
public static final int compat_control_corner_material = 0x7f070068;
public static final int compat_notification_large_icon_max_height = 0x7f070069;
public static final int compat_notification_large_icon_max_width = 0x7f07006a;
public static final int disabled_alpha_material_dark = 0x7f070097;
public static final int disabled_alpha_material_light = 0x7f070098;
public static final int fastscroll_default_thickness = 0x7f07009a;
public static final int fastscroll_margin = 0x7f07009b;
public static final int fastscroll_minimum_range = 0x7f07009c;
public static final int highlight_alpha_material_colored = 0x7f0700a9;
public static final int highlight_alpha_material_dark = 0x7f0700aa;
public static final int highlight_alpha_material_light = 0x7f0700ab;
public static final int hint_alpha_material_dark = 0x7f0700ac;
public static final int hint_alpha_material_light = 0x7f0700ad;
public static final int hint_pressed_alpha_material_dark = 0x7f0700ae;
public static final int hint_pressed_alpha_material_light = 0x7f0700af;
public static final int item_touch_helper_max_drag_scroll_per_frame = 0x7f0700b0;
public static final int item_touch_helper_swipe_escape_max_velocity = 0x7f0700b1;
public static final int item_touch_helper_swipe_escape_velocity = 0x7f0700b2;
public static final int notification_action_icon_size = 0x7f0700e5;
public static final int notification_action_text_size = 0x7f0700e6;
public static final int notification_big_circle_margin = 0x7f0700e7;
public static final int notification_content_margin_start = 0x7f0700e8;
public static final int notification_large_icon_height = 0x7f0700e9;
public static final int notification_large_icon_width = 0x7f0700ea;
public static final int notification_main_column_padding_top = 0x7f0700eb;
public static final int notification_media_narrow_margin = 0x7f0700ec;
public static final int notification_right_icon_size = 0x7f0700ed;
public static final int notification_right_side_padding_top = 0x7f0700ee;
public static final int notification_small_icon_background_padding = 0x7f0700ef;
public static final int notification_small_icon_size_as_large = 0x7f0700f0;
public static final int notification_subtext_size = 0x7f0700f1;
public static final int notification_top_pad = 0x7f0700f2;
public static final int notification_top_pad_large_text = 0x7f0700f3;
public static final int tooltip_corner_radius = 0x7f0700f8;
public static final int tooltip_horizontal_padding = 0x7f0700f9;
public static final int tooltip_margin = 0x7f0700fa;
public static final int tooltip_precise_anchor_extra_offset = 0x7f0700fb;
public static final int tooltip_precise_anchor_threshold = 0x7f0700fc;
public static final int tooltip_vertical_padding = 0x7f0700fd;
public static final int tooltip_y_offset_non_touch = 0x7f0700fe;
public static final int tooltip_y_offset_touch = 0x7f0700ff;
}
public static final class drawable {
private drawable() {}
public static final int abc_ab_share_pack_mtrl_alpha = 0x7f080006;
public static final int abc_action_bar_item_background_material = 0x7f080007;
public static final int abc_btn_borderless_material = 0x7f080008;
public static final int abc_btn_check_material = 0x7f080009;
public static final int abc_btn_check_to_on_mtrl_000 = 0x7f08000a;
public static final int abc_btn_check_to_on_mtrl_015 = 0x7f08000b;
public static final int abc_btn_colored_material = 0x7f08000c;
public static final int abc_btn_default_mtrl_shape = 0x7f08000d;
public static final int abc_btn_radio_material = 0x7f08000e;
public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f08000f;
public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f080010;
public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f080011;
public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f080012;
public static final int abc_cab_background_internal_bg = 0x7f080013;
public static final int abc_cab_background_top_material = 0x7f080014;
public static final int abc_cab_background_top_mtrl_alpha = 0x7f080015;
public static final int abc_control_background_material = 0x7f080016;
public static final int abc_dialog_material_background = 0x7f080017;
public static final int abc_edit_text_material = 0x7f080018;
public static final int abc_ic_ab_back_material = 0x7f080019;
public static final int abc_ic_arrow_drop_right_black_24dp = 0x7f08001a;
public static final int abc_ic_clear_material = 0x7f08001b;
public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f08001c;
public static final int abc_ic_go_search_api_material = 0x7f08001d;
public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f08001e;
public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f08001f;
public static final int abc_ic_menu_overflow_material = 0x7f080020;
public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f080021;
public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f080022;
public static final int abc_ic_menu_share_mtrl_alpha = 0x7f080023;
public static final int abc_ic_search_api_material = 0x7f080024;
public static final int abc_ic_star_black_16dp = 0x7f080025;
public static final int abc_ic_star_black_36dp = 0x7f080026;
public static final int abc_ic_star_black_48dp = 0x7f080027;
public static final int abc_ic_star_half_black_16dp = 0x7f080028;
public static final int abc_ic_star_half_black_36dp = 0x7f080029;
public static final int abc_ic_star_half_black_48dp = 0x7f08002a;
public static final int abc_ic_voice_search_api_material = 0x7f08002b;
public static final int abc_item_background_holo_dark = 0x7f08002c;
public static final int abc_item_background_holo_light = 0x7f08002d;
public static final int abc_list_divider_material = 0x7f08002e;
public static final int abc_list_divider_mtrl_alpha = 0x7f08002f;
public static final int abc_list_focused_holo = 0x7f080030;
public static final int abc_list_longpressed_holo = 0x7f080031;
public static final int abc_list_pressed_holo_dark = 0x7f080032;
public static final int abc_list_pressed_holo_light = 0x7f080033;
public static final int abc_list_selector_background_transition_holo_dark = 0x7f080034;
public static final int abc_list_selector_background_transition_holo_light = 0x7f080035;
public static final int abc_list_selector_disabled_holo_dark = 0x7f080036;
public static final int abc_list_selector_disabled_holo_light = 0x7f080037;
public static final int abc_list_selector_holo_dark = 0x7f080038;
public static final int abc_list_selector_holo_light = 0x7f080039;
public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f08003a;
public static final int abc_popup_background_mtrl_mult = 0x7f08003b;
public static final int abc_ratingbar_indicator_material = 0x7f08003c;
public static final int abc_ratingbar_material = 0x7f08003d;
public static final int abc_ratingbar_small_material = 0x7f08003e;
public static final int abc_scrubber_control_off_mtrl_alpha = 0x7f08003f;
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f080040;
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f080041;
public static final int abc_scrubber_primary_mtrl_alpha = 0x7f080042;
public static final int abc_scrubber_track_mtrl_alpha = 0x7f080043;
public static final int abc_seekbar_thumb_material = 0x7f080044;
public static final int abc_seekbar_tick_mark_material = 0x7f080045;
public static final int abc_seekbar_track_material = 0x7f080046;
public static final int abc_spinner_mtrl_am_alpha = 0x7f080047;
public static final int abc_spinner_textfield_background_material = 0x7f080048;
public static final int abc_switch_thumb_material = 0x7f080049;
public static final int abc_switch_track_mtrl_alpha = 0x7f08004a;
public static final int abc_tab_indicator_material = 0x7f08004b;
public static final int abc_tab_indicator_mtrl_alpha = 0x7f08004c;
public static final int abc_text_cursor_material = 0x7f08004d;
public static final int abc_text_select_handle_left_mtrl_dark = 0x7f08004e;
public static final int abc_text_select_handle_left_mtrl_light = 0x7f08004f;
public static final int abc_text_select_handle_middle_mtrl_dark = 0x7f080050;
public static final int abc_text_select_handle_middle_mtrl_light = 0x7f080051;
public static final int abc_text_select_handle_right_mtrl_dark = 0x7f080052;
public static final int abc_text_select_handle_right_mtrl_light = 0x7f080053;
public static final int abc_textfield_activated_mtrl_alpha = 0x7f080054;
public static final int abc_textfield_default_mtrl_alpha = 0x7f080055;
public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f080056;
public static final int abc_textfield_search_default_mtrl_alpha = 0x7f080057;
public static final int abc_textfield_search_material = 0x7f080058;
public static final int abc_vector_test = 0x7f080059;
public static final int notification_action_background = 0x7f0800db;
public static final int notification_bg = 0x7f0800dc;
public static final int notification_bg_low = 0x7f0800dd;
public static final int notification_bg_low_normal = 0x7f0800de;
public static final int notification_bg_low_pressed = 0x7f0800df;
public static final int notification_bg_normal = 0x7f0800e0;
public static final int notification_bg_normal_pressed = 0x7f0800e1;
public static final int notification_icon_background = 0x7f0800e2;
public static final int notification_template_icon_bg = 0x7f0800e3;
public static final int notification_template_icon_low_bg = 0x7f0800e4;
public static final int notification_tile_bg = 0x7f0800e5;
public static final int notify_panel_notification_icon_bg = 0x7f0800e6;
public static final int tooltip_frame_dark = 0x7f0800ec;
public static final int tooltip_frame_light = 0x7f0800ed;
}
public static final class id {
private id() {}
public static final int action_bar = 0x7f09000e;
public static final int action_bar_activity_content = 0x7f09000f;
public static final int action_bar_container = 0x7f090010;
public static final int action_bar_root = 0x7f090011;
public static final int action_bar_spinner = 0x7f090012;
public static final int action_bar_subtitle = 0x7f090013;
public static final int action_bar_title = 0x7f090014;
public static final int action_container = 0x7f090015;
public static final int action_context_bar = 0x7f090016;
public static final int action_divider = 0x7f090017;
public static final int action_image = 0x7f090019;
public static final int action_menu_divider = 0x7f09001b;
public static final int action_menu_presenter = 0x7f09001c;
public static final int action_mode_bar = 0x7f09001d;
public static final int action_mode_bar_stub = 0x7f09001e;
public static final int action_mode_close_button = 0x7f09001f;
public static final int action_text = 0x7f090027;
public static final int actions = 0x7f090028;
public static final int activity_chooser_view_content = 0x7f090029;
public static final int add = 0x7f09002a;
public static final int alertTitle = 0x7f09002d;
public static final int async = 0x7f090031;
public static final int blocking = 0x7f090036;
public static final int bottom = 0x7f090037;
public static final int buttonPanel = 0x7f090042;
public static final int checkbox = 0x7f090051;
public static final int chronometer = 0x7f090052;
public static final int content = 0x7f090066;
public static final int contentPanel = 0x7f090067;
public static final int custom = 0x7f09006b;
public static final int customPanel = 0x7f09006c;
public static final int decor_content_parent = 0x7f09006e;
public static final int default_activity_button = 0x7f09006f;
public static final int edit_query = 0x7f090085;
public static final int end = 0x7f09008c;
public static final int expand_activities_button = 0x7f090091;
public static final int expanded_menu = 0x7f090092;
public static final int forever = 0x7f0900a5;
public static final int group_divider = 0x7f0900ad;
public static final int home = 0x7f0900b6;
public static final int icon = 0x7f0900b9;
public static final int icon_group = 0x7f0900ba;
public static final int image = 0x7f0900bd;
public static final int info = 0x7f0900be;
public static final int italic = 0x7f0900c3;
public static final int item_touch_helper_previous_elevation = 0x7f0900c4;
public static final int left = 0x7f0900c8;
public static final int line1 = 0x7f0900cc;
public static final int line3 = 0x7f0900ce;
public static final int listMode = 0x7f0900d1;
public static final int list_item = 0x7f0900d2;
public static final int message = 0x7f0900fd;
public static final int multiply = 0x7f090103;
public static final int none = 0x7f090109;
public static final int normal = 0x7f09010a;
public static final int notification_background = 0x7f09010b;
public static final int notification_main_column = 0x7f09010c;
public static final int notification_main_column_container = 0x7f09010d;
public static final int parentPanel = 0x7f090118;
public static final int progress_circular = 0x7f090129;
public static final int progress_horizontal = 0x7f09012a;
public static final int radio = 0x7f09012b;
public static final int recycler_view = 0x7f09012d;
public static final int right = 0x7f09013d;
public static final int right_icon = 0x7f09013e;
public static final int right_side = 0x7f09013f;
public static final int screen = 0x7f090144;
public static final int scrollIndicatorDown = 0x7f090146;
public static final int scrollIndicatorUp = 0x7f090147;
public static final int scrollView = 0x7f090148;
public static final int search_badge = 0x7f09014a;
public static final int search_bar = 0x7f09014b;
public static final int search_button = 0x7f09014c;
public static final int search_close_btn = 0x7f09014d;
public static final int search_edit_frame = 0x7f09014e;
public static final int search_go_btn = 0x7f09014f;
public static final int search_mag_icon = 0x7f090150;
public static final int search_plate = 0x7f090151;
public static final int search_src_text = 0x7f090152;
public static final int search_voice_btn = 0x7f090153;
public static final int select_dialog_listview = 0x7f090154;
public static final int shortcut = 0x7f090159;
public static final int spacer = 0x7f090165;
public static final int split_action_bar = 0x7f090166;
public static final int src_atop = 0x7f090169;
public static final int src_in = 0x7f09016a;
public static final int src_over = 0x7f09016b;
public static final int start = 0x7f09016d;
public static final int submenuarrow = 0x7f090170;
public static final int submit_area = 0x7f090171;
public static final int tabMode = 0x7f090173;
public static final int tag_transition_group = 0x7f090175;
public static final int tag_unhandled_key_event_manager = 0x7f090176;
public static final int tag_unhandled_key_listeners = 0x7f090177;
public static final int text = 0x7f090178;
public static final int text2 = 0x7f090179;
public static final int textSpacerNoButtons = 0x7f09017a;
public static final int textSpacerNoTitle = 0x7f09017b;
public static final int time = 0x7f090184;
public static final int title = 0x7f090185;
public static final int titleDividerNoCustom = 0x7f090186;
public static final int title_template = 0x7f090187;
public static final int top = 0x7f090189;
public static final int topPanel = 0x7f09018a;
public static final int uniform = 0x7f090197;
public static final int up = 0x7f09019a;
public static final int wrap_content = 0x7f0901a6;
}
public static final class integer {
private integer() {}
public static final int abc_config_activityDefaultDur = 0x7f0a0000;
public static final int abc_config_activityShortDur = 0x7f0a0001;
public static final int cancel_button_image_alpha = 0x7f0a0004;
public static final int config_tooltipAnimTime = 0x7f0a0005;
public static final int status_bar_notification_info_maxnum = 0x7f0a0010;
}
public static final class layout {
private layout() {}
public static final int abc_action_bar_title_item = 0x7f0c0001;
public static final int abc_action_bar_up_container = 0x7f0c0002;
public static final int abc_action_menu_item_layout = 0x7f0c0003;
public static final int abc_action_menu_layout = 0x7f0c0004;
public static final int abc_action_mode_bar = 0x7f0c0005;
public static final int abc_action_mode_close_item_material = 0x7f0c0006;
public static final int abc_activity_chooser_view = 0x7f0c0007;
public static final int abc_activity_chooser_view_list_item = 0x7f0c0008;
public static final int abc_alert_dialog_button_bar_material = 0x7f0c0009;
public static final int abc_alert_dialog_material = 0x7f0c000a;
public static final int abc_alert_dialog_title_material = 0x7f0c000b;
public static final int abc_cascading_menu_item_layout = 0x7f0c000c;
public static final int abc_dialog_title_material = 0x7f0c000d;
public static final int abc_expanded_menu_layout = 0x7f0c000e;
public static final int abc_list_menu_item_checkbox = 0x7f0c000f;
public static final int abc_list_menu_item_icon = 0x7f0c0010;
public static final int abc_list_menu_item_layout = 0x7f0c0011;
public static final int abc_list_menu_item_radio = 0x7f0c0012;
public static final int abc_popup_menu_header_item_layout = 0x7f0c0013;
public static final int abc_popup_menu_item_layout = 0x7f0c0014;
public static final int abc_screen_content_include = 0x7f0c0015;
public static final int abc_screen_simple = 0x7f0c0016;
public static final int abc_screen_simple_overlay_action_mode = 0x7f0c0017;
public static final int abc_screen_toolbar = 0x7f0c0018;
public static final int abc_search_dropdown_item_icons_2line = 0x7f0c0019;
public static final int abc_search_view = 0x7f0c001a;
public static final int abc_select_dialog_material = 0x7f0c001b;
public static final int abc_tooltip = 0x7f0c001c;
public static final int dialog_recycler = 0x7f0c003d;
public static final int notification_action = 0x7f0c0062;
public static final int notification_action_tombstone = 0x7f0c0063;
public static final int notification_template_custom_big = 0x7f0c006a;
public static final int notification_template_icon_group = 0x7f0c006b;
public static final int notification_template_part_chronometer = 0x7f0c006f;
public static final int notification_template_part_time = 0x7f0c0070;
public static final int select_dialog_item_material = 0x7f0c0073;
public static final int select_dialog_multichoice_material = 0x7f0c0074;
public static final int select_dialog_singlechoice_material = 0x7f0c0075;
public static final int support_simple_spinner_dropdown_item = 0x7f0c0077;
}
public static final class string {
private string() {}
public static final int abc_action_bar_home_description = 0x7f110000;
public static final int abc_action_bar_up_description = 0x7f110001;
public static final int abc_action_menu_overflow_description = 0x7f110002;
public static final int abc_action_mode_done = 0x7f110003;
public static final int abc_activity_chooser_view_see_all = 0x7f110004;
public static final int abc_activitychooserview_choose_application = 0x7f110005;
public static final int abc_capital_off = 0x7f110006;
public static final int abc_capital_on = 0x7f110007;
public static final int abc_font_family_body_1_material = 0x7f110008;
public static final int abc_font_family_body_2_material = 0x7f110009;
public static final int abc_font_family_button_material = 0x7f11000a;
public static final int abc_font_family_caption_material = 0x7f11000b;
public static final int abc_font_family_display_1_material = 0x7f11000c;
public static final int abc_font_family_display_2_material = 0x7f11000d;
public static final int abc_font_family_display_3_material = 0x7f11000e;
public static final int abc_font_family_display_4_material = 0x7f11000f;
public static final int abc_font_family_headline_material = 0x7f110010;
public static final int abc_font_family_menu_material = 0x7f110011;
public static final int abc_font_family_subhead_material = 0x7f110012;
public static final int abc_font_family_title_material = 0x7f110013;
public static final int abc_menu_alt_shortcut_label = 0x7f110014;
public static final int abc_menu_ctrl_shortcut_label = 0x7f110015;
public static final int abc_menu_delete_shortcut_label = 0x7f110016;
public static final int abc_menu_enter_shortcut_label = 0x7f110017;
public static final int abc_menu_function_shortcut_label = 0x7f110018;
public static final int abc_menu_meta_shortcut_label = 0x7f110019;
public static final int abc_menu_shift_shortcut_label = 0x7f11001a;
public static final int abc_menu_space_shortcut_label = 0x7f11001b;
public static final int abc_menu_sym_shortcut_label = 0x7f11001c;
public static final int abc_prepend_shortcut_label = 0x7f11001d;
public static final int abc_search_hint = 0x7f11001e;
public static final int abc_searchview_description_clear = 0x7f11001f;
public static final int abc_searchview_description_query = 0x7f110020;
public static final int abc_searchview_description_search = 0x7f110021;
public static final int abc_searchview_description_submit = 0x7f110022;
public static final int abc_searchview_description_voice = 0x7f110023;
public static final int abc_shareactionprovider_share_with = 0x7f110024;
public static final int abc_shareactionprovider_share_with_application = 0x7f110025;
public static final int abc_toolbar_collapse_description = 0x7f110026;
public static final int app_name = 0x7f110029;
public static final int search_menu_title = 0x7f1100de;
public static final int status_bar_notification_info_overflow = 0x7f1100e0;
}
public static final class style {
private style() {}
public static final int AlertDialog_AppCompat = 0x7f120000;
public static final int AlertDialog_AppCompat_Light = 0x7f120001;
public static final int Animation_AppCompat_Dialog = 0x7f120002;
public static final int Animation_AppCompat_DropDownUp = 0x7f120003;
public static final int Animation_AppCompat_Tooltip = 0x7f120004;
public static final int Base_AlertDialog_AppCompat = 0x7f12000e;
public static final int Base_AlertDialog_AppCompat_Light = 0x7f12000f;
public static final int Base_Animation_AppCompat_Dialog = 0x7f120010;
public static final int Base_Animation_AppCompat_DropDownUp = 0x7f120011;
public static final int Base_Animation_AppCompat_Tooltip = 0x7f120012;
public static final int Base_DialogWindowTitleBackground_AppCompat = 0x7f120015;
public static final int Base_DialogWindowTitle_AppCompat = 0x7f120014;
public static final int Base_TextAppearance_AppCompat = 0x7f120016;
public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f120017;
public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f120018;
public static final int Base_TextAppearance_AppCompat_Button = 0x7f120019;
public static final int Base_TextAppearance_AppCompat_Caption = 0x7f12001a;
public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f12001b;
public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f12001c;
public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f12001d;
public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f12001e;
public static final int Base_TextAppearance_AppCompat_Headline = 0x7f12001f;
public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f120020;
public static final int Base_TextAppearance_AppCompat_Large = 0x7f120021;
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f120022;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f120023;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f120024;
public static final int Base_TextAppearance_AppCompat_Medium = 0x7f120025;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f120026;
public static final int Base_TextAppearance_AppCompat_Menu = 0x7f120027;
public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f120028;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f120029;
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f12002a;
public static final int Base_TextAppearance_AppCompat_Small = 0x7f12002b;
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f12002c;
public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f12002d;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f12002e;
public static final int Base_TextAppearance_AppCompat_Title = 0x7f12002f;
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f120030;
public static final int Base_TextAppearance_AppCompat_Tooltip = 0x7f120031;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f120032;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f120033;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f120034;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f120035;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f120036;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f120037;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f120038;
public static final int Base_TextAppearance_AppCompat_Widget_Button = 0x7f120039;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f12003a;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 0x7f12003b;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f12003c;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f12003d;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f12003e;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f12003f;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f120040;
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f120041;
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f120042;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f120043;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f120044;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f120045;
public static final int Base_ThemeOverlay_AppCompat = 0x7f120065;
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f120066;
public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f120067;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f120068;
public static final int Base_ThemeOverlay_AppCompat_Dialog = 0x7f120069;
public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 0x7f12006a;
public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f12006b;
public static final int Base_Theme_AppCompat = 0x7f120046;
public static final int Base_Theme_AppCompat_CompactMenu = 0x7f120047;
public static final int Base_Theme_AppCompat_Dialog = 0x7f120048;
public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f12004c;
public static final int Base_Theme_AppCompat_Dialog_Alert = 0x7f120049;
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f12004a;
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f12004b;
public static final int Base_Theme_AppCompat_Light = 0x7f12004d;
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f12004e;
public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f12004f;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f120053;
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f120050;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f120051;
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f120052;
public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 0x7f12007b;
public static final int Base_V21_Theme_AppCompat = 0x7f120077;
public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f120078;
public static final int Base_V21_Theme_AppCompat_Light = 0x7f120079;
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f12007a;
public static final int Base_V22_Theme_AppCompat = 0x7f12007c;
public static final int Base_V22_Theme_AppCompat_Light = 0x7f12007d;
public static final int Base_V23_Theme_AppCompat = 0x7f12007e;
public static final int Base_V23_Theme_AppCompat_Light = 0x7f12007f;
public static final int Base_V26_Theme_AppCompat = 0x7f120080;
public static final int Base_V26_Theme_AppCompat_Light = 0x7f120081;
public static final int Base_V26_Widget_AppCompat_Toolbar = 0x7f120082;
public static final int Base_V28_Theme_AppCompat = 0x7f120083;
public static final int Base_V28_Theme_AppCompat_Light = 0x7f120084;
public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 0x7f120089;
public static final int Base_V7_Theme_AppCompat = 0x7f120085;
public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f120086;
public static final int Base_V7_Theme_AppCompat_Light = 0x7f120087;
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f120088;
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f12008a;
public static final int Base_V7_Widget_AppCompat_EditText = 0x7f12008b;
public static final int Base_V7_Widget_AppCompat_Toolbar = 0x7f12008c;
public static final int Base_Widget_AppCompat_ActionBar = 0x7f12008d;
public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f12008e;
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f12008f;
public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f120090;
public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f120091;
public static final int Base_Widget_AppCompat_ActionButton = 0x7f120092;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f120093;
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f120094;
public static final int Base_Widget_AppCompat_ActionMode = 0x7f120095;
public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f120096;
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f120097;
public static final int Base_Widget_AppCompat_Button = 0x7f120098;
public static final int Base_Widget_AppCompat_ButtonBar = 0x7f12009e;
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f12009f;
public static final int Base_Widget_AppCompat_Button_Borderless = 0x7f120099;
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f12009a;
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f12009b;
public static final int Base_Widget_AppCompat_Button_Colored = 0x7f12009c;
public static final int Base_Widget_AppCompat_Button_Small = 0x7f12009d;
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f1200a0;
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f1200a1;
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f1200a2;
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f1200a3;
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f1200a4;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f1200a5;
public static final int Base_Widget_AppCompat_EditText = 0x7f1200a6;
public static final int Base_Widget_AppCompat_ImageButton = 0x7f1200a7;
public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f1200a8;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f1200a9;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f1200aa;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f1200ab;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f1200ac;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f1200ad;
public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f1200ae;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f1200af;
public static final int Base_Widget_AppCompat_ListMenuView = 0x7f1200b0;
public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f1200b1;
public static final int Base_Widget_AppCompat_ListView = 0x7f1200b2;
public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f1200b3;
public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f1200b4;
public static final int Base_Widget_AppCompat_PopupMenu = 0x7f1200b5;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f1200b6;
public static final int Base_Widget_AppCompat_PopupWindow = 0x7f1200b7;
public static final int Base_Widget_AppCompat_ProgressBar = 0x7f1200b8;
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f1200b9;
public static final int Base_Widget_AppCompat_RatingBar = 0x7f1200ba;
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f1200bb;
public static final int Base_Widget_AppCompat_RatingBar_Small = 0x7f1200bc;
public static final int Base_Widget_AppCompat_SearchView = 0x7f1200bd;
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f1200be;
public static final int Base_Widget_AppCompat_SeekBar = 0x7f1200bf;
public static final int Base_Widget_AppCompat_SeekBar_Discrete = 0x7f1200c0;
public static final int Base_Widget_AppCompat_Spinner = 0x7f1200c1;
public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f1200c2;
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f1200c3;
public static final int Base_Widget_AppCompat_Toolbar = 0x7f1200c4;
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f1200c5;
public static final int Platform_AppCompat = 0x7f12010c;
public static final int Platform_AppCompat_Light = 0x7f12010d;
public static final int Platform_ThemeOverlay_AppCompat = 0x7f120112;
public static final int Platform_ThemeOverlay_AppCompat_Dark = 0x7f120113;
public static final int Platform_ThemeOverlay_AppCompat_Light = 0x7f120114;
public static final int Platform_V21_AppCompat = 0x7f120115;
public static final int Platform_V21_AppCompat_Light = 0x7f120116;
public static final int Platform_V25_AppCompat = 0x7f120117;
public static final int Platform_V25_AppCompat_Light = 0x7f120118;
public static final int Platform_Widget_AppCompat_Spinner = 0x7f120119;
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f12011a;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f12011b;
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f12011c;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f12011d;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f12011e;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Shortcut = 0x7f12011f;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_SubmenuArrow = 0x7f120120;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f120121;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Title = 0x7f120122;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f120128;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f120123;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f120124;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f120125;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f120126;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f120127;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f120129;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f12012a;
public static final int TextAppearance_AppCompat = 0x7f12012b;
public static final int TextAppearance_AppCompat_Body1 = 0x7f12012c;
public static final int TextAppearance_AppCompat_Body2 = 0x7f12012d;
public static final int TextAppearance_AppCompat_Button = 0x7f12012e;
public static final int TextAppearance_AppCompat_Caption = 0x7f12012f;
public static final int TextAppearance_AppCompat_Display1 = 0x7f120130;
public static final int TextAppearance_AppCompat_Display2 = 0x7f120131;
public static final int TextAppearance_AppCompat_Display3 = 0x7f120132;
public static final int TextAppearance_AppCompat_Display4 = 0x7f120133;
public static final int TextAppearance_AppCompat_Headline = 0x7f120134;
public static final int TextAppearance_AppCompat_Inverse = 0x7f120135;
public static final int TextAppearance_AppCompat_Large = 0x7f120136;
public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f120137;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f120138;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f120139;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f12013a;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f12013b;
public static final int TextAppearance_AppCompat_Medium = 0x7f12013c;
public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f12013d;
public static final int TextAppearance_AppCompat_Menu = 0x7f12013e;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f12013f;
public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f120140;
public static final int TextAppearance_AppCompat_Small = 0x7f120141;
public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f120142;
public static final int TextAppearance_AppCompat_Subhead = 0x7f120143;
public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f120144;
public static final int TextAppearance_AppCompat_Title = 0x7f120145;
public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f120146;
public static final int TextAppearance_AppCompat_Tooltip = 0x7f120147;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f120148;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f120149;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f12014a;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f12014b;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f12014c;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f12014d;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f12014e;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f12014f;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f120150;
public static final int TextAppearance_AppCompat_Widget_Button = 0x7f120151;
public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f120152;
public static final int TextAppearance_AppCompat_Widget_Button_Colored = 0x7f120153;
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f120154;
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f120155;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f120156;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f120157;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f120158;
public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f120159;
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f12015a;
public static final int TextAppearance_Compat_Notification = 0x7f12015b;
public static final int TextAppearance_Compat_Notification_Info = 0x7f12015c;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f12015e;
public static final int TextAppearance_Compat_Notification_Time = 0x7f120161;
public static final int TextAppearance_Compat_Notification_Title = 0x7f120163;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f12017c;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f12017d;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f12017e;
public static final int ThemeOverlay_AppCompat = 0x7f1201af;
public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f1201b0;
public static final int ThemeOverlay_AppCompat_Dark = 0x7f1201b1;
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f1201b2;
public static final int ThemeOverlay_AppCompat_Dialog = 0x7f1201b3;
public static final int ThemeOverlay_AppCompat_Dialog_Alert = 0x7f1201b4;
public static final int ThemeOverlay_AppCompat_Light = 0x7f1201b5;
public static final int Theme_AppCompat = 0x7f12017f;
public static final int Theme_AppCompat_CompactMenu = 0x7f120180;
public static final int Theme_AppCompat_DayNight = 0x7f120181;
public static final int Theme_AppCompat_DayNight_DarkActionBar = 0x7f120182;
public static final int Theme_AppCompat_DayNight_Dialog = 0x7f120183;
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f120186;
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f120184;
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f120185;
public static final int Theme_AppCompat_DayNight_NoActionBar = 0x7f120187;
public static final int Theme_AppCompat_Dialog = 0x7f120188;
public static final int Theme_AppCompat_DialogWhenLarge = 0x7f12018b;
public static final int Theme_AppCompat_Dialog_Alert = 0x7f120189;
public static final int Theme_AppCompat_Dialog_MinWidth = 0x7f12018a;
public static final int Theme_AppCompat_Light = 0x7f12018c;
public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f12018d;
public static final int Theme_AppCompat_Light_Dialog = 0x7f12018e;
public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f120191;
public static final int Theme_AppCompat_Light_Dialog_Alert = 0x7f12018f;
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f120190;
public static final int Theme_AppCompat_Light_NoActionBar = 0x7f120192;
public static final int Theme_AppCompat_NoActionBar = 0x7f120193;
public static final int Widget_AppCompat_ActionBar = 0x7f1201c3;
public static final int Widget_AppCompat_ActionBar_Solid = 0x7f1201c4;
public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f1201c5;
public static final int Widget_AppCompat_ActionBar_TabText = 0x7f1201c6;
public static final int Widget_AppCompat_ActionBar_TabView = 0x7f1201c7;
public static final int Widget_AppCompat_ActionButton = 0x7f1201c8;
public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f1201c9;
public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f1201ca;
public static final int Widget_AppCompat_ActionMode = 0x7f1201cb;
public static final int Widget_AppCompat_ActivityChooserView = 0x7f1201cc;
public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f1201cd;
public static final int Widget_AppCompat_Button = 0x7f1201ce;
public static final int Widget_AppCompat_ButtonBar = 0x7f1201d4;
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f1201d5;
public static final int Widget_AppCompat_Button_Borderless = 0x7f1201cf;
public static final int Widget_AppCompat_Button_Borderless_Colored = 0x7f1201d0;
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f1201d1;
public static final int Widget_AppCompat_Button_Colored = 0x7f1201d2;
public static final int Widget_AppCompat_Button_Small = 0x7f1201d3;
public static final int Widget_AppCompat_CompoundButton_CheckBox = 0x7f1201d6;
public static final int Widget_AppCompat_CompoundButton_RadioButton = 0x7f1201d7;
public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f1201d8;
public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f1201d9;
public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f1201da;
public static final int Widget_AppCompat_EditText = 0x7f1201db;
public static final int Widget_AppCompat_ImageButton = 0x7f1201dc;
public static final int Widget_AppCompat_Light_ActionBar = 0x7f1201dd;
public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f1201de;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f1201df;
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f1201e0;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f1201e1;
public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f1201e2;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f1201e3;
public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f1201e4;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f1201e5;
public static final int Widget_AppCompat_Light_ActionButton = 0x7f1201e6;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f1201e7;
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f1201e8;
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f1201e9;
public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f1201ea;
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f1201eb;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f1201ec;
public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f1201ed;
public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f1201ee;
public static final int Widget_AppCompat_Light_PopupMenu = 0x7f1201ef;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f1201f0;
public static final int Widget_AppCompat_Light_SearchView = 0x7f1201f1;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f1201f2;
public static final int Widget_AppCompat_ListMenuView = 0x7f1201f3;
public static final int Widget_AppCompat_ListPopupWindow = 0x7f1201f4;
public static final int Widget_AppCompat_ListView = 0x7f1201f5;
public static final int Widget_AppCompat_ListView_DropDown = 0x7f1201f6;
public static final int Widget_AppCompat_ListView_Menu = 0x7f1201f7;
public static final int Widget_AppCompat_PopupMenu = 0x7f1201f8;
public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f1201f9;
public static final int Widget_AppCompat_PopupWindow = 0x7f1201fa;
public static final int Widget_AppCompat_ProgressBar = 0x7f1201fb;
public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f1201fc;
public static final int Widget_AppCompat_RatingBar = 0x7f1201fd;
public static final int Widget_AppCompat_RatingBar_Indicator = 0x7f1201fe;
public static final int Widget_AppCompat_RatingBar_Small = 0x7f1201ff;
public static final int Widget_AppCompat_SearchView = 0x7f120200;
public static final int Widget_AppCompat_SearchView_ActionBar = 0x7f120201;
public static final int Widget_AppCompat_SeekBar = 0x7f120202;
public static final int Widget_AppCompat_SeekBar_Discrete = 0x7f120203;
public static final int Widget_AppCompat_Spinner = 0x7f120204;
public static final int Widget_AppCompat_Spinner_DropDown = 0x7f120205;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f120206;
public static final int Widget_AppCompat_Spinner_Underlined = 0x7f120207;
public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f120208;
public static final int Widget_AppCompat_Toolbar = 0x7f120209;
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f12020a;
public static final int Widget_Compat_NotificationActionContainer = 0x7f12020b;
public static final int Widget_Compat_NotificationActionText = 0x7f12020c;
public static final int Widget_Support_CoordinatorLayout = 0x7f120243;
}
public static final class styleable {
private styleable() {}
public static final int[] ActionBar = { 0x7f040031, 0x7f040032, 0x7f040033, 0x7f0400a6, 0x7f0400a7, 0x7f0400a8, 0x7f0400a9, 0x7f0400aa, 0x7f0400ab, 0x7f0400b9, 0x7f0400be, 0x7f0400bf, 0x7f0400ce, 0x7f0400f9, 0x7f0400fe, 0x7f040103, 0x7f040104, 0x7f040106, 0x7f040112, 0x7f04011c, 0x7f040171, 0x7f04018a, 0x7f04019b, 0x7f04019f, 0x7f0401a0, 0x7f0401d0, 0x7f0401d3, 0x7f040218, 0x7f040222 };
public static final int ActionBar_background = 0;
public static final int ActionBar_backgroundSplit = 1;
public static final int ActionBar_backgroundStacked = 2;
public static final int ActionBar_contentInsetEnd = 3;
public static final int ActionBar_contentInsetEndWithActions = 4;
public static final int ActionBar_contentInsetLeft = 5;
public static final int ActionBar_contentInsetRight = 6;
public static final int ActionBar_contentInsetStart = 7;
public static final int ActionBar_contentInsetStartWithNavigation = 8;
public static final int ActionBar_customNavigationLayout = 9;
public static final int ActionBar_displayOptions = 10;
public static final int ActionBar_divider = 11;
public static final int ActionBar_elevation = 12;
public static final int ActionBar_height = 13;
public static final int ActionBar_hideOnContentScroll = 14;
public static final int ActionBar_homeAsUpIndicator = 15;
public static final int ActionBar_homeLayout = 16;
public static final int ActionBar_icon = 17;
public static final int ActionBar_indeterminateProgressStyle = 18;
public static final int ActionBar_itemPadding = 19;
public static final int ActionBar_logo = 20;
public static final int ActionBar_navigationMode = 21;
public static final int ActionBar_popupTheme = 22;
public static final int ActionBar_progressBarPadding = 23;
public static final int ActionBar_progressBarStyle = 24;
public static final int ActionBar_subtitle = 25;
public static final int ActionBar_subtitleTextStyle = 26;
public static final int ActionBar_title = 27;
public static final int ActionBar_titleTextStyle = 28;
public static final int[] ActionBarLayout = { 0x10100b3 };
public static final int ActionBarLayout_android_layout_gravity = 0;
public static final int[] ActionMenuItemView = { 0x101013f };
public static final int ActionMenuItemView_android_minWidth = 0;
public static final int[] ActionMenuView = { };
public static final int[] ActionMode = { 0x7f040031, 0x7f040032, 0x7f040083, 0x7f0400f9, 0x7f0401d3, 0x7f040222 };
public static final int ActionMode_background = 0;
public static final int ActionMode_backgroundSplit = 1;
public static final int ActionMode_closeItemLayout = 2;
public static final int ActionMode_height = 3;
public static final int ActionMode_subtitleTextStyle = 4;
public static final int ActionMode_titleTextStyle = 5;
public static final int[] ActivityChooserView = { 0x7f0400d4, 0x7f040113 };
public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 0;
public static final int ActivityChooserView_initialActivityCount = 1;
public static final int[] AlertDialog = { 0x10100f2, 0x7f040054, 0x7f040055, 0x7f040168, 0x7f040169, 0x7f040187, 0x7f0401b7, 0x7f0401b8 };
public static final int AlertDialog_android_layout = 0;
public static final int AlertDialog_buttonIconDimen = 1;
public static final int AlertDialog_buttonPanelSideLayout = 2;
public static final int AlertDialog_listItemLayout = 3;
public static final int AlertDialog_listLayout = 4;
public static final int AlertDialog_multiChoiceItemLayout = 5;
public static final int AlertDialog_showTitle = 6;
public static final int AlertDialog_singleChoiceItemLayout = 7;
public static final int[] AnimatedStateListDrawableCompat = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d };
public static final int AnimatedStateListDrawableCompat_android_dither = 0;
public static final int AnimatedStateListDrawableCompat_android_visible = 1;
public static final int AnimatedStateListDrawableCompat_android_variablePadding = 2;
public static final int AnimatedStateListDrawableCompat_android_constantSize = 3;
public static final int AnimatedStateListDrawableCompat_android_enterFadeDuration = 4;
public static final int AnimatedStateListDrawableCompat_android_exitFadeDuration = 5;
public static final int[] AnimatedStateListDrawableItem = { 0x10100d0, 0x1010199 };
public static final int AnimatedStateListDrawableItem_android_id = 0;
public static final int AnimatedStateListDrawableItem_android_drawable = 1;
public static final int[] AnimatedStateListDrawableTransition = { 0x1010199, 0x1010449, 0x101044a, 0x101044b };
public static final int AnimatedStateListDrawableTransition_android_drawable = 0;
public static final int AnimatedStateListDrawableTransition_android_toId = 1;
public static final int AnimatedStateListDrawableTransition_android_fromId = 2;
public static final int AnimatedStateListDrawableTransition_android_reversible = 3;
public static final int[] AppCompatImageView = { 0x1010119, 0x7f0401c3, 0x7f040216, 0x7f040217 };
public static final int AppCompatImageView_android_src = 0;
public static final int AppCompatImageView_srcCompat = 1;
public static final int AppCompatImageView_tint = 2;
public static final int AppCompatImageView_tintMode = 3;
public static final int[] AppCompatSeekBar = { 0x1010142, 0x7f040213, 0x7f040214, 0x7f040215 };
public static final int AppCompatSeekBar_android_thumb = 0;
public static final int AppCompatSeekBar_tickMark = 1;
public static final int AppCompatSeekBar_tickMarkTint = 2;
public static final int AppCompatSeekBar_tickMarkTintMode = 3;
public static final int[] AppCompatTextHelper = { 0x1010034, 0x101016d, 0x101016e, 0x101016f, 0x1010170, 0x1010392, 0x1010393 };
public static final int AppCompatTextHelper_android_textAppearance = 0;
public static final int AppCompatTextHelper_android_drawableTop = 1;
public static final int AppCompatTextHelper_android_drawableBottom = 2;
public static final int AppCompatTextHelper_android_drawableLeft = 3;
public static final int AppCompatTextHelper_android_drawableRight = 4;
public static final int AppCompatTextHelper_android_drawableStart = 5;
public static final int AppCompatTextHelper_android_drawableEnd = 6;
public static final int[] AppCompatTextView = { 0x1010034, 0x7f04002c, 0x7f04002d, 0x7f04002e, 0x7f04002f, 0x7f040030, 0x7f0400e8, 0x7f0400eb, 0x7f040124, 0x7f040164, 0x7f0401f3 };
public static final int AppCompatTextView_android_textAppearance = 0;
public static final int AppCompatTextView_autoSizeMaxTextSize = 1;
public static final int AppCompatTextView_autoSizeMinTextSize = 2;
public static final int AppCompatTextView_autoSizePresetSizes = 3;
public static final int AppCompatTextView_autoSizeStepGranularity = 4;
public static final int AppCompatTextView_autoSizeTextType = 5;
public static final int AppCompatTextView_firstBaselineToTopHeight = 6;
public static final int AppCompatTextView_fontFamily = 7;
public static final int AppCompatTextView_lastBaselineToBottomHeight = 8;
public static final int AppCompatTextView_lineHeight = 9;
public static final int AppCompatTextView_textAllCaps = 10;
public static final int[] AppCompatTheme = { 0x1010057, 0x10100ae, 0x7f040000, 0x7f040001, 0x7f040002, 0x7f040003, 0x7f040004, 0x7f040005, 0x7f040006, 0x7f040007, 0x7f040008, 0x7f040009, 0x7f04000a, 0x7f04000b, 0x7f04000c, 0x7f04000e, 0x7f04000f, 0x7f040010, 0x7f040011, 0x7f040012, 0x7f040013, 0x7f040014, 0x7f040015, 0x7f040016, 0x7f040017, 0x7f040018, 0x7f040019, 0x7f04001a, 0x7f04001b, 0x7f04001c, 0x7f04001d, 0x7f04001e, 0x7f040021, 0x7f040022, 0x7f040023, 0x7f040024, 0x7f040025, 0x7f04002b, 0x7f040040, 0x7f04004e, 0x7f04004f, 0x7f040050, 0x7f040051, 0x7f040052, 0x7f040057, 0x7f040058, 0x7f040063, 0x7f040068, 0x7f040089, 0x7f04008a, 0x7f04008b, 0x7f04008c, 0x7f04008d, 0x7f04008e, 0x7f04008f, 0x7f040090, 0x7f040091, 0x7f040094, 0x7f0400b2, 0x7f0400bb, 0x7f0400bc, 0x7f0400bd, 0x7f0400c0, 0x7f0400c2, 0x7f0400c9, 0x7f0400ca, 0x7f0400cb, 0x7f0400cc, 0x7f0400cd, 0x7f040103, 0x7f040111, 0x7f040166, 0x7f040167, 0x7f04016a, 0x7f04016b, 0x7f04016c, 0x7f04016d, 0x7f04016e, 0x7f04016f, 0x7f040170, 0x7f040192, 0x7f040193, 0x7f040194, 0x7f04019a, 0x7f04019c, 0x7f0401a3, 0x7f0401a4, 0x7f0401a5, 0x7f0401a6, 0x7f0401af, 0x7f0401b0, 0x7f0401b1, 0x7f0401b2, 0x7f0401c0, 0x7f0401c1, 0x7f0401d7, 0x7f0401fe, 0x7f0401ff, 0x7f040200, 0x7f040201, 0x7f040203, 0x7f040204, 0x7f040205, 0x7f040206, 0x7f040209, 0x7f04020a, 0x7f040224, 0x7f040225, 0x7f040226, 0x7f040227, 0x7f04022e, 0x7f040230, 0x7f040231, 0x7f040232, 0x7f040233, 0x7f040234, 0x7f040235, 0x7f040236, 0x7f040237, 0x7f040238, 0x7f040239 };
public static final int AppCompatTheme_android_windowIsFloating = 0;
public static final int AppCompatTheme_android_windowAnimationStyle = 1;
public static final int AppCompatTheme_actionBarDivider = 2;
public static final int AppCompatTheme_actionBarItemBackground = 3;
public static final int AppCompatTheme_actionBarPopupTheme = 4;
public static final int AppCompatTheme_actionBarSize = 5;
public static final int AppCompatTheme_actionBarSplitStyle = 6;
public static final int AppCompatTheme_actionBarStyle = 7;
public static final int AppCompatTheme_actionBarTabBarStyle = 8;
public static final int AppCompatTheme_actionBarTabStyle = 9;
public static final int AppCompatTheme_actionBarTabTextStyle = 10;
public static final int AppCompatTheme_actionBarTheme = 11;
public static final int AppCompatTheme_actionBarWidgetTheme = 12;
public static final int AppCompatTheme_actionButtonStyle = 13;
public static final int AppCompatTheme_actionDropDownStyle = 14;
public static final int AppCompatTheme_actionMenuTextAppearance = 15;
public static final int AppCompatTheme_actionMenuTextColor = 16;
public static final int AppCompatTheme_actionModeBackground = 17;
public static final int AppCompatTheme_actionModeCloseButtonStyle = 18;
public static final int AppCompatTheme_actionModeCloseDrawable = 19;
public static final int AppCompatTheme_actionModeCopyDrawable = 20;
public static final int AppCompatTheme_actionModeCutDrawable = 21;
public static final int AppCompatTheme_actionModeFindDrawable = 22;
public static final int AppCompatTheme_actionModePasteDrawable = 23;
public static final int AppCompatTheme_actionModePopupWindowStyle = 24;
public static final int AppCompatTheme_actionModeSelectAllDrawable = 25;
public static final int AppCompatTheme_actionModeShareDrawable = 26;
public static final int AppCompatTheme_actionModeSplitBackground = 27;
public static final int AppCompatTheme_actionModeStyle = 28;
public static final int AppCompatTheme_actionModeWebSearchDrawable = 29;
public static final int AppCompatTheme_actionOverflowButtonStyle = 30;
public static final int AppCompatTheme_actionOverflowMenuStyle = 31;
public static final int AppCompatTheme_activityChooserViewStyle = 32;
public static final int AppCompatTheme_alertDialogButtonGroupStyle = 33;
public static final int AppCompatTheme_alertDialogCenterButtons = 34;
public static final int AppCompatTheme_alertDialogStyle = 35;
public static final int AppCompatTheme_alertDialogTheme = 36;
public static final int AppCompatTheme_autoCompleteTextViewStyle = 37;
public static final int AppCompatTheme_borderlessButtonStyle = 38;
public static final int AppCompatTheme_buttonBarButtonStyle = 39;
public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 40;
public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 41;
public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 42;
public static final int AppCompatTheme_buttonBarStyle = 43;
public static final int AppCompatTheme_buttonStyle = 44;
public static final int AppCompatTheme_buttonStyleSmall = 45;
public static final int AppCompatTheme_checkboxStyle = 46;
public static final int AppCompatTheme_checkedTextViewStyle = 47;
public static final int AppCompatTheme_colorAccent = 48;
public static final int AppCompatTheme_colorBackgroundFloating = 49;
public static final int AppCompatTheme_colorButtonNormal = 50;
public static final int AppCompatTheme_colorControlActivated = 51;
public static final int AppCompatTheme_colorControlHighlight = 52;
public static final int AppCompatTheme_colorControlNormal = 53;
public static final int AppCompatTheme_colorError = 54;
public static final int AppCompatTheme_colorPrimary = 55;
public static final int AppCompatTheme_colorPrimaryDark = 56;
public static final int AppCompatTheme_colorSwitchThumbNormal = 57;
public static final int AppCompatTheme_controlBackground = 58;
public static final int AppCompatTheme_dialogCornerRadius = 59;
public static final int AppCompatTheme_dialogPreferredPadding = 60;
public static final int AppCompatTheme_dialogTheme = 61;
public static final int AppCompatTheme_dividerHorizontal = 62;
public static final int AppCompatTheme_dividerVertical = 63;
public static final int AppCompatTheme_dropDownListViewStyle = 64;
public static final int AppCompatTheme_dropdownListPreferredItemHeight = 65;
public static final int AppCompatTheme_editTextBackground = 66;
public static final int AppCompatTheme_editTextColor = 67;
public static final int AppCompatTheme_editTextStyle = 68;
public static final int AppCompatTheme_homeAsUpIndicator = 69;
public static final int AppCompatTheme_imageButtonStyle = 70;
public static final int AppCompatTheme_listChoiceBackgroundIndicator = 71;
public static final int AppCompatTheme_listDividerAlertDialog = 72;
public static final int AppCompatTheme_listMenuViewStyle = 73;
public static final int AppCompatTheme_listPopupWindowStyle = 74;
public static final int AppCompatTheme_listPreferredItemHeight = 75;
public static final int AppCompatTheme_listPreferredItemHeightLarge = 76;
public static final int AppCompatTheme_listPreferredItemHeightSmall = 77;
public static final int AppCompatTheme_listPreferredItemPaddingLeft = 78;
public static final int AppCompatTheme_listPreferredItemPaddingRight = 79;
public static final int AppCompatTheme_panelBackground = 80;
public static final int AppCompatTheme_panelMenuListTheme = 81;
public static final int AppCompatTheme_panelMenuListWidth = 82;
public static final int AppCompatTheme_popupMenuStyle = 83;
public static final int AppCompatTheme_popupWindowStyle = 84;
public static final int AppCompatTheme_radioButtonStyle = 85;
public static final int AppCompatTheme_ratingBarStyle = 86;
public static final int AppCompatTheme_ratingBarStyleIndicator = 87;
public static final int AppCompatTheme_ratingBarStyleSmall = 88;
public static final int AppCompatTheme_searchViewStyle = 89;
public static final int AppCompatTheme_seekBarStyle = 90;
public static final int AppCompatTheme_selectableItemBackground = 91;
public static final int AppCompatTheme_selectableItemBackgroundBorderless = 92;
public static final int AppCompatTheme_spinnerDropDownItemStyle = 93;
public static final int AppCompatTheme_spinnerStyle = 94;
public static final int AppCompatTheme_switchStyle = 95;
public static final int AppCompatTheme_textAppearanceLargePopupMenu = 96;
public static final int AppCompatTheme_textAppearanceListItem = 97;
public static final int AppCompatTheme_textAppearanceListItemSecondary = 98;
public static final int AppCompatTheme_textAppearanceListItemSmall = 99;
public static final int AppCompatTheme_textAppearancePopupMenuHeader = 100;
public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 101;
public static final int AppCompatTheme_textAppearanceSearchResultTitle = 102;
public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 103;
public static final int AppCompatTheme_textColorAlertDialogListItem = 104;
public static final int AppCompatTheme_textColorSearchUrl = 105;
public static final int AppCompatTheme_toolbarNavigationButtonStyle = 106;
public static final int AppCompatTheme_toolbarStyle = 107;
public static final int AppCompatTheme_tooltipForegroundColor = 108;
public static final int AppCompatTheme_tooltipFrameBackground = 109;
public static final int AppCompatTheme_viewInflaterClass = 110;
public static final int AppCompatTheme_windowActionBar = 111;
public static final int AppCompatTheme_windowActionBarOverlay = 112;
public static final int AppCompatTheme_windowActionModeOverlay = 113;
public static final int AppCompatTheme_windowFixedHeightMajor = 114;
public static final int AppCompatTheme_windowFixedHeightMinor = 115;
public static final int AppCompatTheme_windowFixedWidthMajor = 116;
public static final int AppCompatTheme_windowFixedWidthMinor = 117;
public static final int AppCompatTheme_windowMinWidthMajor = 118;
public static final int AppCompatTheme_windowMinWidthMinor = 119;
public static final int AppCompatTheme_windowNoTitle = 120;
public static final int[] ButtonBarLayout = { 0x7f040026 };
public static final int ButtonBarLayout_allowStacking = 0;
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f040027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] CompoundButton = { 0x1010107, 0x7f040059, 0x7f04005a };
public static final int CompoundButton_android_button = 0;
public static final int CompoundButton_buttonTint = 1;
public static final int CompoundButton_buttonTintMode = 2;
public static final int[] CoordinatorLayout = { 0x7f040122, 0x7f0401ca };
public static final int CoordinatorLayout_keylines = 0;
public static final int CoordinatorLayout_statusBarBackground = 1;
public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f040127, 0x7f040128, 0x7f040129, 0x7f040155, 0x7f04015e, 0x7f04015f };
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0;
public static final int CoordinatorLayout_Layout_layout_anchor = 1;
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2;
public static final int CoordinatorLayout_Layout_layout_behavior = 3;
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
public static final int CoordinatorLayout_Layout_layout_insetEdge = 5;
public static final int CoordinatorLayout_Layout_layout_keyline = 6;
public static final int[] DrawerArrowToggle = { 0x7f040029, 0x7f04002a, 0x7f040036, 0x7f040088, 0x7f0400c5, 0x7f0400f6, 0x7f0401bf, 0x7f04020f };
public static final int DrawerArrowToggle_arrowHeadLength = 0;
public static final int DrawerArrowToggle_arrowShaftLength = 1;
public static final int DrawerArrowToggle_barLength = 2;
public static final int DrawerArrowToggle_color = 3;
public static final int DrawerArrowToggle_drawableSize = 4;
public static final int DrawerArrowToggle_gapBetweenBars = 5;
public static final int DrawerArrowToggle_spinBars = 6;
public static final int DrawerArrowToggle_thickness = 7;
public static final int[] FontFamily = { 0x7f0400ec, 0x7f0400ed, 0x7f0400ee, 0x7f0400ef, 0x7f0400f0, 0x7f0400f1 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0400ea, 0x7f0400f2, 0x7f0400f3, 0x7f0400f4, 0x7f04022c };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
public static final int[] LinearLayoutCompat = { 0x10100af, 0x10100c4, 0x1010126, 0x1010127, 0x1010128, 0x7f0400bf, 0x7f0400c1, 0x7f040178, 0x7f0401b4 };
public static final int LinearLayoutCompat_android_gravity = 0;
public static final int LinearLayoutCompat_android_orientation = 1;
public static final int LinearLayoutCompat_android_baselineAligned = 2;
public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3;
public static final int LinearLayoutCompat_android_weightSum = 4;
public static final int LinearLayoutCompat_divider = 5;
public static final int LinearLayoutCompat_dividerPadding = 6;
public static final int LinearLayoutCompat_measureWithLargestChild = 7;
public static final int LinearLayoutCompat_showDividers = 8;
public static final int[] LinearLayoutCompat_Layout = { 0x10100b3, 0x10100f4, 0x10100f5, 0x1010181 };
public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0;
public static final int LinearLayoutCompat_Layout_android_layout_width = 1;
public static final int LinearLayoutCompat_Layout_android_layout_height = 2;
public static final int LinearLayoutCompat_Layout_android_layout_weight = 3;
public static final int[] ListPopupWindow = { 0x10102ac, 0x10102ad };
public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0;
public static final int ListPopupWindow_android_dropDownVerticalOffset = 1;
public static final int[] MenuGroup = { 0x101000e, 0x10100d0, 0x1010194, 0x10101de, 0x10101df, 0x10101e0 };
public static final int MenuGroup_android_enabled = 0;
public static final int MenuGroup_android_id = 1;
public static final int MenuGroup_android_visible = 2;
public static final int MenuGroup_android_menuCategory = 3;
public static final int MenuGroup_android_orderInCategory = 4;
public static final int MenuGroup_android_checkableBehavior = 5;
public static final int[] MenuItem = { 0x1010002, 0x101000e, 0x10100d0, 0x1010106, 0x1010194, 0x10101de, 0x10101df, 0x10101e1, 0x10101e2, 0x10101e3, 0x10101e4, 0x10101e5, 0x101026f, 0x7f04000d, 0x7f04001f, 0x7f040020, 0x7f040028, 0x7f0400a5, 0x7f04010c, 0x7f04010d, 0x7f04018c, 0x7f0401b3, 0x7f040228 };
public static final int MenuItem_android_icon = 0;
public static final int MenuItem_android_enabled = 1;
public static final int MenuItem_android_id = 2;
public static final int MenuItem_android_checked = 3;
public static final int MenuItem_android_visible = 4;
public static final int MenuItem_android_menuCategory = 5;
public static final int MenuItem_android_orderInCategory = 6;
public static final int MenuItem_android_title = 7;
public static final int MenuItem_android_titleCondensed = 8;
public static final int MenuItem_android_alphabeticShortcut = 9;
public static final int MenuItem_android_numericShortcut = 10;
public static final int MenuItem_android_checkable = 11;
public static final int MenuItem_android_onClick = 12;
public static final int MenuItem_actionLayout = 13;
public static final int MenuItem_actionProviderClass = 14;
public static final int MenuItem_actionViewClass = 15;
public static final int MenuItem_alphabeticModifiers = 16;
public static final int MenuItem_contentDescription = 17;
public static final int MenuItem_iconTint = 18;
public static final int MenuItem_iconTintMode = 19;
public static final int MenuItem_numericModifiers = 20;
public static final int MenuItem_showAsAction = 21;
public static final int MenuItem_tooltipText = 22;
public static final int[] MenuView = { 0x10100ae, 0x101012c, 0x101012d, 0x101012e, 0x101012f, 0x1010130, 0x1010131, 0x7f04019d, 0x7f0401ce };
public static final int MenuView_android_windowAnimationStyle = 0;
public static final int MenuView_android_itemTextAppearance = 1;
public static final int MenuView_android_horizontalDivider = 2;
public static final int MenuView_android_verticalDivider = 3;
public static final int MenuView_android_headerBackground = 4;
public static final int MenuView_android_itemBackground = 5;
public static final int MenuView_android_itemIconDisabledAlpha = 6;
public static final int MenuView_preserveIconSpacing = 7;
public static final int MenuView_subMenuArrow = 8;
public static final int[] PopupWindow = { 0x1010176, 0x10102c9, 0x7f04018d };
public static final int PopupWindow_android_popupBackground = 0;
public static final int PopupWindow_android_popupAnimationStyle = 1;
public static final int PopupWindow_overlapAnchor = 2;
public static final int[] PopupWindowBackgroundState = { 0x7f0401c5 };
public static final int PopupWindowBackgroundState_state_above_anchor = 0;
public static final int[] RecycleListView = { 0x7f04018e, 0x7f040191 };
public static final int RecycleListView_paddingBottomNoButtons = 0;
public static final int RecycleListView_paddingTopNoTitle = 1;
public static final int[] RecyclerView = { 0x10100c4, 0x10100f1, 0x7f0400e3, 0x7f0400e4, 0x7f0400e5, 0x7f0400e6, 0x7f0400e7, 0x7f040126, 0x7f0401a7, 0x7f0401be, 0x7f0401c4 };
public static final int RecyclerView_android_orientation = 0;
public static final int RecyclerView_android_descendantFocusability = 1;
public static final int RecyclerView_fastScrollEnabled = 2;
public static final int RecyclerView_fastScrollHorizontalThumbDrawable = 3;
public static final int RecyclerView_fastScrollHorizontalTrackDrawable = 4;
public static final int RecyclerView_fastScrollVerticalThumbDrawable = 5;
public static final int RecyclerView_fastScrollVerticalTrackDrawable = 6;
public static final int RecyclerView_layoutManager = 7;
public static final int RecyclerView_reverseLayout = 8;
public static final int RecyclerView_spanCount = 9;
public static final int RecyclerView_stackFromEnd = 10;
public static final int[] SearchView = { 0x10100da, 0x101011f, 0x1010220, 0x1010264, 0x7f04007c, 0x7f0400a1, 0x7f0400ba, 0x7f0400f7, 0x7f04010e, 0x7f040125, 0x7f0401a1, 0x7f0401a2, 0x7f0401ad, 0x7f0401ae, 0x7f0401cf, 0x7f0401d4, 0x7f04022f };
public static final int SearchView_android_focusable = 0;
public static final int SearchView_android_maxWidth = 1;
public static final int SearchView_android_inputType = 2;
public static final int SearchView_android_imeOptions = 3;
public static final int SearchView_closeIcon = 4;
public static final int SearchView_commitIcon = 5;
public static final int SearchView_defaultQueryHint = 6;
public static final int SearchView_goIcon = 7;
public static final int SearchView_iconifiedByDefault = 8;
public static final int SearchView_layout = 9;
public static final int SearchView_queryBackground = 10;
public static final int SearchView_queryHint = 11;
public static final int SearchView_searchHintIcon = 12;
public static final int SearchView_searchIcon = 13;
public static final int SearchView_submitBackground = 14;
public static final int SearchView_suggestionRowLayout = 15;
public static final int SearchView_voiceIcon = 16;
public static final int[] Spinner = { 0x10100b2, 0x1010176, 0x101017b, 0x1010262, 0x7f04019b };
public static final int Spinner_android_entries = 0;
public static final int Spinner_android_popupBackground = 1;
public static final int Spinner_android_prompt = 2;
public static final int Spinner_android_dropDownWidth = 3;
public static final int Spinner_popupTheme = 4;
public static final int[] StateListDrawable = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d };
public static final int StateListDrawable_android_dither = 0;
public static final int StateListDrawable_android_visible = 1;
public static final int StateListDrawable_android_variablePadding = 2;
public static final int StateListDrawable_android_constantSize = 3;
public static final int StateListDrawable_android_enterFadeDuration = 4;
public static final int StateListDrawable_android_exitFadeDuration = 5;
public static final int[] StateListDrawableItem = { 0x1010199 };
public static final int StateListDrawableItem_android_drawable = 0;
public static final int[] SwitchCompat = { 0x1010124, 0x1010125, 0x1010142, 0x7f0401b6, 0x7f0401c2, 0x7f0401d5, 0x7f0401d6, 0x7f0401d8, 0x7f040210, 0x7f040211, 0x7f040212, 0x7f040229, 0x7f04022a, 0x7f04022b };
public static final int SwitchCompat_android_textOn = 0;
public static final int SwitchCompat_android_textOff = 1;
public static final int SwitchCompat_android_thumb = 2;
public static final int SwitchCompat_showText = 3;
public static final int SwitchCompat_splitTrack = 4;
public static final int SwitchCompat_switchMinWidth = 5;
public static final int SwitchCompat_switchPadding = 6;
public static final int SwitchCompat_switchTextAppearance = 7;
public static final int SwitchCompat_thumbTextPadding = 8;
public static final int SwitchCompat_thumbTint = 9;
public static final int SwitchCompat_thumbTintMode = 10;
public static final int SwitchCompat_track = 11;
public static final int SwitchCompat_trackTint = 12;
public static final int SwitchCompat_trackTintMode = 13;
public static final int[] TextAppearance = { 0x1010095, 0x1010096, 0x1010097, 0x1010098, 0x101009a, 0x101009b, 0x1010161, 0x1010162, 0x1010163, 0x1010164, 0x10103ac, 0x7f0400eb, 0x7f0401f3 };
public static final int TextAppearance_android_textSize = 0;
public static final int TextAppearance_android_typeface = 1;
public static final int TextAppearance_android_textStyle = 2;
public static final int TextAppearance_android_textColor = 3;
public static final int TextAppearance_android_textColorHint = 4;
public static final int TextAppearance_android_textColorLink = 5;
public static final int TextAppearance_android_shadowColor = 6;
public static final int TextAppearance_android_shadowDx = 7;
public static final int TextAppearance_android_shadowDy = 8;
public static final int TextAppearance_android_shadowRadius = 9;
public static final int TextAppearance_android_fontFamily = 10;
public static final int TextAppearance_fontFamily = 11;
public static final int TextAppearance_textAllCaps = 12;
public static final int[] Toolbar = { 0x10100af, 0x1010140, 0x7f040053, 0x7f040084, 0x7f040085, 0x7f0400a6, 0x7f0400a7, 0x7f0400a8, 0x7f0400a9, 0x7f0400aa, 0x7f0400ab, 0x7f040171, 0x7f040172, 0x7f040176, 0x7f040188, 0x7f040189, 0x7f04019b, 0x7f0401d0, 0x7f0401d1, 0x7f0401d2, 0x7f040218, 0x7f04021a, 0x7f04021b, 0x7f04021c, 0x7f04021d, 0x7f04021e, 0x7f04021f, 0x7f040220, 0x7f040221 };
public static final int Toolbar_android_gravity = 0;
public static final int Toolbar_android_minHeight = 1;
public static final int Toolbar_buttonGravity = 2;
public static final int Toolbar_collapseContentDescription = 3;
public static final int Toolbar_collapseIcon = 4;
public static final int Toolbar_contentInsetEnd = 5;
public static final int Toolbar_contentInsetEndWithActions = 6;
public static final int Toolbar_contentInsetLeft = 7;
public static final int Toolbar_contentInsetRight = 8;
public static final int Toolbar_contentInsetStart = 9;
public static final int Toolbar_contentInsetStartWithNavigation = 10;
public static final int Toolbar_logo = 11;
public static final int Toolbar_logoDescription = 12;
public static final int Toolbar_maxButtonHeight = 13;
public static final int Toolbar_navigationContentDescription = 14;
public static final int Toolbar_navigationIcon = 15;
public static final int Toolbar_popupTheme = 16;
public static final int Toolbar_subtitle = 17;
public static final int Toolbar_subtitleTextAppearance = 18;
public static final int Toolbar_subtitleTextColor = 19;
public static final int Toolbar_title = 20;
public static final int Toolbar_titleMargin = 21;
public static final int Toolbar_titleMarginBottom = 22;
public static final int Toolbar_titleMarginEnd = 23;
public static final int Toolbar_titleMarginStart = 24;
public static final int Toolbar_titleMarginTop = 25;
public static final int Toolbar_titleMargins = 26;
public static final int Toolbar_titleTextAppearance = 27;
public static final int Toolbar_titleTextColor = 28;
public static final int[] View = { 0x1010000, 0x10100da, 0x7f04018f, 0x7f040190, 0x7f04020e };
public static final int View_android_theme = 0;
public static final int View_android_focusable = 1;
public static final int View_paddingEnd = 2;
public static final int View_paddingStart = 3;
public static final int View_theme = 4;
public static final int[] ViewBackgroundHelper = { 0x10100d4, 0x7f040034, 0x7f040035 };
public static final int ViewBackgroundHelper_android_background = 0;
public static final int ViewBackgroundHelper_backgroundTint = 1;
public static final int ViewBackgroundHelper_backgroundTintMode = 2;
public static final int[] ViewStubCompat = { 0x10100d0, 0x10100f2, 0x10100f3 };
public static final int ViewStubCompat_android_id = 0;
public static final int ViewStubCompat_android_layout = 1;
public static final int ViewStubCompat_android_inflatedId = 2;
}
}
| [
"lazen123a1009321596@gmail.com"
] | lazen123a1009321596@gmail.com |
ab77b509d199f3d2d492d896da0e60445e282316 | 8087d8a8311c9c34a28d944b4b903193ee89c57f | /src/main/java/ConfigParser.java | 194a70e42954de5fb663f4f5e7867650c1bbfd1a | [] | no_license | NJBodam/configParser | 472e55e0b8b829a309c00abe0c59c9c74cbe8680 | 29a5c539c0d1325449fefa6b1e167212de0d6c6d | refs/heads/main | 2023-08-26T10:36:32.930239 | 2021-11-12T22:17:35 | 2021-11-12T22:17:35 | 427,503,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,185 | java | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class ConfigParser {
private String fileName;
private String pathName;
private Map<String, String> mapKeys = new HashMap<>();
public ConfigParser(String fileName) {
this.fileName = fileName;
this.pathName = getPathName(this.fileName);
this.mapKeys = getMapKeys(this.pathName);
}
private String getPathName(String filename) {
String environment = filename;
if (filename.length() < 1) {
fileName = "src/main/java/config.txt";
} else {
switch (environment) {
case "staging":
pathName = "src/main/java/config.txt.staging";
break;
case "development":
pathName = "src/main/java/config.txt.dev";
break;
default:
pathName = "src/main/java/config.txt";
}
}
return pathName;
}
private Map<String, String> getMapKeys (String pathName) {
try (BufferedReader reader = new BufferedReader(new FileReader(pathName));) {
String rd;
String [] line;
String application = "";
int count = 1;
while ((rd = reader.readLine()) != null) {
if (rd.trim().isEmpty()) {
application = "";
} else {
if (rd.contains("application")) {
application = "application" + count + ".";
count++;
}
else {
line = rd.split("=");
mapKeys.put(application + line[0], line[1]);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
return mapKeys;
}
public String getValue(String key) {
if (mapKeys.get(key) == null) {
return "Invalid key";
} else {
return mapKeys.get(key);
}
}
}
| [
"bodambest@yahoo.com"
] | bodambest@yahoo.com |
13e1dd31431900699112b963c3e665db5a805d52 | 5790e2a36b0c8e3d9f3506ebd2ce64f50f048218 | /src/main/java/com/marvel/developer/exceptions/BadRequestException.java | 37997b113e152a62f662db5c67e5dc39c2056200 | [] | no_license | Lyubov702/MarvelComics | 7962d8616aed1c3ecb19e6dba0abed152bf1a517 | 6bc6eb08a43a0e178aac78f3326d9d2ea86b6df6 | refs/heads/master | 2022-12-24T17:26:25.976940 | 2020-10-02T08:24:33 | 2020-10-02T08:24:33 | 299,657,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 104 | java | package com.marvel.developer.exceptions;
public class BadRequestException extends RuntimeException {
}
| [
"l.a.zakharowa@gmail.com"
] | l.a.zakharowa@gmail.com |
08b587491b3e51612a655e6040051815dfbd0eea | a040e8a7f3e30586cf9436000f1c544ead4afb20 | /src/main/java/de/flapdoodle/mongomapper/DBCollectionAsMongoCollectionImpl.java | 89412a3190d8f45bc1445854594c584afda4fcdf | [
"Apache-2.0"
] | permissive | isabella232/de.flapdoodle.mongomapper | 043118c36aac07543fa82a5baf7aea2f59a86372 | fdbdd35337112c5b7e227478d8b63fdc63371515 | refs/heads/master | 2023-03-15T19:17:51.744395 | 2014-10-29T07:02:06 | 2014-10-29T07:02:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,120 | java | package de.flapdoodle.mongomapper;
import java.util.logging.Logger;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.WriteResult;
public class DBCollectionAsMongoCollectionImpl implements MongoCollection {
private static final Logger LOG=LogFactory.logger();
private final DBCollection collection;
public DBCollectionAsMongoCollectionImpl(DBCollection collection) {
this.collection = Preconditions.checkNotNull(collection,"collection is null");
}
@Override
public void ensureIndex(DBObject asIndexKeys, DBObject asIndexOptions) {
collection.ensureIndex(asIndexKeys, asIndexOptions);
}
@Override
public WriteResult insert(DBObject dbObject) {
return collection.insert(dbObject);
}
@Override
public WriteResult save(DBObject dbObject) {
return collection.save(dbObject);
}
@Override
public WriteResult update(DBObject query, DBObject dbObject) {
return collection.update(query,dbObject);
}
@Override
public WriteResult remove(DBObject dbObject) {
return collection.remove(dbObject);
}
@Override
public DBCursor find(DBObject dbObject) {
return collection.find(dbObject);
}
@Override
public void apply(SchemaMigration migration) {
LOG.warning("Starting "+migration);
long changes=0;
long entries=0;
DBObject query = migration.query();
LOG.warning("Starting "+migration+" with query: "+query);
DBCursor cursor = collection.find(query);
for (DBObject entry : cursor) {
entries++;
Optional<DBObject> rewritten=migration.change(entry);
if (rewritten.isPresent()) {
collection.save(rewritten.get());
changes++;
}
}
LOG.warning("Done "+migration+" with "+changes+" changes for "+entries+" entries");
}
}
| [
"michael@mosmann.de"
] | michael@mosmann.de |
d8a4b12729fec6ba4f93f0fc4290c5a9910fd5a8 | 82304cad82fcf932a19d94d729daf72c08ceaf66 | /app/src/main/java/tn/odc/myfirstapplication/CreateAccount.java | d3dc3b2954db7317ecd9564f0d7e70361731b118 | [] | no_license | oussemaAr/Workshop | d0c101a1efd81cc13d2dbb4264f30e98aeb3189b | 71b55628723def175c6dc68f9049853c14c119b2 | refs/heads/master | 2022-09-17T08:28:54.824946 | 2020-05-19T13:03:21 | 2020-05-19T13:03:21 | 264,938,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,979 | java | package tn.odc.myfirstapplication;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
public class CreateAccount extends AppCompatActivity {
// 1 declaration des Widgets
Button createAccount;
EditText firstName;
EditText lastName;
EditText email;
EditText password;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.create_account);
// 2 link createAccount avec button dans XML
createAccount = findViewById(R.id.create_account);
firstName = findViewById(R.id.first_name);
lastName = findViewById(R.id.last_name);
email = findViewById(R.id.email);
password = findViewById(R.id.password);
// change the text of the button
createAccount.setText("NEW TEXT");
// 3 add click event for the button
createAccount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String fName = firstName.getText().toString();
String lName = lastName.getText().toString();
String emailTxt = email.getText().toString();
String passwordTxt = password.getText().toString();
SharedPreferences sharedPreferences = getSharedPreferences("my_pref", MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("email", emailTxt);
editor.putString("first_name", fName);
editor.putString("last_name", lName);
editor.putString("password", passwordTxt);
editor.commit();
}
});
}
}
| [
"oussama.aroua@orange.com"
] | oussama.aroua@orange.com |
a84b428c930e4339b86d01143f5e97f429d5571c | 9bdec6b1c99f4aece0ab10ac18f3f8b524e6e1e2 | /GST-project/axelor-gst-app/modules/axelor-gst/src/main/java/com/axelor/gst/service/InvoiceService.java | 6c6e9ac72f74add6cbcf1a3dfb1b260e628bcd37 | [] | no_license | ssa-axelor/axelor-gst | 963e350d81b9e4604181303d79088704b5402a44 | 2e67b73a1742276a4b2f88253c8c40f768a7a5f7 | refs/heads/master | 2020-06-20T04:54:06.237732 | 2019-08-05T07:20:28 | 2019-08-05T07:20:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package com.axelor.gst.service;
import com.axelor.gst.db.Address;
import com.axelor.gst.db.Contact;
import com.axelor.gst.db.Invoice;
public interface InvoiceService {
public Contact setInvoicePartyPrimaryContact(Invoice invoice);
public Address setInvoicePartyAddress(Invoice invoice);
public Address setInvoiceShippingAddress(Invoice invoice);
public Invoice invoiceCalculateFieldValue(Invoice invoice);
public Invoice setProductItem(Invoice invoice,String idList,int partyId);
public Invoice calulateValueOnAddressChange(Invoice invoice);
}
| [
"ssa.axelor@gmail.com"
] | ssa.axelor@gmail.com |
db1eda7af0a0d536b11420596ba52c6d0b63e51c | 1db279916f4cb941b345fc5d1b454f222fa0409a | /SE2020_D2_T1/webapps/TeresaHelpHunters/src/main/java/TeresaNoticeList.java | 6eeadd7599e26dc33388c5d57ed8ff2deff19110 | [] | no_license | juancarlosagreda/SoftwareProject | c151e6b55768e1d8b4baaeaf9722c2415372ef4c | 0a18117a1ec984d87f70ef5012fb334206bfbe64 | refs/heads/master | 2022-07-03T08:33:48.651276 | 2020-05-14T03:43:46 | 2020-05-14T03:43:46 | 249,402,041 | 1 | 0 | null | 2022-06-21T03:24:48 | 2020-03-23T10:37:52 | CSS | UTF-8 | Java | false | false | 2,615 | java | import javax.servlet.http.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import com.google.gson.Gson;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Vector;
public class TeresaNoticeList extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Entro al perfil");
HttpSession session = request.getSession(true);
// Get session information.
String name = (String)session.getAttribute("login");
int id = (int)session.getAttribute("loginid");
System.out.println("Nombre en sesión " + name);
System.out.println("Nombre en sesión " + id);
Vector<TeresaNoticeData> v = null;
String stringCon = "jdbc:mysql://34.76.88.212/Caregivers?user=equipo&password=Tecnun2020";
try {
Connection con = DriverManager.getConnection(stringCon);
v = TeresaNoticeData.getNotices(con, id);
} catch (SQLException e) {
e.printStackTrace();
System.out.println("Exception when connecting to Driver: " + e);
//Mejorar la forma de cachar la excepción.
}
String json = new Gson().toJson(v);
System.out.println("Wrote Json");
response.getWriter().write(json);
System.out.println("Terminé la petición voy a regresar la respuesta");
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int noticeID = Integer.parseInt(request.getParameter("noticeID"));
int n = 0;
TeresaResponseTerminate res = new TeresaResponseTerminate("");
String stringCon = "jdbc:mysql://34.76.88.212/Caregivers?user=equipo&password=Tecnun2020";
try {
Connection con = DriverManager.getConnection(stringCon);
n = TeresaNoticeData.readNotice(con, noticeID);
if (n == 1) {
res.setDescription("Database was successfully updated.");
}
} catch (SQLException e) {
e.printStackTrace();
System.out.println("Exception when connecting to Driver: " + e);
//Mejorar la forma de cachar la excepción.
}
String json = new Gson().toJson(res);
System.out.println("Wrote Json");
response.getWriter().write(json);
System.out.println("Terminé la petición voy a regresar la respuesta");
}
}
| [
"teresa.ibarra@icloud.com"
] | teresa.ibarra@icloud.com |
461319616c341c97aa63336df9c3bb74e51bb7fd | c9d6d6a7e4cfaf9bc9d5529912c5e23c4310bafe | /src/InheritanceHeirarchy.java | f0caf001c8933582539b2670301f4acb70868ef7 | [] | no_license | Srujana-K/AccessControlAndMore-Java-Assignment-7 | 58901918094d4859ba64c2bf6a90ff3823ddb246 | 798a2b16d5304feda292a4a93b5d047083bb2795 | refs/heads/master | 2023-06-01T18:49:34.357602 | 2021-06-23T11:04:07 | 2021-06-23T11:04:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,762 | java | abstract class Rodent{
Rodent(){
System.out.println("In base class - Rodent");
}
public void eat(){
System.out.println("In base class - eating");
}
public void teeth(){
System.out.println("Rodents have no teeth");
}
abstract void sound();
}
class Mouse extends Rodent{
Mouse(){
System.out.println("In derived class - Mouse");
}
public void eat(){
System.out.println("Mouse is eating");
}
public void teeth(){
System.out.println("Mouse has teeth");
}
public void sound(){
System.out.println("Mouse is making squeak sound");
}
}
class Gerbil extends Rodent{
Gerbil(){
System.out.println("In derived class - Gerbil");
}
public void eat(){
System.out.println("Gerbil is eating");
}
public void teeth(){
System.out.println("Gerbil has no teeth");
}
public void sound(){
System.out.println("Gerbil is making squak sound");
}
}
class Hamster extends Rodent{
Hamster(){
System.out.println("In derived class - Hamster");
}
public void eat(){
System.out.println("Hamster is eating");
}
public void teeth(){
System.out.println("Hamster has teeth");
}
public void sound(){
System.out.println("Hamster is making whinning sound");
}
}
public class InheritanceHeirarchy {
public static void main(String args[]){
Rodent r[] = { new Mouse(), new Gerbil(), new Hamster() };
for(int i=0;i<r.length;i++){
System.out.println("=======================");
r[i].eat();
r[i].teeth();
r[i].sound();
System.out.println("=======================");
}
}
}
| [
"srujana.koduri@zemosolabs.com"
] | srujana.koduri@zemosolabs.com |
ddae2a09b7926c48d4e5d304b0ab07779a4ce468 | e4e224ba614efadf979fab28499ed2ad4f4ada66 | /src/main/java/ch/hearc/clientsservice/application/configuration/SwaggerConfiguration.java | d7d3d9af7ad230d5660eb473e61641bfd7c7e2df | [] | no_license | Cours-HE-ARC/clients-service | a6a26c0a28a8104ea16163ce429087bf39acddff | cb2e3d20e58967d0cd0f9f2839a939923a70b3ee | refs/heads/master | 2020-04-10T21:39:33.984505 | 2018-12-12T14:24:11 | 2018-12-12T14:24:11 | 161,302,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | package ch.hearc.clientsservice.application.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
| [
"seb.chevre@gmail.com"
] | seb.chevre@gmail.com |
fa8d86554aff2f7cc996bb3a0b3686c1c52ec008 | 31da554dd50e35a0b338b2ce5c153a96d98c7e6b | /src/Lab/Startup.java | a8e10262290e7942b5ca5939fedf44fe3ff4e6c1 | [] | no_license | Jwilliams96/Class22_Lab | d412b2ce1511f491d51bdf6cb08083a7af4b878f | 953e3b9f88f38b90554fe429639f68747254e041 | refs/heads/master | 2016-09-06T09:34:39.560275 | 2012-11-29T06:34:03 | 2012-11-29T06:34:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,420 | java | package Lab;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.text.SimpleDateFormat;
public class Startup {
public static void main(String[] args) throws ParseException {
Calendar partA1 = Calendar.getInstance();
partA1.add(Calendar.WEEK_OF_YEAR, -1);
Date partA2 = partA1.getTime();
SimpleDateFormat partA3 = new SimpleDateFormat("EEE, MMM d, ''yy");
System.out.println("Part A: " + partA3.format(partA2));
Calendar partB1 = Calendar.getInstance();
SimpleDateFormat partB2 = new SimpleDateFormat("M/d/yy h:mm a");
System.out.println("Part B: " + partB2.format(partB1.getTime()));
String partC1 = "12/12/2012";
SimpleDateFormat partC2 = new SimpleDateFormat("d/M/yyyy");
Date partC3 = partC2.parse(partC1);
Calendar partC4 = Calendar.getInstance();
partC4.setTime(partC2.parse(partC1));
System.out.println("Part C: " + partC2.format(partC3));
System.out.println("Part C: " + partC2.format(partC4.getTime()));
Calendar partD1 = Calendar.getInstance();
partD1.add(Calendar.DAY_OF_YEAR, 30);
Date partD2 = partD1.getTime();
SimpleDateFormat partD3 = new SimpleDateFormat("EEE, MMM d, ''yy");
System.out.println("Part D: " + partD3.format(partD2));
}
}
| [
"Jonathon@192.168.10.112"
] | Jonathon@192.168.10.112 |
c3fa4a02701998f254e1871d138733907a5b1bf6 | 15f92b61fafb813cfa8a1ebd162d3c0f1eabd1e1 | /src/main/java/org/apache/sysml/runtime/transform/encode/EncoderFactory.java | b71f5632ad7ead12bb77fe56756a0a54795ea1d6 | [
"Apache-2.0"
] | permissive | nagyistge/incubator-systemml | 3a32aff7d72cd6dd818b994800cad9c36ce9f0b1 | b9cbc415045db87f6a6baf030286e2a7bb835810 | refs/heads/master | 2021-01-11T08:05:13.851123 | 2016-11-04T20:48:35 | 2016-11-04T20:48:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,049 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sysml.runtime.transform.encode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.sysml.parser.Expression.ValueType;
import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.matrix.data.FrameBlock;
import org.apache.sysml.runtime.transform.BinAgent;
import org.apache.sysml.runtime.transform.DummycodeAgent;
import org.apache.sysml.runtime.transform.MVImputeAgent;
import org.apache.sysml.runtime.transform.OmitAgent;
import org.apache.sysml.runtime.transform.RecodeAgent;
import org.apache.sysml.runtime.transform.TfUtils;
import org.apache.sysml.runtime.transform.meta.TfMetaUtils;
import org.apache.sysml.runtime.util.UtilFunctions;
import org.apache.wink.json4j.JSONObject;
public class EncoderFactory
{
/**
*
* @param spec
* @param clen
* @return
* @throws DMLRuntimeException
*/
public static Encoder createEncoder(String spec, String[] colnames, int clen, FrameBlock meta) throws DMLRuntimeException {
return createEncoder(spec, colnames, UtilFunctions.nCopies(clen, ValueType.STRING), meta);
}
/**
*
* @param spec
* @param schema
* @param clen
* @param meta
* @return
* @throws DMLRuntimeException
*/
public static Encoder createEncoder(String spec, String[] colnames, ValueType[] schema, int clen, FrameBlock meta) throws DMLRuntimeException {
ValueType[] lschema = (schema==null) ? UtilFunctions.nCopies(clen, ValueType.STRING) : schema;
return createEncoder(spec, colnames, lschema, meta);
}
/**
*
* @param spec
* @param schema
* @return
* @throws DMLRuntimeException
*/
@SuppressWarnings("unchecked")
public static Encoder createEncoder(String spec, String[] colnames, ValueType[] schema, FrameBlock meta)
throws DMLRuntimeException
{
Encoder encoder = null;
int clen = schema.length;
try {
//parse transform specification
JSONObject jSpec = new JSONObject(spec);
List<Encoder> lencoders = new ArrayList<Encoder>();
//prepare basic id lists (recode, dummycode, pass-through)
//note: any dummycode column requires recode as preparation
List<Integer> rcIDs = Arrays.asList(ArrayUtils.toObject(
TfMetaUtils.parseJsonIDList(jSpec, colnames, TfUtils.TXMETHOD_RECODE)));
List<Integer> dcIDs = Arrays.asList(ArrayUtils.toObject(
TfMetaUtils.parseJsonIDList(jSpec, colnames, TfUtils.TXMETHOD_DUMMYCODE)));
rcIDs = new ArrayList<Integer>(CollectionUtils.union(rcIDs, dcIDs));
List<Integer> binIDs = TfMetaUtils.parseBinningColIDs(jSpec, colnames);
List<Integer> ptIDs = new ArrayList<Integer>(CollectionUtils.subtract(
CollectionUtils.subtract(UtilFunctions.getSequenceList(1, clen, 1), rcIDs), binIDs));
List<Integer> oIDs = Arrays.asList(ArrayUtils.toObject(
TfMetaUtils.parseJsonIDList(jSpec, colnames, TfUtils.TXMETHOD_OMIT)));
List<Integer> mvIDs = Arrays.asList(ArrayUtils.toObject(
TfMetaUtils.parseJsonObjectIDList(jSpec, colnames, TfUtils.TXMETHOD_IMPUTE)));
//create individual encoders
if( !rcIDs.isEmpty() ) {
RecodeAgent ra = new RecodeAgent(jSpec, colnames, clen);
ra.setColList(ArrayUtils.toPrimitive(rcIDs.toArray(new Integer[0])));
lencoders.add(ra);
}
if( !ptIDs.isEmpty() )
lencoders.add(new EncoderPassThrough(
ArrayUtils.toPrimitive(ptIDs.toArray(new Integer[0])), clen));
if( !dcIDs.isEmpty() )
lencoders.add(new DummycodeAgent(jSpec, colnames, schema.length));
if( !binIDs.isEmpty() )
lencoders.add(new BinAgent(jSpec, colnames, schema.length, true));
if( !oIDs.isEmpty() )
lencoders.add(new OmitAgent(jSpec, colnames, schema.length));
if( !mvIDs.isEmpty() ) {
MVImputeAgent ma = new MVImputeAgent(jSpec, colnames, schema.length);
ma.initRecodeIDList(rcIDs);
lencoders.add(ma);
}
//create composite decoder of all created encoders
//and initialize meta data (recode, dummy, bin, mv)
encoder = new EncoderComposite(lencoders);
if( meta != null )
encoder.initMetaData(meta);
}
catch(Exception ex) {
throw new DMLRuntimeException(ex);
}
return encoder;
}
}
| [
"mboehm@us.ibm.com"
] | mboehm@us.ibm.com |
65c255ef5dfc356876e25560570aa35f516f5b68 | 1881ef26770a135a7c207de1be3f86201a58aa99 | /app/src/main/java/com/zwtx/beer_talk/ui/activity/RegisterActivity.java | 999a6e637005b87d89ae9cc4f795cba97a012383 | [] | no_license | chinachen01/first-project | 34c7e990eea2389a9137c5eeeab8e0ae883fd83f | 201d9522e71cab085474e7536d4225d9626307d3 | refs/heads/master | 2021-01-10T13:37:10.509000 | 2015-11-13T09:31:15 | 2015-11-13T09:31:15 | 45,669,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,315 | java | package com.zwtx.beer_talk.ui.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.zwtx.beer_talk.R;
import com.zwtx.beer_talk.constants.HttpConstants;
import com.zwtx.beer_talk.manager.HttpManager;
import com.zwtx.beer_talk.ui.base.BaseActivity;
import com.zwtx.beer_talk.utils.L;
import com.zwtx.beer_talk.utils.T;
import org.apache.http.Header;
import org.json.JSONObject;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 用户的注册界面及相关业务逻辑
*/
public class RegisterActivity extends BaseActivity implements View.OnClickListener {
private EditText mPhoneNumberEdit, mPhoneCodeEdit, mUsernameEdit, mPasswordEdit;
private Button mRegisterBtn, mSendCodeBtn;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case 1:
mSendCodeBtn.setText((CharSequence) msg.obj);
break;
case 2:
mSendCodeBtn.setText("获取验证码");
mSendCodeBtn.setClickable(true);
break;
}
}
};
private String mPhoneNumber, mPassword, mCode;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
initView();
}
/**
* 初始化控件
*/
private void initView() {
/* 初始化Edit */
mPhoneNumberEdit = (EditText) findViewById(R.id.register_phone_number_edit);
mPhoneCodeEdit = (EditText) findViewById(R.id.register_phone_code_edit);
mUsernameEdit = (EditText) findViewById(R.id.register_username_edit);
mPasswordEdit = (EditText) findViewById(R.id.register_password_edit);
/* 初始化Button */
mRegisterBtn = (Button) findViewById(R.id.register_register_btn);
mSendCodeBtn = (Button) findViewById(R.id.register_phone_code_send_btn);
mSendCodeBtn.setOnClickListener(this);
mRegisterBtn.setOnClickListener(this);
}
/**
* 对外提供方法跳转到此Activity
*
* @param activity
*/
public static void startActivity(Activity activity) {
Intent intent = new Intent(activity, RegisterActivity.class);
activity.startActivity(intent);
}
/**
* 判断字符串中是否含有特殊字符
*
* @param string
* @return
*/
private boolean isStringMatch(String string) {
String regEx = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(string);
if (m.find()) {
return false;
}
return true;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.register_phone_code_send_btn:
/* 60s后再发送 */
setSendCodeBtnFor60s();
//点击发送验证码的业务逻辑
String urlCode = HttpConstants.BASE_URL + HttpConstants.CODE + mPhoneNumberEdit.getText().toString().trim();
L.d(urlCode + ">>>code");
HttpManager.get(urlCode, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int i, Header[] headers, byte[] bytes) {
T.showShort(RegisterActivity.this, "请求成功,请收到短信后填写验证码");
}
@Override
public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) {
T.showShort(RegisterActivity.this, "发送失败,请检查网络设置");
}
});
break;
case R.id.register_register_btn:
//点击注册后的业务逻辑
mCode = mPhoneCodeEdit.getText().toString().trim();
mPassword = mPasswordEdit.getText().toString().trim();
mPhoneNumber = mPhoneNumberEdit.getText().toString().trim();
String urlRegister = HttpConstants.BASE_URL + HttpConstants.REGISTER + "mobile/" + mPhoneNumber + "/password/" + mPassword + "/code/" + mCode;
HttpManager.get(urlRegister, new JsonHttpResponseHandler("UTF-8") {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
super.onSuccess(statusCode, headers, response);
T.showShort(RegisterActivity.this, "注册成功");
}
@Override
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
super.onFailure(statusCode, headers, responseString, throwable);
T.showShort(RegisterActivity.this, "注册失败");
}
});
break;
}
}
/**
* 设置发送按键60s不能点击
*/
private void setSendCodeBtnFor60s() {
mSendCodeBtn.setClickable(false);
new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < 60; i++) {
Message msg = Message.obtain();
msg.obj = 60 - i + "s";
msg.what = 1;
mHandler.sendMessage(msg);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Message msg = Message.obtain();
msg.what = 2;
mHandler.sendMessage(msg);
}
}).start();
}
}
| [
"chinachen01@163.com"
] | chinachen01@163.com |
2f253ac3379823910fb0c65ef5a4ba5b369794e9 | c8644fe9d912d76b6696110b8985c806dbb8e97e | /src/main/java/uk/co/birchlabs/Tier.java | 2897c942a54a443d26104900c34b20a35b393cda | [] | no_license | shirakaba/vocablistUI | a3b0680a137ab95e7b2b75aa2a070e6832a6cae1 | 84c8b492db47a4c2f88235a5f7a58fe8ce5c9537 | refs/heads/master | 2021-01-20T18:24:44.718481 | 2016-07-28T14:51:10 | 2016-07-28T14:51:10 | 61,675,376 | 0 | 0 | null | 2016-07-27T12:38:41 | 2016-06-22T00:00:44 | Java | UTF-8 | Java | false | false | 613 | java | package uk.co.birchlabs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by jamiebirch on 14/07/2016.
*/
public class Tier {
private final List<Test> tests;
public Tier(List<Question> kanjiQuestions, List<Question> pronQuestions, List<Question> defQuestions, String tierAlpha) {
tests = new ArrayList<>(
Arrays.asList(new Test(kanjiQuestions, "kanji", tierAlpha), new Test(pronQuestions, "pron", tierAlpha), new Test(defQuestions, "def", tierAlpha))
);
}
public List<Test> getTests() {
return tests;
}
}
| [
"jbizzle5@gmail.com"
] | jbizzle5@gmail.com |
8618759e5f211786801bfae7ffe37661867abbd0 | bf37576ef74315f532c9949cf36a42fb5c2f66b5 | /cc.creativecomputing/demo/cc/creativecomputing/demo/font/CCTextTest.java | 1555147cb831b651df8689291a640ea4670aaa85 | [] | no_license | nickvido/creativecomputing | bd95d060e9b0e86e531c0dd017e2a034e7277252 | 109148ffd342e5f6ab241b858c89a1c2778d900f | refs/heads/master | 2020-04-09T17:24:35.926062 | 2012-01-23T10:31:50 | 2012-01-23T10:31:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,910 | java | package cc.creativecomputing.demo.font;
import java.util.ArrayList;
import java.util.List;
import cc.creativecomputing.CCApp;
import cc.creativecomputing.CCApplicationManager;
import cc.creativecomputing.events.CCKeyEvent;
import cc.creativecomputing.graphics.font.CCCharSet;
import cc.creativecomputing.graphics.font.CCFont;
import cc.creativecomputing.graphics.font.CCFontIO;
import cc.creativecomputing.graphics.font.CCVectorFont;
import cc.creativecomputing.graphics.font.CCGlutFont.CCGlutFontType;
import cc.creativecomputing.graphics.font.text.CCLineBreakMode;
import cc.creativecomputing.graphics.font.text.CCText;
import cc.creativecomputing.graphics.font.util.CCLoremIpsumGenerator;
import cc.creativecomputing.math.CCVector2f;
import cc.creativecomputing.math.CCVector2i;
public class CCTextTest extends CCApp {
CCVectorFont _myVectorFont;
private List<CCText> _myTexts = new ArrayList<CCText>();
private int _myTextID = 0;
private String _myText = "";
public void setup() {
frameRate(30);
String myFont = "arial";
float mySize = 24;
_myText = CCLoremIpsumGenerator.generate(400);
_myTexts.add(createText("GLUT",CCFontIO.createGlutFont(CCGlutFontType.BITMAP_TIMES_ROMAN_24, CCCharSet.EXTENDED_CHARSET)));
_myTexts.add(createText("OUTLINE",CCFontIO.createOutlineFont(myFont, mySize, true, CCCharSet.EXTENDED_CHARSET, 30)));
_myTexts.add(createText("VECTOR",CCFontIO.createVectorFont(myFont, mySize, true, CCCharSet.EXTENDED_CHARSET)));
_myTexts.add(createText("TEXTURE MAP",CCFontIO.createTextureMapFont(myFont, mySize, true, CCCharSet.EXTENDED_CHARSET)));
}
private CCText createText(final String theType, final CCFont<?> theFont) {
CCText myText = new CCText(theFont);
myText.position(-300,300);
myText.dimension(300, 400);
myText.text("As TEXONE"+theType +"\n" + _myText);
myText.lineBreak(CCLineBreakMode.BLOCK);
return myText;
}
public void draw() {
g.clear();
g.color(255);
_myTexts.get(_myTextID).draw(g);
g.color(255,50);
_myTexts.get(_myTextID).boundingBox().draw(g);
_myTexts.get(_myTextID).textGrid().drawGrid(g);
int myIndex = _myTexts.get(_myTextID).textGrid().gridIndex(new CCVector2f(mouseX - width/2, height/2 - mouseY));
CCVector2f myPos = _myTexts.get(_myTextID).textGrid().gridPosition(myIndex);
g.color(255,0,0);
g.line(myPos.x, myPos.y, myPos.x, myPos.y - 20);
g.line(-width/2, 300, width/2, 300);
}
@Override
public void keyPressed(final CCKeyEvent theEvent) {
switch (theEvent.keyCode()) {
case CCKeyEvent.VK_UP:
_myTextID++;
_myTextID %= _myTexts.size();
break;
case CCKeyEvent.VK_DOWN:
_myTextID--;
if(_myTextID < 0)_myTextID += _myTexts.size();
break;
}
}
public static void main(String[] args) {
final CCApplicationManager myManager = new CCApplicationManager(CCTextTest.class);
myManager.settings().size(800, 800);
myManager.start();
}
}
| [
"info@texone.org"
] | info@texone.org |
366a01e2461b5fcee1348e4c2b5caf0568e4fecb | 205ebfdb8676ef6b4271999c491a02034c7b80a4 | /Example/Export/language/java/com/HiProtobuf/HiProtobuf/Test_classname.java | 6bd341ed696b98aae03a235b98fbc41b77406d90 | [] | no_license | AtheosCode/HiExcel2Protobuf | 0f740f152e9b660b156d5920572b7bdb627c9a57 | 4cfa99cabab5c9af6ecaceb5a1a94ad0f74e177a | refs/heads/master | 2021-10-09T09:07:57.511929 | 2021-09-27T09:34:25 | 2021-09-27T09:34:25 | 249,334,937 | 0 | 0 | null | 2020-03-23T04:24:48 | 2020-03-23T04:24:47 | null | UTF-8 | Java | false | true | 62,080 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Test.proto
package com.HiProtobuf.HiProtobuf;
public final class Test_classname {
private Test_classname() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TestOrBuilder extends
// @@protoc_insertion_point(interface_extends:HiProtobuf.Test)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string id = 1;</code>
*/
java.lang.String getId();
/**
* <code>string id = 1;</code>
*/
com.google.protobuf.ByteString
getIdBytes();
/**
* <code>string name = 2;</code>
*/
java.lang.String getName();
/**
* <code>string name = 2;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
/**
* <code>int32 hp = 3;</code>
*/
int getHp();
/**
* <code>int32 attack = 4;</code>
*/
int getAttack();
/**
* <code>repeated string infos = 5;</code>
*/
java.util.List<java.lang.String>
getInfosList();
/**
* <code>repeated string infos = 5;</code>
*/
int getInfosCount();
/**
* <code>repeated string infos = 5;</code>
*/
java.lang.String getInfos(int index);
/**
* <code>repeated string infos = 5;</code>
*/
com.google.protobuf.ByteString
getInfosBytes(int index);
}
/**
* Protobuf type {@code HiProtobuf.Test}
*/
public static final class Test extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:HiProtobuf.Test)
TestOrBuilder {
private static final long serialVersionUID = 0L;
// Use Test.newBuilder() to construct.
private Test(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private Test() {
id_ = "";
name_ = "";
infos_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Test();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Test(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
id_ = s;
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 24: {
hp_ = input.readInt32();
break;
}
case 32: {
attack_ = input.readInt32();
break;
}
case 42: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
infos_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
infos_.add(s);
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
infos_ = infos_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Test_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Test_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.HiProtobuf.HiProtobuf.Test_classname.Test.class, com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder.class);
}
public static final int ID_FIELD_NUMBER = 1;
private volatile java.lang.Object id_;
/**
* <code>string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
}
}
/**
* <code>string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int NAME_FIELD_NUMBER = 2;
private volatile java.lang.Object name_;
/**
* <code>string name = 2;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* <code>string name = 2;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int HP_FIELD_NUMBER = 3;
private int hp_;
/**
* <code>int32 hp = 3;</code>
*/
public int getHp() {
return hp_;
}
public static final int ATTACK_FIELD_NUMBER = 4;
private int attack_;
/**
* <code>int32 attack = 4;</code>
*/
public int getAttack() {
return attack_;
}
public static final int INFOS_FIELD_NUMBER = 5;
private com.google.protobuf.LazyStringList infos_;
/**
* <code>repeated string infos = 5;</code>
*/
public com.google.protobuf.ProtocolStringList
getInfosList() {
return infos_;
}
/**
* <code>repeated string infos = 5;</code>
*/
public int getInfosCount() {
return infos_.size();
}
/**
* <code>repeated string infos = 5;</code>
*/
public java.lang.String getInfos(int index) {
return infos_.get(index);
}
/**
* <code>repeated string infos = 5;</code>
*/
public com.google.protobuf.ByteString
getInfosBytes(int index) {
return infos_.getByteString(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
}
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_);
}
if (hp_ != 0) {
output.writeInt32(3, hp_);
}
if (attack_ != 0) {
output.writeInt32(4, attack_);
}
for (int i = 0; i < infos_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, infos_.getRaw(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
}
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_);
}
if (hp_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, hp_);
}
if (attack_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, attack_);
}
{
int dataSize = 0;
for (int i = 0; i < infos_.size(); i++) {
dataSize += computeStringSizeNoTag(infos_.getRaw(i));
}
size += dataSize;
size += 1 * getInfosList().size();
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.HiProtobuf.HiProtobuf.Test_classname.Test)) {
return super.equals(obj);
}
com.HiProtobuf.HiProtobuf.Test_classname.Test other = (com.HiProtobuf.HiProtobuf.Test_classname.Test) obj;
if (!getId()
.equals(other.getId())) return false;
if (!getName()
.equals(other.getName())) return false;
if (getHp()
!= other.getHp()) return false;
if (getAttack()
!= other.getAttack()) return false;
if (!getInfosList()
.equals(other.getInfosList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + HP_FIELD_NUMBER;
hash = (53 * hash) + getHp();
hash = (37 * hash) + ATTACK_FIELD_NUMBER;
hash = (53 * hash) + getAttack();
if (getInfosCount() > 0) {
hash = (37 * hash) + INFOS_FIELD_NUMBER;
hash = (53 * hash) + getInfosList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.HiProtobuf.HiProtobuf.Test_classname.Test prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code HiProtobuf.Test}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:HiProtobuf.Test)
com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Test_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Test_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.HiProtobuf.HiProtobuf.Test_classname.Test.class, com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder.class);
}
// Construct using com.HiProtobuf.HiProtobuf.Test_classname.Test.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
id_ = "";
name_ = "";
hp_ = 0;
attack_ = 0;
infos_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Test_descriptor;
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Test getDefaultInstanceForType() {
return com.HiProtobuf.HiProtobuf.Test_classname.Test.getDefaultInstance();
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Test build() {
com.HiProtobuf.HiProtobuf.Test_classname.Test result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Test buildPartial() {
com.HiProtobuf.HiProtobuf.Test_classname.Test result = new com.HiProtobuf.HiProtobuf.Test_classname.Test(this);
int from_bitField0_ = bitField0_;
result.id_ = id_;
result.name_ = name_;
result.hp_ = hp_;
result.attack_ = attack_;
if (((bitField0_ & 0x00000001) != 0)) {
infos_ = infos_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.infos_ = infos_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.HiProtobuf.HiProtobuf.Test_classname.Test) {
return mergeFrom((com.HiProtobuf.HiProtobuf.Test_classname.Test)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.HiProtobuf.HiProtobuf.Test_classname.Test other) {
if (other == com.HiProtobuf.HiProtobuf.Test_classname.Test.getDefaultInstance()) return this;
if (!other.getId().isEmpty()) {
id_ = other.id_;
onChanged();
}
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.getHp() != 0) {
setHp(other.getHp());
}
if (other.getAttack() != 0) {
setAttack(other.getAttack());
}
if (!other.infos_.isEmpty()) {
if (infos_.isEmpty()) {
infos_ = other.infos_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureInfosIsMutable();
infos_.addAll(other.infos_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.HiProtobuf.HiProtobuf.Test_classname.Test parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.HiProtobuf.HiProtobuf.Test_classname.Test) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object id_ = "";
/**
* <code>string id = 1;</code>
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string id = 1;</code>
*/
public com.google.protobuf.ByteString
getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string id = 1;</code>
*/
public Builder setId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
onChanged();
return this;
}
/**
* <code>string id = 1;</code>
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
* <code>string id = 1;</code>
*/
public Builder setIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
id_ = value;
onChanged();
return this;
}
private java.lang.Object name_ = "";
/**
* <code>string name = 2;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string name = 2;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string name = 2;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* <code>string name = 2;</code>
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>string name = 2;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private int hp_ ;
/**
* <code>int32 hp = 3;</code>
*/
public int getHp() {
return hp_;
}
/**
* <code>int32 hp = 3;</code>
*/
public Builder setHp(int value) {
hp_ = value;
onChanged();
return this;
}
/**
* <code>int32 hp = 3;</code>
*/
public Builder clearHp() {
hp_ = 0;
onChanged();
return this;
}
private int attack_ ;
/**
* <code>int32 attack = 4;</code>
*/
public int getAttack() {
return attack_;
}
/**
* <code>int32 attack = 4;</code>
*/
public Builder setAttack(int value) {
attack_ = value;
onChanged();
return this;
}
/**
* <code>int32 attack = 4;</code>
*/
public Builder clearAttack() {
attack_ = 0;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList infos_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureInfosIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
infos_ = new com.google.protobuf.LazyStringArrayList(infos_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string infos = 5;</code>
*/
public com.google.protobuf.ProtocolStringList
getInfosList() {
return infos_.getUnmodifiableView();
}
/**
* <code>repeated string infos = 5;</code>
*/
public int getInfosCount() {
return infos_.size();
}
/**
* <code>repeated string infos = 5;</code>
*/
public java.lang.String getInfos(int index) {
return infos_.get(index);
}
/**
* <code>repeated string infos = 5;</code>
*/
public com.google.protobuf.ByteString
getInfosBytes(int index) {
return infos_.getByteString(index);
}
/**
* <code>repeated string infos = 5;</code>
*/
public Builder setInfos(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureInfosIsMutable();
infos_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string infos = 5;</code>
*/
public Builder addInfos(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureInfosIsMutable();
infos_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string infos = 5;</code>
*/
public Builder addAllInfos(
java.lang.Iterable<java.lang.String> values) {
ensureInfosIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, infos_);
onChanged();
return this;
}
/**
* <code>repeated string infos = 5;</code>
*/
public Builder clearInfos() {
infos_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>repeated string infos = 5;</code>
*/
public Builder addInfosBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureInfosIsMutable();
infos_.add(value);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:HiProtobuf.Test)
}
// @@protoc_insertion_point(class_scope:HiProtobuf.Test)
private static final com.HiProtobuf.HiProtobuf.Test_classname.Test DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.HiProtobuf.HiProtobuf.Test_classname.Test();
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Test getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Test>
PARSER = new com.google.protobuf.AbstractParser<Test>() {
@java.lang.Override
public Test parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Test(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Test> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Test> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Test getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface Excel_TestOrBuilder extends
// @@protoc_insertion_point(interface_extends:HiProtobuf.Excel_Test)
com.google.protobuf.MessageOrBuilder {
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
java.util.List<com.HiProtobuf.HiProtobuf.Test_classname.Test>
getDataList();
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
com.HiProtobuf.HiProtobuf.Test_classname.Test getData(int index);
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
int getDataCount();
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
java.util.List<? extends com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder>
getDataOrBuilderList();
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder getDataOrBuilder(
int index);
}
/**
* Protobuf type {@code HiProtobuf.Excel_Test}
*/
public static final class Excel_Test extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:HiProtobuf.Excel_Test)
Excel_TestOrBuilder {
private static final long serialVersionUID = 0L;
// Use Excel_Test.newBuilder() to construct.
private Excel_Test(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private Excel_Test() {
data_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Excel_Test();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Excel_Test(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
data_ = new java.util.ArrayList<com.HiProtobuf.HiProtobuf.Test_classname.Test>();
mutable_bitField0_ |= 0x00000001;
}
data_.add(
input.readMessage(com.HiProtobuf.HiProtobuf.Test_classname.Test.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
data_ = java.util.Collections.unmodifiableList(data_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Excel_Test_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Excel_Test_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test.class, com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test.Builder.class);
}
public static final int DATA_FIELD_NUMBER = 1;
private java.util.List<com.HiProtobuf.HiProtobuf.Test_classname.Test> data_;
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public java.util.List<com.HiProtobuf.HiProtobuf.Test_classname.Test> getDataList() {
return data_;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public java.util.List<? extends com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder>
getDataOrBuilderList() {
return data_;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public int getDataCount() {
return data_.size();
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public com.HiProtobuf.HiProtobuf.Test_classname.Test getData(int index) {
return data_.get(index);
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder getDataOrBuilder(
int index) {
return data_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < data_.size(); i++) {
output.writeMessage(1, data_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < data_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, data_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test)) {
return super.equals(obj);
}
com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test other = (com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test) obj;
if (!getDataList()
.equals(other.getDataList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getDataCount() > 0) {
hash = (37 * hash) + DATA_FIELD_NUMBER;
hash = (53 * hash) + getDataList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code HiProtobuf.Excel_Test}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:HiProtobuf.Excel_Test)
com.HiProtobuf.HiProtobuf.Test_classname.Excel_TestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Excel_Test_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Excel_Test_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test.class, com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test.Builder.class);
}
// Construct using com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getDataFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (dataBuilder_ == null) {
data_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
dataBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.HiProtobuf.HiProtobuf.Test_classname.internal_static_HiProtobuf_Excel_Test_descriptor;
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test getDefaultInstanceForType() {
return com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test.getDefaultInstance();
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test build() {
com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test buildPartial() {
com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test result = new com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test(this);
int from_bitField0_ = bitField0_;
if (dataBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
data_ = java.util.Collections.unmodifiableList(data_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.data_ = data_;
} else {
result.data_ = dataBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test) {
return mergeFrom((com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test other) {
if (other == com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test.getDefaultInstance()) return this;
if (dataBuilder_ == null) {
if (!other.data_.isEmpty()) {
if (data_.isEmpty()) {
data_ = other.data_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureDataIsMutable();
data_.addAll(other.data_);
}
onChanged();
}
} else {
if (!other.data_.isEmpty()) {
if (dataBuilder_.isEmpty()) {
dataBuilder_.dispose();
dataBuilder_ = null;
data_ = other.data_;
bitField0_ = (bitField0_ & ~0x00000001);
dataBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getDataFieldBuilder() : null;
} else {
dataBuilder_.addAllMessages(other.data_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List<com.HiProtobuf.HiProtobuf.Test_classname.Test> data_ =
java.util.Collections.emptyList();
private void ensureDataIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
data_ = new java.util.ArrayList<com.HiProtobuf.HiProtobuf.Test_classname.Test>(data_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.HiProtobuf.HiProtobuf.Test_classname.Test, com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder, com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder> dataBuilder_;
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public java.util.List<com.HiProtobuf.HiProtobuf.Test_classname.Test> getDataList() {
if (dataBuilder_ == null) {
return java.util.Collections.unmodifiableList(data_);
} else {
return dataBuilder_.getMessageList();
}
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public int getDataCount() {
if (dataBuilder_ == null) {
return data_.size();
} else {
return dataBuilder_.getCount();
}
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public com.HiProtobuf.HiProtobuf.Test_classname.Test getData(int index) {
if (dataBuilder_ == null) {
return data_.get(index);
} else {
return dataBuilder_.getMessage(index);
}
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder setData(
int index, com.HiProtobuf.HiProtobuf.Test_classname.Test value) {
if (dataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDataIsMutable();
data_.set(index, value);
onChanged();
} else {
dataBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder setData(
int index, com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder builderForValue) {
if (dataBuilder_ == null) {
ensureDataIsMutable();
data_.set(index, builderForValue.build());
onChanged();
} else {
dataBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder addData(com.HiProtobuf.HiProtobuf.Test_classname.Test value) {
if (dataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDataIsMutable();
data_.add(value);
onChanged();
} else {
dataBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder addData(
int index, com.HiProtobuf.HiProtobuf.Test_classname.Test value) {
if (dataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDataIsMutable();
data_.add(index, value);
onChanged();
} else {
dataBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder addData(
com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder builderForValue) {
if (dataBuilder_ == null) {
ensureDataIsMutable();
data_.add(builderForValue.build());
onChanged();
} else {
dataBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder addData(
int index, com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder builderForValue) {
if (dataBuilder_ == null) {
ensureDataIsMutable();
data_.add(index, builderForValue.build());
onChanged();
} else {
dataBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder addAllData(
java.lang.Iterable<? extends com.HiProtobuf.HiProtobuf.Test_classname.Test> values) {
if (dataBuilder_ == null) {
ensureDataIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, data_);
onChanged();
} else {
dataBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder clearData() {
if (dataBuilder_ == null) {
data_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
dataBuilder_.clear();
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public Builder removeData(int index) {
if (dataBuilder_ == null) {
ensureDataIsMutable();
data_.remove(index);
onChanged();
} else {
dataBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder getDataBuilder(
int index) {
return getDataFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder getDataOrBuilder(
int index) {
if (dataBuilder_ == null) {
return data_.get(index); } else {
return dataBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public java.util.List<? extends com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder>
getDataOrBuilderList() {
if (dataBuilder_ != null) {
return dataBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(data_);
}
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder addDataBuilder() {
return getDataFieldBuilder().addBuilder(
com.HiProtobuf.HiProtobuf.Test_classname.Test.getDefaultInstance());
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder addDataBuilder(
int index) {
return getDataFieldBuilder().addBuilder(
index, com.HiProtobuf.HiProtobuf.Test_classname.Test.getDefaultInstance());
}
/**
* <code>repeated .HiProtobuf.Test Data = 1;</code>
*/
public java.util.List<com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder>
getDataBuilderList() {
return getDataFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.HiProtobuf.HiProtobuf.Test_classname.Test, com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder, com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder>
getDataFieldBuilder() {
if (dataBuilder_ == null) {
dataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.HiProtobuf.HiProtobuf.Test_classname.Test, com.HiProtobuf.HiProtobuf.Test_classname.Test.Builder, com.HiProtobuf.HiProtobuf.Test_classname.TestOrBuilder>(
data_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
data_ = null;
}
return dataBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:HiProtobuf.Excel_Test)
}
// @@protoc_insertion_point(class_scope:HiProtobuf.Excel_Test)
private static final com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test();
}
public static com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Excel_Test>
PARSER = new com.google.protobuf.AbstractParser<Excel_Test>() {
@java.lang.Override
public Excel_Test parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Excel_Test(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Excel_Test> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Excel_Test> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.HiProtobuf.HiProtobuf.Test_classname.Excel_Test getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_HiProtobuf_Test_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_HiProtobuf_Test_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_HiProtobuf_Excel_Test_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_HiProtobuf_Excel_Test_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\nTest.proto\022\nHiProtobuf\"K\n\004Test\022\n\n\002id\030\001" +
" \001(\t\022\014\n\004name\030\002 \001(\t\022\n\n\002hp\030\003 \001(\005\022\016\n\006attack" +
"\030\004 \001(\005\022\r\n\005infos\030\005 \003(\t\",\n\nExcel_Test\022\036\n\004D" +
"ata\030\001 \003(\0132\020.HiProtobuf.TestB7\n\031com.HiPro" +
"tobuf.HiProtobufB\016Test_classname\252\002\tTable" +
"Toolb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_HiProtobuf_Test_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_HiProtobuf_Test_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_HiProtobuf_Test_descriptor,
new java.lang.String[] { "Id", "Name", "Hp", "Attack", "Infos", });
internal_static_HiProtobuf_Excel_Test_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_HiProtobuf_Excel_Test_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_HiProtobuf_Excel_Test_descriptor,
new java.lang.String[] { "Data", });
}
// @@protoc_insertion_point(outer_class_scope)
}
| [
"atheos@qq.com"
] | atheos@qq.com |
0d4e60a2e1662cf96e0f60d751ae5ce125534c93 | d703afa0a4047bbe02f66936d10bcdecb9a939a5 | /src/main/java/cl/cc/zcsclient/voice/CallFeature.java | 7ae39668140f4cece81981a4734d77037efb5670 | [
"Apache-2.0"
] | permissive | CyberCastle/ZimbraClient | 9e514d0e91dfca7074ad6f541fa74b72595d2afb | 8f4028732e695b9ac1c4c69d8948b379bd3ea7f1 | refs/heads/master | 2020-03-17T19:22:02.652019 | 2018-05-17T19:23:17 | 2018-05-17T19:23:17 | 133,857,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | package cl.cc.zcsclient.voice;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for callFeature complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="callFeature">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* </sequence>
* <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "callFeature")
public class CallFeature {
@XmlAttribute(name = "name", required = true)
protected String name;
/**
* Gets the value of the name property.
*
* @return possible object is {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value allowed object is {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
}
| [
"CyberCastle@gmail.com"
] | CyberCastle@gmail.com |
f564141c81534b0a0bf2a82c057cd693518062b9 | 63c723474535f0d764241da5a21c04a931ae55a8 | /src/main/java/com/softwareloop/contactssync/google/GmailClient.java | 7c731c76b019a0ddc0c4baa299ebe07ad82e471c | [
"Apache-2.0"
] | permissive | softwareloop/contacts-sync | 4ab8c5707e93e18e2481e37b34cf155f067a29cd | 564e8ed93be66bf8e16a9f0b83910080d513e8af | refs/heads/master | 2023-03-22T02:29:31.890593 | 2023-03-11T20:04:39 | 2023-03-11T20:04:39 | 125,721,242 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,315 | java | package com.softwareloop.contactssync.google;
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.people.v1.PeopleService;
import com.google.api.services.people.v1.model.ListConnectionsResponse;
import com.google.api.services.people.v1.model.Person;
import com.sun.jndi.toolkit.url.Uri;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Component
public class GmailClient {
//--------------------------------------------------------------------------
// Constants
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// Fields
//--------------------------------------------------------------------------
private final NetHttpTransport netHttpTransport;
private final JacksonFactory jacksonFactory;
private final RestTemplate restTemplate;
//--------------------------------------------------------------------------
// Constructors
//--------------------------------------------------------------------------
@Autowired
public GmailClient(
NetHttpTransport netHttpTransport,
JacksonFactory jacksonFactory,
RestTemplate restTemplate) {
this.netHttpTransport = netHttpTransport;
this.jacksonFactory = jacksonFactory;
this.restTemplate = restTemplate;
}
//--------------------------------------------------------------------------
// Public methods
//--------------------------------------------------------------------------
public List<Person> getContacts(
Credential credential
) throws IOException {
PeopleService peopleService =
new PeopleService.Builder(
netHttpTransport,
jacksonFactory,
credential)
.setApplicationName("Contacts sync").build();
List<Person> allConnections = new ArrayList<>();
String nextPageToken = null;
do {
PeopleService.People.Connections.List connectionsRequest =
peopleService.people()
.connections()
.list("people/me")
.setPersonFields("names,emailAddresses,phoneNumbers,photos")
.setPageToken(nextPageToken);
ListConnectionsResponse response =
connectionsRequest.execute();
List<Person> connections = response.getConnections();
if (connections != null) {
allConnections.addAll(connections);
}
nextPageToken = response.getNextPageToken();
} while (nextPageToken != null);
return allConnections;
}
public void deauthorize(Credential credential) {
MultiValueMap<String, String> map= new LinkedMultiValueMap<>();
map.add("token", credential.getAccessToken());
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
HttpEntity<MultiValueMap<String, String>> requestEntity =
new HttpEntity<>(map, headers);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(
"https://accounts.google.com/o/oauth2/revoke",
requestEntity,
String.class);
if (responseEntity.getStatusCode() != HttpStatus.OK) {
throw new InternalError(responseEntity.getBody());
}
}
//--------------------------------------------------------------------------
// Methods
//--------------------------------------------------------------------------
}
| [
"paolo.predonzani@gmail.com"
] | paolo.predonzani@gmail.com |
2434e26f9ff4739bfd3e79a771efd0d48e897ca3 | e95bf6ac3b0ea4fd20a36cc0c8c41d2612c26590 | /app/src/test/java/com/dovdekeyser/noteapplication/ExampleUnitTest.java | ea7ebabfb8ee6529107759b58e68c738e6a6f002 | [] | no_license | DovDe/AndroidNotesApp | ed126251802127b3a9c78c0b2fadd4701000f1d2 | 17ca3cf21f712342bf2032b43e868230c91ff37e | refs/heads/master | 2020-07-22T00:05:47.331010 | 2019-09-07T18:19:53 | 2019-09-07T18:19:53 | 207,008,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 392 | java | package com.dovdekeyser.noteapplication;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"dovdekeyser@yahoo.com"
] | dovdekeyser@yahoo.com |
12d017f2b1b96fed3678425ada516c6c8b873459 | bedeb9d48dcce378c127e24f020498c120a79861 | /src/test/java/com/wildcodeschool/lendafriend/LendAFriendApplicationTests.java | bbc3f3914d335eea6c8ad6912abb8ddb4b317c74 | [] | no_license | SuriLea/lend-a-friend | 278507f29d6bf691f19a9f5b0592bc855f9daabf | e1f136d4cba2b9b8242156824535bc6deb77b40b | refs/heads/master | 2023-01-28T15:39:02.461198 | 2020-12-10T11:05:41 | 2020-12-10T11:05:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package com.wildcodeschool.lendafriend;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class LendAFriendApplicationTests {
@Test
void contextLoads() {
}
}
| [
"this.is.my.bot@gmail.com"
] | this.is.my.bot@gmail.com |
a3a90e1e86ae0354ca55841713b4f8c1bdfa1417 | c249b1ad063f27997954212267beb60f0b722dee | /mie creazioni/Informatica/Ingegneria/Agenda con persistenza/Lab10-StartKit/src/agenda/domainModel/Address.java | c7bc242e9ed8f53ad47c7cc5c89b851df9abf375 | [
"MIT"
] | permissive | andre-bisa/Archive | e7a91e62a02071594968080d2f65bff24f061f58 | 9599342d684172391d8919714e5494082615efb8 | refs/heads/master | 2020-03-19T16:26:57.462697 | 2018-06-09T12:00:54 | 2018-06-09T12:00:54 | 136,715,783 | 0 | 0 | null | null | null | null | ISO-8859-13 | Java | false | false | 1,236 | java | /**
*
*/
package agenda.domainModel;
import agenda.gui.utils.ColumnTable;
/**
* @author s0000753177
*
*/
public class Address extends Detail {
private String city;
private String number;
private String state;
private String street;
private String zipCode;
@ColumnTable(name = "Cittą")
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
@ColumnTable(name = "Civico")
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
@ColumnTable(name = "Stato")
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
@ColumnTable(name = "Via")
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
@ColumnTable(name = "CAP")
public String getZipCode() {
return zipCode;
}
public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}
@Override
public String getName() {
return "Address";
}
@Override
public String getValues() {
return this.getStreet() + ", " + this.getNumber() + ", " + this.getZipCode() + ", " + this.getCity() + ", " + this.getState();
}
}
| [
"andrea.bisacchi5@studio.unibo.it"
] | andrea.bisacchi5@studio.unibo.it |
7c24652b3afdf73f077c5b71750c199673572dc4 | 5e596a96e3203c56522e7ad3199d791312d95acf | /Session11/src/co/edureka/model/Address.java | eff97c65ad08dbd1e13cc87eae7d05dff94a11f0 | [] | no_license | ishantk/EdurekaJava10Aug2019 | e515fdda11e75d7b1558ff863f583210f85f291c | bcd6539b96c57c6e1a88a3080724745b7e26e890 | refs/heads/master | 2020-07-03T04:06:09.959729 | 2019-09-22T17:46:22 | 2019-09-22T17:46:22 | 201,777,742 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,363 | java | package co.edureka.model;
public class Address {
Integer aid;
String adrsLine;
String city;
String state;
Integer zipCode;
Person person; // HAS-A Relationship | One to One | One Address has One Person
public Address() {
}
public Address(Integer aid, String adrsLine, String city, String state, Integer zipCode, Person person) {
this.aid = aid;
this.adrsLine = adrsLine;
this.city = city;
this.state = state;
this.zipCode = zipCode;
this.person = person;
}
public Integer getAid() {
return aid;
}
public void setAid(Integer aid) {
this.aid = aid;
}
public String getAdrsLine() {
return adrsLine;
}
public void setAdrsLine(String adrsLine) {
this.adrsLine = adrsLine;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Integer getZipCode() {
return zipCode;
}
public void setZipCode(Integer zipCode) {
this.zipCode = zipCode;
}
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
@Override
public String toString() {
return "Address [aid=" + aid + ", adrsLine=" + adrsLine + ", city=" + city + ", state=" + state + ", zipCode="
+ zipCode + "]";
}
}
| [
"er.ishant@gmail.com"
] | er.ishant@gmail.com |
d91488ba5ea68c1cc9b39598f58e7b15575c4795 | bdf28391864f024cb841ea4a9e0182c45836500e | /api/src/main/java/com/yanzhenjie/andserver/framework/mapping/Addition.java | 30732030bfb760bc2d2541f439b5e240c021d760 | [
"Apache-2.0"
] | permissive | yanzhenjie/AndServer | 3d48624d8fecc7f27e24c31c6a6ef85ba6add974 | 23a7c15512f5a70a9ce517710a5d04c06a4d57c9 | refs/heads/master | 2023-09-02T01:10:18.569605 | 2023-06-07T07:58:41 | 2023-06-07T07:58:41 | 61,079,960 | 3,675 | 795 | Apache-2.0 | 2023-06-07T07:58:42 | 2016-06-14T00:52:52 | Java | UTF-8 | Java | false | false | 2,635 | java | /*
* Copyright 2018 Zhenjie Yan.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yanzhenjie.andserver.framework.mapping;
import androidx.annotation.NonNull;
/**
* Created by Zhenjie Yan on 2018/9/9.
*/
public class Addition {
private String[] stringType;
private boolean[] booleanType;
private int[] intType;
private long[] longType;
private short[] shortType;
private float[] floatType;
private double[] doubleType;
private byte[] byteType;
private char[] charType;
public Addition() {
}
@NonNull
public String[] getStringType() {
return stringType;
}
public void setStringType(String[] stringType) {
this.stringType = stringType;
}
@NonNull
public boolean[] getBooleanType() {
return booleanType;
}
public void setBooleanType(boolean[] booleanType) {
this.booleanType = booleanType;
}
@NonNull
public int[] getIntType() {
return intType;
}
public void setIntType(int[] intType) {
this.intType = intType;
}
@NonNull
public long[] getLongType() {
return longType;
}
public void setLongType(long[] longType) {
this.longType = longType;
}
@NonNull
public short[] getShortType() {
return shortType;
}
public void setShortType(short[] shortType) {
this.shortType = shortType;
}
@NonNull
public float[] getFloatType() {
return floatType;
}
public void setFloatType(float[] floatType) {
this.floatType = floatType;
}
@NonNull
public double[] getDoubleType() {
return doubleType;
}
public void setDoubleType(double[] doubleType) {
this.doubleType = doubleType;
}
@NonNull
public byte[] getByteType() {
return byteType;
}
public void setByteType(byte[] byteType) {
this.byteType = byteType;
}
@NonNull
public char[] getCharType() {
return charType;
}
public void setCharType(char[] charType) {
this.charType = charType;
}
} | [
"im.yanzhenjie@gmail.com"
] | im.yanzhenjie@gmail.com |
809dcffe21e5c9a6b1d58504f21668796bbd6f31 | 88798d050be3296e4ce67c54e8ba50c5a3bc7be5 | /app/build/generated/source/buildConfig/debug/com/example/tcpclient/BuildConfig.java | 66c4e50404595b4f0119e0f7ee395c4b324029d4 | [] | no_license | DATerekhov/tcpClient | 065c067c4d5163f0d35373a1485e015b16e0eed6 | 2cb25a71b9f1b15a8427fed7f8c1c93406829d86 | refs/heads/master | 2021-06-10T16:34:27.193070 | 2016-12-16T23:08:41 | 2016-12-16T23:08:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.example.tcpclient;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.example.tcpclient";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
| [
"dimon.terekhov@gmail.com"
] | dimon.terekhov@gmail.com |
99b81d685e5705046a506802190eac38d47ea2dc | f36ea8530e9cfb0724021c60680b38c1930b68f9 | /src/main/java/com/java/springboot/utilities/AES.java | 794708ba01e8ab1fb152b10701a7003c8385ccdd | [] | no_license | avi202020/Spring-boot_with_jwt_sonarqube_jacoco | df267331129c3d9a2c5eefbb3b38a6c3ef21258f | f6f6974dab69864c2e391f296a7e4ae3a5e8bad0 | refs/heads/master | 2021-09-21T13:00:27.179652 | 2018-08-27T07:09:40 | 2018-08-27T07:09:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,938 | java | package com.java.springboot.utilities;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class AES {
private static SecretKeySpec secretKey;
private static byte[] key;
public static void setKey(String myKey)
{
MessageDigest sha = null;
try {
key = myKey.getBytes("UTF-8");
sha = MessageDigest.getInstance("SHA-256");
key = sha.digest(key);
key = Arrays.copyOf(key, 16);
secretKey = new SecretKeySpec(key, "AES");
}
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
public static String encrypt(String strToEncrypt, String secret)
{
try
{
setKey(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
return Base64.getEncoder().encodeToString(cipher.doFinal(strToEncrypt.getBytes("UTF-8")));
}
catch (Exception e)
{
System.out.println("Error while encrypting: " + e.toString());
}
return null;
}
public static String decrypt(String strToDecrypt, String secret)
{
try
{
setKey(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, secretKey);
return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt)));
}
catch (Exception e)
{
System.out.println("Error while decrypting: " + e.toString());
}
return null;
}
} | [
"MSURES56@ford.com"
] | MSURES56@ford.com |
4855bca0143dc5028dbdd322f97ba0d19112a622 | e19700ff71584a358705e2d0e6ac3167e9b7df77 | /src/java/com/teag/estate/GratTrustTool.java | d44fb21341ea4dd682c75bb58332554405f6a054 | [] | no_license | paulstay/APN | a01a2f16ea0f4daafc42d8faf5944405c3eccd0b | d165d1addc7a998dc083dc87719099bfbf2c2236 | refs/heads/master | 2016-09-05T17:34:16.780146 | 2010-02-15T17:49:04 | 2010-02-15T17:49:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,276 | java | package com.teag.estate;
/**
* @author stay
* Created on Apr 12, 2005
* Description, The GratTrustTool calculates the GRAT trust benefits, and estate tax savings.
* Source - GRAT excel spread sheet Sean and Henry Whiffen
*/
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import com.zcalc.zCalc;
public class GratTrustTool {
double value;
double discountValue;
double growthRate;
double incomeRate;
double afrRate;
String transferDate;
double priorGifts;
double spousePriorGifts;
double annuity;
int annuityFreq;
double annuityIncrease;
double estateTaxRate;
double age;
double termLength;
double startTerm;
double lifeExp;
double annuityFactor;
double annuityPaymentRate;
double annuityRate;
double optimalPaymentRate;
double actualPaymentRate;
double annuityInterest;
double remainderInterest;
double subjectToAfrregs;
double totalInterest;
double retainedAnnuityInterest;
double taxableGift;
double totalGiftTaxPayable;
double gratBenefit;
double estateTaxSavings;
double leverage; // On day of transfer
boolean federalRev;
// This method uses zcalc heavily.
public void calculate() {
zCalc zcalc = new zCalc();
zcalc.StartUp();
/*
int yr = (int) age;
if( startTerm != 1) {
yr = (int)((startTerm -1 ) + age);
}
*/
optimalPaymentRate = zcalc.zGRATZO(afrRate, (int)termLength, annuityIncrease, annuityFreq, 0);
if( annuity == 0) {
if( discountValue == 0)
annuity = optimalPaymentRate * value;
else
annuity = optimalPaymentRate * discountValue;
}
lifeExp = zcalc.zLE((int)age,0,0,0,0,0,11);
annuityPaymentRate = annuity / discountValue;
annuityFactor = zcalc.zGRATAF(afrRate, (int)termLength, 0, 0, annuityIncrease, annuityFreq, 0);
actualPaymentRate = annuityPaymentRate;
taxableGift = zcalc.zGRATGIFT(afrRate, (int)termLength, 0, 0,
annuityIncrease, annuityFreq, discountValue, annuityPaymentRate, 0);
remainderInterest = taxableGift;
annuityInterest = discountValue - remainderInterest;
if( actualPaymentRate > optimalPaymentRate) {
federalRev = true;
} else {
federalRev = false;
}
totalInterest = discountValue;
retainedAnnuityInterest = totalInterest - taxableGift;
Date now = new Date();
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(now);
int year = cal.get(Calendar.YEAR);
if( spousePriorGifts > 0) {
totalGiftTaxPayable = zcalc.zFGT(taxableGift, priorGifts + spousePriorGifts, 0,0,year,0,0);
} else {
totalGiftTaxPayable = zcalc.zFGT(taxableGift, priorGifts, 0,0,year,0,0);
}
gratBenefit = zcalc.zGRATBEN(afrRate, (int)termLength, growthRate, annuityIncrease, annuityFreq,
value, annuityPaymentRate, 0);
estateTaxSavings = estateTaxRate * (gratBenefit - taxableGift);
if (taxableGift > 0)
leverage = value / taxableGift;
zcalc.ShutDown();
}
/**
* @return Returns the actualPaymentRate.
*/
public double getActualPaymentRate() {
return actualPaymentRate;
}
/**
* @return Returns the afrRate.
*/
public double getAfrRate() {
return afrRate;
}
/**
* @return Returns the age.
*/
public double getAge() {
return age;
}
/**
* @return Returns the annuity.
*/
public double getAnnuity() {
return annuity;
}
/**
* @return Returns the annuityFactor.
*/
public double getAnnuityFactor() {
return annuityFactor;
}
/**
* @return Returns the annuityFreq.
*/
public int getAnnuityFreq() {
return annuityFreq;
}
/**
* @return Returns the annuityIncrease.
*/
public double getAnnuityIncrease() {
return annuityIncrease;
}
/**
* @return Returns the annuityInterest.
*/
public double getAnnuityInterest() {
return annuityInterest;
}
/**
* @return Returns the annuityPaymentRate.
*/
public double getAnnuityPaymentRate() {
return annuityPaymentRate;
}
/**
* @return Returns the annuityRate.
*/
public double getAnnuityRate() {
return annuityRate;
}
/**
* @return Returns the discountValue.
*/
public double getDiscountValue() {
return discountValue;
}
/**
* @return Returns the estateTaxRate.
*/
public double getEstateTaxRate() {
return estateTaxRate;
}
/**
* @return Returns the estateTaxSavings.
*/
public double getEstateTaxSavings() {
return estateTaxSavings;
}
/**
* @return Returns the gratBenefit.
*/
public double getGratBenefit() {
return gratBenefit;
}
/**
* @return Returns the growthRate.
*/
public double getGrowthRate() {
return growthRate;
}
/**
* @return Returns the incomeRate.
*/
public double getIncomeRate() {
return incomeRate;
}
/**
* @return Returns the leverage.
*/
public double getLeverage() {
return leverage;
}
/**
* @return Returns the lifeExp.
*/
public double getLifeExp() {
return lifeExp;
}
/**
* @return Returns the optimalPaymentRate.
*/
public double getOptimalPaymentRate() {
return optimalPaymentRate;
}
/**
* @return Returns the priorGifts.
*/
public double getPriorGifts() {
return priorGifts;
}
/**
* @return Returns the remainderInterest.
*/
public double getRemainderInterest() {
return remainderInterest;
}
/**
* @return Returns the retainedAnnuityInterest.
*/
public double getRetainedAnnuityInterest() {
return retainedAnnuityInterest;
}
/**
* @return Returns the spousePriorGifts.
*/
public double getSpousePriorGifts() {
return spousePriorGifts;
}
/**
* @return Returns the startTerm.
*/
public double getStartTerm() {
return startTerm;
}
/**
* @return Returns the subjectToAfrregs.
*/
public double getSubjectToAfrregs() {
return subjectToAfrregs;
}
/**
* @return Returns the taxableGift.
*/
public double getTaxableGift() {
return taxableGift;
}
/**
* @return Returns the termLength.
*/
public double getTermLength() {
return termLength;
}
/**
* @return Returns the totalGiftTaxPayable.
*/
public double getTotalGiftTaxPayable() {
return totalGiftTaxPayable;
}
/**
* @return Returns the totalInterest.
*/
public double getTotalInterest() {
return totalInterest;
}
/**
* @return Returns the transferDate.
*/
public String getTransferDate() {
return transferDate;
}
/**
* @return Returns the value.
*/
public double getValue() {
return value;
}
/**
* @return Returns the federalRev.
*/
public boolean isFederalRev() {
return federalRev;
}
/**
* @param actualPaymentRate The actualPaymentRate to set.
*/
public void setActualPaymentRate(double actualPaymentRate) {
this.actualPaymentRate = actualPaymentRate;
}
/**
* @param afrRate The afrRate to set.
*/
public void setAfrRate(double afrRate) {
this.afrRate = afrRate;
}
/**
* @param age The age to set.
*/
public void setAge(double age) {
this.age = age;
}
/**
* @param annuity The annuity to set.
*/
public void setAnnuity(double annuity) {
this.annuity = annuity;
}
/**
* @param annuityFactor The annuityFactor to set.
*/
public void setAnnuityFactor(double annuityFactor) {
this.annuityFactor = annuityFactor;
}
/**
* @param annuityFreq The annuityFreq to set.
*/
public void setAnnuityFreq(int annuityFreq) {
this.annuityFreq = annuityFreq;
}
/**
* @param annuityIncrease The annuityIncrease to set.
*/
public void setAnnuityIncrease(double annuityIncrease) {
this.annuityIncrease = annuityIncrease;
}
/**
* @param annuityInterest The annuityInterest to set.
*/
public void setAnnuityInterest(double annuityInterest) {
this.annuityInterest = annuityInterest;
}
/**
* @param annuityPaymentRate The annuityPaymentRate to set.
*/
public void setAnnuityPaymentRate(double annuityPaymentRate) {
this.annuityPaymentRate = annuityPaymentRate;
}
/**
* @param annuityRate The annuityRate to set.
*/
public void setAnnuityRate(double annuityRate) {
this.annuityRate = annuityRate;
}
/**
* @param discountValue The discountValue to set.
*/
public void setDiscountValue(double discountValue) {
this.discountValue = discountValue;
}
/**
* @param estateTaxRate The estateTaxRate to set.
*/
public void setEstateTaxRate(double estateTaxRate) {
this.estateTaxRate = estateTaxRate;
}
/**
* @param estateTaxSavings The estateTaxSavings to set.
*/
public void setEstateTaxSavings(double estateTaxSavings) {
this.estateTaxSavings = estateTaxSavings;
}
/**
* @param federalRev The federalRev to set.
*/
public void setFederalRev(boolean federalRev) {
this.federalRev = federalRev;
}
/**
* @param gratBenefit The gratBenefit to set.
*/
public void setGratBenefit(double gratBenefit) {
this.gratBenefit = gratBenefit;
}
/**
* @param growthRate The growthRate to set.
*/
public void setGrowthRate(double growthRate) {
this.growthRate = growthRate;
}
/**
* @param incomeRate The incomeRate to set.
*/
public void setIncomeRate(double incomeRate) {
this.incomeRate = incomeRate;
}
/**
* @param leverage The leverage to set.
*/
public void setLeverage(double leverage) {
this.leverage = leverage;
}
/**
* @param lifeExp The lifeExp to set.
*/
public void setLifeExp(double lifeExp) {
this.lifeExp = lifeExp;
}
/**
* @param optimalPaymentRate The optimalPaymentRate to set.
*/
public void setOptimalPaymentRate(double optimalPaymentRate) {
this.optimalPaymentRate = optimalPaymentRate;
}
/**
* @param priorGifts The priorGifts to set.
*/
public void setPriorGifts(double priorGifts) {
this.priorGifts = priorGifts;
}
/**
* @param remainderInterest The remainderInterest to set.
*/
public void setRemainderInterest(double remainderInterest) {
this.remainderInterest = remainderInterest;
}
/**
* @param retainedAnnuityInterest The retainedAnnuityInterest to set.
*/
public void setRetainedAnnuityInterest(double retainedAnnuityInterest) {
this.retainedAnnuityInterest = retainedAnnuityInterest;
}
/**
* @param spousePriorGifts The spousePriorGifts to set.
*/
public void setSpousePriorGifts(double spousePriorGifts) {
this.spousePriorGifts = spousePriorGifts;
}
/**
* @param startTerm The startTerm to set.
*/
public void setStartTerm(double startTerm) {
this.startTerm = startTerm;
}
/**
* @param subjectToAfrregs The subjectToAfrregs to set.
*/
public void setSubjectToAfrregs(double subjectToAfrregs) {
this.subjectToAfrregs = subjectToAfrregs;
}
/**
* @param taxableGift The taxableGift to set.
*/
public void setTaxableGift(double taxableGift) {
this.taxableGift = taxableGift;
}
/**
* @param termLength The termLength to set.
*/
public void setTermLength(double termLength) {
this.termLength = termLength;
}
/**
* @param totalGiftTaxPayable The totalGiftTaxPayable to set.
*/
public void setTotalGiftTaxPayable(double totalGiftTaxPayable) {
this.totalGiftTaxPayable = totalGiftTaxPayable;
}
/**
* @param totalInterest The totalInterest to set.
*/
public void setTotalInterest(double totalInterest) {
this.totalInterest = totalInterest;
}
/**
* @param transferDate The transferDate to set.
*/
public void setTransferDate(String transferDate) {
this.transferDate = transferDate;
}
/**
* @param value The value to set.
*/
public void setValue(double value) {
this.value = value;
}
}
| [
"paul.stay@gmail.com"
] | paul.stay@gmail.com |
295eb6cae00905536d87a88597dfc9c4dedaedfb | fa42c8d3cbaea8c741e5f9fb59dc7c2c77e0c3b8 | /src/test/java/knowledge/ClassLoaderAndClassForName.java | d7d5454f773d458dbfbb8ffc61346f79726f3d6f | [] | no_license | AndiHappy/Knowledge | eb49de921844b791c680691e595a012cd4b0442a | ab503c09fb494dfd6cabada150901c1a77e579ad | refs/heads/master | 2021-01-12T00:30:34.037041 | 2017-09-21T05:57:40 | 2017-09-21T05:57:40 | 78,734,686 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 504 | java | package knowledge;
import static java.lang.Class.forName;
/**
* @author zhailz
* @date 17/9/17 - 上午9:40.
*/
public class ClassLoaderAndClassForName {
public static void main(String[] args){
try {
Object value = forName ("com.interview.FileCopyUtil");
System.out.println (value.toString ());
value = ClassLoader.getSystemClassLoader ();
System.out.println (value.toString ());
} catch (ClassNotFoundException e) {
e.printStackTrace ();
}
}
}
| [
"zhailz@chanjet.com"
] | zhailz@chanjet.com |
9b7d342338635ecc8eb34fe68b353d1178ce1f73 | fdc23269adb900a714bf93c98acae52aecb5873e | /jndroid/src/main/java/com/jignesh/jndroid/utils/FileFormatHelper.java | 496bbda7dfd15c29b297275cbe49f0931b6549c7 | [] | no_license | Yahayawebmaster/Status-Saver-For-WhatsaApp | 1cae644c0af44035937898b4a13d2bd21f71237b | 651a3ec2f9a95d3db9484e8f593fee36f0f905b0 | refs/heads/master | 2023-02-19T21:11:46.844985 | 2021-01-23T08:13:12 | 2021-01-23T08:13:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,751 | java | package com.jignesh.jndroid.utils;
import android.content.Intent;
import android.webkit.MimeTypeMap;
import android.widget.Toast;
import java.io.File;
public class FileFormatHelper {
/* switch (FileFormatHelper.FileType.getFileType(new File(path))) {
case IMAGE:
intent = new Intent(mContext, PhotoPreviewActivity.class);
break;
case VIDEO:
intent = new Intent(mContext, VideoPreviewActivity.class);
break;
default:
Toast.makeText(mContext, "Invalid file format", Toast.LENGTH_SHORT).show();
}
*/
private static String getExtension(String filename) {
return filename.contains(".") ? filename.substring(filename.lastIndexOf(".") + 1) : "";
}
public static String getMimeType(File file) {
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(getExtension(file.getName()));
}
public static enum FileType {
DIRECTORY, MISC_FILE, AUDIO, IMAGE, VIDEO, DOC, PPT, XLS, PDF, TXT, ZIP;
public static FileType getFileType(File file) {
if (file.isDirectory())
return FileType.DIRECTORY;
String mime = FileFormatHelper.getMimeType(file);
if (mime == null)
return FileType.MISC_FILE;
if (mime.startsWith("audio"))
return FileType.AUDIO;
if (mime.startsWith("image"))
return FileType.IMAGE;
if (mime.startsWith("video"))
return FileType.VIDEO;
if (mime.startsWith("application/ogg"))
return FileType.AUDIO;
if (mime.startsWith("application/msword"))
return FileType.DOC;
if (mime.startsWith("application/vnd.ms-word"))
return FileType.DOC;
if (mime.startsWith("application/vnd.ms-powerpoint"))
return FileType.PPT;
if (mime.startsWith("application/vnd.ms-excel"))
return FileType.XLS;
if (mime.startsWith("application/vnd.openxmlformats-officedocument.wordprocessingml"))
return FileType.DOC;
if (mime.startsWith("application/vnd.openxmlformats-officedocument.presentationml"))
return FileType.PPT;
if (mime.startsWith("application/vnd.openxmlformats-officedocument.spreadsheetml"))
return FileType.XLS;
if (mime.startsWith("application/pdf"))
return FileType.PDF;
if (mime.startsWith("text"))
return FileType.TXT;
if (mime.startsWith("application/zip"))
return FileType.ZIP;
return FileType.MISC_FILE;
}
}
} | [
"jignesh8992@gmail.com"
] | jignesh8992@gmail.com |
04e8478afa9d98e2d91e6e8a1aab85a09b7cde34 | 32e377464d25e23115db3eb91c64b15129f3b968 | /CeiCustom/src/main/java/com/hyrt/cei/ui/ebook/GoodsReportActivity.java | 9eeed66955ebb898a34057d430fc2dab70437b26 | [] | no_license | jiacunhe/xz_cei | a51dad4c6fe5557bc335a153ac53e65f2168a143 | 2496d0843961dcc0e37b070b64aa18563ee945a0 | refs/heads/master | 2020-04-10T04:42:48.013313 | 2014-04-23T08:53:32 | 2014-04-23T08:53:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,515 | java | package com.hyrt.cei.ui.ebook;
import java.util.ArrayList;
import java.util.List;
import com.hyrt.cei.R;
import com.hyrt.cei.adapter.GoodReportAdapter;
import com.hyrt.cei.application.CeiApplication;
import com.hyrt.cei.dzb.ui.HomePageDZB;
import com.hyrt.cei.util.MyTools;
import com.hyrt.cei.util.WriteOrRead;
import com.hyrt.cei.util.XmlUtil;
import com.hyrt.cei.vo.ColumnEntry;
import com.hyrt.cei.vo.Report;
import com.hyrt.cei.webservice.service.Service;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
public class GoodsReportActivity extends Activity implements OnClickListener {
private ImageView homePage, homeReport, goodsView, sortView, partView,
mianfeiReport, findReport;
private ImageButton back, bookSelf;
private ListView goodList;
private List<Report> goodData;
private ColumnEntry columnEntry;
private GoodReportAdapter adapter;
private int pageSize = 1;
private LinearLayout loadProgressBar;
private TextView moreTextView;
private LinearLayout prolayout;
private String bgId;
private Handler goodHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (msg.what == 2) {
if (msg.arg1 < 20) {
moreTextView.setVisibility(View.GONE);
} else {
moreTextView.setVisibility(View.VISIBLE);
}
loadProgressBar.setVisibility(View.GONE);
if (adapter != null)
adapter.notifyDataSetChanged();
}
if (msg.what == 3) {
loadProgressBar.setVisibility(View.GONE);
moreTextView.setVisibility(View.GONE);
} else {
adapter = new GoodReportAdapter(GoodsReportActivity.this,
goodData, goodList);
if (goodData.size() >= 20)
addPageMore();
goodList.setAdapter(adapter);
}
prolayout.setVisibility(View.GONE);
}
};
private void addPageMore() {
View view = LayoutInflater.from(this).inflate(R.layout.list_page_load,
null);
moreTextView = (TextView) view.findViewById(R.id.more_id);
loadProgressBar = (LinearLayout) view.findViewById(R.id.load_id);
moreTextView.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
// 隐藏"加载更多"
moreTextView.setVisibility(View.GONE);
// 显示进度条
loadProgressBar.setVisibility(View.VISIBLE);
new Thread(new Runnable() {
@Override
public void run() {
// 加载模拟数据:下一页数据, 在正常情况下,上面的休眠是不需要,直接使用下面这句代码加载相关数据
try {
if (bgId != null&&!bgId.equals("")) {
pageSize++;
String addBg = Service.queryReport(bgId, "bg",
pageSize + "");
List<Report> addReport = XmlUtil
.parseReport(addBg);
if (addReport.size() == 0) {
goodHandler.sendEmptyMessage(3);
return;
}
goodData.addAll(addReport);
Message msg = new Message();
msg.what = 2;
msg.arg1 = addReport.size();
goodHandler.sendMessage(msg);
}
} catch (Exception e) {
MyTools.showPushXml(getApplicationContext());
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
}
});
goodList.addFooterView(view);
}
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
homePage = null;
homeReport = null;
goodsView = null;
sortView = null;
partView = null;
mianfeiReport = null;
findReport = null;
bookSelf = null;
back = null;
columnEntry = null;
goodHandler = null;
goodData = null;
adapter = null;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.yjbg_jingpin);
// overridePendingTransition(R.anim.push_in, R.anim.push_out);
initView();
prolayout.setVisibility(View.VISIBLE);
initData();
}
private void initView() {
TextView title=(TextView)(findViewById(R.id.top).findViewById(R.id.title));
title.setText("精彩报告");
prolayout = (LinearLayout) findViewById(R.id.report_jingp_pro);
goodList = (ListView) findViewById(R.id.yjbg_goodreport_list);
homePage = (ImageView) findViewById(R.id.iv_good_report_page_home);
homePage.setOnClickListener(this);
homeReport = (ImageView) findViewById(R.id.iv_good_report_home);
homeReport.setOnClickListener(this);
goodsView = (ImageView) findViewById(R.id.iv_good_report_goods);
goodsView.setOnClickListener(this);
sortView = (ImageView) findViewById(R.id.iv_good_report_sort);
sortView.setOnClickListener(this);
partView = (ImageView) findViewById(R.id.iv_good_report_partition);
partView.setOnClickListener(this);
mianfeiReport = (ImageView) findViewById(R.id.iv_good_report_miamfei);
mianfeiReport.setOnClickListener(this);
findReport = (ImageView) findViewById(R.id.iv_good_report_find);
findReport.setOnClickListener(this);
bookSelf = (ImageButton) (findViewById(R.id.top).findViewById(R.id.ib_bg_bookshelf));
bookSelf.setOnClickListener(this);
back = (ImageButton) (findViewById(R.id.top).findViewById(R.id.ib_bg_back));
back.setOnClickListener(this);
}
private void initData() {
columnEntry = ((CeiApplication) getApplication()).columnEntry;
goodData = new ArrayList<Report>();
// 更据业务ID查询业务里面的数据
if (ReadReportActivity.allColBg != null
&& ReadReportActivity.allColBg.getId() != null
&& !ReadReportActivity.allColBg.getId().equals("")) {
String allBgId = ReadReportActivity.allColBg.getId();
List<ColumnEntry> allCol = columnEntry
.getEntryChildsForParent(allBgId);
for (ColumnEntry columnEntry : allCol) {
if (columnEntry.getName().equals("精品推荐")) {
bgId = columnEntry.getId();
}
}
}
if (((CeiApplication) getApplication()).isNet()) {
new Thread() {
@Override
public void run() {
// 所有精彩报告
if (bgId != null && !bgId.equals("")) {
String retData = Service.queryReport(bgId, "bg",
pageSize + "");
try {
goodData.clear();
goodData.addAll(XmlUtil.parseReport(retData));
if (goodHandler != null) {
goodHandler.sendEmptyMessage(1);
}
} catch (Exception e) {
MyTools.showPushXml(getApplicationContext());
e.printStackTrace();
}
}
}
}.start();
} else {
try {
goodData.addAll(XmlUtil.parseReport(WriteOrRead.read(
MyTools.nativeData, "goodReport.xml")));
if (goodHandler != null) {
goodHandler.sendEmptyMessage(1);
}
} catch (Exception e) {
MyTools.showPushXml(getApplicationContext());
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@Override
public void onClick(View v) {
// if (ReadReportActivity.activitys != null) {
if (v == homeReport) {
// 阅读报告页
Intent intent = new Intent(this, ReadReportActivity.class);
startActivity(intent);
// saveActivity(ReadReportActivity.class);
} else if (v == goodsView) {
/*
* Intent intent = new Intent(this, GoodsReportActivity.class);
* startActivity(intent); saveActivity(GoodsReportActivity.class);
*/
return;
// 精彩报告页
} else if (v == sortView) {
// 排序报告页
Intent intent = new Intent(this, SortReportActivity.class);
startActivity(intent);
// saveActivity(SortReportActivity.class);
} else if (v == partView) {
// 分类报告页
Intent intent = new Intent(this, PartitionReportActivity.class);
startActivity(intent);
// saveActivity(PartitionReportActivity.class);
} else if (v == mianfeiReport) {
// 免费报告
Intent intent = new Intent(this, MianfeiReportActivity.class);
startActivity(intent);
// saveActivity(MianfeiReportActivity.class);
} else if (v == findReport) {
// 报告查询查询
Intent intent = new Intent(this, FindReportActivity.class);
startActivity(intent);
// saveActivity(FindReportActivity.class);
} else if (v == homePage) {
// 首页
Intent intent = new Intent(this, HomePageDZB.class);
startActivity(intent);
// ReadReportActivity.activitys.clear();
} else if (v == back) {
// 返回键
/*
* if (ReadReportActivity.activitys.size() > 0) {
* ReadReportActivity.activitys .remove(ReadReportActivity.activitys
* .get(ReadReportActivity.activitys.size() - 1)); Intent intent =
* new Intent( this, ReadReportActivity.activitys
* .get(ReadReportActivity.activitys.size() - 1));
* startActivity(intent); }
*/
} else if (v == bookSelf) {
// 右侧数据图片
Intent intent = new Intent(this, CeiShelfBookActivity.class);
startActivity(intent);
// saveActivity(CeiShelfBookActivity.class);
}
// this.finish();
}
/*
* private void saveActivity(Class<?> clas) { if
* (ReadReportActivity.activitys.contains(clas)) {
* ReadReportActivity.activitys.remove(clas);
* ReadReportActivity.activitys.add(clas); } else {
* ReadReportActivity.activitys.add(clas); } }
*/
@Override
protected void onRestart() {
if (adapter != null)
adapter.notifyDataSetChanged();
super.onRestart();
}
}
| [
"jiacunhe@163.com"
] | jiacunhe@163.com |
39ac95d797c6f42a9bb7a7603e02966ef0b5b8d0 | 9542627682b3109c7754c6b94fcc1542b772e83e | /springboot-dubbo-provider/src/main/java/com/sundy/boot/utils/Md5Utils.java | 919c43766d3c73f841782dc9f44c60eab060ce04 | [] | no_license | sundy20/spring-boot-sundy | 10246e0ff5f5412e30e66b2d4b42ade8f9b869b8 | 972ff90cd95a88b826e08798a960469efac7482f | refs/heads/master | 2023-07-20T15:00:12.419806 | 2023-07-13T08:46:14 | 2023-07-13T08:46:14 | 145,501,500 | 3 | 0 | null | 2022-02-09T22:06:45 | 2018-08-21T03:28:08 | Java | UTF-8 | Java | false | false | 891 | java | package com.sundy.boot.utils;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Md5Utils {
public static String stringToMD5(String plainText) {
byte[] secretBytes = null;
try {
secretBytes = MessageDigest.getInstance("md5").digest(
plainText.getBytes());
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("没有这个md5算法!");
}
String md5code = new BigInteger(1, secretBytes).toString(16);
for (int i = 0; i < 32 - md5code.length(); i++) {
md5code = "0" + md5code;
}
return md5code;
}
public static String featureCode() {
return Md5Utils.stringToMD5("" + Thread.currentThread().getId());
}
public final static int FEATURE_CODE_LEN = 32;
}
| [
"wz193281@alibaba-inc.com"
] | wz193281@alibaba-inc.com |
3966442e12e49f4acdb448f091f0aab78eec1579 | 82f1190105490904f0582d211d0ce1adca770261 | /app/src/main/java/org/xbill/DNS/Record.java | 155faa743466a02ea5032d31b269f0e80908c5d5 | [] | no_license | sorcerer310/BakerStreet42ProjectorPlayer | a302c0585aa8e871dc3a497f5eda7123cf541390 | fb11b9cecef35941c9588493714b2dea41ad387a | refs/heads/master | 2021-10-22T21:31:31.264606 | 2021-10-11T06:45:30 | 2021-10-11T06:45:30 | 49,888,230 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 21,559 | java | // Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
package org.xbill.DNS;
import java.io.*;
import java.text.*;
import java.util.*;
import org.xbill.DNS.utils.*;
/**
* A generic DNS resource record. The specific record types extend this class.
* A record contains a name, type, class, ttl, and rdata.
*
* @author Brian Wellington
*/
public abstract class Record implements Cloneable, Comparable, Serializable {
private static final long serialVersionUID = 2694906050116005466L;
protected Name name;
protected int type, dclass;
protected long ttl;
private static final DecimalFormat byteFormat = new DecimalFormat();
static {
byteFormat.setMinimumIntegerDigits(3);
}
protected Record() {
}
Record(Name name, int type, int dclass, long ttl) {
if (!name.isAbsolute())
throw new RelativeNameException(name);
Type.check(type);
DClass.check(dclass);
TTL.check(ttl);
this.name = name;
this.type = type;
this.dclass = dclass;
this.ttl = ttl;
}
/**
* Creates an empty record of the correct type; must be overriden
*/
abstract Record
getObject();
private static final Record
getEmptyRecord(Name name, int type, int dclass, long ttl, boolean hasData) {
Record proto, rec;
if (hasData) {
proto = Type.getProto(type);
if (proto != null)
rec = proto.getObject();
else
rec = new UNKRecord();
} else
rec = new EmptyRecord();
rec.name = name;
rec.type = type;
rec.dclass = dclass;
rec.ttl = ttl;
return rec;
}
/**
* Converts the type-specific RR to wire format - must be overriden
*/
abstract void
rrFromWire(DNSInput in) throws IOException;
private static Record
newRecord(Name name, int type, int dclass, long ttl, int length, DNSInput in)
throws IOException {
Record rec;
rec = getEmptyRecord(name, type, dclass, ttl, in != null);
if (in != null) {
if (in.remaining() < length)
throw new WireParseException("truncated record");
in.setActive(length);
rec.rrFromWire(in);
if (in.remaining() > 0)
throw new WireParseException("invalid record length");
in.clearActive();
}
return rec;
}
/**
* Creates a new record, with the given parameters.
*
* @param name The owner name of the record.
* @param type The record's type.
* @param dclass The record's class.
* @param ttl The record's time to live.
* @param length The length of the record's data.
* @param data The rdata of the record, in uncompressed DNS wire format. Only
* the first length bytes are used.
*/
public static Record
newRecord(Name name, int type, int dclass, long ttl, int length, byte[] data) {
if (!name.isAbsolute())
throw new RelativeNameException(name);
Type.check(type);
DClass.check(dclass);
TTL.check(ttl);
DNSInput in;
if (data != null)
in = new DNSInput(data);
else
in = null;
try {
return newRecord(name, type, dclass, ttl, length, in);
} catch (IOException e) {
return null;
}
}
/**
* Creates a new record, with the given parameters.
*
* @param name The owner name of the record.
* @param type The record's type.
* @param dclass The record's class.
* @param ttl The record's time to live.
* @param data The complete rdata of the record, in uncompressed DNS wire
* format.
*/
public static Record
newRecord(Name name, int type, int dclass, long ttl, byte[] data) {
return newRecord(name, type, dclass, ttl, data.length, data);
}
/**
* Creates a new empty record, with the given parameters.
*
* @param name The owner name of the record.
* @param type The record's type.
* @param dclass The record's class.
* @param ttl The record's time to live.
* @return An object of a subclass of Record
*/
public static Record
newRecord(Name name, int type, int dclass, long ttl) {
if (!name.isAbsolute())
throw new RelativeNameException(name);
Type.check(type);
DClass.check(dclass);
TTL.check(ttl);
return getEmptyRecord(name, type, dclass, ttl, false);
}
/**
* Creates a new empty record, with the given parameters. This method is
* designed to create records that will be added to the QUERY section
* of a message.
*
* @param name The owner name of the record.
* @param type The record's type.
* @param dclass The record's class.
* @return An object of a subclass of Record
*/
public static Record
newRecord(Name name, int type, int dclass) {
return newRecord(name, type, dclass, 0);
}
static Record
fromWire(DNSInput in, int section, boolean isUpdate) throws IOException {
int type, dclass;
long ttl;
int length;
Name name;
Record rec;
name = new Name(in);
type = in.readU16();
dclass = in.readU16();
if (section == Section.QUESTION)
return newRecord(name, type, dclass);
ttl = in.readU32();
length = in.readU16();
if (length == 0 && isUpdate)
return newRecord(name, type, dclass, ttl);
rec = newRecord(name, type, dclass, ttl, length, in);
return rec;
}
static Record
fromWire(DNSInput in, int section) throws IOException {
return fromWire(in, section, false);
}
/**
* Builds a Record from DNS uncompressed wire format.
*/
public static Record
fromWire(byte[] b, int section) throws IOException {
return fromWire(new DNSInput(b), section, false);
}
void
toWire(DNSOutput out, int section, Compression c) {
name.toWire(out, c);
out.writeU16(type);
out.writeU16(dclass);
if (section == Section.QUESTION)
return;
out.writeU32(ttl);
int lengthPosition = out.current();
out.writeU16(0); /* until we know better */
rrToWire(out, c, false);
int rrlength = out.current() - lengthPosition - 2;
out.save();
out.jump(lengthPosition);
out.writeU16(rrlength);
out.restore();
}
/**
* Converts a Record into DNS uncompressed wire format.
*/
public byte[]
toWire(int section) {
DNSOutput out = new DNSOutput();
toWire(out, section, null);
return out.toByteArray();
}
private void
toWireCanonical(DNSOutput out, boolean noTTL) {
name.toWireCanonical(out);
out.writeU16(type);
out.writeU16(dclass);
if (noTTL) {
out.writeU32(0);
} else {
out.writeU32(ttl);
}
int lengthPosition = out.current();
out.writeU16(0); /* until we know better */
rrToWire(out, null, true);
int rrlength = out.current() - lengthPosition - 2;
out.save();
out.jump(lengthPosition);
out.writeU16(rrlength);
out.restore();
}
/*
* Converts a Record into canonical DNS uncompressed wire format (all names are
* converted to lowercase), optionally ignoring the TTL.
*/
private byte[]
toWireCanonical(boolean noTTL) {
DNSOutput out = new DNSOutput();
toWireCanonical(out, noTTL);
return out.toByteArray();
}
/**
* Converts a Record into canonical DNS uncompressed wire format (all names are
* converted to lowercase).
*/
public byte[]
toWireCanonical() {
return toWireCanonical(false);
}
/**
* Converts the rdata in a Record into canonical DNS uncompressed wire format
* (all names are converted to lowercase).
*/
public byte[]
rdataToWireCanonical() {
DNSOutput out = new DNSOutput();
rrToWire(out, null, true);
return out.toByteArray();
}
/**
* Converts the type-specific RR to text format - must be overriden
*/
abstract String rrToString();
/**
* Converts the rdata portion of a Record into a String representation
*/
public String
rdataToString() {
return rrToString();
}
/**
* Converts a Record into a String representation
*/
public String
toString() {
StringBuffer sb = new StringBuffer();
sb.append(name);
if (sb.length() < 8)
sb.append("\t");
if (sb.length() < 16)
sb.append("\t");
sb.append("\t");
if (Options.check("BINDTTL"))
sb.append(TTL.format(ttl));
else
sb.append(ttl);
sb.append("\t");
if (dclass != DClass.IN || !Options.check("noPrintIN")) {
sb.append(DClass.string(dclass));
sb.append("\t");
}
sb.append(Type.string(type));
String rdata = rrToString();
if (!rdata.equals("")) {
sb.append("\t");
sb.append(rdata);
}
return sb.toString();
}
/**
* Converts the text format of an RR to the internal format - must be overriden
*/
abstract void
rdataFromString(Tokenizer st, Name origin) throws IOException;
/**
* Converts a String into a byte array.
*/
protected static byte[]
byteArrayFromString(String s) throws TextParseException {
byte[] array = s.getBytes();
boolean escaped = false;
boolean hasEscapes = false;
for (int i = 0; i < array.length; i++) {
if (array[i] == '\\') {
hasEscapes = true;
break;
}
}
if (!hasEscapes) {
if (array.length > 255) {
throw new TextParseException("text string too long");
}
return array;
}
ByteArrayOutputStream os = new ByteArrayOutputStream();
int digits = 0;
int intval = 0;
for (int i = 0; i < array.length; i++) {
byte b = array[i];
if (escaped) {
if (b >= '0' && b <= '9' && digits < 3) {
digits++;
intval *= 10;
intval += (b - '0');
if (intval > 255)
throw new TextParseException
("bad escape");
if (digits < 3)
continue;
b = (byte) intval;
} else if (digits > 0 && digits < 3)
throw new TextParseException("bad escape");
os.write(b);
escaped = false;
} else if (array[i] == '\\') {
escaped = true;
digits = 0;
intval = 0;
} else
os.write(array[i]);
}
if (digits > 0 && digits < 3)
throw new TextParseException("bad escape");
array = os.toByteArray();
if (array.length > 255) {
throw new TextParseException("text string too long");
}
return os.toByteArray();
}
/**
* Converts a byte array into a String.
*/
protected static String
byteArrayToString(byte[] array, boolean quote) {
StringBuffer sb = new StringBuffer();
if (quote)
sb.append('"');
for (int i = 0; i < array.length; i++) {
int b = array[i] & 0xFF;
if (b < 0x20 || b >= 0x7f) {
sb.append('\\');
sb.append(byteFormat.format(b));
} else if (b == '"' || b == '\\') {
sb.append('\\');
sb.append((char) b);
} else
sb.append((char) b);
}
if (quote)
sb.append('"');
return sb.toString();
}
/**
* Converts a byte array into the unknown RR format.
*/
protected static String
unknownToString(byte[] data) {
StringBuffer sb = new StringBuffer();
sb.append("\\# ");
sb.append(data.length);
sb.append(" ");
sb.append(base16.toString(data));
return sb.toString();
}
/**
* Builds a new Record from its textual representation
*
* @param name The owner name of the record.
* @param type The record's type.
* @param dclass The record's class.
* @param ttl The record's time to live.
* @param st A tokenizer containing the textual representation of the rdata.
* @param origin The default origin to be appended to relative domain names.
* @return The new record
* @throws IOException The text format was invalid.
*/
public static Record
fromString(Name name, int type, int dclass, long ttl, Tokenizer st, Name origin)
throws IOException {
Record rec;
if (!name.isAbsolute())
throw new RelativeNameException(name);
Type.check(type);
DClass.check(dclass);
TTL.check(ttl);
Tokenizer.Token t = st.get();
if (t.type == Tokenizer.IDENTIFIER && t.value.equals("\\#")) {
int length = st.getUInt16();
byte[] data = st.getHex();
if (data == null) {
data = new byte[0];
}
if (length != data.length)
throw st.exception("invalid unknown RR encoding: " +
"length mismatch");
DNSInput in = new DNSInput(data);
return newRecord(name, type, dclass, ttl, length, in);
}
st.unget();
rec = getEmptyRecord(name, type, dclass, ttl, true);
rec.rdataFromString(st, origin);
t = st.get();
if (t.type != Tokenizer.EOL && t.type != Tokenizer.EOF) {
throw st.exception("unexpected tokens at end of record");
}
return rec;
}
/**
* Builds a new Record from its textual representation
*
* @param name The owner name of the record.
* @param type The record's type.
* @param dclass The record's class.
* @param ttl The record's time to live.
* @param s The textual representation of the rdata.
* @param origin The default origin to be appended to relative domain names.
* @return The new record
* @throws IOException The text format was invalid.
*/
public static Record
fromString(Name name, int type, int dclass, long ttl, String s, Name origin)
throws IOException {
return fromString(name, type, dclass, ttl, new Tokenizer(s), origin);
}
/**
* Returns the record's name
*
* @see Name
*/
public Name
getName() {
return name;
}
/**
* Returns the record's type
*
* @see Type
*/
public int
getType() {
return type;
}
/**
* Returns the type of RRset that this record would belong to. For all types
* except RRSIG, this is equivalent to getType().
*
* @return The type of record, if not RRSIG. If the type is RRSIG,
* the type covered is returned.
* @see Type
* @see RRset
* @see SIGRecord
*/
public int
getRRsetType() {
if (type == Type.RRSIG) {
RRSIGRecord sig = (RRSIGRecord) this;
return sig.getTypeCovered();
}
return type;
}
/**
* Returns the record's class
*/
public int
getDClass() {
return dclass;
}
/**
* Returns the record's TTL
*/
public long
getTTL() {
return ttl;
}
/**
* Converts the type-specific RR to wire format - must be overriden
*/
abstract void
rrToWire(DNSOutput out, Compression c, boolean canonical);
/**
* Determines if two Records could be part of the same RRset.
* This compares the name, type, and class of the Records; the ttl and
* rdata are not compared.
*/
public boolean
sameRRset(Record rec) {
return (getRRsetType() == rec.getRRsetType() &&
dclass == rec.dclass &&
name.equals(rec.name));
}
/**
* Determines if two Records are identical. This compares the name, type,
* class, and rdata (with names canonicalized). The TTLs are not compared.
*
* @param arg The record to compare to
* @return true if the records are equal, false otherwise.
*/
public boolean
equals(Object arg) {
if (arg == null || !(arg instanceof Record))
return false;
Record r = (Record) arg;
if (type != r.type || dclass != r.dclass || !name.equals(r.name))
return false;
byte[] array1 = rdataToWireCanonical();
byte[] array2 = r.rdataToWireCanonical();
return Arrays.equals(array1, array2);
}
/**
* Generates a hash code based on the Record's data.
*/
public int
hashCode() {
byte[] array = toWireCanonical(true);
int code = 0;
for (int i = 0; i < array.length; i++)
code += ((code << 3) + (array[i] & 0xFF));
return code;
}
Record
cloneRecord() {
try {
return (Record) clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException();
}
}
/**
* Creates a new record identical to the current record, but with a different
* name. This is most useful for replacing the name of a wildcard record.
*/
public Record
withName(Name name) {
if (!name.isAbsolute())
throw new RelativeNameException(name);
Record rec = cloneRecord();
rec.name = name;
return rec;
}
/**
* Creates a new record identical to the current record, but with a different
* class and ttl. This is most useful for dynamic update.
*/
Record
withDClass(int dclass, long ttl) {
Record rec = cloneRecord();
rec.dclass = dclass;
rec.ttl = ttl;
return rec;
}
/* Sets the TTL to the specified value. This is intentionally not public. */
void
setTTL(long ttl) {
this.ttl = ttl;
}
/**
* Compares this Record to another Object.
*
* @param o The Object to be compared.
* @return The value 0 if the argument is a record equivalent to this record;
* a value less than 0 if the argument is less than this record in the
* canonical ordering, and a value greater than 0 if the argument is greater
* than this record in the canonical ordering. The canonical ordering
* is defined to compare by name, class, type, and rdata.
* @throws ClassCastException if the argument is not a Record.
*/
public int
compareTo(Object o) {
Record arg = (Record) o;
if (this == arg)
return (0);
int n = name.compareTo(arg.name);
if (n != 0)
return (n);
n = dclass - arg.dclass;
if (n != 0)
return (n);
n = type - arg.type;
if (n != 0)
return (n);
byte[] rdata1 = rdataToWireCanonical();
byte[] rdata2 = arg.rdataToWireCanonical();
for (int i = 0; i < rdata1.length && i < rdata2.length; i++) {
n = (rdata1[i] & 0xFF) - (rdata2[i] & 0xFF);
if (n != 0)
return (n);
}
return (rdata1.length - rdata2.length);
}
/**
* Returns the name for which additional data processing should be done
* for this record. This can be used both for building responses and
* parsing responses.
*
* @return The name to used for additional data processing, or null if this
* record type does not require additional data processing.
*/
public Name
getAdditionalName() {
return null;
}
/* Checks that an int contains an unsigned 8 bit value */
static int
checkU8(String field, int val) {
if (val < 0 || val > 0xFF)
throw new IllegalArgumentException("\"" + field + "\" " + val +
" must be an unsigned 8 " +
"bit value");
return val;
}
/* Checks that an int contains an unsigned 16 bit value */
static int
checkU16(String field, int val) {
if (val < 0 || val > 0xFFFF)
throw new IllegalArgumentException("\"" + field + "\" " + val +
" must be an unsigned 16 " +
"bit value");
return val;
}
/* Checks that a long contains an unsigned 32 bit value */
static long
checkU32(String field, long val) {
if (val < 0 || val > 0xFFFFFFFFL)
throw new IllegalArgumentException("\"" + field + "\" " + val +
" must be an unsigned 32 " +
"bit value");
return val;
}
/* Checks that a name is absolute */
static Name
checkName(String field, Name name) {
if (!name.isAbsolute())
throw new RelativeNameException(name);
return name;
}
}
| [
"fengchong@126.com"
] | fengchong@126.com |
eb664a456e7603194c503355982407124f3f0ecd | 936e3b9be5d59cf2e6d83f8e74509659a4eb3423 | /src/main/java/ues/occ/edu/sv/ingenieria/prn335/cinewebapp/boundary/AtributoAsientoBean.java | 20e403150cf0ff1a3e9557c4e0f1475d55f470ea | [] | no_license | MarioVanegas/web | fbc39052ef6d23e113323842bbde8f0358373680 | 9ccace832585af97cb39564d435ea7d37451878d | refs/heads/master | 2022-02-26T15:08:06.898388 | 2019-11-03T19:42:09 | 2019-11-03T19:42:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,134 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ues.occ.edu.sv.ingenieria.prn335.cinewebapp.boundary;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.primefaces.event.SelectEvent;
import org.primefaces.model.LazyDataModel;
import ues.occ.edu.sv.ingenieria.prn335.cinewebapp.control.AbstractFacade;
import ues.occ.edu.sv.ingenieria.prn335.cinewebapp.control.AtributoAsientoFacade;
import ues.occ.edu.sv.ingenieria.prn335.cinewebapp.control.CaracteristicaAsientoFacade;
import ues.occ.edu.sv.ingenieria.prn335.cinewebapp.entity.Asiento;
import ues.occ.edu.sv.ingenieria.prn335.cinewebapp.entity.AtributoAsiento;
import ues.occ.edu.sv.ingenieria.prn335.cinewebapp.entity.AtributoAsientoPK;
import ues.occ.edu.sv.ingenieria.prn335.cinewebapp.entity.CaracteristicaAsiento;
/**
*
* @author melvin
*/
@Named(value = "atributoAsientoBean")
@ViewScoped
public class AtributoAsientoBean extends BackingBean<AtributoAsiento> implements Serializable{
public AtributoAsientoBean() {
}
@Inject
private AtributoAsientoFacade atributoAsientoFacade;
List<AtributoAsiento> atributoAsientoC;
@Inject
AsientoBean asientoFacade;
@Inject
private CaracteristicaAsientoFacade caracteristicaAsientoFacade;
private List<CaracteristicaAsiento> caracteristicaAsientoList;
String formularioTab;
List<String> nombreCaracteristica =new ArrayList();
Asiento selecionadoAS;
protected boolean exito = false;
protected String atributoVal;
protected int asiento;
protected String caracteristicaNome;
protected int caracteristica;
@Override
public void iniciar(){
relaciona();
if (atributoAsientoC.size() == caracteristicaAsientoList.size()) {
this.exito = true;
}else{
this.exito = false;
}
for (int iteracion = 0; iteracion < caracteristicaAsientoList.size(); iteracion++) {
nombreCaracteristica.add(caracteristicaAsientoList.get(iteracion).getCaracteristica());
}
for (int item = 0; item < atributoAsientoC.size(); item++) {
if (nombreCaracteristica.contains(atributoAsientoC.get(item).getCaracteristicaAsiento().getCaracteristica())) {
nombreCaracteristica.remove(atributoAsientoC.get(item).getCaracteristicaAsiento().getCaracteristica());
}
}
this.acciones = Estado.NADA;
registro = null;
}
public void relaciona(){
nombreCaracteristica.clear();
caracteristicaAsientoList = caracteristicaAsientoFacade.findAll();
atributoAsientoC = atributoAsientoFacade.AtributoAsientoIdAs(this.asiento);
}
@Override
public void onRowSelect(SelectEvent event) {
acciones = Estado.OTHER;
for (int i = 0; i < caracteristicaAsientoList.size(); i++) {
nombreCaracteristica.add(caracteristicaAsientoList.get(i).getCaracteristica());
}
registro = (AtributoAsiento) event.getObject();
this.atributoVal = registro.getValor();
this.caracteristicaNome = registro.getCaracteristicaAsiento().getCaracteristica();
}
public void getAsientoRowS(SelectEvent event) {
this.selecionadoAS = (Asiento) event.getObject();
this.asiento = selecionadoAS.getIdAsiento();
iniciar();
}
public void menuCaracteristicaAsiento() {
for (int j = 0; j < selecionadoAS.getAtributoAsientoList().size(); j++) {
for (int i = 0; i < caracteristicaAsientoList.size(); i++) {
if (selecionadoAS.getAtributoAsientoList().get(j).getCaracteristicaAsiento().getIdCaracteristica() != caracteristicaAsientoList.get(i).getIdCaracteristica()) {
System.out.println(caracteristicaAsientoList.get(i).getCaracteristica());
nombreCaracteristica.add(caracteristicaAsientoList.get(i).getCaracteristica());
}
}
}
}
@Override
public void btnEditarHandler(ActionEvent ae) {
registro.setValor(this.atributoVal);
atributoAsientoFacade.edit(registro);
limpiar();
this.iniciar();
}
@Override
public Object clavePorDatos(AtributoAsiento object) {
if(object != null){
return object.getAtributoAsientoPK();
}
return null;
}
@Override
public AtributoAsiento datosPorClave(String rowKey) {
if (rowKey != null && !rowKey.isEmpty()) {
try {
Integer buscar = new Integer(rowKey);
for (AtributoAsiento at : this.List) {
if (Integer.valueOf(at.getAtributoAsientoPK().getIdAsiento()).compareTo(buscar) == 0) {
return at;
}
}
} catch (NumberFormatException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getMessage(), e);
}
}
return null;
}
@Override
protected AbstractFacade<AtributoAsiento> getFacade() {
return atributoAsientoFacade;
}
@Override
public void btnCancelarHandler(ActionEvent ae) {
registro = null;
limpiar();
iniciar();
}
@Override
public void btnAgregarHandler(ActionEvent ae) {
AtributoAsiento nuevo = new AtributoAsiento();
this.caracteristica = caracteristicaAsientoFacade.caracteristicaAsientoNombre(this.caracteristicaNome);
AtributoAsientoPK id = new AtributoAsientoPK(caracteristica, asiento);
nuevo.setAtributoAsientoPK(id);
nuevo.setAsiento(selecionadoAS);
nuevo.setCaracteristicaAsiento(caracteristicaAsientoFacade.find(caracteristica));
nuevo.setValor(atributoVal);
atributoAsientoFacade.create(nuevo);
limpiar();
this.iniciar();
}
@Override
public void btnEliminarHandler(ActionEvent ae) {
try {
atributoAsientoFacade.remove(registro);
limpiar();
iniciar();
} catch (Exception e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getMessage(), e);
}
}
public void limpiar() {
this.atributoVal = new String();
this.caracteristicaNome = new String();
}
@Override
public AtributoAsiento getRegistro(){
if(registro == null){
registro = new AtributoAsiento();
}
return super.getRegistro();
}
@Override
public LazyDataModel<AtributoAsiento> getModelo(){
return super.getModelo();
}
public List<CaracteristicaAsiento> getCaracteristicaAsientoList() {
return caracteristicaAsientoList;
}
public void setCaracteristicaAsientoList(List<CaracteristicaAsiento> caracteristicaAsientoList) {
this.caracteristicaAsientoList = caracteristicaAsientoList;
}
public List<AtributoAsiento> getAtributoAsientoC() {
return atributoAsientoC;
}
public void setAtributoAsientoC(List<AtributoAsiento> atributoAsientoC) {
this.atributoAsientoC = atributoAsientoC;
}
public List<String> getNombreCaracteristica() {
return nombreCaracteristica;
}
public void setNombreCaracteristica(List<String> nombreCaracteristica) {
this.nombreCaracteristica = nombreCaracteristica;
}
public Asiento getSelecionadoAS() {
return selecionadoAS;
}
public void setSelecionadoAS(Asiento selecionadoAS) {
this.selecionadoAS = selecionadoAS;
}
public boolean isExito() {
return exito;
}
public void setExito(boolean exito) {
this.exito = exito;
}
public String getAtributoVal() {
return atributoVal;
}
public void setAtributoVal(String atributoVal) {
this.atributoVal = atributoVal;
}
public int getAsiento() {
return asiento;
}
public void setAsiento(int asiento) {
this.asiento = asiento;
}
public String getCaracteristicaNome() {
return caracteristicaNome;
}
public void setCaracteristicaNome(String caracteristicaNome) {
this.caracteristicaNome = caracteristicaNome;
}
public int getCaracteristica() {
return caracteristica;
}
public void setCaracteristica(int caracteristica) {
this.caracteristica = caracteristica;
}
public String getFormularioTab() {
return formularioTab;
}
public void setFormularioTab(String formularioTab) {
this.formularioTab = formularioTab;
}
}
| [
"Vladimir@192.168.0.10"
] | Vladimir@192.168.0.10 |
142adb4b5a1430bf800cf834cc68a0361f3586cc | fe1e63c5938d3fd5528b6a7bf4fc27e5c8e64604 | /MineInAbyss/src/main/java/com/derongan/minecraft/mineinabyss/Player/PlayerDataConfigManager.java | bd3c882877dd7434df41b6a2d10c4b3e7151d794 | [] | no_license | Miirpat-Gaalsien/MineInAbyss | dced036021df4760417d15c935a53e7162d9d590 | 82912b4f13c3edfb5ad28c2adba0e5726009711c | refs/heads/master | 2020-03-22T13:21:18.005239 | 2018-10-03T18:19:56 | 2018-10-03T18:19:56 | 140,101,393 | 0 | 0 | null | 2018-10-03T08:44:36 | 2018-07-07T16:50:55 | Java | UTF-8 | Java | false | false | 2,599 | java | package com.derongan.minecraft.mineinabyss.Player;
import com.derongan.minecraft.mineinabyss.AbyssContext;
import com.derongan.minecraft.mineinabyss.Configuration.ConfigurationConstants;
import com.derongan.minecraft.mineinabyss.MineInAbyss;
import com.derongan.minecraft.mineinabyss.World.AbyssWorldManager;
import com.google.common.annotations.VisibleForTesting;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.io.IOException;
import java.nio.file.Path;
import java.util.UUID;
public class PlayerDataConfigManager {
private static final String UUID_KEY = "uuid";
private static final String AFFECTABLE_KEY = "affectable";
private static final String ANCHORED_KEY = "anchored";
private static final String ASCENDED_KEY = "ascended";
private AbyssContext context;
public PlayerDataConfigManager(AbyssContext context) {
this.context = context;
}
public PlayerData loadPlayerData(Player player) {
Path path = getPlayerDataPath(player);
AbyssWorldManager manager = context.getWorldManager();
if(path.toFile().exists()){
YamlConfiguration config = YamlConfiguration.loadConfiguration(path.toFile());
PlayerData data = new PlayerDataImpl(player);
data.setAffectedByCurse(config.getBoolean(AFFECTABLE_KEY));
data.setAnchored(config.getBoolean(ANCHORED_KEY));
data.setDistanceAscended(config.getDouble(ASCENDED_KEY));
return data;
} else {
PlayerData data = new PlayerDataImpl(player);
return data;
}
}
public void savePlayerData(PlayerData playerData) throws IOException {
Path path = getPlayerDataPath(playerData.getPlayer());
// Recreate directories if missing
path.toFile().getParentFile().mkdirs();
YamlConfiguration config = new YamlConfiguration();
config.set(UUID_KEY, playerData.getPlayer().getUniqueId().toString());
config.set(AFFECTABLE_KEY, playerData.isAffectedByCurse());
config.set(ANCHORED_KEY, playerData.isAnchored());
config.set(ASCENDED_KEY, playerData.getDistanceAscended());
config.save(path.toFile());
}
@VisibleForTesting
Path getPlayerDataPath(Player player) {
UUID uuid = player.getUniqueId();
return MineInAbyss.getInstance().getDataFolder()
.toPath()
.resolve(ConfigurationConstants.PLAYER_DATA_DIR)
.resolve(uuid.toString() + ".yml");
}
}
| [
"dgfriedman@ucdavis.edu"
] | dgfriedman@ucdavis.edu |
04f3a23948cf15fd6fe5e45697163759efc2bc07 | cd5f4f00a8a072d4bed8b98b409a8aa38d2284e2 | /module-framework-core/src/main/java/com/mobvoi/ticwatch/framework/core/exceptions/UserNotExistException.java | 70d1e8c1736e32c3093f80966304ae2c0787d34d | [] | no_license | myaq1314/ticwatch | 7aab8b0987ee0cad5dbec9dc02cc012f23f19d36 | 0ac4f83f5051846d9a6fa54414c68a01d8a37687 | refs/heads/main | 2023-06-24T05:25:06.701064 | 2021-07-23T16:27:58 | 2021-07-23T16:27:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package com.mobvoi.ticwatch.framework.core.exceptions;
import com.mobvoi.ticwatch.framework.core.responses.ResultCode;
/**
* @Project : elearningweb
* @Package Name : com.mobvoi.elearning.console.exception
* @Author : xiekun
* @Create Date : 2018年06月08日 下午4:23
* @ModificationHistory Who When What
* ------------ -------------- ---------------------------------
*/
public class UserNotExistException extends RuntimeException{
private Integer code;
public UserNotExistException(ResultCode resultCode) {
super(resultCode.get().getMsg());
this.code = resultCode.get().getCode();
}
public UserNotExistException(Integer code, String message) {
super(message);
this.code = code;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
}
| [
"xiekun@sunlands.com"
] | xiekun@sunlands.com |
00acbef98ad30f846044cf7b7d4904c82567d29f | 09dfa684d53717ffe9ab489b1f1834ee04ed4ddb | /app/src/main/java/pl/ipebk/tabi/presentation/ui/utils/animation/SimpleTransitionListener.java | a9ca223db68bb07b7c504180afc36c5ee46da196 | [
"Apache-2.0"
] | permissive | bskierys/tabi | d31aa326bf99b158622f870b47eeb4a253fadfd5 | b4d69db1176d6028f135fec9c623a87b4bc16fb3 | refs/heads/master | 2021-01-19T05:56:08.207590 | 2019-05-06T22:30:33 | 2019-05-06T22:30:33 | 60,730,639 | 0 | 0 | null | 2016-11-28T15:22:39 | 2016-06-08T21:03:52 | Java | UTF-8 | Java | false | false | 3,164 | java | /*
* author: Bartlomiej Kierys
* date: 2017-02-14
* email: bskierys@gmail.com
*/
package pl.ipebk.tabi.presentation.ui.utils.animation;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.transition.Transition;
import rx.functions.Action1;
/**
* Implementation of {@link android.transition.Transition.TransitionListener} that makes use of a builder instead of overriding all methods
*/
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class SimpleTransitionListener implements Transition.TransitionListener {
private Builder builder;
private SimpleTransitionListener(Builder builder) {
this.builder = builder;
}
@Override public void onTransitionStart(Transition transition) {
if (builder.startAction != null) {
builder.startAction.call(transition);
}
}
@Override public void onTransitionEnd(Transition transition) {
if(builder.unregisterOnEnd) {
transition.removeListener(this);
}
if (builder.endAction != null) {
builder.endAction.call(transition);
}
}
@Override public void onTransitionCancel(Transition transition) {
if(builder.unregisterOnEnd) {
transition.removeListener(this);
}
if (builder.cancelAction != null) {
builder.cancelAction.call(transition);
}
}
@Override public void onTransitionPause(Transition transition) {
if (builder.pauseAction != null) {
builder.pauseAction.call(transition);
}
}
@Override public void onTransitionResume(Transition transition) {
if (builder.resumeAction != null) {
builder.resumeAction.call(transition);
}
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public static class Builder {
private Action1<Transition> startAction;
private Action1<Transition> endAction;
private Action1<Transition> cancelAction;
private Action1<Transition> pauseAction;
private Action1<Transition> resumeAction;
private boolean unregisterOnEnd;
public Builder withOnStartAction(Action1<Transition> startAction) {
this.startAction = startAction;
return this;
}
public Builder withOnEndAction(Action1<Transition> endAction) {
this.endAction = endAction;
return this;
}
public Builder withOnCancelAction(Action1<Transition> cancelAction) {
this.cancelAction = cancelAction;
return this;
}
public Builder withOnPauseAction(Action1<Transition> pauseAction) {
this.pauseAction = pauseAction;
return this;
}
public Builder withOnResumeAction(Action1<Transition> resumeAction) {
this.resumeAction = resumeAction;
return this;
}
public Builder unregisterOnEnd() {
this.unregisterOnEnd = true;
return this;
}
public Transition.TransitionListener build() {
return new SimpleTransitionListener(this);
}
}
}
| [
"bskierys@gmail.com"
] | bskierys@gmail.com |
1d0e5cef2f554f6759c3f70c1afea63a980f5534 | 4f08bcb953fd6a6dea9166c1ce22e5755222c4c1 | /src/main/java/com/ele/mapper/MenuMapper.java | 31a9ec0da3dd107f7b967310a49006711033d1d6 | [] | no_license | Fish-Fan/ele-spring | 0ecceff712c37599b3da48adc04c5a9e69cbaea9 | 93be5fc079619c6ad1e6bf8178ade84d96d7f048 | refs/heads/master | 2020-12-03T02:00:43.959439 | 2017-07-21T01:55:20 | 2017-07-21T01:55:20 | 95,892,741 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 534 | java | package com.ele.mapper;
import com.ele.pojo.MenuTypeReal;
import com.ele.pojo.Shop;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Created by Administrator on 2017/7/12 0012.
*/
@Component
public interface MenuMapper {
/**
* 将商家添加到Menu
* @param
* @param menuTypeReal
*/
void insertShopToMenu(MenuTypeReal menuTypeReal);
/**
* 根据菜单查找商家
* @param
* @param
*/
List<Shop> selectShopFoodByMenuTypeId(Integer shopId);
}
| [
"fanyank@126.com"
] | fanyank@126.com |
83f9ad24ecffca10269feb7dcf029e30dfd303d3 | c16a803c0c2143162ecbb6ec962fed2d4c922d41 | /src/main/java/anna/pizzadeliveryservice/repository/JpaPizzaRepository.java | ceb0757d23879def247bc4000a6b182d58406505 | [] | no_license | ArvenAnna/PizzaDeliveryService | 9b3873e6f39b25afdd5a6db8e186781522cfc2f4 | 44c5ad158f9280cc6157182ffbea977cccf70efd | refs/heads/master | 2021-01-17T07:10:08.752139 | 2016-06-01T19:57:55 | 2016-06-01T19:57:55 | 52,147,957 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,899 | java | package anna.pizzadeliveryservice.repository;
import anna.pizzadeliveryservice.domain.Pizza;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
/**
* Implementation of pizza repository for JPA
* @author Anna
*/
@Repository
@Transactional
public class JpaPizzaRepository implements PizzaRepository{
@PersistenceContext
private EntityManager em;
@Transactional(readOnly = true)
@Override
public Pizza findById(Long id) {
TypedQuery<Pizza> query = em.createNamedQuery("Pizza.findById", Pizza.class);
query.setParameter("id", id);
return query.getSingleResult();
}
@Override
public Pizza remove(Pizza pizza) {
Pizza p = em.merge(pizza);
em.remove(p);
return pizza;
}
@Override
public Pizza addOrUpdate(Pizza pizza) {
if(pizza.getId() == null){
em.persist(pizza);
}else{
em.merge(pizza);
}
return pizza;
}
@Override
public Pizza update(Pizza pizza) {
return em.merge(pizza);
}
@Transactional(readOnly = true)
@Override
public Set<Pizza> findAll() {
TypedQuery<Pizza> query = em.createNamedQuery("Pizza.findAll", Pizza.class);
return new HashSet<Pizza>(query.getResultList());
}
@Override
public Pizza addNew(Pizza pizza) {
em.persist(pizza);
return pizza;
}
@Override
public Set<Pizza> findSomeRandom(int limit) {
TypedQuery<Pizza> query = em.createNamedQuery("Pizza.findSomeRandom", Pizza.class);
query.setMaxResults(limit);
return new HashSet<Pizza>(query.getResultList());
}
}
| [
"LastSunsetBeam@yandex.ru"
] | LastSunsetBeam@yandex.ru |
fa2b6afcc213c1f6190155ccb97910b865d3df48 | d93a1aa9dfaa768ed067077a3d7d382cfee53a44 | /app/src/main/java/com/lbx/huiji/MainActivity.java | 14afda249ea023e878e2dc7d94f251e843922b62 | [] | no_license | 610968110/Plane | 9e78750dd0807cb6627a2c2a7a71459153290a5e | 91baf7d34829de6b5183b96ca01105d2916be31a | refs/heads/master | 2020-04-05T07:22:10.643717 | 2018-11-08T08:50:51 | 2018-11-08T08:50:51 | 156,672,970 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,058 | java | package com.lbx.huiji;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.lbx.huiji.view.GameView;
/**
* @author lbx
*/
public class MainActivity extends AppCompatActivity {
/**
* 游戏窗口
*/
private GameView mGameView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mGameView = (GameView) findViewById(R.id.gv_main);
//设置游戏监听
mGameView.setOnGameListener(new GameView.OnGameListener() {
@Override
public void onStart() {
//游戏开始
mGameView.setVisibility(View.VISIBLE);
}
@Override
public void onGameOver() {
//游戏失败
mGameView.setVisibility(View.GONE);
}
});
}
public void again(View view) {
//重来一次
mGameView.again();
}
}
| [
"610968110@qq.com"
] | 610968110@qq.com |
4d3eec7bfb6e0cdc998a38444da3e357318cc201 | 02c50a9385c99a29e98fc1ee2ad169688917e8e2 | /app/src/main/java/com/example/space_game/Result.java | 4b018bfd59887ba4177a75efc915a0887bc31a7a | [] | no_license | GuySulamiAndroid/SpaceGame1 | e839132877af5381fb8ae02ee69bb03bc45bab30 | c603e23efd569adec052fa7e4d337783be57a2b2 | refs/heads/master | 2020-09-23T23:35:05.582850 | 2020-01-08T20:09:18 | 2020-01-08T20:09:18 | 225,615,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,000 | java | package com.example.space_game;
public class Result implements Comparable<Result>{
private String playerName;
private int score;
private double lat = 0;
private double lng = 0;
public Result(String playerName, int score, double lat, double lng){
this.playerName = playerName;
this.score = score;
setLat(lat);
setLng(lng);
}
public String getPlayerName(){
return playerName;
}
public int getScore() {
return score;
}
public void setLat(double lat) {
this.lat = lat;
}
public void setLng(double lng) {
this.lng = lng;
}
public double getLat() {
return lat;
}
public double getLng() {
return lng;
}
@Override
public int compareTo(Result result) {
return result.getScore() > score ? 1 : result.getScore() < score ? -1: 0;
}
@Override
public String toString() {
return playerName + " - " + score;
}
}
| [
"guysulami@gmail.com"
] | guysulami@gmail.com |
9035e4e3f7904c9b256bd663a5aec14dec971db2 | db2cd2a4803e546d35d5df2a75b7deb09ffadc01 | /nemo-tfl-online/src/test/java/com/novacroft/nemo/tfl/online/controller/CartControllerTest.java | 4058ce62e8d6a86e549f5ad4b7e03f376f88526e | [] | no_license | balamurugan678/nemo | 66d0d6f7062e340ca8c559346e163565c2628814 | 1319daafa5dc25409ae1a1872b1ba9b14e5a297e | refs/heads/master | 2021-01-19T17:47:22.002884 | 2015-06-18T12:03:43 | 2015-06-18T12:03:43 | 37,656,983 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,100 | java | package com.novacroft.nemo.tfl.online.controller;
import static com.novacroft.nemo.test_support.CartSessionDataTestUtil.getTestCartSessionDataDTO1;
import static com.novacroft.nemo.test_support.CartTestUtil.getNewCartDTOWithItem;
import static com.novacroft.nemo.test_support.CartTestUtil.getNewCartDTOWithShippingItem;
import static com.novacroft.nemo.test_support.ShippingMethodItemTestUtil.getTestShippingMethodItemDTO1;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.springframework.test.util.ReflectionTestUtils.setField;
import javax.servlet.http.HttpSession;
import org.junit.Before;
import org.junit.Test;
import org.springframework.ui.Model;
import org.springframework.validation.support.BindingAwareModelMap;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.view.RedirectView;
import com.novacroft.nemo.common.application_service.SelectListService;
import com.novacroft.nemo.common.transfer.SelectListDTO;
import com.novacroft.nemo.tfl.common.application_service.CartAdministrationService;
import com.novacroft.nemo.tfl.common.application_service.CartService;
import com.novacroft.nemo.tfl.common.application_service.CustomerService;
import com.novacroft.nemo.tfl.common.application_service.PayAsYouGoService;
import com.novacroft.nemo.tfl.common.application_service.SecurityService;
import com.novacroft.nemo.tfl.common.command.impl.CartCmdImpl;
import com.novacroft.nemo.tfl.common.command.impl.CartItemCmdImpl;
import com.novacroft.nemo.tfl.common.constant.PageAttribute;
import com.novacroft.nemo.tfl.common.constant.PageCommand;
import com.novacroft.nemo.tfl.common.constant.PageUrl;
import com.novacroft.nemo.tfl.common.constant.PageView;
import com.novacroft.nemo.tfl.common.transfer.CartDTO;
import com.novacroft.nemo.tfl.common.transfer.ShippingMethodItemDTO;
import com.novacroft.nemo.tfl.common.util.CartUtil;
/**
* Unit tests for cart Controller
*/
public class CartControllerTest {
private CartController controller;
private CartCmdImpl mockCmd;
private RedirectAttributes mockRedirectAttributes;
private CartService mockCartService;
private CustomerService mockCustomerService;
private SecurityService mockSecurityService;
private Model mockModel;
private HttpSession mockSession;
private CartAdministrationService mockNewCartAdminService;
private BindingAwareModelMap model;
private SelectListService mockSelectListService;
private PayAsYouGoService mockPayAsYouGoService;
private CartDTO mockCartDTO;
public static final String ANONYMOUS_USER = "anonymousUser";
public static final String SHIPPING_TYPE_RECORDED_DELIVERY = "Recorded Delivery";
public static final String USER = "user";
@Before
public void setUp() {
controller = new CartController();
mockRedirectAttributes = mock(RedirectAttributes.class);
mockCmd = mock(CartCmdImpl.class);
mockCustomerService = mock(CustomerService.class);
mockSecurityService = mock(SecurityService.class);
mockCartService = mock(CartService.class);
mockModel = mock(Model.class);
mockSession = mock(HttpSession.class);
mockNewCartAdminService = mock(CartAdministrationService.class);
mockSelectListService = mock(SelectListService.class);
mockPayAsYouGoService = mock(PayAsYouGoService.class);
mockCartDTO = mock(CartDTO.class);
model = new BindingAwareModelMap();
controller.customerService = mockCustomerService;
controller.cartService = mockCartService;
controller.cartAdminService = mockNewCartAdminService;
controller.selectListService = mockSelectListService;
controller.payAsYouGoService = mockPayAsYouGoService;
setField(controller, "securityService", mockSecurityService);
when(CartUtil.getCartSessionDataDTOFromSession(mockSession)).thenReturn(getTestCartSessionDataDTO1());
}
@Test
public void shouldGetCartCmd() {
assertNotNull(controller.getCartCmd());
}
@Test
public void shouldpopulateBasketTicketTypesSelectList() {
when(mockSelectListService.getSelectList(anyString())).thenReturn(new SelectListDTO());
controller.populateBasketTicketTypesSelectList(model);
assertTrue(model.containsAttribute(PageAttribute.CART_SHIPPING_METHODS));
}
@Test
public void shouldShowCart() {
when(mockCartService.findById(anyLong())).thenReturn(getNewCartDTOWithItem());
ModelAndView result = controller.viewCart(mockSession, mockCmd, mockRedirectAttributes, mockModel);
assertEquals(PageView.CART, result.getViewName());
assertTrue(result.getModel().containsKey(PageCommand.CART));
assertTrue(result.getModel().get(PageCommand.CART) instanceof CartCmdImpl);
}
@Test
public void shouldShowCartForCartWithShippingItem() {
when(mockCartService.findById(anyLong())).thenReturn(getNewCartDTOWithShippingItem());
ModelAndView result = controller.viewCart(mockSession, mockCmd, mockRedirectAttributes, mockModel);
assertEquals(PageView.CART, result.getViewName());
assertTrue(result.getModel().containsKey(PageCommand.CART));
assertTrue(result.getModel().get(PageCommand.CART) instanceof CartCmdImpl);
}
@Test
public void emptyCartShouldShowCartAndCallEmprtyCart() {
when(mockCartService.findById(anyLong())).thenReturn(getNewCartDTOWithItem());
ModelAndView result = controller.emptyCart(mockSession, mockCmd);
verify(mockCartService, atLeastOnce()).emptyCart((CartDTO) any());
assertEquals(PageUrl.BASKET, ((RedirectView) result.getView()).getUrl());
}
@Test
public void addMoreItemsShouldShowBasket() {
ModelAndView result = controller.addMoreItems();
assertEquals(PageUrl.BASKET, ((RedirectView) result.getView()).getUrl());
}
@Test
public void continueCartShouldShowCheckout() {
when(mockCartService.findById(anyLong())).thenReturn(getNewCartDTOWithItem());
ModelAndView result = controller.continueCart(mockSession, mockCmd);
verify(mockCartService, atLeastOnce()).findById(anyLong());
assertEquals(PageUrl.ACCOUNT_DETAILS, ((RedirectView) result.getView()).getUrl());
}
@Test
public void updateTotalCostShouldShowCart() {
ModelAndView result = controller.updateTotalCost(mockSession, mockCmd, mockModel);
assertEquals(PageView.CART, result.getViewName());
}
@Test
public void updateTotalCostShouldShowCartAndApplyShippingCost() {
when(mockCartService.findById(anyLong())).thenReturn(getNewCartDTOWithItem());
when(mockCmd.getShippingType()).thenReturn(SHIPPING_TYPE_RECORDED_DELIVERY);
ModelAndView result = controller.updateTotalCost(mockSession, mockCmd, mockModel);
verify(mockNewCartAdminService, atLeastOnce()).applyShippingCost(any(CartDTO.class), any(CartItemCmdImpl.class));
verify(mockCartService, atLeastOnce()).findById(anyLong());
assertEquals(PageView.CART, result.getViewName());
}
@Test
public void deleteShoppingItemShouldShowCart() {
when(mockCartService.findById(anyLong())).thenReturn(getNewCartDTOWithItem());
when(mockNewCartAdminService.removeRefundableDepositAndShippingCost(getNewCartDTOWithItem()))
.thenReturn(getNewCartDTOWithItem());
when(mockNewCartAdminService.removeRefundableDepositAndShippingCost(any(CartDTO.class))).thenReturn(mockCartDTO);
when(mockPayAsYouGoService.removeNonApplicableAutoTopUpCartItem(any(CartDTO.class))).thenReturn(mockCartDTO);
ModelAndView result = controller.deleteShoppingItem(mockSession, mockCmd, 1, mockModel);
verify(mockCartService, atLeastOnce()).deleteItem((CartDTO) any(), anyLong());
verify(mockNewCartAdminService, atLeastOnce()).removeRefundableDepositAndShippingCost((CartDTO) any());
verify(mockCartService, atLeastOnce()).findById(anyLong());
assertEquals(PageView.CART, result.getViewName());
}
@Test
public void deleteShoppingItemShouldSetShippingType() {
ShippingMethodItemDTO shippingItemDTO = getTestShippingMethodItemDTO1();
shippingItemDTO.setName(SHIPPING_TYPE_RECORDED_DELIVERY);
when(mockCartService.findById(anyLong())).thenReturn(getNewCartDTOWithItem());
when(mockNewCartAdminService.removeRefundableDepositAndShippingCost(getNewCartDTOWithItem()))
.thenReturn(getNewCartDTOWithItem());
when(mockNewCartAdminService.removeRefundableDepositAndShippingCost(any(CartDTO.class))).thenReturn(mockCartDTO);
when(mockPayAsYouGoService.removeNonApplicableAutoTopUpCartItem(any(CartDTO.class))).thenReturn(mockCartDTO);
when(mockCartDTO.getShippingMethodItem()).thenReturn(shippingItemDTO);
ModelAndView result = controller.deleteShoppingItem(mockSession, mockCmd, 1, mockModel);
verify(mockCartService, atLeastOnce()).deleteItem((CartDTO) any(), anyLong());
verify(mockNewCartAdminService, atLeastOnce()).removeRefundableDepositAndShippingCost((CartDTO) any());
verify(mockCartService, atLeastOnce()).findById(anyLong());
verify(mockCmd, atLeastOnce()).setShippingType(anyString());
assertEquals(PageView.CART, result.getViewName());
assertNotNull(result.getModel());
}
}
| [
"balamurugan678@yahoo.co.in"
] | balamurugan678@yahoo.co.in |
2b5dc2ec5292e2fd4d6c126071ddf7e684c9ce28 | 4bd07abc4403260e8e8c47236520e936d7ca1e9b | /app/src/main/java/mahiti/org/oelp/xmpp/stanzas/streammgmt/RequestPacket.java | bddf1a2ef6bc840d01ae707453904a2ee40391db | [] | no_license | kranthi0987/OELP_APP | 50329a36d0acbf88a7d76a3dcd934ea9991f3ef1 | cee659f4213f76dcfda75bc74aea46455c1a3766 | refs/heads/master1 | 2020-08-27T02:28:46.490633 | 2019-10-23T14:51:23 | 2019-10-23T14:51:23 | 217,215,942 | 0 | 0 | null | 2019-10-24T05:14:05 | 2019-10-24T05:09:07 | Java | UTF-8 | Java | false | false | 291 | java | package mahiti.org.oelp.xmpp.stanzas.streammgmt;
import mahiti.org.oelp.xmpp.stanzas.AbstractStanza;
public class RequestPacket extends AbstractStanza {
public RequestPacket(int smVersion) {
super("r");
this.setAttribute("xmlns", "urn:xmpp:sm:" + smVersion);
}
}
| [
"kranthi.kumar@mahiti.org"
] | kranthi.kumar@mahiti.org |
0eaa5d7814fb9983190b7fdb86b9b9d8ec10eec3 | 541735596191734ecbbdb80e81c91480c1c95b31 | /Kami5-1.7-SRC-main/org/yaml/snakeyaml/events/DocumentEndEvent.java | 0d54077e8c209d0f1935124dcf4e218fd6dfde89 | [] | no_license | yunusborazan/Kami5-1.7 | 2cdd4f5c2331444f4079dd65614c304695df11be | 60e220d027c5a8298762bb1a9a270984a796a5d9 | refs/heads/main | 2023-08-27T11:40:18.228427 | 2021-11-02T16:57:35 | 2021-11-02T16:57:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 562 | java | /*
* Decompiled with CFR 0.151.
*/
package org.yaml.snakeyaml.events;
import org.yaml.snakeyaml.error.Mark;
import org.yaml.snakeyaml.events.Event;
public final class DocumentEndEvent
extends Event {
private final boolean explicit;
public DocumentEndEvent(Mark startMark, Mark endMark, boolean explicit) {
super(startMark, endMark);
this.explicit = explicit;
}
public boolean getExplicit() {
return this.explicit;
}
@Override
public Event.ID getEventId() {
return Event.ID.DocumentEnd;
}
}
| [
"92902311+JustARandomAccount420@users.noreply.github.com"
] | 92902311+JustARandomAccount420@users.noreply.github.com |
57ee238ba62c47c173beea11c20b8392be65b619 | 9018ef82fb62b44b542e04084542ce26c95d4382 | /src/examples/jpf2017/bankaccount/withdraw/BankAccount_12c.java | 3f135229d4521fbf94eb0621eddf19d2f40aa9e4 | [
"Apache-2.0"
] | permissive | hub-se/jpf-shadow | 3c4f6a559c3bb7f400f79e5f5c4b83c22b8f69cd | 1042c18e14be64b0f89991edc1d71cb4638ef0e5 | refs/heads/master | 2021-06-17T22:37:37.795524 | 2019-09-11T08:08:03 | 2019-09-11T08:08:03 | 103,697,964 | 8 | 2 | MIT | 2018-06-25T13:02:16 | 2017-09-15T20:22:05 | Java | UTF-8 | Java | false | false | 947 | java | package jpf2017.bankaccount.withdraw;
public class BankAccount_12c {
public int change(int oldVal, int newVal) {
return oldVal;
}
public float change(float oldVal, float newVal) {
return oldVal;
}
public double change(double oldVal, double newVal) {
return oldVal;
}
public boolean change(boolean oldVal, boolean newVal) {
return oldVal;
}
public long change(long oldVal, long newVal) {
return oldVal;
}
public boolean execute(boolean executionMode) {
return executionMode;
};
private int balance;
public BankAccount_12c(int amount) {
super();
balance = amount;
}
public void withdraw(int amount, int numberOfWithdrawals) {
if (amount > balance) {
return;
}
if (numberOfWithdrawals >= 5) {
assert (false);
return;
}
balance = change((balance - amount), balance);
}
public static void main(String[] args) {
BankAccount_12c b = new BankAccount_12c(0);
b.withdraw(-1, 1);
}
}
| [
"nolleryc@gmail.com"
] | nolleryc@gmail.com |
2cf860270d4adf50e4af01a09f99b8a336b43922 | 0918bcd6728767cf0a8870e15c995ec4269bdb76 | /microservicecloud-provider-dept-8001/src/main/java/com/yufeng/springcloud/service/impl/DeptServiceImpl.java | 57557faeaf0fe5eaeb921e8d0e51349974b22c3e | [] | no_license | feng218/springcloud | 5b70cc1d34505695fe2a2185166c4c8ef87b2980 | 2bbcd268613a40cc8a96ee8f72d824e08235a7c9 | refs/heads/master | 2022-07-10T06:30:31.154124 | 2019-09-09T15:51:40 | 2019-09-09T15:51:40 | 180,178,943 | 0 | 0 | null | 2022-06-21T01:02:57 | 2019-04-08T15:29:19 | Java | UTF-8 | Java | false | false | 638 | java | package com.yufeng.springcloud.service.impl;
import java.util.List;
import com.yufeng.springcloud.dao.DeptDao;
import com.yufeng.springcloud.entities.Dept;
import com.yufeng.springcloud.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class DeptServiceImpl implements DeptService
{
@Autowired
private DeptDao dao;
@Override
public boolean add(Dept dept)
{
return dao.addDept(dept);
}
@Override
public Dept get(Long id)
{
return dao.findById(id);
}
@Override
public List<Dept> list()
{
return dao.findAll();
}
}
| [
"1158690013@qq.com"
] | 1158690013@qq.com |
edea517f8cd7ec319c298f1baa3cfdeee3b987e2 | 7e4ef8c20f94e0e14d40ad44ca6e5e49bcd5c5ef | /List.java | 7acf18d6c08868dd01d71f7491983a728c21c7a6 | [] | no_license | yjfanling/aha | 22b533e0c706b6e0afe904392276d54343933012 | c834ba075cb783f94f5ce32512832657be860cb3 | refs/heads/master | 2020-04-17T22:24:16.028466 | 2019-01-30T16:44:51 | 2019-01-30T16:44:51 | 166,993,303 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 135 | java | package aha;
public class List {
int val;
List next=null;
public List(){
val=0;
}
public List(int val){
this.val=val;
}
}
| [
"33656378+yjfanling@users.noreply.github.com"
] | 33656378+yjfanling@users.noreply.github.com |
cc95f86de327f1630e942105b1fc137d55bf64f0 | 6c62dadbf1cc1e85695729d24535d5426bba7f6f | /android/playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Margin_Div_Margin.java | e1f2dea0ee20e906906c007a750635539e295b1d | [
"Apache-2.0",
"MIT",
"CC-BY-3.0"
] | permissive | pp1232/weex | b2f872748c34593231d83bb865fa330ea722cd2d | 9c1e77a82b87448d438b6fa39f05964257e7c084 | refs/heads/dev | 2021-01-20T23:44:49.141230 | 2018-04-24T01:01:05 | 2018-04-24T01:01:05 | 67,906,323 | 0 | 0 | Apache-2.0 | 2018-04-24T01:01:06 | 2016-09-11T02:49:36 | Java | UTF-8 | Java | false | false | 901 | java | package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.TreeMap;
import org.junit.Before;
import org.junit.Test;
public class AG_Margin_Div_Margin extends TestFlow {
public AG_Margin_Div_Margin() {
super(WXPageActivity.class);
}
@Before
public void setUp() throws InterruptedException {
super.setUp();
TreeMap testMap = new <String, Object> TreeMap();
testMap.put("testComponet", "AG_Margin");
testMap.put("testChildCaseInit", "AG_Margin_Div_Margin");
testMap.put("step1",new TreeMap(){
{
put("click", "10");
put("screenshot", "AG_Margin_Div_Margin_01_10");
}
});
testMap.put("step2",new TreeMap(){
{
put("click", "20");
put("screenshot", "AG_Margin_Div_Margin_02_20");
}
});
super.setTestMap(testMap);
}
@Test
public void doTest(){
super.testByTestMap();
}
}
| [
"tong_huabing@qq.com"
] | tong_huabing@qq.com |
680d137aca09dbdb2cc43ca8e5c8abf1ebff90e2 | b3be79a5cd43813f8f7bbb8acbe1ae696c6757b1 | /pojobuilder-maven-plugin/src/main/java/com/flextrade/builder/builder/WithMethodCreator.java | 05c269b6776231afd32232f1050f1a4fa5a65ab6 | [
"MIT"
] | permissive | FlexTradeUKLtd/pojobuilder-mvn | 3393b798645ef06d7849142ff289a4cfebc14e97 | 6de28bf90991179694e33cd00a2e6635df96da7a | refs/heads/master | 2023-03-16T14:30:38.540884 | 2015-05-05T16:12:19 | 2015-05-05T16:12:19 | 29,013,821 | 0 | 1 | MIT | 2020-10-15T11:28:49 | 2015-01-09T11:30:15 | Java | UTF-8 | Java | false | false | 2,933 | java | package com.flextrade.builder.builder;
import static com.sun.codemodel.JExpr.ref;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import com.flextrade.builder.model.ClassModel;
import com.flextrade.builder.model.CodeModelProperty;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JExpr;
import com.sun.codemodel.JExpression;
import com.sun.codemodel.JFieldVar;
import com.sun.codemodel.JInvocation;
import com.sun.codemodel.JMethod;
import com.sun.codemodel.JMod;
import com.sun.codemodel.JType;
class WithMethodCreator {
private final ClassModel classModel;
private final JFieldVar matcherField;
public WithMethodCreator(ClassModel classModel, JFieldVar matcherField) {
this.classModel = classModel;
this.matcherField = matcherField;
}
void createWithMethods(CodeModelProperty property) {
createWithValueMethod(property);
createWithMatcherMethod(property);
}
private void createWithMatcherMethod(CodeModelProperty property) {
createWithMethod(property,
classModel.getCodeModel().ref(Matcher.class).narrow(property.getJType()),
ref(property.getFieldNameCamelCase())
);
}
private void createWithValueMethod(CodeModelProperty property) {
createWithMethod(property,
property.getJType(),
matchers_is(property.getFieldNameCamelCase(), classModel));
}
private void createWithMethod(CodeModelProperty property, JType paramType, JExpression expression) {
JMethod withMethod = definedClass().method(JMod.PUBLIC, definedClass(), "with" + property.getFieldName());
withMethod.param(paramType, property.getFieldNameCamelCase());
withMethod.body().assign(matcherField,
matchers_allOf(
matcherField,
matchers_hasProperty(
property.getFieldNameCamelCase(),
expression,
classModel),
classModel
)
);
withMethod.body()._return(JExpr._this());
}
private JDefinedClass definedClass() {
return classModel.getDefinedClass();
}
private JInvocation matchers_is(String expected, ClassModel classModel) {
return classModel.getCodeModel().ref(Matchers.class).staticInvoke("is").arg(ref(expected));
}
private JInvocation matchers_allOf(JExpression matcher1, JExpression matcher2, ClassModel classModel) {
return classModel.getCodeModel().ref(Matchers.class).staticInvoke("allOf").arg(matcher1).arg(matcher2);
}
private JInvocation matchers_hasProperty(String propertyName, JExpression matcher, ClassModel classModel) {
return classModel.getCodeModel().ref(Matchers.class).staticInvoke("hasProperty").arg(JExpr.lit(propertyName)).arg(matcher);
}
}
| [
"Paul.Hutchin@flextrade.com"
] | Paul.Hutchin@flextrade.com |
d47b438223acf44ea772abf95cafa477a2131da2 | 26a5ba184c2db27bb3d82324d493e8ab6a842093 | /HQL_Select_Single_Aggraget/src/main/java/com/rk/test/HQL_SelectTest.java | c3653e55e35dad0bc1f4e74f36368e837234d27c | [] | no_license | Rakesh-Subudhi-GitHub/Hibernate | d4ca00dcccb293258cf54b02b8228ec0fd471b85 | fc065aaaa702f168f45f855ecbd58d4f4807b56f | refs/heads/master | 2022-12-28T06:22:23.110211 | 2020-10-08T07:16:03 | 2020-10-08T07:16:03 | 293,690,089 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,120 | java | package com.rk.test;
import java.util.List;
import java.util.Iterator;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.query.Query;
import com.rk.entity.InsurancePolicy;
import com.rk.utility.HibernateUtil;
public class HQL_SelectTest {
public static void main(String[] args) {
Session ses=null;
Transaction tx=null;
//Query<InsurancePolicy> query=null;
//List<InsurancePolicy> list=null;
//get Session obj
ses=HibernateUtil.getSession();
try {
tx=ses.beginTransaction(); //dummy
//prepare Query
Query query=ses.createQuery("SELECT COUNT(*) FROM com.rk.entity.InsurancePolicy");
//execute HQL query
List<?> list=query.getResultList();
//process result
if(!list.isEmpty())
{
Long count=(Long)list.get(0);
System.out.println("record count is :: "+count);
}//if
} //try
catch(HibernateException he) {
he.printStackTrace();
}
finally {
HibernateUtil.closeSessionFacory();
}
}//main
}//class | [
"rakesh.subudhi50@gmail.com"
] | rakesh.subudhi50@gmail.com |
24dbbc3e75fb16a5506b3642e35e416c4770df99 | 9d7f8af6c3334d467511dcf545f93ffbd6c0c0dd | /Proyecto 3/test/src/InterpreteTest.java | 27c7628a9b0db42d50c3ab53b31bc005bf0087fe | [] | no_license | guadabsb15/proyecto-3-cc2003 | 606c6d71ee3be084a9f8524962864f5c8ec4c024 | 904c6879710396210e1f3a240007e637d83ba786 | refs/heads/master | 2021-01-10T11:03:24.116283 | 2012-11-23T16:29:28 | 2012-11-23T16:29:28 | 51,647,445 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,690 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package src;
import lang.Operador;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author asus
*/
public class InterpreteTest {
public InterpreteTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of eval method, of class Interprete.
*/
@Test
public void testEval() throws Exception {
System.out.println("eval");
String exp = "8";
Ambiente amb = null;
Interprete instance = new Interprete();
Object expResult = "8";
Object result = instance.eval(exp, amb);
assertEquals(expResult, result);
exp = "(+ (+ 3 2) 2)";
result = instance.eval(exp, amb);
assertEquals(result, "7.0");
exp = "(+ (- (+ 3 2) (* 2 4)) 3)";
result = instance.eval(exp, amb);
assertEquals(result, "0.0");
}
/**
* Test de esDefinicion
*/
@Test
public void testEsDefinicion() throws Exception {
Interprete instance = new Interprete();
String exp = "(define x 3)";
assertEquals(true, instance.esDefinicion(exp));
exp = "define x 3";
assertEquals(true, instance.esDefinicion(exp));
assertEquals(true, instance.esAsignacion(exp));
}
@Test
public void definirTest() throws Exception {
Interprete instance = new Interprete();
Ambiente amb = new Ambiente();
instance.definir("(define x 3)", amb);
String valor = amb.obtenerValorVariable("x");
assertEquals(valor, "3");
instance.definir("define y 45", amb);
valor = amb.obtenerValorVariable("y");
assertEquals(valor, "45");
}
/**
* Test of aplicar method, of class Interprete
*/
/*
@Test
public void testAplicar() throws Exception {
System.out.println("aplicar");
Operador op = null;
String args = "";
Interprete instance = new Interprete();
String expResult = "";
String result = instance.aplicar(op, args);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}*/
}
| [
"templar996@gmail.com"
] | templar996@gmail.com |
bcc79c1f166e1751b73656bbcd21eff533a6ca05 | 33c768f41774a74b261383460e6f833cdae34658 | /m3-sql/m3-sql-examples/src/main/java/io/m3/sql/apt/ex001/Ex001GlobalConfiguration.java | 7d3a5c997088d3c02a29b9801b1eaff36cde72cc | [] | no_license | jacquesmilitello/m3 | d75a4f789db106190d7bfb5a7fff0b8d51a37db9 | 263fd4a3865d1644e21b372cb84e477deacb2a0c | refs/heads/master | 2022-03-07T14:27:47.534065 | 2019-09-11T20:05:28 | 2019-09-11T20:05:28 | 85,995,038 | 2 | 2 | null | 2022-02-10T03:12:28 | 2017-03-23T20:35:50 | Java | UTF-8 | Java | false | false | 348 | java | package io.m3.sql.apt.ex001;
import io.m3.sql.annotation.Database;
import io.m3.sql.annotation.FlywayConfiguration;
import io.m3.sql.annotation.GlobalConfiguration;
@GlobalConfiguration(flywayConfiguration = @FlywayConfiguration(database = {Database.H2 }, packages = "io.m3.sql.apt.ex001"))
public interface Ex001GlobalConfiguration {
} | [
"Jacques Militello@DESKTOP-VIBH6GO"
] | Jacques Militello@DESKTOP-VIBH6GO |
d8ac02b9c887938f8d1ef58ea9f40353f8d861e8 | 579ddf244694996819f26cb0745ecf360ad077ed | /src/com/leo/algorithm/AppAcc.java | 9254c9aef96da242207bd4269aa584074cfde2d9 | [] | no_license | Liuguanli/Community_Search | 6cb5c655d3f2ba73a664e20bf103b66595a9a946 | fedbbc5cd03b969f677470b8c3bcab45f63934fb | refs/heads/master | 2021-08-31T17:01:47.992887 | 2017-12-22T05:07:41 | 2017-12-22T05:07:41 | 114,957,793 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,259 | java | package com.leo.algorithm;
import com.leo.bean.AppFastResult;
import com.leo.bean.Graph;
import com.leo.utils.KCore;
import com.leo.bean.Point;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* Created by apple on 2017/12/21.
*/
public class AppAcc extends AppAbstract {
public List<Point> calc(Point query, Graph graph, int k, AppFastResult appFastResult, double epsilon) {
double delta = appFastResult.delta;
double gamma = appFastResult.gamma;
// S ← vertices of the k-c ore, containing q, in O(q, 2γ);
List<Point> points = findRangePoints(query, graph.points, 2 * gamma);
Graph subGraph = graph.induceSubGraph(points);
KCore kcore = new KCore(subGraph, k, query);
List<Point> tempResult = kcore.findKCore();
List<Point> Γ = appFastResult.reuslt;
double beta = gamma;
double rCur = gamma;
List<Point> achList = new LinkedList() {{
add(query);
}};
while (beta > delta * epsilon / (Math.sqrt(2) * (2 + epsilon))) {
Map<Point, Double> map = new HashMap<>();
for (Point point : achList) {
}
}
return null;
}
}
| [
"liuguanli1205@qq.com"
] | liuguanli1205@qq.com |
1df73102080a84d4134f683759babf2f7ba9510a | ee96ae685e371696c0effba8499f3ea4cafcbc61 | /src/com/wxf/data/test/Node.java | 693485a60212b5be9890873aa487dc86132b87ec | [] | no_license | jaydenwen123/Algorithms-java | 24b7478c3b5f599201b2e7c9dcf591334dffa898 | f04ef1d4ae9da15c8cafd63ebe472c5e91479c4e | refs/heads/master | 2021-03-03T08:42:45.035079 | 2020-03-09T05:53:22 | 2020-03-09T05:53:22 | 245,947,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | package com.wxf.data.test;
import java.util.ArrayList;
/* 表示一个节点以及和这个节点相连的所有节点 */
public class Node {
public String name = null;
public ArrayList<Node> relationNodes = new ArrayList<Node>();
public int weight;
public int cost;
public Node() {
// TODO Auto-generated constructor stub
}
public Node(String name, int weight, int cost) {
super();
this.name = name;
this.weight = weight;
this.cost = cost;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ArrayList<Node> getRelationNodes() {
return relationNodes;
}
public void setRelationNodes(ArrayList<Node> relationNodes) {
this.relationNodes = relationNodes;
}
class Edge {
public String start;
public String end;
public int weight;
public int cost;
public Edge() {
// TODO Auto-generated constructor stub
}
public Edge(String start, String end, int weight, int cost) {
super();
this.start = start;
this.end = end;
this.weight = weight;
this.cost = cost;
}
}
} | [
"228186474@qq.com"
] | 228186474@qq.com |
f2d41a7d19160067b2c8f742f0906d0d136f18e0 | 7ed175f79860bdf602cfd096cfb40456b692b5b3 | /HashMap/src/hashmap/HashMap1.java | e3378b4545a437389431f3e317e38f61266f6169 | [] | no_license | r4deadv/vezbanje-java | a3dd8067a3bc33a94812cb13bba5982c663e073f | 7d3423359ed189522a5335edec63644275b0a6f7 | refs/heads/master | 2022-11-29T23:45:52.675376 | 2020-07-29T16:59:00 | 2020-07-29T16:59:00 | 215,519,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,534 | java | package hashmap;
import java.util.HashMap;
import java.util.Scanner;
public class HashMap1 {
public static void main(String[] args) {
HashMap sr = new HashMap();
sr.put("hello", "Pozdrav i dobro dosli");
sr.put("first", "Unesite prvi sabirak: ");
sr.put("second", "Unesite drugi sabirak: ");
sr.put("result", "Rezultat je");
HashMap en = new HashMap();
en.put("hello", "Hello and welcome");
en.put("first", "Enter first operand: ");
en.put("second", "Enter second operand: ");
en.put("result", "The result is: ");
HashMap zemunski = new HashMap();
zemunski.put("hello", "De si tebra");
zemunski.put("first", "Prvi??!!");
zemunski.put("second", "Drugi??!!");
zemunski.put("result", "Rezultat");
HashMap jezici = new HashMap();
jezici.put("srpski", sr);
jezici.put("engleski", en);
jezici.put("zemunski", zemunski);
Scanner scanner = new Scanner(System.in);
System.out.println("Enter language (srpski, engleski, zemunski): ");
String lang = scanner.nextLine();
HashMap jezik = (HashMap)jezici.get(lang);
System.out.println(jezik.get("hello"));
System.out.println(jezik.get("first"));
int a = scanner.nextInt();
System.out.println(jezik.get("second"));
int b = scanner.nextInt();
System.out.println(jezik.get("result") + ": " + (a+b));
}
}
| [
"mihovilovic.rade@gmail.com"
] | mihovilovic.rade@gmail.com |
0b14e9e55dc8dd52a0365b76fc30fc18df3c90f9 | 63e53596cbda1d57d5fe0197b6f866d9c31f6571 | /tomcat-work/src/org/apache/catalina/SessionEvent.java | 59366566dd4371f3d1782bd61e7eae3a0ff81352 | [] | no_license | wjl327/SomeJava | 0e20acf194df086123e3eb8322f76ea82674e297 | 2324e935a6a1e0723749d8134b11bd68fbf72b3a | refs/heads/master | 2021-01-19T09:31:07.749424 | 2015-03-25T12:42:43 | 2015-03-25T12:42:43 | 23,346,097 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,529 | java | /*
* $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/SessionEvent.java,v 1.1 2001/07/29 03:43:54 craigmcc Exp $
* $Revision: 1.1 $
* $Date: 2001/07/29 03:43:54 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.catalina;
import java.util.EventObject;
/**
* General event for notifying listeners of significant changes on a Session.
*
* @author Craig R. McClanahan
* @version $Revision: 1.1 $ $Date: 2001/07/29 03:43:54 $
*/
public final class SessionEvent
extends EventObject {
/**
* The event data associated with this event.
*/
private Object data = null;
/**
* The Session on which this event occurred.
*/
private Session session = null;
/**
* The event type this instance represents.
*/
private String type = null;
/**
* Construct a new SessionEvent with the specified parameters.
*
* @param session Session on which this event occurred
* @param type Event type
* @param data Event data
*/
public SessionEvent(Session session, String type, Object data) {
super(session);
this.session = session;
this.type = type;
this.data = data;
}
/**
* Return the event data of this event.
*/
public Object getData() {
return (this.data);
}
/**
* Return the Session on which this event occurred.
*/
public Session getSession() {
return (this.session);
}
/**
* Return the event type of this event.
*/
public String getType() {
return (this.type);
}
/**
* Return a string representation of this event.
*/
public String toString() {
return ("SessionEvent['" + getSession() + "','" +
getType() + "']");
}
}
| [
"shmily320700@gmail.com"
] | shmily320700@gmail.com |
354b4841d1c80ede589e04acaf5ab7caf4ab699b | 53acc4caa7a5d454a09b6add932fd0b66a0d1b40 | /FIXTURE/src/main/java/com/fixture/job/FlushJob.java | 7fb1af1259502b0bc232c501bf5f88820357c8b7 | [] | no_license | wenyahui/bywork | 754704f7eaa209353580b8c1c044c0d307e4ac29 | c5f7c3c2f99f7496e9e7fb04f7e926381c97b69f | refs/heads/master | 2021-01-25T13:06:57.451265 | 2018-03-02T09:11:00 | 2018-03-02T09:11:00 | 123,531,155 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | /*
* 文件名:FlushJob.java
* 版权:Copyright by www.taohuakeji.com
* 描述:
* 修改人:ying
* 修改时间:2017-4-10
*/
package com.fixture.job;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/**
* 〈一句话功能简述〉
* 〈功能详细描述〉
* @author ying
* @version 2017-4-10
* @see FlushJob
* @since
*/
@Component
public class FlushJob
{
private Logger loger = LoggerFactory.getLogger(this.getClass());
public void flushActivity()
{
loger.info("------执行任务1----------");
}
}
| [
"317520943@qq.com"
] | 317520943@qq.com |
87344a4ef00df0214d45ee39e53776152f38c639 | 7da70868fbf59c6ae5312345d1d2c62aa5f0c010 | /src/main/java/io/github/UdayHE/reactive/ReactiveProgrammingApplication.java | 11a6f35aacd89badf95175c3872e6b7046ee31a0 | [] | no_license | UdayHE/reactive-programming | b97b4ce40ecde1651b86a8c6670e253f5b1f0ab1 | 6a999cd35c92a55c57479810cd7647c9e0764154 | refs/heads/master | 2023-07-16T17:56:52.015828 | 2021-08-31T05:35:45 | 2021-08-31T05:35:45 | 401,582,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package io.github.UdayHE.reactive;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ReactiveProgrammingApplication {
public static void main(String[] args) {
SpringApplication.run(ReactiveProgrammingApplication.class, args);
}
}
| [
"uhegde@tekion.com"
] | uhegde@tekion.com |
f39254725951e859bba56003c863d23e5346bc27 | eed9ed8290d2fe55362bb7a6be48d6774c9138db | /src/main/java/eu/europa/ec/digit/contentmanagement/repo/business/security/EccmSecurityException.java | b3fc48c64e7efe2e3b0624f7bee1001609ef08bf | [] | no_license | bentzn/eccm_business_rules | 30ba6e7084d0004e3bbc781e5d2ebab090b9af40 | 38cf75870e8a8e8c42aa030a9d04b26cd74ea9bc | refs/heads/main | 2023-02-26T12:14:37.599065 | 2021-02-08T14:16:56 | 2021-02-08T14:16:56 | 337,099,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 248 | java | package eu.europa.ec.digit.contentmanagement.repo.business.security;
import eu.europa.ec.digit.contentmanagement.repo.business.EccmException;
/**
*
* @author bentsth
*/
public class EccmSecurityException extends EccmException {
}
| [
"bentzn@something.bentzn.com"
] | bentzn@something.bentzn.com |
da6baa6d70525dd8268da739c9835b6a3b1f6242 | dea106e962222cb871ed749681c64730f6af18c9 | /project/src/main/java/com/christianmendez/project/entity/User.java | 2f211716630d2e0768e2e9b8ac8ea7a9b9a13936 | [] | no_license | DevChristian/SpringBoot_JWT_H2 | 7c908a43c17a6ab7e7a18e0a65c47be6875fc9bc | da594a4b7bfd3bbd50fd0daa2579e1bd01dd9e73 | refs/heads/master | 2021-01-01T03:14:08.926624 | 2020-02-08T16:11:32 | 2020-02-08T16:11:32 | 239,157,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,634 | java | package com.christianmendez.project.entity;
import java.util.Date;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import com.fasterxml.jackson.annotation.JsonFormat;
@Entity
@Table(name = "USER")
public class User {
@Id
@GeneratedValue( strategy = GenerationType.IDENTITY,generator = "uuid" )
@GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
@Column(name = "ID_USER")
private String id;
@Column(name = "NAME")
private String name;
@Column(name = "EMAIL")
private String email;
@Column(name = "PASSWORD")
private String password;
@Column(name = "CREATED")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date created;
@Column(name = "MODIFIED")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date modified;
@Column(name = "LAST_LOGIN")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date last_login;
@Column(name = "TOKEN")
private String token;
@Column(name = "ISACTIVE")
private Boolean isactive;
@OneToMany( cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Phones> phones;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public Date getLast_login() {
return last_login;
}
public void setLast_login(Date last_login) {
this.last_login = last_login;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Boolean getIsactive() {
return isactive;
}
public void setIsactive(Boolean isactive) {
this.isactive = isactive;
}
public Set<Phones> getPhones() {
return phones;
}
public void setPhones(Set<Phones> phones) {
this.phones = phones;
}
} | [
"christianmendezav@gmail.com"
] | christianmendezav@gmail.com |
0af02c5c03ff68e88f94f4a2f9879f5fd6429533 | 0697a98c2b4413db2f91a6697a401a29f960ac58 | /process-manager/process-spring-boot/src/main/java/in/stackroute/planage/process/repository/BoardRepository.java | ff004abe341f7e445161e05de9dfcd995a072dbe | [] | no_license | srjk/planage | d4102c5294c80be84b6b7980a94fea4a42f93c87 | 6b45765a2b2094798cc36342a07fee3e718ce210 | refs/heads/master | 2022-10-21T04:18:18.204612 | 2019-11-05T04:44:08 | 2019-11-05T04:44:08 | 219,647,357 | 0 | 0 | null | 2022-10-19T01:30:12 | 2019-11-05T03:12:45 | JavaScript | UTF-8 | Java | false | false | 545 | java | package in.stackroute.planage.process.repository;
import in.stackroute.planage.process.model.boardModel.Board;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
/*
* Persistence layer which will use mongoDB database for CRUD operations.
* MongoRepository interface will take two argument : first one will be the collection class name and second one will be
* the type of unique id.
*/
@Repository
public interface BoardRepository extends MongoRepository<Board, String> {
}
| [
"shubham1997.kabra@gmail.com"
] | shubham1997.kabra@gmail.com |
e922646830bd301269d457764efb74e299f151f4 | da8b475dffdc21db067242bac394ceb72003ee1c | /src/cn/fh/datastructure/LinkedQueue.java | 74d7f6fe592b895f1411bb77c1ab4065d21baca5 | [] | no_license | wanghongfei/algorithm-java | ba79709e3d3f7229cf36faf035b7d4bf6260808e | 5ce26b44e3cbacbc0799a720aa2a29c7ab3623f5 | refs/heads/master | 2021-01-22T06:49:24.266636 | 2015-07-14T04:47:37 | 2015-07-14T04:47:37 | 21,011,344 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 656 | java | package cn.fh.datastructure;
public class LinkedQueue<T> {
private Node first;
private Node last;
private int size;
private class Node {
T data;
Node next;
}
/**
* 在队尾插入元素
* @param elem
*/
public void enqueue(T elem) {
Node oldLast = last;
last = new Node();
last.data = elem;
last.next = null;
if (true == isEmpty()) {
first = last;
} else {
oldLast.next = last;
}
++size;
}
public T dequeue() {
Node oldFirst = first;
first = first.next;
--size;
if (true == isEmpty()) {
last = null;
}
return oldFirst.data;
}
public boolean isEmpty() {
return size == 0;
}
}
| [
"brucew@vip.qq.com"
] | brucew@vip.qq.com |
b84f086113a410845c7931a22ef93341798da2f8 | 40c7614a530b4b81ef1c948c521f831e9b267128 | /src/test/java/com/jielong/core/service/QRcodeServiceTest.java | 753ba2e9f8b156f4cd64a61d2234c739b96a7613 | [] | no_license | yuditxj/Jielong-Server | e8eb1a57e3aae421a008448a38413b91c89d252d | b206da5875903462b05dd823905ae3c5e32cf9e4 | refs/heads/master | 2020-05-26T07:08:22.773442 | 2018-11-09T08:06:29 | 2018-11-09T08:06:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | package com.jielong.core.service;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.File;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class QRcodeServiceTest {
@Autowired
QRcodeService qRcodeService;
@Test
public void testImage(){
String path="pages/index/index?parentUserId=42";
File imageFile=qRcodeService.getQRcodeImage(path);
Assert.assertNotNull(imageFile);
}
}
| [
"caoxingyu2016@qq.com"
] | caoxingyu2016@qq.com |
2c3939f14e91e4e44969f8cd5dd2c60093f8f869 | 7eb298225e9b8d272b71c00327b4c47932fa39a7 | /rxo-platform/src/main/java/com/refactoring/rxo/mybatis/BaseEntity.java | dd71a39f4f0f0c82763eaac4b5daeadb24140b62 | [] | no_license | yaofei123/rxo | 82689a3568f1ddbfe128f3df81aad4f28a1ddb67 | 163dd84dea445eb2b910c8fed4df9c49f4c47421 | refs/heads/master | 2020-03-19T06:03:12.566410 | 2018-06-04T09:33:27 | 2018-06-04T09:33:27 | 135,986,612 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package com.refactoring.rxo.mybatis;
import com.baomidou.mybatisplus.activerecord.Model;
import java.io.Serializable;
/**
* @author: fei.yao
* @date: 2018/5/28
* @modified by:
*/
public class BaseEntity<T extends Model> extends Model<T> {
/**
* 主键ID
*/
private String id;
// private String tenantId;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
// public String getTenantId() {
// return tenantId;
// }
// public void setTenantId(String tenantId) {
// this.tenantId = tenantId;
// }
@Override
protected Serializable pkVal() {
return this.id;
}
}
| [
"yaof@qumaiyao.com"
] | yaof@qumaiyao.com |
4c68957ba42b3194b2a29c808123fc4efc3b7fc9 | 0ff864977ed43f433709d26e0b3d8404034bae21 | /app/src/androidTest/java/android/com/GraphTask/ApplicationTest.java | 7c97b3f2701bf778d1f197bfa45c46c96cf41b59 | [] | no_license | AlexKorRnd/OperationsResearch | ec63982ab4e96d819453b54c4c34127b16ef838e | 1b9fbd3905d422ade5e7c613c8cfc03695dac359 | HEAD | 2019-01-21T18:30:34.130812 | 2015-07-02T20:42:38 | 2015-07-02T20:42:38 | 34,808,286 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package android.com.GraphTask;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"AlexKorRnd@yandex.ru"
] | AlexKorRnd@yandex.ru |
0d227360a9d6b01b594ed2bfad493b6ee7997151 | d552386d072e1b0eaad1c8392d7619a3e3ec0786 | /src/main/java/taf/extensions/webdriver/factory/DriverFactory.java | cad56364079a72b06ff3d475e36d650fa4a2869a | [] | no_license | cihansunar/taf | 2f3c9d3746b1034249f62bbdff2263153b5777a4 | 3ed31b4c15e0564859b215cfde1deb755b026805 | refs/heads/master | 2016-08-06T12:23:31.336953 | 2015-08-05T09:52:12 | 2015-08-05T09:52:12 | 40,237,664 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,195 | java | package taf.extensions.webdriver.factory;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import taf.core.exceptions.DriverNotFoundException;
public class DriverFactory
{
public WebDriver getDriver(String driverName) throws DriverNotFoundException
{
WebDriver driver;
if(driverName.equalsIgnoreCase("firefox")){
//create firefox instance
driver = new FirefoxDriver();
driver.manage().window().maximize();
}
//Check if parameter passed as 'chrome'
else if(driverName.equalsIgnoreCase("chrome")){
//set path to chromedriver.exe You may need to download it from http://code.google.com/p/selenium/wiki/ChromeDriver
System.setProperty("webdriver.chrome.driver","External\\Drivers\\chromedriver_win32\\chromedriver.exe");
//create chrome instance
driver = new ChromeDriver();
driver.manage().window().maximize();
}
else if(driverName.equalsIgnoreCase("ie32")){
System.setProperty("webdriver.ie.driver","External\\Drivers\\iedriver_win32\\IEDriverServer.exe");
//create chrome instance
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
driver = new InternetExplorerDriver(ieCapabilities);
}
else if(driverName.equalsIgnoreCase("ie64")){
System.setProperty("webdriver.ie.driver","External\\Drivers\\iedriver_win64\\IEDriverServer.exe");
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
//create chrome instance
driver = new InternetExplorerDriver(ieCapabilities);
}
else{
//If no browser passed throw exception
throw new DriverNotFoundException("Requested driver is not correct");
}
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
return driver;
}
}
| [
"cihansun@gmail.com"
] | cihansun@gmail.com |
44a2762eb1c75985b1f4635054a372b0f2bd6d8f | 3cd7261c3428b4c70cb25ad4a1bca8d49d873884 | /src/main/java/threadless/TaskExternal.java | ad695bde20e5b4eb417f381c77ab442a0c385fe8 | [] | no_license | undeconstructed/threadless-java | fb52bcf2624f53220fbb1e6a67789a928571cabe | 074c5841767bee7ee999dac5f29652dfc455a58c | refs/heads/master | 2021-01-23T01:12:31.611544 | 2017-10-03T09:47:07 | 2017-10-03T09:48:30 | 85,887,501 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | package threadless;
/**
* Used for setting up external work that needs to notify the lox about when it is done.
*
* @author phil
*/
public interface TaskExternal<T> {
public void notify(ValueOrError<T> voe);
public F<T> future();
}
| [
"philip_housley@scee.net"
] | philip_housley@scee.net |
021088db78669425d339e1efab76b61a1588ba06 | 7d379d604d107a6eec5003011aadccdba2296fd4 | /utils/src/main/java/com/bigoat/utils/ActivityUtils.java | be63e4b9e2ab5026e5f5398d4a1ae44a25e8b1c3 | [] | no_license | yaolunwei/Busybox2 | 041a8f2aac0223df8e3a517881f9bcf3a929fa9a | be0aa6bd6f855a5888a3ee53a910007e179ac0d1 | refs/heads/master | 2020-05-25T15:58:32.287228 | 2019-05-23T10:01:46 | 2019-05-23T10:01:46 | 187,877,092 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 66,149 | java | package com.bigoat.utils;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.AnimRes;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.util.Pair;
import android.view.View;
import java.util.List;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2016/09/23
* desc : utils about activity
* </pre>
*/
public final class ActivityUtils {
private ActivityUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}
/**
* Return whether the activity exists.
*
* @param pkg The name of the package.
* @param cls The name of the class.
* @return {@code true}: yes<br>{@code false}: no
*/
public static boolean isActivityExists(@NonNull final String pkg,
@NonNull final String cls) {
Intent intent = new Intent();
intent.setClassName(pkg, cls);
return !(Utils.getApp().getPackageManager().resolveActivity(intent, 0) == null ||
intent.resolveActivity(Utils.getApp().getPackageManager()) == null ||
Utils.getApp().getPackageManager().queryIntentActivities(intent, 0).size() == 0);
}
/**
* Start the activity.
*
* @param clz The activity class.
*/
public static void startActivity(@NonNull final Class<? extends Activity> clz) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, null, context.getPackageName(), clz.getName(), null);
}
/**
* Start the activity.
*
* @param clz The activity class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Class<? extends Activity> clz,
final Bundle options) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, null, context.getPackageName(), clz.getName(), options);
}
/**
* Start the activity.
*
* @param clz The activity class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Class<? extends Activity> clz,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, null, context.getPackageName(), clz.getName(),
getOptionsBundle(context, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN && context instanceof Activity) {
((Activity) context).overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz) {
startActivity(activity, null, activity.getPackageName(), clz.getName(), null);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final Bundle options) {
startActivity(activity, null, activity.getPackageName(), clz.getName(), options);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final View... sharedElements) {
startActivity(activity, null, activity.getPackageName(), clz.getName(),
getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivity(activity, null, activity.getPackageName(), clz.getName(),
getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param clz The activity class.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Class<? extends Activity> clz) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, extras, context.getPackageName(), clz.getName(), null);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param clz The activity class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Class<? extends Activity> clz,
@NonNull final Bundle options) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, extras, context.getPackageName(), clz.getName(), options);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param clz The activity class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Class<? extends Activity> clz,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, extras, context.getPackageName(), clz.getName(),
getOptionsBundle(context, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN && context instanceof Activity) {
((Activity) context).overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz) {
startActivity(activity, extras, activity.getPackageName(), clz.getName(), null);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
@NonNull final Bundle options) {
startActivity(activity, extras, activity.getPackageName(), clz.getName(), options);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final View... sharedElements) {
startActivity(activity, extras, activity.getPackageName(), clz.getName(),
getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivity(activity, extras, activity.getPackageName(), clz.getName(),
getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param pkg The name of the package.
* @param cls The name of the class.
*/
public static void startActivity(@NonNull final String pkg,
@NonNull final String cls) {
startActivity(Utils.getTopActivityOrApp(), null, pkg, cls, null);
}
/**
* Start the activity.
*
* @param pkg The name of the package.
* @param cls The name of the class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final String pkg,
@NonNull final String cls,
final Bundle options) {
startActivity(Utils.getTopActivityOrApp(), null, pkg, cls, options);
}
/**
* Start the activity.
*
* @param pkg The name of the package.
* @param cls The name of the class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final String pkg,
@NonNull final String cls,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, null, pkg, cls, getOptionsBundle(context, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN && context instanceof Activity) {
((Activity) context).overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls) {
startActivity(activity, null, pkg, cls, null);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final Bundle options) {
startActivity(activity, null, pkg, cls, options);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final View... sharedElements) {
startActivity(activity, null, pkg, cls, getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity.
*
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivity(activity, null, pkg, cls, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param pkg The name of the package.
* @param cls The name of the class.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final String pkg,
@NonNull final String cls) {
startActivity(Utils.getTopActivityOrApp(), extras, pkg, cls, null);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final String pkg,
@NonNull final String cls,
final Bundle options) {
startActivity(Utils.getTopActivityOrApp(), extras, pkg, cls, options);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final String pkg,
@NonNull final String cls,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
Context context = Utils.getTopActivityOrApp();
startActivity(context, extras, pkg, cls, getOptionsBundle(context, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN && context instanceof Activity) {
((Activity) context).overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param activity The activity.
* @param extras The Bundle of extras to add to this intent.
* @param pkg The name of the package.
* @param cls The name of the class.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls) {
startActivity(activity, extras, pkg, cls, null);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final Bundle options) {
startActivity(activity, extras, pkg, cls, options);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final View... sharedElements) {
startActivity(activity, extras, pkg, cls, getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivity(activity, extras, pkg, cls, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param intent The description of the activity to start.
*/
public static void startActivity(@NonNull final Intent intent) {
startActivity(intent, Utils.getTopActivityOrApp(), null);
}
/**
* Start the activity.
*
* @param intent The description of the activity to start.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Intent intent,
@NonNull final Bundle options) {
startActivity(intent, Utils.getTopActivityOrApp(), options);
}
/**
* Start the activity.
*
* @param intent The description of the activity to start.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Intent intent,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
Context context = Utils.getTopActivityOrApp();
startActivity(intent, context, getOptionsBundle(context, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN && context instanceof Activity) {
((Activity) context).overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param activity The activity.
* @param intent The description of the activity to start.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Intent intent) {
startActivity(intent, activity, null);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param intent The description of the activity to start.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Intent intent,
final Bundle options) {
startActivity(intent, activity, options);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param intent The description of the activity to start.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Intent intent,
final View... sharedElements) {
startActivity(intent, activity, getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity.
*
* @param activity The activity.
* @param intent The description of the activity to start.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivity(@NonNull final Activity activity,
@NonNull final Intent intent,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivity(intent, activity, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode) {
startActivityForResult(activity, null, activity.getPackageName(), clz.getName(),
requestCode, null);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode,
final Bundle options) {
startActivityForResult(activity, null, activity.getPackageName(), clz.getName(),
requestCode, options);
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode,
final View... sharedElements) {
startActivityForResult(activity, null, activity.getPackageName(), clz.getName(),
requestCode, getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivityForResult(activity, null, activity.getPackageName(), clz.getName(),
requestCode, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode) {
startActivityForResult(activity, extras, activity.getPackageName(), clz.getName(),
requestCode, null);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode,
@NonNull final Bundle options) {
startActivityForResult(activity, extras, activity.getPackageName(), clz.getName(),
requestCode, options);
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode,
final View... sharedElements) {
startActivityForResult(activity, extras, activity.getPackageName(), clz.getName(),
requestCode, getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivityForResult(activity, extras, activity.getPackageName(), clz.getName(),
requestCode, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity for result.
*
* @param activity The activity.
* @param extras The Bundle of extras to add to this intent.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final int requestCode) {
startActivityForResult(activity, extras, pkg, cls, requestCode, null);
}
/**
* Start the activity for result.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final int requestCode,
final Bundle options) {
startActivityForResult(activity, extras, pkg, cls, requestCode, options);
}
/**
* Start the activity for result.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final int requestCode,
final View... sharedElements) {
startActivityForResult(activity, extras, pkg, cls,
requestCode, getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity for result.
*
* @param extras The Bundle of extras to add to this intent.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final int requestCode,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivityForResult(activity, extras, pkg, cls,
requestCode, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start the activity for result.
*
* @param activity The activity.
* @param intent The description of the activity to start.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Intent intent,
final int requestCode) {
startActivityForResult(intent, activity, requestCode, null);
}
/**
* Start the activity for result.
*
* @param activity The activity.
* @param intent The description of the activity to start.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Intent intent,
final int requestCode,
final Bundle options) {
startActivityForResult(intent, activity, requestCode, options);
}
/**
* Start the activity for result.
*
* @param activity The activity.
* @param intent The description of the activity to start.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param sharedElements The names of the shared elements to transfer to the called
* Activity and their associated Views.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Intent intent,
final int requestCode,
final View... sharedElements) {
startActivityForResult(intent, activity,
requestCode, getOptionsBundle(activity, sharedElements));
}
/**
* Start the activity for result.
*
* @param activity The activity.
* @param intent The description of the activity to start.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Intent intent,
final int requestCode,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivityForResult(intent, activity,
requestCode, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start activities.
*
* @param intents The descriptions of the activities to start.
*/
public static void startActivities(@NonNull final Intent[] intents) {
startActivities(intents, Utils.getTopActivityOrApp(), null);
}
/**
* Start activities.
*
* @param intents The descriptions of the activities to start.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivities(@NonNull final Intent[] intents,
final Bundle options) {
startActivities(intents, Utils.getTopActivityOrApp(), options);
}
/**
* Start activities.
*
* @param intents The descriptions of the activities to start.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivities(@NonNull final Intent[] intents,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
Context context = Utils.getTopActivityOrApp();
startActivities(intents, context, getOptionsBundle(context, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN && context instanceof Activity) {
((Activity) context).overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start activities.
*
* @param activity The activity.
* @param intents The descriptions of the activities to start.
*/
public static void startActivities(@NonNull final Activity activity,
@NonNull final Intent[] intents) {
startActivities(intents, activity, null);
}
/**
* Start activities.
*
* @param activity The activity.
* @param intents The descriptions of the activities to start.
* @param options Additional options for how the Activity should be started.
*/
public static void startActivities(@NonNull final Activity activity,
@NonNull final Intent[] intents,
final Bundle options) {
startActivities(intents, activity, options);
}
/**
* Start activities.
*
* @param activity The activity.
* @param intents The descriptions of the activities to start.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void startActivities(@NonNull final Activity activity,
@NonNull final Intent[] intents,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivities(intents, activity, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Start home activity.
*/
public static void startHomeActivity() {
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory(Intent.CATEGORY_HOME);
startActivity(homeIntent);
}
/**
* Return the list of activity.
*
* @return the list of activity
*/
public static List<Activity> getActivityList() {
return Utils.getActivityList();
}
/**
* Return the name of launcher activity.
*
* @return the name of launcher activity
*/
public static String getLauncherActivity() {
return getLauncherActivity(Utils.getApp().getPackageName());
}
/**
* Return the name of launcher activity.
*
* @param pkg The name of the package.
* @return the name of launcher activity
*/
public static String getLauncherActivity(@NonNull final String pkg) {
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PackageManager pm = Utils.getApp().getPackageManager();
List<ResolveInfo> info = pm.queryIntentActivities(intent, 0);
for (ResolveInfo aInfo : info) {
if (aInfo.activityInfo.packageName.equals(pkg)) {
return aInfo.activityInfo.name;
}
}
return "no " + pkg;
}
/**
* Return the top activity in activity's stack.
*
* @return the top activity in activity's stack
*/
public static Activity getTopActivity() {
return Utils.getActivityLifecycle().getTopActivity();
}
/**
* Return whether the activity exists in activity's stack.
*
* @param activity The activity.
* @return {@code true}: yes<br>{@code false}: no
*/
public static boolean isActivityExistsInStack(@NonNull final Activity activity) {
List<Activity> activities = Utils.getActivityList();
for (Activity aActivity : activities) {
if (aActivity.equals(activity)) {
return true;
}
}
return false;
}
/**
* Return whether the activity exists in activity's stack.
*
* @param clz The activity class.
* @return {@code true}: yes<br>{@code false}: no
*/
public static boolean isActivityExistsInStack(@NonNull final Class<? extends Activity> clz) {
List<Activity> activities = Utils.getActivityList();
for (Activity aActivity : activities) {
if (aActivity.getClass().equals(clz)) {
return true;
}
}
return false;
}
/**
* Finish the activity.
*
* @param activity The activity.
*/
public static void finishActivity(@NonNull final Activity activity) {
finishActivity(activity, false);
}
/**
* Finish the activity.
*
* @param activity The activity.
* @param isLoadAnim True to use animation for the outgoing activity, false otherwise.
*/
public static void finishActivity(@NonNull final Activity activity, final boolean isLoadAnim) {
activity.finish();
if (!isLoadAnim) {
activity.overridePendingTransition(0, 0);
}
}
/**
* Finish the activity.
*
* @param activity The activity.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void finishActivity(@NonNull final Activity activity,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
activity.finish();
activity.overridePendingTransition(enterAnim, exitAnim);
}
/**
* Finish the activity.
*
* @param clz The activity class.
*/
public static void finishActivity(@NonNull final Class<? extends Activity> clz) {
finishActivity(clz, false);
}
/**
* Finish the activity.
*
* @param clz The activity class.
* @param isLoadAnim True to use animation for the outgoing activity, false otherwise.
*/
public static void finishActivity(@NonNull final Class<? extends Activity> clz,
final boolean isLoadAnim) {
List<Activity> activities = Utils.getActivityList();
for (Activity activity : activities) {
if (activity.getClass().equals(clz)) {
activity.finish();
if (!isLoadAnim) {
activity.overridePendingTransition(0, 0);
}
}
}
}
/**
* Finish the activity.
*
* @param clz The activity class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void finishActivity(@NonNull final Class<? extends Activity> clz,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
List<Activity> activities = Utils.getActivityList();
for (Activity activity : activities) {
if (activity.getClass().equals(clz)) {
activity.finish();
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
}
/**
* Finish to the activity.
*
* @param activity The activity.
* @param isIncludeSelf True to include the activity, false otherwise.
*/
public static boolean finishToActivity(@NonNull final Activity activity,
final boolean isIncludeSelf) {
return finishToActivity(activity, isIncludeSelf, false);
}
/**
* Finish to the activity.
*
* @param activity The activity.
* @param isIncludeSelf True to include the activity, false otherwise.
* @param isLoadAnim True to use animation for the outgoing activity, false otherwise.
*/
public static boolean finishToActivity(@NonNull final Activity activity,
final boolean isIncludeSelf,
final boolean isLoadAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 1; i >= 0; --i) {
Activity aActivity = activities.get(i);
if (aActivity.equals(activity)) {
if (isIncludeSelf) {
finishActivity(aActivity, isLoadAnim);
}
return true;
}
finishActivity(aActivity, isLoadAnim);
}
return false;
}
/**
* Finish to the activity.
*
* @param activity The activity.
* @param isIncludeSelf True to include the activity, false otherwise.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static boolean finishToActivity(@NonNull final Activity activity,
final boolean isIncludeSelf,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 1; i >= 0; --i) {
Activity aActivity = activities.get(i);
if (aActivity.equals(activity)) {
if (isIncludeSelf) {
finishActivity(aActivity, enterAnim, exitAnim);
}
return true;
}
finishActivity(aActivity, enterAnim, exitAnim);
}
return false;
}
/**
* Finish to the activity.
*
* @param clz The activity class.
* @param isIncludeSelf True to include the activity, false otherwise.
*/
public static boolean finishToActivity(@NonNull final Class<? extends Activity> clz,
final boolean isIncludeSelf) {
return finishToActivity(clz, isIncludeSelf, false);
}
/**
* Finish to the activity.
*
* @param clz The activity class.
* @param isIncludeSelf True to include the activity, false otherwise.
* @param isLoadAnim True to use animation for the outgoing activity, false otherwise.
*/
public static boolean finishToActivity(@NonNull final Class<? extends Activity> clz,
final boolean isIncludeSelf,
final boolean isLoadAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 1; i >= 0; --i) {
Activity aActivity = activities.get(i);
if (aActivity.getClass().equals(clz)) {
if (isIncludeSelf) {
finishActivity(aActivity, isLoadAnim);
}
return true;
}
finishActivity(aActivity, isLoadAnim);
}
return false;
}
/**
* Finish to the activity.
*
* @param clz The activity class.
* @param isIncludeSelf True to include the activity, false otherwise.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static boolean finishToActivity(@NonNull final Class<? extends Activity> clz,
final boolean isIncludeSelf,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 1; i >= 0; --i) {
Activity aActivity = activities.get(i);
if (aActivity.getClass().equals(clz)) {
if (isIncludeSelf) {
finishActivity(aActivity, enterAnim, exitAnim);
}
return true;
}
finishActivity(aActivity, enterAnim, exitAnim);
}
return false;
}
/**
* Finish the activities whose type not equals the activity class.
*
* @param clz The activity class.
*/
public static void finishOtherActivities(@NonNull final Class<? extends Activity> clz) {
finishOtherActivities(clz, false);
}
/**
* Finish the activities whose type not equals the activity class.
*
* @param clz The activity class.
* @param isLoadAnim True to use animation for the outgoing activity, false otherwise.
*/
public static void finishOtherActivities(@NonNull final Class<? extends Activity> clz,
final boolean isLoadAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 1; i >= 0; i--) {
Activity activity = activities.get(i);
if (!activity.getClass().equals(clz)) {
finishActivity(activity, isLoadAnim);
}
}
}
/**
* Finish the activities whose type not equals the activity class.
*
* @param clz The activity class.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void finishOtherActivities(@NonNull final Class<? extends Activity> clz,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 1; i >= 0; i--) {
Activity activity = activities.get(i);
if (!activity.getClass().equals(clz)) {
finishActivity(activity, enterAnim, exitAnim);
}
}
}
/**
* Finish all of activities.
*/
public static void finishAllActivities() {
finishAllActivities(false);
}
/**
* Finish all of activities.
*
* @param isLoadAnim True to use animation for the outgoing activity, false otherwise.
*/
public static void finishAllActivities(final boolean isLoadAnim) {
List<Activity> activityList = Utils.getActivityList();
for (int i = activityList.size() - 1; i >= 0; --i) {// remove from top
Activity activity = activityList.get(i);
// sActivityList remove the index activity at onActivityDestroyed
activity.finish();
if (!isLoadAnim) {
activity.overridePendingTransition(0, 0);
}
}
}
/**
* Finish all of activities.
*
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void finishAllActivities(@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
List<Activity> activityList = Utils.getActivityList();
for (int i = activityList.size() - 1; i >= 0; --i) {// remove from top
Activity activity = activityList.get(i);
// sActivityList remove the index activity at onActivityDestroyed
activity.finish();
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
/**
* Finish all of activities except the newest activity.
*/
public static void finishAllActivitiesExceptNewest() {
finishAllActivitiesExceptNewest(false);
}
/**
* Finish all of activities except the newest activity.
*
* @param isLoadAnim True to use animation for the outgoing activity, false otherwise.
*/
public static void finishAllActivitiesExceptNewest(final boolean isLoadAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 2; i >= 0; i--) {
finishActivity(activities.get(i), isLoadAnim);
}
}
/**
* Finish all of activities except the newest activity.
*
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
public static void finishAllActivitiesExceptNewest(@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
List<Activity> activities = Utils.getActivityList();
for (int i = activities.size() - 2; i >= 0; i--) {
finishActivity(activities.get(i), enterAnim, exitAnim);
}
}
/**
* Return the icon of activity.
*
* @param activity The activity.
* @return the icon of activity
*/
public static Drawable getActivityIcon(@NonNull final Activity activity) {
return getActivityIcon(activity.getComponentName());
}
/**
* Return the icon of activity.
*
* @param clz The activity class.
* @return the icon of activity
*/
public static Drawable getActivityIcon(@NonNull final Class<? extends Activity> clz) {
return getActivityIcon(new ComponentName(Utils.getApp(), clz));
}
/**
* Return the icon of activity.
*
* @param activityName The name of activity.
* @return the icon of activity
*/
public static Drawable getActivityIcon(@NonNull final ComponentName activityName) {
PackageManager pm = Utils.getApp().getPackageManager();
try {
return pm.getActivityIcon(activityName);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return null;
}
}
/**
* Return the logo of activity.
*
* @param activity The activity.
* @return the logo of activity
*/
public static Drawable getActivityLogo(@NonNull final Activity activity) {
return getActivityLogo(activity.getComponentName());
}
/**
* Return the logo of activity.
*
* @param clz The activity class.
* @return the logo of activity
*/
public static Drawable getActivityLogo(@NonNull final Class<? extends Activity> clz) {
return getActivityLogo(new ComponentName(Utils.getApp(), clz));
}
/**
* Return the logo of activity.
*
* @param activityName The name of activity.
* @return the logo of activity
*/
public static Drawable getActivityLogo(@NonNull final ComponentName activityName) {
PackageManager pm = Utils.getApp().getPackageManager();
try {
return pm.getActivityLogo(activityName);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return null;
}
}
private static void startActivity(final Context context,
final Bundle extras,
final String pkg,
final String cls,
final Bundle options) {
Intent intent = new Intent(Intent.ACTION_VIEW);
if (extras != null) intent.putExtras(extras);
intent.setComponent(new ComponentName(pkg, cls));
startActivity(intent, context, options);
}
private static void startActivity(final Intent intent,
final Context context,
final Bundle options) {
if (!(context instanceof Activity)) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (options != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
context.startActivity(intent, options);
} else {
context.startActivity(intent);
}
}
private static void startActivityForResult(final Activity activity,
final Bundle extras,
final String pkg,
final String cls,
final int requestCode,
final Bundle options) {
Intent intent = new Intent(Intent.ACTION_VIEW);
if (extras != null) intent.putExtras(extras);
intent.setComponent(new ComponentName(pkg, cls));
startActivityForResult(intent, activity, requestCode, options);
}
private static void startActivityForResult(final Intent intent,
final Activity activity,
final int requestCode,
final Bundle options) {
if (options != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
activity.startActivityForResult(intent, requestCode, options);
} else {
activity.startActivityForResult(intent, requestCode);
}
}
private static void startActivities(final Intent[] intents,
final Context context,
final Bundle options) {
if (!(context instanceof Activity)) {
for (Intent intent : intents) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
}
if (options != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
context.startActivities(intents, options);
} else {
context.startActivities(intents);
}
}
private static Bundle getOptionsBundle(final Context context,
final int enterAnim,
final int exitAnim) {
return ActivityOptionsCompat.makeCustomAnimation(context, enterAnim, exitAnim).toBundle();
}
private static Bundle getOptionsBundle(final Activity activity,
final View[] sharedElements) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return null;
if (sharedElements == null) return null;
int len = sharedElements.length;
if (len <= 0) return null;
@SuppressWarnings("unchecked")
Pair<View, String>[] pairs = new Pair[len];
for (int i = 0; i < len; i++) {
pairs[i] = Pair.create(sharedElements[i], sharedElements[i].getTransitionName());
}
return ActivityOptionsCompat.makeSceneTransitionAnimation(activity, pairs).toBundle();
}
}
| [
"bigoatsm@gmail.com"
] | bigoatsm@gmail.com |
e72a1c19efe8bd296823cd5fc4fdd14024e204bd | 90e063c63a137e44cf8c659455087cd5ac937a2a | /src/com/teambuy/zhongtuan/activity/near/pay/PayActivity.java | 28dfa8e452839e8ad60b1fc001e029187bc92eab | [] | no_license | yangchuyingt/zhongtuanapp20150706 | b90cff5288da62a4925063b76e6d701a570e9f75 | 12a7aad48767dce397163d59ded456cf520c00dc | refs/heads/master | 2021-01-01T19:29:01.870462 | 2015-07-06T08:05:05 | 2015-07-06T08:05:05 | 38,605,057 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,111 | java | package com.teambuy.zhongtuan.activity.near.pay;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import com.pingplusplus.android.PaymentActivity;
import com.teambuy.zhongtuan.R;
import com.teambuy.zhongtuan.ZhongTuanApp;
import com.teambuy.zhongtuan.activity.BaseActivity;
import com.teambuy.zhongtuan.activity.HomeActivity;
import com.teambuy.zhongtuan.activity.me.unpay.UnpayActivity;
import com.teambuy.zhongtuan.background.FileDownLoadService;
import com.teambuy.zhongtuan.background.NetAsync;
import com.teambuy.zhongtuan.define.D;
import com.teambuy.zhongtuan.listener.global.NetAsyncListener;
import com.teambuy.zhongtuan.listener.near.OrderListener;
import com.teambuy.zhongtuan.utilities.JsonUtilities;
import com.teambuy.zhongtuan.utilities.LogUtilities;
import com.teambuy.zhongtuan.views.CustomProgressDialog;
/**
* 支付页面
* @author lforxeverc
* 2015-1-13
*/
public class PayActivity extends BaseActivity implements OnClickListener,
OrderListener, NetAsyncListener, OnCheckedChangeListener {
TextView tittle, tv_productname, tv_primeprice, tv_price;
Button backBtn, submitBtn;
String productName, price, ordno, payMetho,productId;
float all;
RadioGroup radiogroup;
RadioButton rbtn1, rbtn2, rbtn3;
RelativeLayout rl1,rl2,rl3;
CustomProgressDialog mDialog;
OrderListener mOrderListener;
NetAsyncListener mListener;
private static int REQUEST_CODE_PAYMENT = 1;
//private int currentstate = -1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pay);
findViews();
initData();
initListener();
rbtn1.performClick();
}
/**
* 初始化监听器 2015-1-13 lforxeverc
*/
private void initListener() {
mOrderListener = this;
mListener = this;
backBtn.setOnClickListener(this);
submitBtn.setOnClickListener(this);
radiogroup.setOnCheckedChangeListener(this);
rl1.setOnClickListener(this);
rl2.setOnClickListener(this);
rl3.setOnClickListener(this);
}
/**
* 设置Views
*
* 2015-1-13 Administrator
*/
private void initData() {
productName = getIntent().getStringExtra("productname");
price = getIntent().getStringExtra("cpje");
ordno = getIntent().getStringExtra("ordno");
productId=getIntent().getStringExtra("id");
int sum=getIntent().getIntExtra("sum",1);
Cursor c=ZhongTuanApp.getInstance().getRDB().query("PRODUCT_LIST",null,"_id = ?", new String[]{productId}, null,null,null);
if(c.moveToFirst()){
String primePrice=c.getString(c.getColumnIndex("_dj0"));
c.close();
all = (float) Math.round(Float.parseFloat(primePrice) * sum * 100) / 100;
}
//currentstate = getIntent().getIntExtra("currentstate", -1);
tittle.setText("支付收银台");
backBtn.setBackgroundResource(R.drawable.header_back);
tv_productname.setText(productName);
tv_primeprice.setText(all + "元");
tv_price.setText(price + "元");
}
/**
* 找到views 2015-1-13 lforxeverc
*/
private void findViews() {
tittle = (TextView) findViewById(R.id.tv_header_tittle);
backBtn = (Button) findViewById(R.id.back);
submitBtn = (Button) findViewById(R.id.btn_submit);
tv_productname = (TextView) findViewById(R.id.tv_productname);
tv_primeprice = (TextView) findViewById(R.id.tv_primeprice);
tv_price = (TextView) findViewById(R.id.tv_price);
radiogroup = (RadioGroup) findViewById(R.id.radiogroup);
rbtn1 = (RadioButton) findViewById(R.id.rbtn1);
rbtn2 = (RadioButton) findViewById(R.id.rbtn2);
rbtn3 = (RadioButton) findViewById(R.id.rbtn3);
rl1=(RelativeLayout) findViewById(R.id.rl1);
rl2=(RelativeLayout) findViewById(R.id.rl2);
rl3=(RelativeLayout) findViewById(R.id.rl3);
}
@Override
public void onClick(View arg0) {
switch (arg0.getId()) {
// 返回事件
case R.id.back:
finish();
break;
// 提交按钮触发事件
case R.id.btn_submit:
/*if (currentstate == 1) {
pay(D.API_SPECIAL_CREATEPAY);
} else {*/
pay(D.API_CPORD_CREATEPAY);
//}
break;
case R.id.rl1:
rbtn1.setChecked(true);
break;
case R.id.rl2:
rbtn2.setChecked(true);
break;
case R.id.rl3:
rbtn3.setChecked(true);
break;
default:
break;
}
}
/**
* 按照特卖或团购支付订单
*
* @param url
* 2015-1-13 yg
*/
private void pay(String url) {
mDialog = CustomProgressDialog.createDialog(this);
mDialog.show();
NetAsync repayTask = new NetAsync(url, mListener) {
@Override
public Object processDataInBackground(JsonElement elData) {
Type type = new TypeToken<Map<String, JsonElement>>() {
}.getType();
Map<String, JsonElement> mResult = JsonUtilities
.parseModelByType(elData, type);
JsonElement jCredential = mResult.get("credential");
return jCredential.toString();
}
@Override
public void beforeRequestInBackground(List<NameValuePair> params) {
params.add(new BasicNameValuePair("ordno", ordno));
params.add(new BasicNameValuePair("paym", payMetho));
}
};
repayTask.execute();
}
@Override
public void onCheckedChanged(RadioGroup arg0, int arg1) {
switch (arg1) {
// 选择支付方式
case R.id.rbtn1:
payMetho = D.PAY_BY_ALI;
break;
case R.id.rbtn2:
payMetho = D.PAY_BY_YINLIAN;
break;
case R.id.rbtn3:
payMetho = D.PAY_BY_WECHAT;
break;
default:
break;
}
}
@Override
public void onResultError(String reqUrl, String errMsg) {
mDialog.dismiss();
Toast.makeText(this, errMsg, Toast.LENGTH_SHORT).show();
}
@Override
public void onResultSuccess(String reqUrl, Object data) {
switch (reqUrl) {
case D.API_SPECIAL_CREATEPAY:
case D.API_CPORD_CREATEPAY:
mDialog.dismiss();
String vouchers = (String) data;
Intent intent_co = new Intent();
String packageName = getPackageName();
ComponentName componentName = new ComponentName(packageName,
packageName + ".wxapi.WXPayEntryActivity");
intent_co.setComponent(componentName);
LogUtilities.Log(D.DEBUG + " input", vouchers, D.DEBUG_DEBUG);
intent_co.putExtra(PaymentActivity.EXTRA_CREDENTIAL, vouchers); // credential
startActivityForResult(intent_co, REQUEST_CODE_PAYMENT);
break;
default:
break;
}
}
@Override
public void onTokenTimeout() {
mDialog.dismiss();
ZhongTuanApp.getInstance().logout(this);
}
@Override
public void onClick(DialogInterface arg0, int arg1) {
switch (arg1) {
case Dialog.BUTTON_POSITIVE:
Intent intent = new Intent(this, FileDownLoadService.class);
intent.putExtra("url", D.DOWN_YIN_LIAN);
startService(intent);
break;
case Dialog.BUTTON_NEGATIVE:
arg0.dismiss();
break;
default:
break;
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// if (requestCode == D.REQUEST_UAID && resultCode == D.RESPONSE_UAID) {
// uaid = data.getStringExtra("uaid");
// UserAddress address = Model.load(new UserAddress(), uaid);
// mActor.upDateRecieveInfo(address);
// return;
// }
// payment result process
if (requestCode == REQUEST_CODE_PAYMENT) {
if (data == null) {
return;
}
String msg = null;
/*
* 返回字符串:success, fail, cancel, invalid
* 分别代表支付成功,支付失败,支付取消,未安装第三方支付控件
*/
String str = data.getExtras().getString("pay_result");
if (str.equalsIgnoreCase("success")) {
msg = "支付成功!";
// jumpToMyOrder(D.OPT_CONFORM);
Intent intent = new Intent(PayActivity.this,
PaySuccessActivity.class);
intent.putExtra("ordno", ordno);
Intent intent_clear=new Intent(PayActivity.this,HomeActivity.class);
intent_clear.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent_clear);
startActivity(intent);
// startActivities(new Intent[]{intent_clear,intent});
// finish();
return;
} else if (str.equalsIgnoreCase("fail")) {
msg = "支付失败!";
jumpToMyOrder(0);
return;
} else if (str.equalsIgnoreCase("cancel")) {
msg = "用户取消了支付";
jumpToMyOrder(0);
return;
} else if (str.equalsIgnoreCase("invalid")) {
msg = "未安装第三方支付控件";
// mActor.notifyDownLoadPaymentServices();
mDialog.dismiss();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("下载");
builder.setMessage("缺少银联客户端,是否现在下载?");
builder.setPositiveButton("立刻下载", mOrderListener);
builder.setNegativeButton("等等,我考虑一下", mOrderListener);
builder.create().show();
}
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
}
/**
* 跳转到未支付订单页面,由于重用了特卖和团购的未支付页面,所以用Tag分割两个页面的跳转,0为团购,1为特卖
* @param tag
* 2015-1-20
* lforxeverc
*/
public void jumpToMyOrder(int tag) {
Intent intent = new Intent(this, UnpayActivity.class);
intent.putExtra("tgOrtm", tag);
Intent intent_clear=new Intent(PayActivity.this,HomeActivity.class);
intent_clear.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// startActivities(new Intent[]{intent_clear,intent});
// finish();
startActivity(intent_clear);
startActivity(intent);
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
}
}
| [
"1191378206@qq.com"
] | 1191378206@qq.com |
7386b1d6057f30414be64364b96312e556ae9f45 | 77d404587a019c5e0aad91ce399d4c42736b90ac | /IdeaProjects/AdminLETjavacto/design-pattern/mybatis/src/main/java/cn/itnanls/Test.java | 2e56a59af4ef36e1a06a2f46518eb8d70df29599 | [] | no_license | yan13960/Ideaproject | dc895e10817a3ca87c649a45572edab545a9141a | 68180e916a8694a92a813c1adec99e9362aa76d0 | refs/heads/master | 2023-08-22T23:59:39.919458 | 2021-10-25T17:02:01 | 2021-10-25T17:02:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 864 | java | package cn.itnanls;
import cn.itnanls.core.Session;
import cn.itnanls.core.SessionFactory;
import cn.itnanls.dao.StudentDao;
import cn.itnanls.dao.UserDao;
import cn.itnanls.entity.User;
import java.util.List;
/**
*
*/
public class Test {
public static void main(String[] args) {
SessionFactory sessionFactory=new SessionFactory("mybatis-config.xml");
Session session = sessionFactory.openSession();
System.out.println(session.getConnection());
//生成代理对象
UserDao userDao=session.getMapper(UserDao.class);
//userDao.saveUser(new User(5,"a","b"));
List<User> user = userDao.findUser(5);
System.out.println(user);
StudentDao studentDao=session.getMapper(StudentDao.class);
List<User> student = studentDao.findStudent(1);
System.out.println(student);
}
}
| [
"1396045173@qq.com"
] | 1396045173@qq.com |
d4840b7d5b5f41d8bd00faa460690ffef67216fa | db83aa5d07fab893e69593a1fb4ff2d51f2334d3 | /power-api/src/main/java/com/mrliang/ver/service/TuserRoleService.java | 83a2e755336f3f35971f53fcea0f62e75d56bb65 | [] | no_license | txmlw/ver | afeba6a3ebd56c5aee015ce121fc8783135348b6 | 1cf8b3c038deaf0045d2aa2611c58458d33a2fc6 | refs/heads/master | 2021-01-01T18:39:39.247416 | 2017-08-31T10:06:26 | 2017-08-31T10:06:26 | 98,396,589 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,278 | java | package com.mrliang.ver.service;
import com.mrliang.ver.dto.TuserRoleDto;
import java.util.List;
import java.util.Map;
import com.mrliang.common.page.PageInfo;
import org.springframework.stereotype.Repository;
public interface TuserRoleService {
public void insert(TuserRoleDto tuserRoleDto) throws Exception;
public void insert(List<TuserRoleDto> tuserRoleDtoList) throws Exception;
/**
* 获取TuserRole根据主键获取
* @param tuserRoleDto
* @return Map
*/
public TuserRoleDto findByPrimaryKey(TuserRoleDto tuserRoleDto) throws Exception;
/**
* TuserRole列表信息
* @param pageIno
* @return List
*/
public PageInfo findPage(PageInfo pageIno) throws Exception;
/**
* TuserRole列表信息
* @param tuserRoleDto)
* @return List<TuserRoleDto>
*/
public List<TuserRoleDto> findList(TuserRoleDto tuserRoleDto) throws Exception;
/**
* 删除单条
* @param tuserRoleDto
* @return
*/
public int delete(TuserRoleDto tuserRoleDto) throws Exception;
public int delete(List<TuserRoleDto> tuserRoleDtoList) throws Exception;
/**
* 修改
* @param tuserRoleDto
* @return String
*/
public int update(TuserRoleDto tuserRoleDto) throws Exception;
public long update(List<TuserRoleDto> tuserRoleDtoList) throws Exception;
}
| [
"284355163@qq.com"
] | 284355163@qq.com |
fc7b5ec5cdd7ff3be9a3318fba5ee13986fe8432 | ed6ee43ce316213299e84ef0f52972910548f994 | /src/main/java/com/solstice/ecommercedemo/data/AccountRepository.java | 4152187c6fc1da7abc0352fa0d238b56d1bb0d6c | [] | no_license | derrick-anderson/e-commerce-demo | 21e8c36d69100bce806199b061dc71f8b6e5d708 | a4942b18ff24d1c450bb0b1a002fba29a3ca9f2a | refs/heads/master | 2021-09-20T17:12:18.128974 | 2018-08-13T03:10:18 | 2018-08-13T03:10:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | package com.solstice.ecommercedemo.data;
import com.solstice.ecommercedemo.model.Account;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface AccountRepository extends JpaRepository<Account, Long> {
Account findByAccountId(Long accountId);
}
| [
"deanderson@solstice.com"
] | deanderson@solstice.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.