blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8eb0b0a8aa1b593aac20100a9d445a175eaf2a32
|
4b98b931651e2f841e154f55189ecd7b39e3d106
|
/ArrayOfArray08.java
|
26fd730bf3d70b916957f047e196cf08c67de56f
|
[] |
no_license
|
Vladimir3120/JavaOnline_2_Algorithmization
|
61c1cc07b6530e0146ddaf5c75438fc670bfda64
|
d934ba76ddcc764afedb4b9ba69f18ac44953c02
|
refs/heads/master
| 2022-10-20T14:30:52.091000
| 2020-06-29T11:36:23
| 2020-06-29T11:36:23
| 275,791,901
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,708
|
java
|
package by.http.alltask;
import java.util.Scanner;
public class ArrayOfArray08 {
/*
* В числовой матрице поменять местами два столбца любых столбца, т. е. все
* элементы одного столбца поставить на соответствующие им позиции другого, а
* его элементы второго переместить в первый. Номера столбцов вводит
* пользователь с клавиатуры.
*/
public static void main(String[] args) {
int n = 6;
int[][] a = new int[n][n];
initialization(a);
changeColumn(a, column(), column());
}
public static int[][] initialization(int[][] a) {
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a.length; j++) {
a[i][j] = i + 1 * j;
System.out.print(a[i][j] + "\t");
}
System.out.println();
}
return a;
}
public static int column() {
System.out.println();
int c = 0;
Scanner sc = new Scanner(System.in);
System.out.print("Введите номер столбца для замены: >> ");
while (!sc.hasNextInt()) {
sc.next();
System.out.println("Введите цифру: >> ");
}
c = sc.nextInt();
return c;
}
public static int[][] changeColumn(int[][] a, int c1, int c2) {
System.out.println();
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a.length; j++) {
int temp = a[i][c1];
a[i][c1] = a[i][c2];
a[i][c2] = temp;
System.out.print(a[i][j] + "\t");
}
System.out.println();
}
return a;
}
}
|
[
"noreply@github.com"
] |
noreply@github.com
|
e4ce393c496ecde0b52f6dec1af5e0ab8af6cb2b
|
c680cc77b875eb52a4179061953827fa6db5bdc0
|
/SinglelyLinkedList/src/main/Main.java
|
2724c38f95bb7dcd77fa4bf419a4b22ff86a8caa
|
[] |
no_license
|
Chandanct/Shell-Sort
|
6485823717ad09e8f7fb9ac20f8f36198dafc592
|
6992d11f1482bf648121068bbe989c001a29d9d2
|
refs/heads/master
| 2020-04-13T04:19:39.452065
| 2018-12-24T06:30:26
| 2018-12-24T06:30:26
| 162,958,056
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 739
|
java
|
package main;
import employee.Employee;
import employee.EmplyeeLinkList;
public class Main {
public static void main(String[] args) {
Employee janeJones = new Employee("Jane", "Jones", 123);
Employee johnDoe = new Employee("John", "Doe", 456);
Employee marySmith = new Employee("Mary", "Smith", 789);
Employee mikeWilson = new Employee("Mike", "Wilson", 4562);
EmplyeeLinkList list = new EmplyeeLinkList();
System.out.println(list.isEmpty());
list.addToFront(janeJones);
list.addToFront(johnDoe);
list.addToFront(marySmith);
list.addToFront(mikeWilson);
System.out.println(list.getSize());
list.printList();
list.removeFromFront();
list.printList();
System.out.println(list.getSize());
}
}
|
[
"chandan.thakur@dreamorbit.com"
] |
chandan.thakur@dreamorbit.com
|
1a7961a5885e1cb02218f64738c0b36af69cd03a
|
363d94464c33a8e90ec5db5c1acd1272128c6154
|
/src/main/java/businesslogic/processes/LeadFromSiteServiceImpl.java
|
e26def1de13cc5a7df564d0b76bf35af4c0cc534
|
[] |
no_license
|
berzellius/com.berzellius.integrations.astraestate
|
311cd7e6a28373c35e787c24f9fcd716cac44d4a
|
892ecc2b24e6fdeba084295b8bc6582a60eb2b77
|
refs/heads/master
| 2021-01-01T20:43:25.222215
| 2017-08-03T19:23:42
| 2017-08-03T19:23:42
| 98,918,810
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 20,346
|
java
|
package businesslogic.processes;
import businesslogic.rules.transformer.FieldsTransformer;
import businesslogic.rules.validator.BusinessRulesValidator;
import com.berzellius.integrations.amocrmru.dto.api.amocrm.AmoCRMContact;
import com.berzellius.integrations.amocrmru.dto.api.amocrm.AmoCRMCustomField;
import com.berzellius.integrations.amocrmru.dto.api.amocrm.AmoCRMCustomFieldValue;
import com.berzellius.integrations.amocrmru.dto.api.amocrm.AmoCRMLead;
import com.berzellius.integrations.amocrmru.dto.api.amocrm.response.AmoCRMCreatedEntityResponse;
import com.berzellius.integrations.amocrmru.service.AmoCRMService;
import com.berzellius.integrations.basic.exception.APIAuthException;
import com.berzellius.integrations.comagicru.dto.sessioninfo.SessionInfo;
import com.berzellius.integrations.comagicru.service.ComagicAPIService;
import dmodel.LeadFromSite;
import dmodel.Site;
import dto.site.Lead;
import dto.site.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import repository.LeadFromSiteRepository;
import repository.SiteRepository;
import java.util.*;
/**
* Created by berz on 09.03.2017.
*/
@Service
@Transactional
public class LeadFromSiteServiceImpl implements LeadsFromSiteService {
@Autowired
SiteRepository siteRepository;
@Autowired
BusinessRulesValidator businessRulesValidator;
@Autowired
FieldsTransformer fieldsTransformer;
@Autowired
LeadFromSiteRepository leadFromSiteRepository;
@Autowired
AmoCRMService amoCRMService;
@Autowired
ComagicAPIService comagicAPIService;
private Long phoneNumberCustomFieldLeads;
private Long phoneNumberCustomField;
private Long commentCustomField;
private Long defaultUserID;
private Long marketingChannelContactsCustomField;
private Long marketingChannelLeadsCustomField;
private Long emailContactCustomField;
private String emailContactEnum;
private Long phoneNumberContactStockField;
private String phoneNumberStockFieldContactEnumWork;
private Long leadFromSiteTagId;
private Long sourceLeadsCustomField;
private Long sourceContactsCustomField;
private HashMap<Integer, Long> siteIdToLeadsSource;
private static final Logger log = LoggerFactory.getLogger(LeadsFromSiteService.class);
private String transformPhone(String phone){
String res = fieldsTransformer.transform(phone, FieldsTransformer.Transformation.CALL_NUMBER_COMMON);
res = fieldsTransformer.transform(res, FieldsTransformer.Transformation.CALL_NUMBER_LEADING_7);
return res;
}
@Override
public LeadFromSite processLeadFromSite(LeadFromSite leadFromSite) throws APIAuthException {
if(leadFromSite.getSite() != null && leadFromSite.getLead() != null) {
log.info("Started processing lead from site " + leadFromSite.getSite().getUrl() + "; contacts: " + leadFromSite.getLead().getPhone() + " / " + leadFromSite.getLead().getEmail());
// Приводим номер к общему формату
if (leadFromSite.getLead().getPhone() != null) {
leadFromSite.getLead().setPhone(this.transformPhone(leadFromSite.getLead().getPhone()));
}
if (!businessRulesValidator.validate(leadFromSite)) {
log.error("LeadFromSite object has not validated!");
leadFromSite.setState(LeadFromSite.State.DONE);
leadFromSiteRepository.save(leadFromSite);
return leadFromSite;
} else {
log.info("LeadFromSite was succesfully validated!");
}
String marketingChannel = "";
if(leadFromSite.getLead().getVisitor_id() != null){
marketingChannel = comagicAPIService.getActiveAcByVisitorId(leadFromSite.getLead().getVisitor_id());
}
AmoCRMContact contact = contactForLeadFromSite(leadFromSite, marketingChannel);
if(contact == null){
throw new RuntimeException("seems to be contact was not created and not exists for leadFromSite#" + leadFromSite.getId());
}
this.workWithContact(leadFromSite, contact, marketingChannel);
leadFromSite.setState(LeadFromSite.State.DONE);
leadFromSiteRepository.save(leadFromSite);
return leadFromSite;
}
return null;
}
public HashMap<Integer, Long> getSiteIdToLeadsSource() {
if(siteIdToLeadsSource == null){
this.setSiteIdToLeadsSource(new HashMap<>());
}
if(siteIdToLeadsSource.size() == 0){
log.debug("updating siteIdToLeadsSource in AmoCRMLeadsFromSiteServiceImpl");
List<Site> sites = (List<Site>) siteRepository.findAll();
for(Site site : sites){
siteIdToLeadsSource.put(site.getCallTrackingSiteId(), Long.decode(site.getCrmLeadSourceId()));
}
}
return siteIdToLeadsSource;
}
private AmoCRMContact contactForLeadFromSite(LeadFromSite leadFromSite, String sourceName) throws APIAuthException {
Lead lead = leadFromSite.getLead();
if(lead == null){
return null;
}
String contacts = contactStrByLead(lead);
if(lead.getPhone() != null) {
List<AmoCRMContact> contactsByPhone = amoCRMService.getContactsByQuery(lead.getPhone());
if(contactsByPhone.size() > 0){
return contactsByPhone.get(0);
}
}
if(lead.getEmail() != null){
List<AmoCRMContact> contactsByEmail = amoCRMService.getContactsByQuery(lead.getEmail());
if(contactsByEmail.size() > 0){
return contactsByEmail.get(0);
}
}
AmoCRMContact amoCRMContact = new AmoCRMContact();
amoCRMContact.setName(lead.getName() + " (с сайта " + lead.getOrigin() + ") :[" + contacts + "]");
amoCRMContact.setResponsible_user_id(this.getDefaultUserID());
if(lead.getPhone() != null){
String[] fieldNumber = {lead.getPhone()};
amoCRMContact.addStringValuesToCustomField(this.getPhoneNumberCustomField(), fieldNumber);
amoCRMContact.addStringValuesToCustomField(this.getPhoneNumberContactStockField(), fieldNumber, this.getPhoneNumberStockFieldContactEnumWork());
}
if(lead.getEmail() != null){
String[] fieldEmail = {lead.getEmail()};
amoCRMContact.addStringValuesToCustomField(this.getEmailContactCustomField(), fieldEmail, this.getEmailContactEnum());
}
String[] fieldProject = {leadFromSite.getSite().getCrmContactSourceId()};
amoCRMContact.addStringValuesToCustomField(this.getSourceContactsCustomField(), fieldProject);
String[] fieldSource = {sourceName};
amoCRMContact.addStringValuesToCustomField(this.getMarketingChannelContactsCustomField(), fieldSource);
AmoCRMCreatedEntityResponse response = amoCRMService.addContact(amoCRMContact);
if(response.getId() != null){
log.info("Contact was created: #" + response.getId());
AmoCRMContact contact = amoCRMService.getContactById(response.getId());
return contact;
}
return null;
}
private void workWithContact(LeadFromSite leadFromSite, AmoCRMContact contact, String sourceName) throws APIAuthException {
log.info("searching leads for contact#" + contact.getId().toString());
// Проверяем заполненность полей "телефон" и "email"
log.info("checking contact fields...");
String phone2check = leadFromSite.getLead().getPhone();
log.info("phone: " + phone2check);
String email2check = leadFromSite.getLead().getEmail();
log.info("email: " + email2check);
for(AmoCRMCustomField amoCRMCustomField : contact.getCustom_fields()){
if(amoCRMCustomField.getCode() != null &&
amoCRMCustomField.getCode().equals("PHONE")){
for(AmoCRMCustomFieldValue amoCRMCustomFieldValue : amoCRMCustomField.getValues()){
String transformedPhone = this.transformPhone(amoCRMCustomFieldValue.getValue());
if(transformedPhone.equals(phone2check)){
// больше можно не проверять
phone2check = null;
}
}
}
if(amoCRMCustomField.getCode() != null &&
amoCRMCustomField.getCode().equals("EMAIL")){
for(AmoCRMCustomFieldValue amoCRMCustomFieldValue : amoCRMCustomField.getValues()){
if(amoCRMCustomFieldValue.getValue().equals(email2check)){
// больше можно не проверять
email2check = null;
}
}
}
}
if(phone2check != null){
log.info("adding to phone numbers: ".concat(phone2check));
String[] phone2checkField = {phone2check};
contact.addStringValuesToCustomField(this.getPhoneNumberContactStockField(), phone2checkField, this.getPhoneNumberStockFieldContactEnumWork());
}
if(email2check != null){
log.info("adding to emails: ".concat(email2check));
String[] email2checkField = {email2check};
contact.addStringValuesToCustomField(this.getEmailContactCustomField(), email2checkField, this.getEmailContactEnum());
}
amoCRMService.saveByUpdate(contact);
// Проверяем, есть ли сделки
ArrayList<Long> leadIds = contact.getLinked_leads_id();
if (leadIds != null && leadIds.size() != 0) {
log.info("Leads found. Checking statuses");
for (Long leadId : leadIds){
log.info("work with lead#" + leadId);
AmoCRMLead lead = amoCRMService.getLeadById(leadId);
if(lead != null){
if(amoCRMService.getLeadClosedStatusesIDs().contains(lead.getStatus_id())){
log.info("lead is closed. next..");
}
else{
log.info("lead is open. ok");
return;
}
}
}
}
// Если лид не найден, то попадаем сюда и создаем лид
this.createLead(leadFromSite, contact, sourceName);
}
private void createLead(LeadFromSite leadFromSite, AmoCRMContact contact, String sourceName) throws APIAuthException {
if(leadFromSite.getLead() == null)
return;
AmoCRMLead lead = new AmoCRMLead();
lead.setName("Заявка с сайта -> " + this.contactStrByLead(leadFromSite.getLead()));
//lead.setResponsible_user_id(this.getDefaultUserID());
if(leadFromSite.getLead().getPhone() != null){
String[] numberField = {leadFromSite.getLead().getPhone()};
lead.addStringValuesToCustomField(this.getPhoneNumberCustomFieldLeads(), numberField);
}
if(leadFromSite.getLead().getComment() != null){
String[] commentField = {leadFromSite.getLead().getComment()};
lead.addStringValuesToCustomField(this.getCommentCustomField(), commentField);
}
String[] fieldProject = {leadFromSite.getSite().getCrmLeadSourceId()};
lead.addStringValuesToCustomField(this.getSourceLeadsCustomField(), fieldProject);
String[] fieldSource = {sourceName};
lead.addStringValuesToCustomField(this.getMarketingChannelLeadsCustomField(), fieldSource);
String marketingChannelName = "";
String searchEngineName = "";
String utmSource = "";
if(leadFromSite.getLead().getVisitor_id() != null){
marketingChannelName = comagicAPIService.getActiveAcByVisitorId(leadFromSite.getLead().getVisitor_id());
}
if(leadFromSite.getLead().getSession_id() != null){
ArrayList<SessionInfo> sessionInfos = comagicAPIService.getSessionInfoBySessionId(leadFromSite.getLead().getSession_id());
if(sessionInfos.size() > 0 && sessionInfos.get(0).getSearch_engine() != null){
searchEngineName = sessionInfos.get(0).getSearch_engine();
}
if(sessionInfos.size() > 0 && sessionInfos.get(0).getUtm_source() != null){
utmSource = sessionInfos.get(0).getUtm_source();
}
}
log.info("utmSource: " + utmSource);
log.info("searchEngine: " + searchEngineName);
log.info("marketingChannel: " + marketingChannelName);
//lead.tag(this.getLeadFromSiteTagId(), "Заявка с сайта");
lead = this.transfromLeadFromSiteForChangePipelineAndTags(lead, leadFromSite, marketingChannelName, searchEngineName, utmSource);
// если в ходе трансформации ответственный не определен
// если у контакта есть ответственный и он не является ответственным по умолчанию, ставим отвественного за контакт
// иначе ставим пользователя по умолчанию
if(lead.getResponsible_user_id() == null){
if(
contact.getResponsible_user_id() != null &&
!contact.getResponsible_user_id().equals(this.getDefaultUserID())
){
lead.setResponsible_user_id(contact.getResponsible_user_id());
}
else{
lead.setResponsible_user_id(this.getDefaultUserID());
}
}
log.info("creating lead for leadFromSite..");
AmoCRMCreatedEntityResponse amoCRMCreatedEntityResponse = amoCRMService.addLead(lead);
if(amoCRMCreatedEntityResponse.getId() != null){
log.info("created lead#" + amoCRMCreatedEntityResponse.getId().toString());
AmoCRMLead lead1 = amoCRMService.getLeadById(amoCRMCreatedEntityResponse.getId());
amoCRMService.addContactToLead(contact, lead1);
}
else{
log.error("error creating lead!");
throw new RuntimeException("Lead was not created with unknown reason!");
}
}
private String contactStrByLead(Lead lead){
if(lead == null)
return "";
String contact = "";
if(lead.getPhone() != null){
contact = contact.concat(lead.getPhone());
}
if(lead.getEmail() != null){
contact = contact.concat((contact.equals(""))? lead.getEmail() : " / ".concat(lead.getEmail()));
}
return contact;
}
protected AmoCRMLead transfromLeadFromSiteForChangePipelineAndTags(AmoCRMLead amoCRMLead, LeadFromSite leadFromSite, String marketingChannelName, String searchEngineName, String utmSource){
HashMap<String, Object> params = new LinkedHashMap<>();
log.info("preparing to run transformer");
if(leadFromSite.getSite() != null){
log.info("lead was from site#" + leadFromSite.getSite().getId());
params.put("site", leadFromSite.getSite());
}
params.put("marketing_channel", marketingChannelName);
params.put("search_engine_name", searchEngineName);
params.put("utm_source", utmSource);
return fieldsTransformer.transform(
amoCRMLead,
FieldsTransformer.Transformation.AMOCRM_LEADFROMSITE_PIPELINE_AND_TAGS,
params
);
}
public Long getPhoneNumberCustomFieldLeads() {
return phoneNumberCustomFieldLeads;
}
@Override
public void setPhoneNumberCustomFieldLeads(Long phoneNumberCustomFieldLeads) {
this.phoneNumberCustomFieldLeads = phoneNumberCustomFieldLeads;
}
public Long getPhoneNumberCustomField() {
return phoneNumberCustomField;
}
@Override
public void setPhoneNumberCustomField(Long phoneNumberCustomField) {
this.phoneNumberCustomField = phoneNumberCustomField;
}
public Long getCommentCustomField() {
return commentCustomField;
}
@Override
public void setCommentCustomField(Long commentCustomField) {
this.commentCustomField = commentCustomField;
}
public Long getDefaultUserID() {
return defaultUserID;
}
@Override
public void setDefaultUserID(Long defaultUserID) {
this.defaultUserID = defaultUserID;
}
public Long getMarketingChannelContactsCustomField() {
return marketingChannelContactsCustomField;
}
@Override
public void setMarketingChannelContactsCustomField(Long marketingChannelContactsCustomField) {
this.marketingChannelContactsCustomField = marketingChannelContactsCustomField;
}
public Long getMarketingChannelLeadsCustomField() {
return marketingChannelLeadsCustomField;
}
@Override
public void setMarketingChannelLeadsCustomField(Long marketingChannelLeadsCustomField) {
this.marketingChannelLeadsCustomField = marketingChannelLeadsCustomField;
}
public Long getEmailContactCustomField() {
return emailContactCustomField;
}
@Override
public void setEmailContactCustomField(Long emailContactCustomField) {
this.emailContactCustomField = emailContactCustomField;
}
public String getEmailContactEnum() {
return emailContactEnum;
}
@Override
public void setEmailContactEnum(String emailContactEnum) {
this.emailContactEnum = emailContactEnum;
}
public Long getPhoneNumberContactStockField() {
return phoneNumberContactStockField;
}
@Override
public void setPhoneNumberContactStockField(Long phoneNumberContactStockField) {
this.phoneNumberContactStockField = phoneNumberContactStockField;
}
public String getPhoneNumberStockFieldContactEnumWork() {
return phoneNumberStockFieldContactEnumWork;
}
@Override
public void setPhoneNumberStockFieldContactEnumWork(String phoneNumberStockFieldContactEnumWork) {
this.phoneNumberStockFieldContactEnumWork = phoneNumberStockFieldContactEnumWork;
}
public Long getLeadFromSiteTagId() {
return leadFromSiteTagId;
}
@Override
public void setLeadFromSiteTagId(Long leadFromSiteTagId) {
this.leadFromSiteTagId = leadFromSiteTagId;
}
public Long getSourceLeadsCustomField() {
return sourceLeadsCustomField;
}
@Override
public void setSourceLeadsCustomField(Long sourceLeadsCustomField) {
this.sourceLeadsCustomField = sourceLeadsCustomField;
}
public Long getSourceContactsCustomField() {
return sourceContactsCustomField;
}
@Override
public void setSourceContactsCustomField(Long sourceContactsCustomField) {
this.sourceContactsCustomField = sourceContactsCustomField;
}
@Override
public Result newLeadFromSite(List<Lead> leads, String origin, String password) {
List<Site> sites = siteRepository.findByUrlAndPassword(origin, password);
if(sites.size() == 0){
return new Result("error");
}
Site site = sites.get(0);
List<LeadFromSite> leadFromSiteList = new ArrayList<>();
for(Lead lead : leads){
LeadFromSite leadFromSite = new LeadFromSite();
leadFromSite.setDtmCreate(new Date());
leadFromSite.setSite(site);
leadFromSite.setLead(lead);
leadFromSite.setState(LeadFromSite.State.NEW);
leadFromSiteList.add(leadFromSite);
}
leadFromSiteRepository.save(leadFromSiteList);
return new Result("success");
}
public void setSiteIdToLeadsSource(HashMap<Integer, Long> siteIdToLeadsSource) {
this.siteIdToLeadsSource = siteIdToLeadsSource;
}
}
|
[
"berzellius@gmail.com"
] |
berzellius@gmail.com
|
ec57bbdbcaaa34940c7f124ec86a7d40fb88f9db
|
1ed0e7930d6027aa893e1ecd4c5bba79484b7c95
|
/keiji/source/java/jp/maio/sdk/android/av.java
|
610ab00a58b0f3f181cec84c301cbec675f46522
|
[] |
no_license
|
AnKoushinist/hikaru-bottakuri-slot
|
36f1821e355a76865057a81221ce2c6f873f04e5
|
7ed60c6d53086243002785538076478c82616802
|
refs/heads/master
| 2021-01-20T05:47:00.966573
| 2017-08-26T06:58:25
| 2017-08-26T06:58:25
| 101,468,394
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,549
|
java
|
package jp.maio.sdk.android;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.Timer;
import java.util.TimerTask;
import org.cocos2dx.lib.BuildConfig;
import org.cocos2dx.lib.GameControllerDelegate;
public class av {
private static av c = null;
private static String d = (v.b() + "/WebApiManager/viewlog/viewlog.log");
private Timer a;
private TimerTask b;
private String e = "viewlog.log";
private ArrayList f = new ArrayList();
private boolean g = true;
private av() {
}
public static synchronized av a(String str, int i) {
av avVar;
synchronized (av.class) {
if (c == null) {
c = new av();
c.b(str, i);
}
avVar = c;
}
return avVar;
}
private synchronized void a() {
try {
OutputStream fileOutputStream = new FileOutputStream(new File(d));
ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
objectOutputStream.writeObject(this.f);
objectOutputStream.close();
fileOutputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
private synchronized void a(int i) {
Calendar instance = Calendar.getInstance();
instance.add(12, -i);
Collection arrayList = new ArrayList();
for (int size = this.f.size() - 1; size >= 0; size--) {
au auVar = (au) this.f.get(size);
if (instance.getTime().after(auVar.e) && auVar.d.booleanValue()) {
arrayList.add(auVar);
}
}
if (!arrayList.isEmpty()) {
this.f.removeAll(arrayList);
}
}
private void a(String str) {
this.b = new aw(this, str);
}
private synchronized ArrayList b() {
ArrayList arrayList;
ArrayList arrayList2 = new ArrayList();
try {
InputStream fileInputStream = new FileInputStream(new File(d));
ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
arrayList = (ArrayList) objectInputStream.readObject();
try {
objectInputStream.close();
fileInputStream.close();
} catch (Exception e) {
}
} catch (Exception e2) {
arrayList = arrayList2;
}
return arrayList;
}
private synchronized void b(String str, int i) {
if (this.a == null) {
File file = new File(d);
if (!file.exists()) {
try {
file.getParentFile().mkdirs();
file.createNewFile();
} catch (Exception e) {
}
}
c.c(str, i);
}
}
private void c(String str, int i) {
this.f = b();
this.a = new Timer();
a(str);
if (i < 1) {
i = 20;
}
this.a.schedule(this.b, 0, (long) (i * GameControllerDelegate.THUMBSTICK_LEFT_X));
}
public synchronized void a(au auVar, int i) {
this.g = false;
boolean z;
try {
a(i);
this.f.add(auVar);
a();
z = "Add Log";
bc.a(z, BuildConfig.FLAVOR, null);
this.g = z;
} catch (Exception e) {
z = e;
this.g = z;
} finally {
this.g = true;
}
}
public synchronized boolean a(Date date, String str) {
boolean z;
int size = this.f.size() - 1;
while (size >= 0) {
au auVar = (au) this.f.get(size);
if (auVar.a.equals(str)) {
z = !date.before(auVar.e);
} else {
size--;
}
}
z = true;
return z;
}
public synchronized int b(Date date, String str) {
int i;
i = 0;
Iterator it = this.f.iterator();
while (it.hasNext()) {
au auVar = (au) it.next();
int i2 = (auVar.a.equals(str) && !auVar.b.booleanValue() && date.before(auVar.e)) ? i + 1 : i;
i = i2;
}
return i;
}
}
|
[
"09f713c@sigaint.org"
] |
09f713c@sigaint.org
|
0ef6c69b2945c6be8621be1789f994849e80dcf1
|
e1cee9a479ae1747b331749c48a4f62e22c42b7c
|
/ControleOcorrencia/src/main/java/br/com/tcc/ocorrencia/config/SwaggerConfig.java
|
8ad00461d14513ae5d299f5ceb868356a86e0a44
|
[] |
no_license
|
edmarr/spring-microservice-oauth2
|
9e4e7c7235c2e620f362f4c62162175048a05d8b
|
1a550e3c65cb7966f78440e7569ba54b18c0cac7
|
refs/heads/master
| 2022-01-23T16:58:47.097022
| 2019-10-01T17:29:01
| 2019-10-01T17:29:01
| 212,147,680
| 0
| 0
| null | 2022-01-21T23:31:17
| 2019-10-01T16:40:55
|
Java
|
UTF-8
|
Java
| false
| false
| 893
|
java
|
package br.com.tcc.ocorrencia.config;
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 SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
|
[
"edmar.silva@sicoob.com.br"
] |
edmar.silva@sicoob.com.br
|
8c64c5512de0f438d06c9dafb42c577b8bb2ae91
|
73fbcf91cc074954c28eb17ddcbeea3cf7e636ff
|
/CaminhoSeguro/src/MockData/MainMock.java
|
9df25f4d1bfb1c7ab78b9954da097991169cbbfd
|
[] |
no_license
|
emanuel1222/Caminho-Seguro-POO2
|
185f8db958362fcc78671a83a2eb5df68f7d178b
|
2d517049137885c9558ea753ac84c59d47f51b45
|
refs/heads/main
| 2023-07-23T09:49:50.472748
| 2021-08-31T19:51:45
| 2021-08-31T19:51:45
| 376,914,524
| 0
| 0
| null | 2021-08-03T14:02:43
| 2021-06-14T18:06:16
|
Java
|
UTF-8
|
Java
| false
| false
| 445
|
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 MockData;
/**
*
* @author vinic
*/
public class MainMock {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
MockData garcon = new MockData();
garcon.Iniciar();
}
}
|
[
"viniciusrocha28@gmail.com"
] |
viniciusrocha28@gmail.com
|
a50bfb998582f85e1f1cbabda7818a3b2d2856be
|
e8a309fd11b09e6bc17943041dc4f5268c48e87b
|
/src/main/java/com/xvitcoder/springmvcangularjs/model/OrderStatus.java
|
7998e5c10f1faed24cf1dbccd52465e27599cf4a
|
[] |
no_license
|
RIMS-team/NetCrackerProj_SA_v2
|
0edb9dd3a2a3bdf7a89ab009c30cb009152318ae
|
c8d4c685ff6f9a2f37f24cf106b6bb4036773bdd
|
refs/heads/master
| 2021-01-13T02:42:03.574222
| 2017-02-02T23:40:09
| 2017-02-02T23:40:09
| 77,183,978
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,043
|
java
|
package com.xvitcoder.springmvcangularjs.model;
/**
* Created by dell on 24-Nov-16.
*/
public class OrderStatus {
protected int id;
protected String code;
protected String name;
//protected String attrTypeCode; == 'ORD_STATUS'
public OrderStatus() {
}
public OrderStatus(int id, String code, String name) {
this.id = id;
this.code = code;
this.name = name;
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return id;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
// public void setAttrTypeCode(String attrTypeCode) {
// this.attrTypeCode = attrTypeCode;
// }
//
// public String getAttrTypeCode() {
// return attrTypeCode;
// }
public String toString() {
return "";
}
}
|
[
"a"
] |
a
|
c931e5c365c542c28b274dc5a2e9e79223bda7ce
|
84252cedb590b800850950d8f9ae200179afac66
|
/src/HoldemDealer.java
|
7a5034602b540f2e20609e830608cc5a36467777
|
[] |
no_license
|
dumel93/ProjectPokerJAVADesignPatterns
|
4e8f13569254afd400aa8ec75f7fff725d9b1790
|
716f1d2ce5a9cd7851665bf74ae53792e2405d10
|
refs/heads/master
| 2020-09-30T21:12:01.097985
| 2019-12-11T13:39:10
| 2019-12-11T13:39:10
| 227,374,436
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 796
|
java
|
import java.util.*;
public class HoldemDealer extends Dealer{
public HoldemDealer(){
super();
}
public HoldemDealer(String name){
super(name);
}
public void startHands(){
setDeck();
shuffleDeck();
setActivePlayers();
if( getAnte() > 0){
getAnteFromPlayer();
}
getBlindsFromPlayer();
getCard();
int currentNumPlayer = this.table.getCurrentNumPlayer();
int buttonPosition = this.table.getButtonPosition();
for (int i = 0; i < this.pokerGame.getNumPlayerCards(); i ++){
// Give first player
for (int j = 1; j <= this.table.getCurrentNumPlayer(); j++){
Card card = getCard();
this.table.getCurrentPlayers().get( (buttonPosition + j) % currentNumPlayer ).getPlayerHand().setCard(card);
}
}
setChanged();
notifyObservers();
}
}
|
[
"Ziomel19"
] |
Ziomel19
|
24d08624567778c2a4246fb01c8528e80441a92c
|
f0ea84990f90fbc62ba2f0f16846e3dd58378cf9
|
/minecraft/cn/Judgment/util/RenderUtil.java
|
361b1bd42e78e57762c45f2280eebc2329c39905
|
[] |
no_license
|
malcolm945/maldmeaf
|
75cbda463f6298443d462195ef8e487f22a65abb
|
9fb5a3dce9ad7563d4ba7c9eac0cc05c4f71b1cc
|
refs/heads/main
| 2022-12-24T05:29:06.247834
| 2020-10-04T14:02:10
| 2020-10-04T14:02:10
| 301,137,801
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 54,289
|
java
|
package cn.Judgment.util;
import java.awt.Color;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import org.lwjgl.opengl.ARBShaderObjects;
import org.lwjgl.opengl.EXTFramebufferObject;
import org.lwjgl.opengl.EXTPackedDepthStencil;
import org.lwjgl.opengl.GL11;
import com.mojang.authlib.GameProfile;
import cn.Judgment.events.EventRender;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.shader.Framebuffer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ResourceLocation;
public enum RenderUtil {
INSTANCE;
public static Minecraft mc = Minecraft.getMinecraft();
public static float delta;
public static void enableGL3D(float lineWidth) {
GL11.glDisable(3008);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glEnable(2884);
GL11.glEnable(2848);
GL11.glHint(3154, 4354);
GL11.glHint(3155, 4354);
GL11.glLineWidth(lineWidth);
}
public static void entityESPBox(Entity e, Color color, EventRender event) {
double posX = e.lastTickPosX + (e.posX - e.lastTickPosX) * (double)event.getPartialTicks() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double posY = e.lastTickPosY + (e.posY - e.lastTickPosY) * (double)event.getPartialTicks() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double posZ = e.lastTickPosZ + (e.posZ - e.lastTickPosZ) * (double)event.getPartialTicks() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
AxisAlignedBB box = AxisAlignedBB.fromBounds(posX - (double)e.width, posY, posZ - (double)e.width, posX + (double)e.width, posY + (double)e.height + 0.2, posZ + (double)e.width);
if (e instanceof EntityLivingBase) {
box = AxisAlignedBB.fromBounds(posX - (double)e.width + 0.2, posY, posZ - (double)e.width + 0.2, posX + (double)e.width - 0.2, posY + (double)e.height + (e.isSneaking() ? 0.02 : 0.2), posZ + (double)e.width - 0.2);
}
GL11.glLineWidth(1.0f);
GL11.glColor4f((float)((float)color.getRed() / 255.0f), (float)((float)color.getGreen() / 255.0f), (float)((float)color.getBlue() / 255.0f), (float)1f);
RenderUtil.drawOutlinedBoundingBox(box);
}
public static int rainbow(int delay) {
double rainbow = Math.ceil((double)(System.currentTimeMillis() + (long)delay) / 10.0);
return Color.getHSBColor((float)((rainbow %= 360.0) / 360.0), 0.7f, 1.0f).getRGB();
}
public static void disableGL3D() {
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDisable(3042);
GL11.glEnable(3008);
GL11.glDepthMask(true);
GL11.glCullFace(1029);
GL11.glDisable(2848);
GL11.glHint(3154, 4352);
GL11.glHint(3155, 4352);
}
public static void drawCircle(double x, double y, double radius, int c) {
float f2 = (float)(c >> 24 & 255) / 255.0f;
float f22 = (float)(c >> 16 & 255) / 255.0f;
float f3 = (float)(c >> 8 & 255) / 255.0f;
float f4 = (float)(c & 255) / 255.0f;
GlStateManager.alphaFunc(516, 0.001f);
GlStateManager.color(f22, f3, f4, f2);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
Tessellator tes = Tessellator.getInstance();
double i = 0.0;
while (i < 360.0) {
double f5 = Math.sin(i * 3.141592653589793 / 180.0) * radius;
double f6 = Math.cos(i * 3.141592653589793 / 180.0) * radius;
GL11.glVertex2d((double)((double)f3 + x), (double)((double)f4 + y));
i += 1.0;
}
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
GlStateManager.enableTexture2D();
GlStateManager.alphaFunc(516, 0.1f);
}
public static void drawFilledCircle(double x, double y, double r, int c, int id) {
float f = (float) (c >> 24 & 0xff) / 255F;
float f1 = (float) (c >> 16 & 0xff) / 255F;
float f2 = (float) (c >> 8 & 0xff) / 255F;
float f3 = (float) (c & 0xff) / 255F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor4f(f1, f2, f3, f);
GL11.glBegin(GL11.GL_POLYGON);
if (id == 1) {
GL11.glVertex2d(x, y);
for (int i = 0; i <= 90; i++) {
double x2 = Math.sin((i * 3.141526D / 180)) * r;
double y2 = Math.cos((i * 3.141526D / 180)) * r;
GL11.glVertex2d(x - x2, y - y2);
}
} else if (id == 2) {
GL11.glVertex2d(x, y);
for (int i = 90; i <= 180; i++) {
double x2 = Math.sin((i * 3.141526D / 180)) * r;
double y2 = Math.cos((i * 3.141526D / 180)) * r;
GL11.glVertex2d(x - x2, y - y2);
}
} else if (id == 3) {
GL11.glVertex2d(x, y);
for (int i = 270; i <= 360; i++) {
double x2 = Math.sin((i * 3.141526D / 180)) * r;
double y2 = Math.cos((i * 3.141526D / 180)) * r;
GL11.glVertex2d(x - x2, y - y2);
}
} else if (id == 4) {
GL11.glVertex2d(x, y);
for (int i = 180; i <= 270; i++) {
double x2 = Math.sin((i * 3.141526D / 180)) * r;
double y2 = Math.cos((i * 3.141526D / 180)) * r;
GL11.glVertex2d(x - x2, y - y2);
}
} else {
for (int i = 0; i <= 360; i++) {
double x2 = Math.sin((i * 3.141526D / 180)) * r;
double y2 = Math.cos((i * 3.141526D / 180)) * r;
GL11.glVertex2f((float) (x - x2), (float) (y - y2));
}
}
GL11.glEnd();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
}
public static void rectangle(double left, double top, double right, double bottom, int color)
{
if (left < right)
{
double var5 = left;
left = right;
right = var5;
}
if (top < bottom)
{
double var5 = top;
top = bottom;
bottom = var5;
}
float var11 = (color >> 24 & 0xFF) / 255.0F;
float var6 = (color >> 16 & 0xFF) / 255.0F;
float var7 = (color >> 8 & 0xFF) / 255.0F;
float var8 = (color & 0xFF) / 255.0F;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(var6, var7, var8, var11);
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(left, bottom, 0.0D).endVertex();
worldRenderer.pos(right, bottom, 0.0D).endVertex();
worldRenderer.pos(right, top, 0.0D).endVertex();
worldRenderer.pos(left, top, 0.0D).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
public static void drawGradientSideways(double left, double top, double right, double bottom, int col1, int col2)
{
float f = (col1 >> 24 & 0xFF) / 255.0F;
float f1 = (col1 >> 16 & 0xFF) / 255.0F;
float f2 = (col1 >> 8 & 0xFF) / 255.0F;
float f3 = (col1 & 0xFF) / 255.0F;
float f4 = (col2 >> 24 & 0xFF) / 255.0F;
float f5 = (col2 >> 16 & 0xFF) / 255.0F;
float f6 = (col2 >> 8 & 0xFF) / 255.0F;
float f7 = (col2 & 0xFF) / 255.0F;
GL11.glEnable(3042);
GL11.glDisable(3553);
GL11.glBlendFunc(770, 771);
GL11.glEnable(2848);
GL11.glShadeModel(7425);
GL11.glPushMatrix();
GL11.glBegin(7);
GL11.glColor4f(f1, f2, f3, f);
GL11.glVertex2d(left, top);
GL11.glVertex2d(left, bottom);
GL11.glColor4f(f5, f6, f7, f4);
GL11.glVertex2d(right, bottom);
GL11.glVertex2d(right, top);
GL11.glEnd();
GL11.glPopMatrix();
GL11.glEnable(3553);
GL11.glDisable(3042);
GL11.glDisable(2848);
GL11.glShadeModel(7424);
}
public static void rectangleBordered(double x, double y, double x1, double y1, double width, int internalColor, int borderColor)
{
rectangle(x + width, y + width, x1 - width, y1 - width, internalColor);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
rectangle(x + width, y, x1 - width, y + width, borderColor);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
rectangle(x, y, x + width, y1, borderColor);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
rectangle(x1 - width, y, x1, y1, borderColor);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
rectangle(x + width, y1 - width, x1 - width, y1, borderColor);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
public static void drawFullCircle(int cx, int cy, double r, int segments, float lineWidth, int part, int c) {
GL11.glScalef((float)0.5f, (float)0.5f, (float)0.5f);
r *= 2.0;
cx *= 2;
cy *= 2;
float f2 = (float)(c >> 24 & 255) / 255.0f;
float f22 = (float)(c >> 16 & 255) / 255.0f;
float f3 = (float)(c >> 8 & 255) / 255.0f;
float f4 = (float)(c & 255) / 255.0f;
GL11.glEnable((int)3042);
GL11.glLineWidth((float)lineWidth);
GL11.glDisable((int)3553);
GL11.glEnable((int)2848);
GL11.glBlendFunc((int)770, (int)771);
GL11.glColor4f((float)f22, (float)f3, (float)f4, (float)f2);
GL11.glBegin((int)3);
int i = segments - part;
while (i <= segments) {
double x = Math.sin((double)i * 3.141592653589793 / 180.0) * r;
double y = Math.cos((double)i * 3.141592653589793 / 180.0) * r;
GL11.glVertex2d((double)((double)cx + x), (double)((double)cy + y));
++i;
}
GL11.glEnd();
GL11.glDisable((int)2848);
GL11.glEnable((int)3553);
GL11.glDisable((int)3042);
GL11.glScalef((float)2.0f, (float)2.0f, (float)2.0f);
}
public static void drawBox(Box box) {
if (box == null) {
return;
}
// back
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.minX, box.minY, box.maxZ);
GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
GL11.glVertex3d(box.minX, box.minY, box.maxZ);
GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
GL11.glEnd();
// left
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.minX, box.minY, box.minZ);
GL11.glVertex3d(box.minX, box.minY, box.maxZ);
GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
GL11.glVertex3d(box.minX, box.maxY, box.minZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.minX, box.minY, box.maxZ);
GL11.glVertex3d(box.minX, box.minY, box.minZ);
GL11.glVertex3d(box.minX, box.maxY, box.minZ);
GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
GL11.glEnd();
// right
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
GL11.glVertex3d(box.maxX, box.minY, box.minZ);
GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.maxX, box.minY, box.minZ);
GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
GL11.glEnd();
// front
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.minX, box.minY, box.minZ);
GL11.glVertex3d(box.maxX, box.minY, box.minZ);
GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
GL11.glVertex3d(box.minX, box.maxY, box.minZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.maxX, box.minY, box.minZ);
GL11.glVertex3d(box.minX, box.minY, box.minZ);
GL11.glVertex3d(box.minX, box.maxY, box.minZ);
GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
GL11.glEnd();
// top
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.minX, box.maxY, box.minZ);
GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.maxX, box.maxY, box.minZ);
GL11.glVertex3d(box.minX, box.maxY, box.minZ);
GL11.glVertex3d(box.minX, box.maxY, box.maxZ);
GL11.glVertex3d(box.maxX, box.maxY, box.maxZ);
GL11.glEnd();
// bottom
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.minX, box.minY, box.minZ);
GL11.glVertex3d(box.maxX, box.minY, box.minZ);
GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
GL11.glVertex3d(box.minX, box.minY, box.maxZ);
GL11.glEnd();
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(box.maxX, box.minY, box.minZ);
GL11.glVertex3d(box.minX, box.minY, box.minZ);
GL11.glVertex3d(box.minX, box.minY, box.maxZ);
GL11.glVertex3d(box.maxX, box.minY, box.maxZ);
GL11.glEnd();
}
public static void glColor(int hex) {
float alpha = (hex >> 24 & 0xFF) / 255.0F;
float red = (hex >> 16 & 0xFF) / 255.0F;
float green = (hex >> 8 & 0xFF) / 255.0F;
float blue = (hex & 0xFF) / 255.0F;
GL11.glColor4f(red, green, blue, alpha);
}
public static double interpolate(double newPos, double oldPos) {
return oldPos + (newPos - oldPos) * (double)Minecraft.getMinecraft().timer.renderPartialTicks;
}
public static Color rainbowEffect(int delay) {
float hue = (float) (System.nanoTime() + delay) / 2.0E10F % 1.0F;
Color color = new Color((int) Long.parseLong(Integer.toHexString(Integer.valueOf(Color.HSBtoRGB(hue, 1.0F, 1.0F)).intValue()), 16));
return new Color(color.getRed() / 255.0F, color.getGreen() / 255.0F, color.getBlue() / 255.0F, color.getAlpha() / 255.0F);
}
public static void drawFullscreenImage(ResourceLocation image) {
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GL11.glDisable((int)2929);
GL11.glDepthMask((boolean)false);
OpenGlHelper.glBlendFunc((int)770, (int)771, (int)1, (int)0);
GL11.glColor4f((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
GL11.glDisable((int)3008);
Minecraft.getMinecraft().getTextureManager().bindTexture(image);
Gui.drawModalRectWithCustomSizedTexture((int)0, (int)0, (float)0.0f, (float)0.0f, (int)scaledResolution.getScaledWidth(), (int)scaledResolution.getScaledHeight(), (float)scaledResolution.getScaledWidth(), (float)scaledResolution.getScaledHeight());
GL11.glDepthMask((boolean)true);
GL11.glEnable((int)2929);
GL11.glEnable((int)3008);
GL11.glColor4f((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
}
public static void drawPlayerHead(String playerName, int x, int y, int width, int height) {
for (Object player : Minecraft.getMinecraft().theWorld.getLoadedEntityList()) {
if(player instanceof EntityPlayer) {
EntityPlayer ply = (EntityPlayer)player;
if (playerName.equalsIgnoreCase(ply.getName())) {
GameProfile profile = new GameProfile(ply.getUniqueID(), ply.getName());
NetworkPlayerInfo networkplayerinfo1 = new NetworkPlayerInfo(profile);
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GL11.glDisable((int)2929);
GL11.glEnable((int)3042);
GL11.glDepthMask((boolean)false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
Minecraft.getMinecraft().getTextureManager().bindTexture(networkplayerinfo1.getLocationSkin());
Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0f, 0.0f, width, height, width, height);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glEnable((int)2929);
}
}
}
}
public static double getAnimationState(double animation, double finalState, double speed) {
float add = (float) (0.01 * speed);
if (animation < finalState) {
if (animation + add < finalState)
animation += add;
else
animation = finalState;
} else {
if (animation - add > finalState)
animation -= add;
else
animation = finalState;
}
return animation;
}
public static String getShaderCode(InputStreamReader file) {
String shaderSource = "";
try {
String line;
BufferedReader reader = new BufferedReader((Reader)file);
while ((line = reader.readLine()) != null) {
shaderSource = String.valueOf((Object)shaderSource) + line + "\n";
}
reader.close();
}
catch (IOException e) {
e.printStackTrace();
System.exit((int)-1);
}
return shaderSource.toString();
}
public static void drawImage(ResourceLocation image, int x, int y, int width, int height) {
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GL11.glDisable((int)2929);
GL11.glEnable((int)3042);
GL11.glDepthMask((boolean)false);
OpenGlHelper.glBlendFunc((int)770, (int)771, (int)1, (int)0);
GL11.glColor4f((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
Minecraft.getMinecraft().getTextureManager().bindTexture(image);
Gui.drawModalRectWithCustomSizedTexture((int)x, (int)y, (float)0.0f, (float)0.0f, (int)width, (int)height, (float)width, (float)height);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glEnable((int)2929);
}
public static void drawOutlinedRect(int x, int y, int width, int height, int lineSize, Color lineColor, Color backgroundColor) {
RenderUtil.drawRect(x, y, width, height, backgroundColor.getRGB());
RenderUtil.drawRect(x, y, width, y + lineSize, lineColor.getRGB());
RenderUtil.drawRect(x, height - lineSize, width, height, lineColor.getRGB());
RenderUtil.drawRect(x, y + lineSize, x + lineSize, height - lineSize, lineColor.getRGB());
RenderUtil.drawRect(width - lineSize, y + lineSize, width, height - lineSize, lineColor.getRGB());
}
public static void drawImage(ResourceLocation image, int x, int y, int width, int height, Color color) {
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GL11.glDisable((int)2929);
GL11.glEnable((int)3042);
GL11.glDepthMask((boolean)false);
OpenGlHelper.glBlendFunc((int)770, (int)771, (int)1, (int)0);
GL11.glColor4f((float)((float)color.getRed() / 255.0f), (float)((float)color.getBlue() / 255.0f), (float)((float)color.getRed() / 255.0f), (float)1.0f);
Minecraft.getMinecraft().getTextureManager().bindTexture(image);
Gui.drawModalRectWithCustomSizedTexture((int)x, (int)y, (float)0.0f, (float)0.0f, (int)width, (int)height, (float)width, (float)height);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glEnable((int)2929);
}
public static void doGlScissor(int x, int y, int width, int height) {
Minecraft mc = Minecraft.getMinecraft();
int scaleFactor = 1;
int k = mc.gameSettings.guiScale;
if (k == 0) {
k = 1000;
}
while (scaleFactor < k && mc.displayWidth / (scaleFactor + 1) >= 320 && mc.displayHeight / (scaleFactor + 1) >= 240) {
++scaleFactor;
}
GL11.glScissor((int)(x * scaleFactor), (int)(mc.displayHeight - (y + height) * scaleFactor), (int)(width * scaleFactor), (int)(height * scaleFactor));
}
public static void drawRect(float x1, float y1, float x2, float y2, int color) {
GL11.glPushMatrix();
GL11.glEnable((int)3042);
GL11.glDisable((int)3553);
GL11.glBlendFunc((int)770, (int)771);
GL11.glEnable((int)2848);
GL11.glPushMatrix();
RenderUtil.color(color);
GL11.glBegin((int)7);
GL11.glVertex2d((double)x2, (double)y1);
GL11.glVertex2d((double)x1, (double)y1);
GL11.glVertex2d((double)x1, (double)y2);
GL11.glVertex2d((double)x2, (double)y2);
GL11.glEnd();
GL11.glPopMatrix();
GL11.glEnable((int)3553);
GL11.glDisable((int)3042);
GL11.glDisable((int)2848);
GL11.glPopMatrix();
}
public static void color(int color) {
float f = (float)(color >> 24 & 255) / 255.0f;
float f1 = (float)(color >> 16 & 255) / 255.0f;
float f2 = (float)(color >> 8 & 255) / 255.0f;
float f3 = (float)(color & 255) / 255.0f;
GL11.glColor4f((float)f1, (float)f2, (float)f3, (float)f);
}
public static int createShader(String shaderCode, int shaderType) throws Exception {
int shader;
block4 : {
shader = 0;
try {
shader = ARBShaderObjects.glCreateShaderObjectARB((int)shaderType);
if (shader != 0) break block4;
return 0;
}
catch (Exception exc) {
ARBShaderObjects.glDeleteObjectARB((int)shader);
throw exc;
}
}
ARBShaderObjects.glShaderSourceARB((int)shader, (CharSequence)shaderCode);
ARBShaderObjects.glCompileShaderARB((int)shader);
if (ARBShaderObjects.glGetObjectParameteriARB((int)shader, (int)35713) == 0) {
throw new RuntimeException("Error creating shader:");
}
return shader;
}
public void drawCircle(int x, int y, float radius, int color) {
float alpha = (float)(color >> 24 & 255) / 255.0f;
float red = (float)(color >> 16 & 255) / 255.0f;
float green = (float)(color >> 8 & 255) / 255.0f;
float blue = (float)(color & 255) / 255.0f;
boolean blend = GL11.glIsEnabled((int)3042);
boolean line = GL11.glIsEnabled((int)2848);
boolean texture = GL11.glIsEnabled((int)3553);
if (!blend) {
GL11.glEnable((int)3042);
}
if (!line) {
GL11.glEnable((int)2848);
}
if (texture) {
GL11.glDisable((int)3553);
}
GL11.glBlendFunc((int)770, (int)771);
GL11.glColor4f((float)red, (float)green, (float)blue, (float)alpha);
GL11.glBegin((int)9);
int i = 0;
while (i <= 360) {
GL11.glVertex2d((double)((double)x + Math.sin((double)((double)i * 3.141526 / 180.0)) * (double)radius), (double)((double)y + Math.cos((double)((double)i * 3.141526 / 180.0)) * (double)radius));
++i;
}
GL11.glEnd();
if (texture) {
GL11.glEnable((int)3553);
}
if (!line) {
GL11.glDisable((int)2848);
}
if (!blend) {
GL11.glDisable((int)3042);
}
}
public static void renderOne(float width) {
checkSetupFBO();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glLineWidth(width);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glEnable(GL11.GL_STENCIL_TEST);
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
GL11.glClearStencil(0xF);
GL11.glStencilFunc(GL11.GL_NEVER, 1, 0xF);
GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_REPLACE, GL11.GL_REPLACE);
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
}
public static void renderTwo() {
GL11.glStencilFunc(GL11.GL_NEVER, 0, 0xF);
GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_REPLACE, GL11.GL_REPLACE);
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
}
public static void renderThree() {
GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xF);
GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
}
public static void renderFour() {
setColor(new Color(255, 255, 255));
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_POLYGON_OFFSET_LINE);
GL11.glPolygonOffset(1.0F, -2000000F);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
}
public static void renderFive() {
GL11.glPolygonOffset(1.0F, 2000000F);
GL11.glDisable(GL11.GL_POLYGON_OFFSET_LINE);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_STENCIL_TEST);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_DONT_CARE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glPopAttrib();
}
public static void setColor(Color c) {
GL11.glColor4d(c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f, c.getAlpha() / 255f);
}
public static void checkSetupFBO() {
Framebuffer fbo = Minecraft.getMinecraft().getFramebuffer();
if (fbo != null) {
if (fbo.depthBuffer > -1) {
setupFBO(fbo);
fbo.depthBuffer = -1;
}
}
}
public static void setupFBO(Framebuffer fbo) {
EXTFramebufferObject.glDeleteRenderbuffersEXT(fbo.depthBuffer);
int stencil_depth_buffer_ID = EXTFramebufferObject.glGenRenderbuffersEXT();
EXTFramebufferObject.glBindRenderbufferEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, stencil_depth_buffer_ID);
EXTFramebufferObject.glRenderbufferStorageEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, EXTPackedDepthStencil.GL_DEPTH_STENCIL_EXT, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, stencil_depth_buffer_ID);
EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, stencil_depth_buffer_ID);
}
public static void drawOutlinedBoundingBox(AxisAlignedBB aa) {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
worldRenderer.begin(3, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
tessellator.draw();
worldRenderer.begin(3, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
tessellator.draw();
worldRenderer.begin(1, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
tessellator.draw();
}
public static void drawBoundingBox(AxisAlignedBB aa) {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(aa.minX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.maxZ).endVertex();
worldRenderer.pos(aa.minX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.minX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.minZ).endVertex();
worldRenderer.pos(aa.maxX, aa.maxY, aa.maxZ).endVertex();
worldRenderer.pos(aa.maxX, aa.minY, aa.maxZ).endVertex();
tessellator.draw();
}
public static void drawOutlinedBlockESP(double x, double y, double z, float red, float green, float blue, float alpha, float lineWidth) {
GL11.glPushMatrix();
GL11.glEnable((int)3042);
GL11.glBlendFunc((int)770, (int)771);
GL11.glDisable((int)3553);
GL11.glEnable((int)2848);
GL11.glDisable((int)2929);
GL11.glDepthMask((boolean)false);
GL11.glLineWidth((float)lineWidth);
GL11.glColor4f((float)red, (float)green, (float)blue, (float)alpha);
RenderUtil.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glDisable((int)2848);
GL11.glEnable((int)3553);
GL11.glEnable((int)2929);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glPopMatrix();
}
public static void drawBlockESP(double x, double y, double z, float red, float green, float blue, float alpha, float lineRed, float lineGreen, float lineBlue, float lineAlpha, float lineWidth) {
GL11.glPushMatrix();
GL11.glEnable((int)3042);
GL11.glBlendFunc((int)770, (int)771);
GL11.glDisable((int)2896);
GL11.glDisable((int)3553);
GL11.glEnable((int)2848);
GL11.glDisable((int)2929);
GL11.glDepthMask((boolean)false);
GL11.glColor4f((float)red, (float)green, (float)blue, (float)alpha);
RenderUtil.drawBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glLineWidth((float)lineWidth);
GL11.glColor4f((float)lineRed, (float)lineGreen, (float)lineBlue, (float)lineAlpha);
RenderUtil.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glDisable((int)2848);
GL11.glEnable((int)3553);
GL11.glEnable((int)2896);
GL11.glEnable((int)2929);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glPopMatrix();
}
public static void drawSolidBlockESP(double x, double y, double z, float red, float green, float blue, float alpha) {
GL11.glPushMatrix();
GL11.glEnable((int)3042);
GL11.glBlendFunc((int)770, (int)771);
GL11.glDisable((int)3553);
GL11.glEnable((int)2848);
GL11.glDisable((int)2929);
GL11.glDepthMask((boolean)false);
GL11.glColor4f((float)red, (float)green, (float)blue, (float)alpha);
RenderUtil.drawBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glColor3f(1, 1, 1);
GL11.glDisable((int)2848);
GL11.glEnable((int)3553);
GL11.glEnable((int)2929);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glPopMatrix();
}
public static void drawOutlinedEntityESP(double x, double y, double z, double width, double height, float red, float green, float blue, float alpha) {
GL11.glPushMatrix();
GL11.glEnable((int)3042);
GL11.glBlendFunc((int)770, (int)771);
GL11.glDisable((int)3553);
GL11.glEnable((int)2848);
GL11.glDisable((int)2929);
GL11.glDepthMask((boolean)false);
GL11.glColor4f((float)red, (float)green, (float)blue, (float)alpha);
RenderUtil.drawOutlinedBoundingBox(new AxisAlignedBB(x - width, y, z - width, x + width, y + height, z + width));
GL11.glDisable((int)2848);
GL11.glEnable((int)3553);
GL11.glEnable((int)2929);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glPopMatrix();
}
public static void drawSolidEntityESP(double x, double y, double z, double width, double height, float red, float green, float blue, float alpha) {
GL11.glPushMatrix();
GL11.glEnable((int)3042);
GL11.glBlendFunc((int)770, (int)771);
GL11.glDisable((int)3553);
GL11.glEnable((int)2848);
GL11.glDisable((int)2929);
GL11.glDepthMask((boolean)false);
GL11.glColor4f((float)red, (float)green, (float)blue, (float)alpha);
RenderUtil.drawBoundingBox(new AxisAlignedBB(x - width, y, z - width, x + width, y + height, z + width));
GL11.glDisable((int)2848);
GL11.glEnable((int)3553);
GL11.glEnable((int)2929);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glPopMatrix();
}
public static void drawEntityESP(double x, double y, double z, double width, double height, float red, float green, float blue, float alpha, float lineRed, float lineGreen, float lineBlue, float lineAlpha, float lineWdith) {
GL11.glPushMatrix();
GL11.glEnable((int)3042);
GL11.glBlendFunc((int)770, (int)771);
GL11.glDisable((int)3553);
GL11.glEnable((int)2848);
GL11.glDisable((int)2929);
GL11.glDepthMask((boolean)false);
GL11.glColor4f((float)red, (float)green, (float)blue, (float)alpha);
RenderUtil.drawBoundingBox(new AxisAlignedBB(x - width, y, z - width, x + width, y + height, z + width));
GL11.glLineWidth((float)lineWdith);
GL11.glColor4f((float)lineRed, (float)lineGreen, (float)lineBlue, (float)lineAlpha);
RenderUtil.drawOutlinedBoundingBox(new AxisAlignedBB(x - width, y, z - width, x + width, y + height, z + width));
GL11.glDisable((int)2848);
GL11.glEnable((int)3553);
GL11.glEnable((int)2929);
GL11.glDepthMask((boolean)true);
GL11.glDisable((int)3042);
GL11.glPopMatrix();
}
public static void drawEntityESP(double x, double y, double z, double width, double height, float red, float green, float blue, float alpha) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(770, 771);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4f(red, green, blue, alpha);
drawBoundingBox(new AxisAlignedBB(x - width, y, z - width, x + width , y + height, z + width));
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
private static void glColor(Color color) {
GL11.glColor4f(color.getRed() / 255.0F, color.getGreen() / 255.0F, color.getBlue() / 255.0F, color.getAlpha() / 255.0F);
}
public static void drawFilledBox(AxisAlignedBB mask) {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(mask.minX, mask.minY, mask.minZ).endVertex();
worldRenderer.pos(mask.minX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.maxZ);
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(mask.maxX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.minZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.minX, mask.minY, mask.minZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.maxZ);
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(mask.minX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.minZ);
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(mask.minX, mask.minY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.minY, mask.minZ);
worldRenderer.pos(mask.minX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.minZ);
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(mask.minX, mask.minY, mask.minZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.minX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.minZ);
tessellator.draw();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(mask.minX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.minY, mask.maxZ);
worldRenderer.pos(mask.minX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.minX, mask.minY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.minZ);
worldRenderer.pos(mask.maxX, mask.maxY, mask.maxZ);
worldRenderer.pos(mask.maxX, mask.minY, mask.maxZ);
tessellator.draw();
}
public static void drawRoundedRect(float x, float y, float x2, float y2, final float round, final int color) {
x += (float)(round / 2.0f + 0.5);
y += (float)(round / 2.0f + 0.5);
x2 -= (float)(round / 2.0f + 0.5);
y2 -= (float)(round / 2.0f + 0.5);
Gui.drawRect((int)x, (int)y, (int)x2, (int)y2, color);
circle(x2 - round / 2.0f, y + round / 2.0f, round, color);
circle(x + round / 2.0f, y2 - round / 2.0f, round, color);
circle(x + round / 2.0f, y + round / 2.0f, round, color);
circle(x2 - round / 2.0f, y2 - round / 2.0f, round, color);
Gui.drawRect((int)(x - round / 2.0f - 0.5f), (int)(y + round / 2.0f), (int)x2, (int)(y2 - round / 2.0f), color);
Gui.drawRect((int)x, (int)(y + round / 2.0f), (int)(x2 + round / 2.0f + 0.5f), (int)(y2 - round / 2.0f), color);
Gui.drawRect((int)(x + round / 2.0f), (int)(y - round / 2.0f - 0.5f), (int)(x2 - round / 2.0f), (int)(y2 - round / 2.0f), color);
Gui.drawRect((int)(x + round / 2.0f), (int)y, (int)(x2 - round / 2.0f), (int)(y2 + round / 2.0f + 0.5f), color);
}
public static void circle(final float x, final float y, final float radius, final int fill) {
arc(x, y, 0.0f, 360.0f, radius, fill);
}
public static void circle(final float x, final float y, final float radius, final Color fill) {
arc(x, y, 0.0f, 360.0f, radius, fill);
}
public static void arc(final float x, final float y, final float start, final float end, final float radius, final int color) {
arcEllipse(x, y, start, end, radius, radius, color);
}
public static void arc(final float x, final float y, final float start, final float end, final float radius, final Color color) {
arcEllipse(x, y, start, end, radius, radius, color);
}
public static void arcEllipse(final float x, final float y, float start, float end, final float w, final float h, final int color) {
GlStateManager.color(0.0f, 0.0f, 0.0f);
GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.0f);
float temp = 0.0f;
if (start > end) {
temp = end;
end = start;
start = temp;
}
final float var11 = (color >> 24 & 0xFF) / 255.0f;
final float var12 = (color >> 16 & 0xFF) / 255.0f;
final float var13 = (color >> 8 & 0xFF) / 255.0f;
final float var14 = (color & 0xFF) / 255.0f;
final Tessellator var15 = Tessellator.getInstance();
final WorldRenderer var16 = var15.getWorldRenderer();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(var12, var13, var14, var11);
if (var11 > 0.5f) {
GL11.glEnable(2848);
GL11.glLineWidth(2.0f);
GL11.glBegin(3);
for (float i = end; i >= start; i -= 4.0f) {
final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * w * 1.001f;
final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * h * 1.001f;
GL11.glVertex2f(x + ldx, y + ldy);
}
GL11.glEnd();
GL11.glDisable(2848);
}
GL11.glBegin(6);
for (float i = end; i >= start; i -= 4.0f) {
final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * w;
final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * h;
GL11.glVertex2f(x + ldx, y + ldy);
}
GL11.glEnd();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}
public static void arcEllipse(final float x, final float y, float start, float end, final float w, final float h, final Color color) {
GlStateManager.color(0.0f, 0.0f, 0.0f);
GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.0f);
float temp = 0.0f;
if (start > end) {
temp = end;
end = start;
start = temp;
}
final Tessellator var9 = Tessellator.getInstance();
final WorldRenderer var10 = var9.getWorldRenderer();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, color.getAlpha() / 255.0f);
if (color.getAlpha() > 0.5f) {
GL11.glEnable(2848);
GL11.glLineWidth(2.0f);
GL11.glBegin(3);
for (float i = end; i >= start; i -= 4.0f) {
final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * w * 1.001f;
final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * h * 1.001f;
GL11.glVertex2f(x + ldx, y + ldy);
}
GL11.glEnd();
GL11.glDisable(2848);
}
GL11.glBegin(6);
for (float i = end; i >= start; i -= 4.0f) {
final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * w;
final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * h;
GL11.glVertex2f(x + ldx, y + ldy);
}
GL11.glEnd();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}
public static void pre() {
GL11.glDisable(2929);
GL11.glDisable(3553);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
}
public static void post() {
GL11.glDisable(3042);
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glColor3d(1.0, 1.0, 1.0);
}
public static void drawBorderedRect(final float x, final float y, final float x2, final float y2, final float l1, final int col1, final int col2) {
Gui.drawRect(x, y, x2, y2, col2);
final float f = (col1 >> 24 & 0xFF) / 255.0f;
final float f2 = (col1 >> 16 & 0xFF) / 255.0f;
final float f3 = (col1 >> 8 & 0xFF) / 255.0f;
final float f4 = (col1 & 0xFF) / 255.0f;
GL11.glEnable(3042);
GL11.glDisable(3553);
GL11.glBlendFunc(770, 771);
GL11.glEnable(2848);
GL11.glPushMatrix();
GL11.glColor4f(f2, f3, f4, f);
GL11.glLineWidth(l1);
GL11.glBegin(1);
GL11.glVertex2d((double)x, (double)y);
GL11.glVertex2d((double)x, (double)y2);
GL11.glVertex2d((double)x2, (double)y2);
GL11.glVertex2d((double)x2, (double)y);
GL11.glVertex2d((double)x, (double)y);
GL11.glVertex2d((double)x2, (double)y);
GL11.glVertex2d((double)x, (double)y2);
GL11.glVertex2d((double)x2, (double)y2);
GL11.glEnd();
GL11.glPopMatrix();
GL11.glEnable(3553);
GL11.glDisable(3042);
GL11.glDisable(2848);
}
public static int width() {
return new ScaledResolution(Minecraft.getMinecraft()).getScaledWidth();
}
public static int height() {
return new ScaledResolution(Minecraft.getMinecraft()).getScaledHeight();
}
public static void drawFastRoundedRect(float x0, float y0, float x1, float y1, float radius, int color) {
int Semicircle = 18;
float f = 5.0f;
float f2 = (float)(color >> 24 & 0xFF) / 255.0f;
float f3 = (float)(color >> 16 & 0xFF) / 255.0f;
float f4 = (float)(color >> 8 & 0xFF) / 255.0f;
float f5 = (float)(color & 0xFF) / 255.0f;
GL11.glDisable(2884);
GL11.glDisable(3553);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(f3, f4, f5, f2);
GL11.glBegin(5);
GL11.glVertex2f(x0 + radius, y0);
GL11.glVertex2f(x0 + radius, y1);
GL11.glVertex2f(x1 - radius, y0);
GL11.glVertex2f(x1 - radius, y1);
GL11.glEnd();
GL11.glBegin(5);
GL11.glVertex2f(x0, y0 + radius);
GL11.glVertex2f(x0 + radius, y0 + radius);
GL11.glVertex2f(x0, y1 - radius);
GL11.glVertex2f(x0 + radius, y1 - radius);
GL11.glEnd();
GL11.glBegin(5);
GL11.glVertex2f(x1, y0 + radius);
GL11.glVertex2f(x1 - radius, y0 + radius);
GL11.glVertex2f(x1, y1 - radius);
GL11.glVertex2f(x1 - radius, y1 - radius);
GL11.glEnd();
GL11.glBegin(6);
float f6 = x1 - radius;
float f7 = y0 + radius;
GL11.glVertex2f(f6, f7);
int j = 0;
for (j = 0; j <= 18; ++j) {
float f8 = (float)j * 5.0f;
GL11.glVertex2f((float)((double)f6 + (double)radius * Math.cos(Math.toRadians(f8))), (float)((double)f7 - (double)radius * Math.sin(Math.toRadians(f8))));
}
GL11.glEnd();
GL11.glBegin(6);
f6 = x0 + radius;
f7 = y0 + radius;
GL11.glVertex2f(f6, f7);
for (j = 0; j <= 18; ++j) {
float f9 = (float)j * 5.0f;
GL11.glVertex2f((float)((double)f6 - (double)radius * Math.cos(Math.toRadians(f9))), (float)((double)f7 - (double)radius * Math.sin(Math.toRadians(f9))));
}
GL11.glEnd();
GL11.glBegin(6);
f6 = x0 + radius;
f7 = y1 - radius;
GL11.glVertex2f(f6, f7);
for (j = 0; j <= 18; ++j) {
float f10 = (float)j * 5.0f;
GL11.glVertex2f((float)((double)f6 - (double)radius * Math.cos(Math.toRadians(f10))), (float)((double)f7 + (double)radius * Math.sin(Math.toRadians(f10))));
}
GL11.glEnd();
GL11.glBegin(6);
f6 = x1 - radius;
f7 = y1 - radius;
GL11.glVertex2f(f6, f7);
for (j = 0; j <= 18; ++j) {
float f11 = (float)j * 5.0f;
GL11.glVertex2f((float)((double)f6 + (double)radius * Math.cos(Math.toRadians(f11))), (float)((double)f7 + (double)radius * Math.sin(Math.toRadians(f11))));
}
GL11.glEnd();
GL11.glEnable(3553);
GL11.glEnable(2884);
GL11.glDisable(3042);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}
public static void startDrawing() {
GL11.glEnable(3042);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(2848);
GL11.glDisable(3553);
GL11.glDisable(2929);
Minecraft.getMinecraft().entityRenderer.setupCameraTransform(Minecraft.getMinecraft().timer.renderPartialTicks, 0);
}
public static void stopDrawing() {
GL11.glDisable(3042);
GL11.glEnable(3553);
GL11.glDisable(2848);
GL11.glDisable(3042);
GL11.glEnable(2929);
}
}
|
[
"zichen315460@163.com"
] |
zichen315460@163.com
|
444c9c76e01e2bfd7c659c57e44fe216dba87894
|
2f273dfd4c3c24ecd39d03bd8789301acae6a11a
|
/skin-support/src/main/java/skin/support/widget/SkinCompatMultiAutoCompleteTextView.java
|
a129b5c075d22334e3c18344068af9b619b2dd4e
|
[
"MIT"
] |
permissive
|
lixiangAndroid/Android-skin-support
|
e3883ef4973eb4bf87f0387f7262459d3cfd665b
|
75b64a56369515fe7e959c2c948f9d5c4cc67128
|
refs/heads/master
| 2021-06-12T13:36:36.781434
| 2017-04-13T11:26:33
| 2017-04-13T11:26:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,363
|
java
|
package skin.support.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.DrawableRes;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.widget.AppCompatMultiAutoCompleteTextView;
import android.support.v7.widget.TintTypedArray;
import android.util.AttributeSet;
import skin.support.R;
import skin.support.content.res.SkinCompatResources;
import static skin.support.widget.SkinCompatHelper.INVALID_ID;
/**
* Created by ximsfei on 17-1-14.
*/
public class SkinCompatMultiAutoCompleteTextView extends AppCompatMultiAutoCompleteTextView implements SkinCompatSupportable {
private static final int[] TINT_ATTRS = {
android.R.attr.popupBackground
};
private int mDropDownBackgroundResId = INVALID_ID;
private SkinCompatTextHelper mTextHelper;
private SkinCompatBackgroundHelper mBackgroundTintHelper;
public SkinCompatMultiAutoCompleteTextView(Context context) {
this(context, null);
}
public SkinCompatMultiAutoCompleteTextView(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.editTextStyle);
}
public SkinCompatMultiAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
TINT_ATTRS, defStyleAttr, 0);
if (a.hasValue(0)) {
mDropDownBackgroundResId = a.getResourceId(0, INVALID_ID);
}
a.recycle();
applyDropDownBackgroundResource();
mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
mTextHelper = SkinCompatTextHelper.create(this);
mTextHelper.loadFromAttributes(attrs, defStyleAttr);
}
@Override
public void setDropDownBackgroundResource(@DrawableRes int resId) {
super.setDropDownBackgroundResource(resId);
mDropDownBackgroundResId = resId;
applyDropDownBackgroundResource();
}
private void applyDropDownBackgroundResource() {
mDropDownBackgroundResId = SkinCompatHelper.checkResourceId(mDropDownBackgroundResId);
if (mDropDownBackgroundResId != INVALID_ID) {
String typeName = getResources().getResourceTypeName(mDropDownBackgroundResId);
if ("color".equals(typeName)) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
int color = SkinCompatResources.getInstance().getColor(mDropDownBackgroundResId);
setDrawingCacheBackgroundColor(color);
} else {
ColorStateList colorStateList =
SkinCompatResources.getInstance().getColorStateList(mDropDownBackgroundResId);
Drawable drawable = getDropDownBackground();
DrawableCompat.setTintList(drawable, colorStateList);
setDropDownBackgroundDrawable(drawable);
}
} else if ("drawable".equals(typeName)) {
Drawable drawable = SkinCompatResources.getInstance().getDrawable(mDropDownBackgroundResId);
setDropDownBackgroundDrawable(drawable);
} else if ("mipmap".equals(typeName)) {
Drawable drawable = SkinCompatResources.getInstance().getMipmap(mDropDownBackgroundResId);
setDropDownBackgroundDrawable(drawable);
}
}
}
@Override
public void setBackgroundResource(@DrawableRes int resId) {
super.setBackgroundResource(resId);
if (mBackgroundTintHelper != null) {
mBackgroundTintHelper.onSetBackgroundResource(resId);
}
}
@Override
public void setTextAppearance(int resId) {
setTextAppearance(getContext(), resId);
}
@Override
public void setTextAppearance(Context context, int resId) {
super.setTextAppearance(context, resId);
if (mTextHelper != null) {
mTextHelper.onSetTextAppearance(context, resId);
}
}
@Override
public void setCompoundDrawablesRelativeWithIntrinsicBounds(
@DrawableRes int start, @DrawableRes int top, @DrawableRes int end, @DrawableRes int bottom) {
super.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom);
if (mTextHelper != null) {
mTextHelper.onSetCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom);
}
}
@Override
public void setCompoundDrawablesWithIntrinsicBounds(
@DrawableRes int left, @DrawableRes int top, @DrawableRes int right, @DrawableRes int bottom) {
super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom);
if (mTextHelper != null) {
mTextHelper.onSetCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom);
}
}
@Override
public void applySkin() {
if (mBackgroundTintHelper != null) {
mBackgroundTintHelper.applySkin();
}
if (mTextHelper != null) {
mTextHelper.applySkin();
}
applyDropDownBackgroundResource();
}
}
|
[
"550616352@qq.com"
] |
550616352@qq.com
|
21296b0c4ca78106d5f3fd1e889fcbfc82765fa9
|
9c8f45203fe0eb9bc337ddc583daf716a67080e5
|
/public/transactions-jta/src/main/java/com/atomikos/datasource/pool/XPooledConnectionEventListener.java
|
338e178d6e27b40cbf494dc865271bd044abd43d
|
[] |
no_license
|
ragnel/transactions-essentials
|
f26cb108c44c0db0c33f75b53837ed20032c31b5
|
909422b15000a44088ea09a6f112da9f9cd39c6b
|
refs/heads/master
| 2023-08-10T15:24:36.945005
| 2023-05-05T13:45:11
| 2023-05-05T13:45:11
| 136,076,751
| 0
| 0
| null | 2018-06-04T20:06:07
| 2018-06-04T20:06:07
| null |
UTF-8
|
Java
| false
| false
| 471
|
java
|
/**
* Copyright (C) 2000-2023 Atomikos <info@atomikos.com>
*
* LICENSE CONDITIONS
*
* See http://www.atomikos.com/Main/WhichLicenseApplies for details.
*/
package com.atomikos.datasource.pool;
public interface XPooledConnectionEventListener<ConnectionType>
{
/**
* fired when a connection changed its state to terminated
* @param connection
*/
void onXPooledConnectionTerminated(XPooledConnection<ConnectionType> connection);
}
|
[
"guy@atomikos.com"
] |
guy@atomikos.com
|
cdfab078c05798155dd54039b1c4efd5a91d273a
|
c1017aec396da5e2739dafab843bdfa39d38af69
|
/junit_train/02-项目/02-TDD/LeapYearProject/src/LeapYearTestCase.java
|
ea2768d316adfb0d7aeb5f0a302018aa4dd9c01c
|
[] |
no_license
|
gin2010/java
|
76b383157c22cc4120ee908ebfbaa07cc3cbf40e
|
128ba234d47ae54c8de8673d42abeb9080da4b33
|
refs/heads/master
| 2020-06-23T06:28:30.131468
| 2019-10-11T07:14:41
| 2019-10-11T07:14:41
| 198,543,785
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,294
|
java
|
import static org.junit.Assert.*;
import org.junit.Test;
public class LeapYearTestCase {
/*
*
* 在20世纪和21世纪,这是一个列表的所有闰年:
1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, 1948,
1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996,
2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044,
2048, 2052, 2056, 2060, 2064, 2068, 2072, 2076, 2080, 2084, 2088, 2092, 2096
*/
@Test
public void TestThat_IsLeapYear()
{
// 第一步先实现 1996是典型的闰年
int typicalLeapYear = 1996;
boolean isLeapYear = LeapYearCalculator.isLeapYear(typicalLeapYear);
assertTrue(isLeapYear);
/*
int typicalCommonYear = 2001;
isLeapYear = LeapYearCalculator.isLeapYear(typicalCommonYear);
assertFalse(isLeapYear);
*/
/*
int atypicalLeapYear = 2000;
isLeapYear = LeapYearCalculator.isLeapYear(atypicalLeapYear );
assertTrue(isLeapYear);
*/
/*
int atypicalCommonYear = 1900;
isLeapYear = LeapYearCalculator.isLeapYear(atypicalCommonYear );
assertFalse(isLeapYear);
*/
}
}
|
[
"gin2010@yeah.net"
] |
gin2010@yeah.net
|
03112932f429c157b5216fcb0a34dbc7317440f9
|
2ace134c2896c207f53f61c7b38637a58ba88123
|
/src/main/java/dahuashejimoshi/strategy/TaxType.java
|
419bb6fd26aed2e24c8f53e9cff2f0ba4e7a89ae
|
[] |
no_license
|
zhaojiatao/javase
|
7e70f7459dd8c00c9f2abf423a36e9e5a8ddb61f
|
a53f8232abf76ffc68470c925a6cf4604aa8cb84
|
refs/heads/master
| 2022-12-22T10:41:41.665529
| 2022-09-28T09:15:38
| 2022-09-28T09:15:38
| 147,178,977
| 0
| 0
| null | 2022-12-16T11:39:12
| 2018-09-03T09:03:00
|
Java
|
UTF-8
|
Java
| false
| false
| 94
|
java
|
package dahuashejimoshi.strategy;
// 税类型定义
public enum TaxType {
INTER, OUTER
}
|
[
"jtzhao@ichint.com"
] |
jtzhao@ichint.com
|
2e3113a84cc63aa0300d5c403ba08d5d07af3511
|
b26071317013872bd7e4e22f84b62541129461ca
|
/library/src/main/java/com/google/android/exoplayer/DefaultLoadControl.java
|
c57dff8c958df683064dce26860b3324aa8871bf
|
[
"Apache-2.0"
] |
permissive
|
brightcove/ExoPlayer
|
3956adb0c85749705f55890fd2a487d80230d91c
|
5e74b70afdb4af0e04b93e2ed84f2d9f96a0c6fd
|
refs/heads/master
| 2021-12-14T01:20:41.975664
| 2017-08-07T19:30:05
| 2017-08-07T19:30:05
| 62,909,191
| 3
| 0
|
Apache-2.0
| 2021-12-02T16:43:16
| 2016-07-08T18:30:49
|
Java
|
UTF-8
|
Java
| false
| false
| 10,664
|
java
|
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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.google.android.exoplayer;
import android.os.Handler;
import com.google.android.exoplayer.upstream.Allocator;
import com.google.android.exoplayer.upstream.NetworkLock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* A {@link LoadControl} implementation that allows loads to continue in a sequence that prevents
* any loader from getting too far ahead or behind any of the other loaders.
* <p>
* Loads are scheduled so as to fill the available buffer space as rapidly as possible. Once the
* duration of buffered media and the buffer utilization both exceed respective thresholds, the
* control switches to a draining state during which no loads are permitted to start. During
* draining periods, resources such as the device radio have an opportunity to switch into low
* power modes. The control reverts back to the loading state when either the duration of buffered
* media or the buffer utilization fall below respective thresholds.
* <p>
* This implementation of {@link LoadControl} integrates with {@link NetworkLock}, by registering
* itself as a task with priority {@link NetworkLock#STREAMING_PRIORITY} during loading periods,
* and unregistering itself during draining periods.
*/
public final class DefaultLoadControl implements LoadControl {
/**
* Interface definition for a callback to be notified of {@link DefaultLoadControl} events.
*/
public interface EventListener {
/**
* Invoked when the control transitions from a loading to a draining state, or vice versa.
*
* @param loading Whether the control is now in a loading state.
*/
void onLoadingChanged(boolean loading);
}
public static final int DEFAULT_LOW_WATERMARK_MS = 15000;
public static final int DEFAULT_HIGH_WATERMARK_MS = 30000;
public static final float DEFAULT_LOW_BUFFER_LOAD = 0.2f;
public static final float DEFAULT_HIGH_BUFFER_LOAD = 0.8f;
private static final int ABOVE_HIGH_WATERMARK = 0;
private static final int BETWEEN_WATERMARKS = 1;
private static final int BELOW_LOW_WATERMARK = 2;
private final Allocator allocator;
private final List<Object> loaders;
private final HashMap<Object, LoaderState> loaderStates;
private final Handler eventHandler;
private final EventListener eventListener;
private final long lowWatermarkUs;
private final long highWatermarkUs;
private final float lowBufferLoad;
private final float highBufferLoad;
private int targetBufferSize;
private long maxLoadStartPositionUs;
private int bufferState;
private boolean fillingBuffers;
private boolean streamingPrioritySet;
/**
* Constructs a new instance, using the {@code DEFAULT_*} constants defined in this class.
*
* @param allocator The {@link Allocator} used by the loader.
*/
public DefaultLoadControl(Allocator allocator) {
this(allocator, null, null);
}
/**
* Constructs a new instance, using the {@code DEFAULT_*} constants defined in this class.
*
* @param allocator The {@link Allocator} used by the loader.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
*/
public DefaultLoadControl(Allocator allocator, Handler eventHandler,
EventListener eventListener) {
this(allocator, eventHandler, eventListener, DEFAULT_LOW_WATERMARK_MS,
DEFAULT_HIGH_WATERMARK_MS, DEFAULT_LOW_BUFFER_LOAD, DEFAULT_HIGH_BUFFER_LOAD);
}
/**
* Constructs a new instance.
*
* @param allocator The {@link Allocator} used by the loader.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @param lowWatermarkMs The minimum duration of media that can be buffered for the control to
* be in the draining state. If less media is buffered, then the control will transition to
* the filling state.
* @param highWatermarkMs The minimum duration of media that can be buffered for the control to
* transition from filling to draining.
* @param lowBufferLoad The minimum fraction of the buffer that must be utilized for the control
* to be in the draining state. If the utilization is lower, then the control will transition
* to the filling state.
* @param highBufferLoad The minimum fraction of the buffer that must be utilized for the control
* to transition from the loading state to the draining state.
*/
public DefaultLoadControl(Allocator allocator, Handler eventHandler, EventListener eventListener,
int lowWatermarkMs, int highWatermarkMs, float lowBufferLoad, float highBufferLoad) {
this.allocator = allocator;
this.eventHandler = eventHandler;
this.eventListener = eventListener;
this.loaders = new ArrayList<>();
this.loaderStates = new HashMap<>();
this.lowWatermarkUs = lowWatermarkMs * 1000L;
this.highWatermarkUs = highWatermarkMs * 1000L;
this.lowBufferLoad = lowBufferLoad;
this.highBufferLoad = highBufferLoad;
}
@Override
public void register(Object loader, int bufferSizeContribution) {
loaders.add(loader);
loaderStates.put(loader, new LoaderState(bufferSizeContribution));
targetBufferSize += bufferSizeContribution;
}
@Override
public void unregister(Object loader) {
loaders.remove(loader);
LoaderState state = loaderStates.remove(loader);
targetBufferSize -= state.bufferSizeContribution;
updateControlState();
}
@Override
public void trimAllocator() {
allocator.trim(targetBufferSize);
}
@Override
public Allocator getAllocator() {
return allocator;
}
@Override
public boolean update(Object loader, long playbackPositionUs, long nextLoadPositionUs,
boolean loading) {
// Update the loader state.
int loaderBufferState = getLoaderBufferState(playbackPositionUs, nextLoadPositionUs);
LoaderState loaderState = loaderStates.get(loader);
boolean loaderStateChanged = loaderState.bufferState != loaderBufferState
|| loaderState.nextLoadPositionUs != nextLoadPositionUs || loaderState.loading != loading;
if (loaderStateChanged) {
loaderState.bufferState = loaderBufferState;
loaderState.nextLoadPositionUs = nextLoadPositionUs;
loaderState.loading = loading;
}
// Update the buffer state.
int currentBufferSize = allocator.getTotalBytesAllocated();
int bufferState = getBufferState(currentBufferSize);
boolean bufferStateChanged = this.bufferState != bufferState;
if (bufferStateChanged) {
this.bufferState = bufferState;
}
// If either of the individual states have changed, update the shared control state.
if (loaderStateChanged || bufferStateChanged) {
updateControlState();
}
return nextLoadPositionUs != -1 && nextLoadPositionUs <= maxLoadStartPositionUs;
}
private int getLoaderBufferState(long playbackPositionUs, long nextLoadPositionUs) {
if (nextLoadPositionUs == -1) {
return ABOVE_HIGH_WATERMARK;
} else {
long timeUntilNextLoadPosition = nextLoadPositionUs - playbackPositionUs;
return timeUntilNextLoadPosition > highWatermarkUs ? ABOVE_HIGH_WATERMARK :
timeUntilNextLoadPosition < lowWatermarkUs ? BELOW_LOW_WATERMARK :
BETWEEN_WATERMARKS;
}
}
private int getBufferState(int currentBufferSize) {
float bufferLoad = (float) currentBufferSize / targetBufferSize;
return bufferLoad > highBufferLoad ? ABOVE_HIGH_WATERMARK
: bufferLoad < lowBufferLoad ? BELOW_LOW_WATERMARK
: BETWEEN_WATERMARKS;
}
private void updateControlState() {
boolean loading = false;
boolean haveNextLoadPosition = false;
int highestState = bufferState;
for (int i = 0; i < loaders.size(); i++) {
LoaderState loaderState = loaderStates.get(loaders.get(i));
loading |= loaderState.loading;
haveNextLoadPosition |= loaderState.nextLoadPositionUs != -1;
highestState = Math.max(highestState, loaderState.bufferState);
}
fillingBuffers = !loaders.isEmpty() && (loading || haveNextLoadPosition)
&& (highestState == BELOW_LOW_WATERMARK
|| (highestState == BETWEEN_WATERMARKS && fillingBuffers));
if (fillingBuffers && !streamingPrioritySet) {
NetworkLock.instance.add(NetworkLock.STREAMING_PRIORITY);
streamingPrioritySet = true;
notifyLoadingChanged(true);
} else if (!fillingBuffers && streamingPrioritySet && !loading) {
NetworkLock.instance.remove(NetworkLock.STREAMING_PRIORITY);
streamingPrioritySet = false;
notifyLoadingChanged(false);
}
maxLoadStartPositionUs = -1;
if (fillingBuffers) {
for (int i = 0; i < loaders.size(); i++) {
Object loader = loaders.get(i);
LoaderState loaderState = loaderStates.get(loader);
long loaderTime = loaderState.nextLoadPositionUs;
if (loaderTime != -1
&& (maxLoadStartPositionUs == -1 || loaderTime < maxLoadStartPositionUs)) {
maxLoadStartPositionUs = loaderTime;
}
}
}
}
private void notifyLoadingChanged(final boolean loading) {
if (eventHandler != null && eventListener != null) {
eventHandler.post(new Runnable() {
@Override
public void run() {
eventListener.onLoadingChanged(loading);
}
});
}
}
private static class LoaderState {
public final int bufferSizeContribution;
public int bufferState;
public boolean loading;
public long nextLoadPositionUs;
public LoaderState(int bufferSizeContribution) {
this.bufferSizeContribution = bufferSizeContribution;
bufferState = ABOVE_HIGH_WATERMARK;
loading = false;
nextLoadPositionUs = -1;
}
}
}
|
[
"olly@google.com"
] |
olly@google.com
|
73e454f2d34375d56f4aab375c327b36d42ba835
|
2bf1f3fa882ba47cea662ee0f99c2c8d74342a7d
|
/src/main/java/com/djpadbit/psioc/mixins/MixinLoader.java
|
d4380b409b92622bcd12b5cd35ecc24dae4b8186
|
[] |
no_license
|
djpadbit/PsiOC
|
b42640fe9351a8bfe17b409c3b06cded8a249a3e
|
8dbc7f8f716bd7eb7a77c383b6e84674845d41d5
|
refs/heads/master
| 2020-09-12T01:24:48.724355
| 2019-11-17T14:05:49
| 2019-11-17T14:05:49
| 222,254,789
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,119
|
java
|
package com.djpadbit.psioc.mixins;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.ModClassLoader;
import net.minecraftforge.fml.common.ModContainer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.Mixins;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.transformer.MixinTransformer;
import org.spongepowered.asm.mixin.transformer.Proxy;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.util.List;
// ALL CREDITS GOES TO THE VANILLAFIX DEVS
// THIS IS RIPPED FROM THERE
// I DID NOT MAKE THIS PART
// SEE https://github.com/DimensionalDevelopment/VanillaFix/blob/master/src/main/java/org/dimdev/vanillafix/modsupport/mixins/MixinLoader.java
@Mixin(Loader.class)
public class MixinLoader {
@Shadow
private List<ModContainer> mods;
@Shadow
private ModClassLoader modClassLoader;
/**
* @reason Load all mods now and load mod support mixin configs. This can't be done later
* since constructing mods loads classes from them.
*/
@Inject(method = "loadMods", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/LoadController;transition(Lnet/minecraftforge/fml/common/LoaderState;Z)V", ordinal = 1), remap = false)
private void beforeConstructingMods(List<String> injectedModContainers, CallbackInfo ci) {
// Add all mods to class loader
for (ModContainer mod : mods) {
try {
modClassLoader.addFile(mod.getSource());
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
// Add and reload mixin configs
Mixins.addConfiguration("mixins.psioc.mods.json");
Proxy mixinProxy = (Proxy) Launch.classLoader.getTransformers().stream().filter(transformer -> transformer instanceof Proxy).findFirst().get();
try {
Field transformerField = Proxy.class.getDeclaredField("transformer");
transformerField.setAccessible(true);
MixinTransformer transformer = (MixinTransformer) transformerField.get(mixinProxy);
Method selectConfigsMethod = MixinTransformer.class.getDeclaredMethod("selectConfigs", MixinEnvironment.class);
selectConfigsMethod.setAccessible(true);
selectConfigsMethod.invoke(transformer, MixinEnvironment.getCurrentEnvironment());
Method prepareConfigsMethod = MixinTransformer.class.getDeclaredMethod("prepareConfigs", MixinEnvironment.class);
prepareConfigsMethod.setAccessible(true);
prepareConfigsMethod.invoke(transformer, MixinEnvironment.getCurrentEnvironment());
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
}
}
}
|
[
"djpadbit@gmail.com"
] |
djpadbit@gmail.com
|
654df425563a46ad03db4ef35a52eaca916ae26e
|
1b57856682aa77e6e7f91e10db4a0c11dc6ff896
|
/app/src/main/java/com/waziinovation/watchman/AboutActivity.java
|
c957fa8720d842e7a482b51bcd90e56d35fde21e
|
[] |
no_license
|
pkaramagi/Watchman-Min
|
23b3870cf15261c960e0bcaa17320992a6605137
|
5b8c8faf4b11cac687a46409de65a083d5f3cd90
|
refs/heads/master
| 2023-06-12T00:40:45.197700
| 2016-07-14T14:23:03
| 2016-07-14T14:23:03
| 383,247,889
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,834
|
java
|
package com.waziinovation.watchman;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView;
public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
//
WebView aboutWebView = (WebView)findViewById(R.id.watchman_about_webview);
aboutWebView.loadUrl(
getResources().
getString(R.string.watchman_about_content_url)
);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
//NavUtils.navigateUpFromSameTask(this);
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
[
"pkaramagi1@gmail.com"
] |
pkaramagi1@gmail.com
|
823dc5d5d48261c117d9c6ec6bffc266dd874f18
|
a6836f197325fe30c6886bad80b3df2318d4ffc5
|
/src/main/java/com/springcloudtest/SpringcloudtestApplication.java
|
ca5a49348e6291bf21ee290e8365466853b1a449
|
[] |
no_license
|
jacker2000/springcloudtest
|
679d98470032258873fd94be737659b1b776374f
|
103221d094e383e8a1699028199d98d94762725b
|
refs/heads/master
| 2022-04-18T22:19:46.161695
| 2020-04-13T10:03:31
| 2020-04-13T10:03:31
| 255,114,898
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 494
|
java
|
package com.springcloudtest;
import com.cxytiandi.demo.EnableUserClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableUserClient
@SpringBootApplication
@MapperScan(basePackages = "com.springcloudtest.dao")
public class SpringcloudtestApplication {
public static void main(String[] args) {
SpringApplication.run(SpringcloudtestApplication.class, args);
}
}
|
[
"fangao1829@126.com"
] |
fangao1829@126.com
|
4666007bab9bdfa4b7fe737e4b0ea8106f060b62
|
a8e8878732c7f2635d9c71987c742fddc0770201
|
/src/java/controle/VO/PedidoCompra.java
|
66598f4e4fa70703508c1ff71e47562a2e36628a
|
[] |
no_license
|
LucianeBenetti/Exercicio10
|
ce7ca070f2d6b3d6c2b837d97b8a78cb907eb7bc
|
02e5517f6fb59b42a5b63cd7dfcdcfa433ca9d30
|
refs/heads/master
| 2020-05-29T17:50:34.125385
| 2019-05-29T19:30:40
| 2019-05-29T19:30:40
| 189,285,699
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,297
|
java
|
package controle.VO;
import java.util.ArrayList;
import java.util.Date;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
class PedidoCompra {
private int codigoPedido;
private ItemPedido[] itensDePedido;
private Date dataPedido;
public PedidoCompra() {
}
public PedidoCompra(int codigoPedido, ItemPedido[] itensDePedido, Date dataPedido) {
this.codigoPedido = codigoPedido;
this.itensDePedido = itensDePedido;
this.dataPedido = dataPedido;
}
public int getCodigoPedido() {
return codigoPedido;
}
public void setCodigoPedido(int codigoPedido) {
this.codigoPedido = codigoPedido;
}
public ItemPedido[] getItensDePedido() {
return itensDePedido;
}
public void setItensDePedido(ItemPedido[] itensDePedido) {
this.itensDePedido = itensDePedido;
}
public Date getDataPedido() {
return dataPedido;
}
public void setDataPedido(Date dataPedido) {
this.dataPedido = dataPedido;
}
@Override
public String toString() {
return "PedidoCompra{" + "codigoPedido=" + codigoPedido + ", itensDePedido=" + itensDePedido + ", dataPedido=" + dataPedido + '}';
}
}
|
[
"80119050@MSC36171427.correiosnet.int"
] |
80119050@MSC36171427.correiosnet.int
|
a37893db5d07d7732180fd86d309b1321b0ed929
|
bfc7a4cda00a0b89d4b984c83976770b0523f7f5
|
/OA/JavaSource/com/icss/oa/addressbook/admin/writeexcel.java
|
1f730636a46b4a5335e0e5177ce83499fabb0088
|
[] |
no_license
|
liveqmock/oa
|
100c4a554c99cabe0c3f9af7a1ab5629dcb697a6
|
0dfbb239210d4187e46a933661a031dba2711459
|
refs/heads/master
| 2021-01-18T05:02:00.704337
| 2015-03-03T06:47:30
| 2015-03-03T06:47:30
| 35,557,095
| 0
| 1
| null | 2015-05-13T15:26:06
| 2015-05-13T15:26:06
| null |
GB18030
|
Java
| false
| false
| 5,867
|
java
|
/*
* Created on 2004-4-12
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package com.icss.oa.addressbook.admin;
import java.sql.Connection;
import java.util.Iterator;
import java.util.List;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
import com.icss.oa.addressbook.handler.AddressbookHandler;
import com.icss.oa.addressbook.vo.AddressbookContentVO;
import com.icss.oa.addressbook.vo.AddressbookFolderVO;
/**
* @author Administrator
*
* To change the template for this generated type comment go to Window -
* Preferences - Java - Code Generation - Code and Comments
*/
public class writeexcel {
private Connection conn;
public String filepath = null;
List chabfList = null;
List chabcList = null;
AddressbookFolderVO chabfvo = null;
AddressbookContentVO chabcvo = null;
Label l = null;
WritableFont detFont;
WritableCellFormat detFormat;
WritableSheet sheet;
WritableCellFormat titleFormat;
int returncolumn;
int returnrow;
int changecolumn;
int changerow;
public writeexcel(Connection conn) {
this.conn = conn;
}
public void setl(Label _l) {
l = _l;
}
public void setdetFormat(WritableCellFormat _detFormat) {
detFormat = _detFormat;
}
public void setsheet(WritableSheet _sheet) {
sheet = _sheet;
}
public void settitleFormat(WritableCellFormat _titleFormat) {
titleFormat = _titleFormat;
}
public Integer writeexcel(int column, int i, Integer haschildabf) throws RowsExceededException, WriteException {
AddressbookHandler handler = new AddressbookHandler(conn);
chabfList = handler.getchildList(haschildabf);
Iterator chabfit = chabfList.iterator();
int j;
//int i=row;
for (j = i + 1; chabfit.hasNext(); j++) {
chabfvo = (AddressbookFolderVO) chabfit.next();
if (("1").equals(chabfvo.getAbfFlag())) {
//打印出所有分组信息
//System.out.println("+++++++has child abf+++++++");
if (j > 50) {
j = 3;
column = column + 2;
writetitle(sheet, l, detFormat, titleFormat, column);
}
l = new Label(column, j, chabfvo.getAbfName(), detFormat);
sheet.addCell(l);
haschildabf = chabfvo.getAbfId();
//System.out.println("+++++++this is in the while abfolder column_j+++++++"+haschildabf+column+j);
if (handler.hasChildinfo(haschildabf)) {
System.out.println("+++++++there is still has childabf haschildabf+++++++" + haschildabf + column + j);
writeexcel childwriteexcel = new writeexcel(conn);
childwriteexcel.setsheet(sheet);
childwriteexcel.setl(l);
childwriteexcel.setdetFormat(detFormat);
childwriteexcel.settitleFormat(titleFormat);
haschildabf = childwriteexcel.writeexcel(column, j, haschildabf);
column = childwriteexcel.getcolumn();
j = childwriteexcel.getrow() - 1;
System.out.println("++++++out out out " + column + j + haschildabf);
}
} else {
chabcList = handler.getdetailFileList(chabfvo.getAbfId());
System.out.println("+++++++there is childabc+++++++");
System.out.println("+++++++column_j+++++++" + column + j);
Iterator chabcit = chabcList.iterator();
if (chabcit.hasNext()) {
chabcvo = (AddressbookContentVO) chabcit.next();
System.out.println("+++++++this is in the while abcontent column_j+++++++" + chabcvo.getAddAbfcId() + column + j);
if (j > 50) {
j = 3;
column = column + 2;
writetitle(sheet, l, detFormat, titleFormat, column);
}
l = new Label(column, j, chabcvo.getAbcName(), detFormat);
sheet.addCell(l);
if (j > 50) {
j = 3;
column = column + 2;
writetitle(sheet, l, detFormat, titleFormat, column);
}
l = new Label(column + 1, j, "(c)" + chabcvo.getAbcCellphone(), detFormat);
sheet.addCell(l);
if (j > 50) {
j = 3;
column = column + 2;
writetitle(sheet, l, detFormat, titleFormat, column);
}
l = new Label(column + 1, j + 1, "(o)" + chabcvo.getAbcCompanytel(), detFormat);
sheet.addCell(l);
if (j > 50) {
j = 3;
column = column + 2;
writetitle(sheet, l, detFormat, titleFormat, column);
}
l = new Label(column + 1, j + 2, "(f)" + chabcvo.getAbcFamilytel(), detFormat);
sheet.addCell(l);
if (j > 50) {
j = 3;
column = column + 2;
writetitle(sheet, l, detFormat, titleFormat, column);
}
l = new Label(column + 1, j + 3, "(e)" + chabcvo.getAbcEmail(), detFormat);
sheet.addCell(l);
j = j + 3;
//haschildabf=childabcvo.getAddAbfcId();
//System.out.println("+++++++there is childabc haschildabf+++++++"+haschildabf);
}
}
}
i = j;
returncolumn = column;
returnrow = i;
System.out.println("+++++++there is outing while+++++++" + haschildabf + returncolumn + returnrow);
return haschildabf;
}
public int getcolumn() {
return returncolumn;
}
public int getrow() {
return returnrow;
}
/*public int changcolumn(int _changecolumn) {
changecolumn=_changecolumn+2;
return changecolumn;
}
public int changrow(int _changerow) {
changerow=_changerow;
if(changerow>20){
changerow=3;
}
return returnrow;
}
*/
public void writetitle(WritableSheet sheet, Label l, WritableCellFormat detFormat, WritableCellFormat titleFormat, int column) throws RowsExceededException, WriteException {
l = new Label(column, 2, "姓名", titleFormat);
sheet.addCell(l);
l = new Label(column + 1, 2, "电话", titleFormat);
sheet.addCell(l);
}
}
|
[
"peijn1026@gmail.com"
] |
peijn1026@gmail.com
|
b9a3acc2fe9e801b95312aa823ccaae2cbd8c720
|
e20990f27bdab95315b9bdce4268b038c658ec87
|
/codigo/src/main/java/model/Funcionario.java
|
40c61572b9c42fa75ce04fddac438fcd0ea0ef5a
|
[] |
no_license
|
carol-manso/ti2-cc-disponibilidade-de-estoque
|
dd1a4530dc0beb8e8b4280665381cfab4eca1b6c
|
4f646e2b2d079f1be848d1e4fc20653f1689b06d
|
refs/heads/master
| 2023-01-24T10:41:02.814162
| 2020-11-30T13:34:17
| 2020-11-30T13:34:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 749
|
java
|
package model;
public class Funcionario {
private int codigo;
private double salario;
private String cargo, nome;
public Funcionario(int codigo, double salario, String cargo, String nome){
this.codigo=codigo;
this.salario=salario;
this.cargo=cargo;
this.nome=nome;
}
public int getCodigo() {
return codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public double getSalario() {
return salario;
}
public void setSalario(double salario) {
this.salario = salario;
}
public String getCargo() {
return cargo;
}
public void setCargo(String cargo) {
this.cargo = cargo;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
|
[
"markgomer@users.noreply.github.com"
] |
markgomer@users.noreply.github.com
|
ce6e56b9b9df5b5811bfece1f4cfa961106e3841
|
51f86d83ec5723dcf7d295608d77ae6b868ca570
|
/src/main/java/Semantic/SimTest.java
|
c21e58e7d7aae67eeb7288f7b9f7c01693d6c225
|
[] |
no_license
|
algoprog/WAMBy
|
30b4556c6f2114ad12a8f772c1a01eebb4d43cb6
|
1df49505e008131014eac3f0f311ee8ba5aa4524
|
refs/heads/master
| 2021-03-27T14:42:50.254235
| 2018-09-16T20:08:46
| 2018-09-16T20:08:46
| 104,537,316
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,359
|
java
|
package Semantic;
import TextModel.Paragraph;
import TextModel.Word;
import TextModel.WordsUtil;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
* Created by Chris Samarinas
*/
public class SimTest {
public static void startTest() throws IOException {
String train_corpus = "C:/Users/Chris/Desktop/Wamby/data/msr_paraphrase/train.txt";
String test_corpus = "C:/Users/Chris/Desktop/Wamby/data/msr_paraphrase/test.txt";
double SIMILARITY_THRESHOLD = 0.83; // 0.55 0.9 0.0003 0.81 0.66 0.83
TextSimilarity ts = new TextSimilarity();
ts.addDocuments(11602);
int limit = 0;
System.out.println("Calculating IDFs...");
BufferedReader in = new BufferedReader(new FileReader(test_corpus));
String line;
while((line = in.readLine()) != null && limit < 20000)
{
String[] parts = line.split("\\t");
String s1 = parts[3];
String s2 = parts[4];
ArrayList<Word> words = WordsUtil.getWords(s1);
for(Word w : words) {
ts.addWord(w.getText(),1);
}
words = WordsUtil.getWords(s2);
for(Word w : words) {
ts.addWord(w.getText(),1);
}
if(limit % 100 == 0) {
System.out.println(limit+100);
}
limit++;
}
in.close();
System.out.println("Calculating similarities...");
limit = 0;
int correct = 0;
int predicted_positives = 0;
int all_positives = 0;
int true_positives = 0;
in = new BufferedReader(new FileReader(test_corpus));
double sum = 0;
while((line = in.readLine()) != null && limit < 20000)
{
String[] parts = line.split("\\t");
String relevant = parts[0];
String s1 = parts[3];
String s2 = parts[4];
Paragraph p1 = new Paragraph(0,0,s1,"");
Paragraph p2 = new Paragraph(0,0,s2,"");
double similarity = ts.sim_matrix(p1, p2);
System.out.println(similarity);
String found_relevant = "0";
if(similarity > SIMILARITY_THRESHOLD) {
found_relevant = "1";
predicted_positives++;
}
if(relevant.equals(found_relevant)) {
correct++;
if(relevant.equals("1")) {
true_positives++;
}
}
if(relevant.equals("1")) {
all_positives++;
sum += similarity;
}
if(limit % 100 == 0) {
System.out.println(limit+100);
}
limit++;
}
in.close();
double accuracy = (double) correct / limit;
double precision = (double) true_positives / predicted_positives;
double recall = (double) true_positives / all_positives;
double f1 = 2 * (precision * recall) / (precision + recall);
System.out.println("Accuracy: "+accuracy);
System.out.println("Precision: "+precision);
System.out.println("Recall: "+recall);
System.out.println("F1: "+f1);
System.out.println((sum/all_positives));
}
}
|
[
"devgreek@gmail.com"
] |
devgreek@gmail.com
|
393a4d263c757e3ae4335839df2448a892c9ff69
|
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
|
/src/chosun/ciis/hd/vaca/ds/HD_VACA_3003_ADataSet.java
|
5ad6757c72729842cd34cf5c614e8a122b639611
|
[] |
no_license
|
nosmoon/misdevteam
|
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
|
1829d5bd489eb6dd307ca244f0e183a31a1de773
|
refs/heads/master
| 2020-04-15T15:57:05.480056
| 2019-01-10T01:12:01
| 2019-01-10T01:12:01
| 164,812,547
| 1
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 2,654
|
java
|
/***************************************************************************************************
* 파일명 : .java
* 기능 :
* 작성일자 :
* 작성자 : 이태식
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.hd.vaca.ds;
import java.sql.*;
import java.util.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.hd.vaca.dm.*;
import chosun.ciis.hd.vaca.rec.*;
/**
*
*/
public class HD_VACA_3003_ADataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{
public String errcode;
public String errmsg;
public HD_VACA_3003_ADataSet(){}
public HD_VACA_3003_ADataSet(String errcode, String errmsg){
this.errcode = errcode;
this.errmsg = errmsg;
}
public void setErrcode(String errcode){
this.errcode = errcode;
}
public void setErrmsg(String errmsg){
this.errmsg = errmsg;
}
public String getErrcode(){
return this.errcode;
}
public String getErrmsg(){
return this.errmsg;
}
public void getValues(CallableStatement cstmt) throws SQLException{
this.errcode = Util.checkString(cstmt.getString(1));
this.errmsg = Util.checkString(cstmt.getString(2));
}
}/*----------------------------------------------------------------------------------------------------
Web Tier에서 DataSet 객체 관련 코드 작성시 사용하십시오.
<%
HD_VACA_3003_ADataSet ds = (HD_VACA_3003_ADataSet)request.getAttribute("ds");
%>
Web Tier에서 Record 객체 관련 코드 작성시 사용하십시오.
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DataSet 객체의 <%= %> 작성시 사용하십시오.
<%= ds.getErrcode()%>
<%= ds.getErrmsg()%>
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 Record 객체의 <%= %> 작성시 사용하십시오.
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Wed Mar 16 11:06:12 KST 2016 */
|
[
"DLCOM000@172.16.30.11"
] |
DLCOM000@172.16.30.11
|
1ef05b5824434cd826c3c56993fe85437a281bea
|
b09d009b2716af3f5c047ff38888c807b2222f45
|
/src/test/java/com/PhpTravels/TestScripts/Hotel_TestCase.java
|
fbb1fbd6adf86c8406fed7c5d43ef0e86b54bc75
|
[] |
no_license
|
KVSandesh/Php_Travels
|
9244bf581171e58675879948313d50d93e00c1f7
|
a9f39e9ba3f508fa0e35b51152e19f0ad8044e2c
|
refs/heads/master
| 2023-05-14T09:51:42.517217
| 2019-06-25T02:25:24
| 2019-06-25T02:25:24
| 192,483,182
| 0
| 0
| null | 2023-05-01T20:21:10
| 2019-06-18T06:54:15
|
HTML
|
UTF-8
|
Java
| false
| false
| 2,445
|
java
|
package com.PhpTravels.TestScripts;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.PageFactory;
import org.testng.Assert;
import org.testng.Reporter;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.PhpTravels.Constants.Browsers;
import com.PhpTravels.Constants.ExcelLibrary;
import com.PhpTravels.pom.AHomePage_Object;
import com.PhpTravels.pom.Hotel_Final_Booking_1;
import com.PhpTravels.pom.Hotel_Final_Booking_2;
import com.PhpTravels.pom.HotelsFilter_Object;
import com.PhpTravels.pom.Login_Object;
import com.PhpTravels.pom.MyAccount_Object;
public class Hotel_TestCase {
WebDriver driver;
AHomePage_Object homepageobject;
Login_Object loginobject;
MyAccount_Object myaccountobject;
HotelsFilter_Object hotelsfilterobject;
Hotel_Final_Booking_1 finalbook_1;
Hotel_Final_Booking_2 finalbook_2;
ExcelLibrary excelLibrary = new ExcelLibrary();
@BeforeClass
public void openBrowser() {
driver = Browsers.getBrowser();
homepageobject = PageFactory.initElements(driver, AHomePage_Object.class);
myaccountobject = PageFactory.initElements(driver, MyAccount_Object.class);
loginobject = PageFactory.initElements(driver, Login_Object.class);
hotelsfilterobject = PageFactory.initElements(driver, HotelsFilter_Object.class);
finalbook_1 = PageFactory.initElements(driver, Hotel_Final_Booking_1.class);
finalbook_2 = PageFactory.initElements(driver, Hotel_Final_Booking_2.class);
}
@Test
public void Hotel_Booking() throws Throwable {
homepageobject.Home_Login();
Thread.sleep(2000);
String username = excelLibrary.getExceldata("Hotel_Data", 0, 0);
String password = excelLibrary.getExceldata("Hotel_Data", 1, 0);
loginobject.login_1(username, password);
homepageobject.Hotel();
hotelsfilterobject.Hotel_Select();
Thread.sleep(3000);
Actions action = new Actions(driver);
action.sendKeys(Keys.PAGE_DOWN).perform();
action.sendKeys(Keys.PAGE_DOWN).perform();
finalbook_1.confirm_hotel_booking_1();
Thread.sleep(3000);
action.sendKeys(Keys.PAGE_DOWN).perform();
Thread.sleep(3000);
/* finalbook_2.confirm_hotel_booking_2();
action.sendKeys(Keys.PAGE_DOWN).perform();
Thread.sleep(3000);*/
}
@AfterClass(enabled = true)
public void close_Browser() {
driver.close();
}
}
|
[
"sandytocode@gmail.com"
] |
sandytocode@gmail.com
|
dcc58e7a94089acb12574560ae67160cce8908e8
|
2c6f1e43a7d50e81c4a40589471b6a606a5e56ac
|
/mega/megafulfilmentprocess/src/com/mega/fulfilmentprocess/actions/consignment/AllowShipmentAction.java
|
a7ef4cf9ea32a98554bc783cf5633d720fba8e3e
|
[] |
no_license
|
lt215943200/megastore
|
f051d1672f07d87bef3aebc95ef8bf6239ab6c2d
|
3606e0939590ab6ba25eaad3e330d44a7dece7ab
|
refs/heads/master
| 2021-09-06T06:24:13.279899
| 2018-02-03T04:54:43
| 2018-02-03T04:54:43
| 120,058,325
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,903
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package com.mega.fulfilmentprocess.actions.consignment;
import de.hybris.platform.commerceservices.model.PickUpDeliveryModeModel;
import de.hybris.platform.core.enums.OrderStatus;
import de.hybris.platform.ordersplitting.model.ConsignmentModel;
import de.hybris.platform.ordersplitting.model.ConsignmentProcessModel;
import de.hybris.platform.processengine.action.AbstractAction;
import de.hybris.platform.warehouse.Process2WarehouseAdapter;
import java.util.HashSet;
import java.util.Set;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Required;
public class AllowShipmentAction extends AbstractAction<ConsignmentProcessModel>
{
private static final Logger LOG = Logger.getLogger(AllowShipmentAction.class);
private Process2WarehouseAdapter process2WarehouseAdapter;
public enum Transition
{
DELIVERY, PICKUP, CANCEL, ERROR;
public static Set<String> getStringValues()
{
final Set<String> res = new HashSet<String>();
for (final Transition transition : Transition.values())
{
res.add(transition.toString());
}
return res;
}
}
@Override
public String execute(final ConsignmentProcessModel process)
{
final ConsignmentModel consignment = process.getConsignment();
if (consignment != null)
{
try
{
// Check if the Order is Cancelled
if (OrderStatus.CANCELLED.equals(consignment.getOrder().getStatus())
|| OrderStatus.CANCELLING.equals(consignment.getOrder().getStatus()))
{
return Transition.CANCEL.toString();
}
else
{
getProcess2WarehouseAdapter().shipConsignment(process.getConsignment());
return getTransitionForConsignment(consignment);
}
}
catch (final Exception e)
{
if (LOG.isDebugEnabled())
{
LOG.debug(e);
}
return Transition.ERROR.toString();
}
}
return Transition.ERROR.toString();
}
protected String getTransitionForConsignment(final ConsignmentModel consignment) {
if (consignment.getDeliveryMode() instanceof PickUpDeliveryModeModel)
{
return Transition.PICKUP.toString();
}
else
{
return Transition.DELIVERY.toString();
}
}
protected Process2WarehouseAdapter getProcess2WarehouseAdapter()
{
return process2WarehouseAdapter;
}
@Required
public void setProcess2WarehouseAdapter(final Process2WarehouseAdapter process2WarehouseAdapter)
{
this.process2WarehouseAdapter = process2WarehouseAdapter;
}
@Override
public Set<String> getTransitions()
{
return Transition.getStringValues();
}
}
|
[
"micheal_tao@126.com"
] |
micheal_tao@126.com
|
9c0c0b621de6f3037339c1a33748a8e52cadec7e
|
bddd1ee79f2fe09f141d69a9015b4f21a08dbcbd
|
/Java/src/com/cjj/java01/WhileDemo.java
|
4751928613eda64e73945d03510700e67ebf409b
|
[] |
no_license
|
oncetrader2018/JavaLearning
|
762b0eaf01dc04d771a90138243de1729e4b4c0b
|
75800e2c633f7e0822cfaf694cc588e2ad2a55c8
|
refs/heads/main
| 2023-03-25T02:51:24.931990
| 2021-03-11T16:06:08
| 2021-03-11T16:06:08
| 332,363,671
| 0
| 0
| null | 2021-01-30T16:27:47
| 2021-01-24T04:04:34
|
Java
|
UTF-8
|
Java
| false
| false
| 1,624
|
java
|
package com.cjj.java01;
import java.util.Scanner;
public class WhileDemo {
public static void main(String[] args) {
// int i = 1;
// while (i < 100){
// System.out.println(i+",Java");
// i++;
// }
//100以内的和
// int i = 1;
// int sun = 0;
// while (i <=100){
// if (i % 2 == 0){
// sun+=i;
// }
// i++;
// }
// System.out.println(sun);
//
System.out.println("请选择所要购买的商品:");
System.out.println("1、苹果"+" "+"2、草莓"+" "+"3、香蕉");
Scanner sc = new Scanner(System.in);
int chiose = sc.nextInt();
System.out.println("请输入购买数量:");
Scanner sc2 = new Scanner(System.in);
int vol = sc2.nextInt();
int sum = 0;
switch (chiose){
case 1:
sum = vol * 5;
System.out.println("苹果的单价为 5元/个");
System.out.println("合计金额="+sum);
break;
case 2:
sum = vol * 10;
System.out.println("草莓的单价为 10元/个");
System.out.println("合计金额="+sum);
break;
case 3:
sum = vol * 15;
System.out.println("香蕉的单价为 15元/个");
System.out.println("合计金额="+sum);
break;
default:
System.out.println("您的输入有误,请核对后再试,谢谢!");
}
}
}
|
[
"oncetrader2018@gmail.com"
] |
oncetrader2018@gmail.com
|
e03833eff54010ae2cd178901c8576445d9eb3e2
|
30aef0abd9a0e7ab42a93152d63f00237b49cb2b
|
/concurrent-demo/src/main/java/com/ggp/noob/demo/concurrent/juc/juc04_otherLock/O06_CyclicBarrier.java
|
f346e31d6eb1bb789b40ec29f716381f36037263
|
[] |
no_license
|
gongxianshengjiadexiaohuihui/NoobDemo
|
d609180d88df32a6339904df2c4852aa703528c3
|
e5d76568760da6728b9a7036bbd79650ecc715be
|
refs/heads/master
| 2022-06-21T18:59:37.198947
| 2022-04-11T05:06:52
| 2022-04-11T05:06:52
| 249,323,293
| 2
| 0
| null | 2022-06-21T04:26:32
| 2020-03-23T03:05:22
|
Java
|
UTF-8
|
Java
| false
| false
| 916
|
java
|
package com.ggp.noob.demo.concurrent.juc.juc04_otherLock;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
/**
* @Author:GGP
* @Date:2020/4/4 17:32
* @Description:
* 可以灵活的让几个线程进行了某种操作后,同时进行下一步,或者执行某个动作
*/
public class O06_CyclicBarrier {
public static void main(String[] args) {
CyclicBarrier cyclicBarrier = new CyclicBarrier(20,()->{
System.out.println("满人,发车");
});
for (int i = 0; i <100 ; i++) {
new Thread(()->{
try {
cyclicBarrier.await();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
}).start();
}
}
}
|
[
"937827303@qq.com"
] |
937827303@qq.com
|
bdfeb11318dd8f9bb2cc3e5d35c8bb64b71f8c02
|
6979ac242a62679f93648ad7db9af8e56d34bb45
|
/Log Analyser/src/main/java/com/assignment/database/EmailRepository.java
|
02b05993789196c7f82e9dc629426bde6ceae295
|
[] |
no_license
|
Mohanatheesan26/Log-Analyser
|
09506d20bd3397c97975ba09c1674a0e4a4c4ccc
|
180e3671b78e21da19e6788662fa6f376c59b6e3
|
refs/heads/master
| 2022-12-17T01:37:33.352670
| 2020-09-19T14:42:19
| 2020-09-19T14:42:19
| 294,051,246
| 0
| 0
| null | 2020-09-09T08:31:12
| 2020-09-09T08:31:12
| null |
UTF-8
|
Java
| false
| false
| 826
|
java
|
package com.assignment.database;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public class EmailRepository implements DataRepository {
public List<String> getData() {
List<String> emailList = new ArrayList<>();
try {
DatabaseConnection databaseConnection = new DatabaseConnection();
Connection con = databaseConnection.connectDatabase();
String sql = "SELECT * FROM email_details";
Statement stmt = con.createStatement();
ResultSet result = stmt.executeQuery(sql);
while (result.next()) {
emailList.add(result.getString("email"));
}
} catch (SQLException e) {
e.printStackTrace();
}
return emailList;
}
}
|
[
"noreply@github.com"
] |
noreply@github.com
|
aca949d9e82f67d2a5375709cca2c6f980ab9bc8
|
fe7c1d1efec2378e2f2d38b1122e16bbb7039cdd
|
/app/src/main/java/com/example/myarface/ar/FaceArFragment.java
|
8ffdfc0c7a88c3fc89ff72262381e7a65fbaf9f0
|
[] |
no_license
|
yudystriawan/MyArFace
|
3b3ee1018c701e75947fe0da2d58f9a4d64bbfa1
|
429ef1abc5aa4b6fdd7b7e96e854bc3cc3d3ba1d
|
refs/heads/master
| 2020-12-30T02:38:40.976099
| 2020-02-07T03:11:10
| 2020-02-07T03:11:10
| 238,833,782
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,190
|
java
|
package com.example.myarface.ar;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import com.google.ar.core.Config;
import com.google.ar.core.Session;
import com.google.ar.sceneform.ux.ArFragment;
import java.util.EnumSet;
import java.util.Set;
public class FaceArFragment extends ArFragment {
@Override
protected Set<Session.Feature> getSessionFeatures() {
return EnumSet.of(Session.Feature.FRONT_CAMERA);
}
@Override
protected Config getSessionConfiguration(Session session) {
Config config = new Config(session);
config.setAugmentedFaceMode(Config.AugmentedFaceMode.MESH3D);
;
return config;
}
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
FrameLayout frameLayout = (FrameLayout) super.onCreateView(inflater, container, savedInstanceState);
getPlaneDiscoveryController().hide();
getPlaneDiscoveryController().setInstructionView(null);
return frameLayout;
}
/**
* Fragment extends the ArFragment class to include the WRITER_EXTERNAL_STORAGE
* permission. This adds this permission to the list of permissions presented to the user for
* granting.
*/
@Override
public String[] getAdditionalPermissions() {
String[] additionPermissions = super.getAdditionalPermissions();
int permissionLength = additionPermissions != null ? additionPermissions.length : 0;
String[] permissions = new String[permissionLength + 2];
permissions[0] = Manifest.permission.WRITE_EXTERNAL_STORAGE;
permissions[1] = Manifest.permission.RECORD_AUDIO;
if (permissionLength > 0) {
System.arraycopy(
additionPermissions,
0,
permissions,
1,
additionPermissions.length
);
}
return permissions;
}
boolean hasWritePermission() {
return ActivityCompat.checkSelfPermission(
this.requireActivity(),
Manifest.permission.WRITE_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED;
}
boolean hasRecordAudioPermission() {
return ActivityCompat.checkSelfPermission(
this.requireActivity(),
Manifest.permission.RECORD_AUDIO
) == PackageManager.PERMISSION_GRANTED;
}
/**
* Launch Application Setting to grant permissions.
*/
public void launchPermissionSettings() {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.fromParts("package", requireActivity().getPackageName(), null));
requireActivity().startActivity(intent);
}
}
|
[
"yudistriawan@gmail.com"
] |
yudistriawan@gmail.com
|
53ab1a4a8bb1915e382c78db2efc76eb6c748c0e
|
e1b97d667b3d23b0a31e500818621973683c9c7b
|
/DIT012/Labs/week2/week2/src/assignment/product/DiceWars.java
|
60f85588143ef89e365cbd6bccba6066067b6a86
|
[] |
no_license
|
ketric/DIT012
|
05e00f78b53db20a4a3345e40c5f562a53e226b5
|
a87414ffe0a01b476406e8590b139ebc11b050ec
|
refs/heads/master
| 2020-03-19T00:22:44.831267
| 2018-05-30T17:31:25
| 2018-05-30T17:31:25
| 135,476,530
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,803
|
java
|
package assignment.product;
import java.util.Random;
import java.util.Scanner;
import static java.lang.Math.sqrt;
import static java.lang.System.in;
import static java.lang.System.out;
/*
* Simplified text based (i.e. non graphical) version of the Dice Wars game
* For a full graphical version, see http://www.gamedesign.jp/flash/dice/dice.html (or other)
*
* Some rule simplification
* - No limit of dices in a country
* - Distribution of earned dices may be "somewhat" random.
* - Game over when a player lost all countries
* - Player with most countries wins (or dices? or a combination? find a measure)
*
* Structure:
* - As usual,separate IO and logic
*
* Process:
* - The plotMap method (given) needs method hasBorders. Implement and test it.
* - Use inside-out and functional decomposition to let attacker do one attack
* - Add a command line (while+switch) and put the above under the attack selection.
* - Implement the "next"-selection. More functional decomposition.
* - Add loop for the command line and implement the quit-choice.
*/
public class DiceWars {
public static void main(String[] args) {
new DiceWars().program();
}
// The only allowed variables outside the methods
static Scanner sc = new Scanner(in);
static Random rand = new Random();
void program() {
// ------ Booleans------------------------------------
boolean endTurn = false;
boolean done = false;
boolean q1 = false;
boolean q2 = false;
boolean q3 = false;
boolean loopDone = false;
// The players of the game (mostly referenced by index)
String[] players = {"pelle", "fia", "lisa"};
// A map with nine countries, named by their index (0-8)
// Leading 1:s because can't have leading 0 (just skip the ones when processing)
// 114 says: The country 0 has border to countries 1 and 4.
// Number of countries is a multiple of players, they all get the same numbers of
// countries
int[] map = {114, 1024, 115, 146, 101357, 12487, 137, 14568, 157};
// This is the owners of the countries. Country 0 is owned by player
// pelle (players[0])
int[] owners = {0, 1, 2, 1, 2, 0, 0, 1, 2};
// This is the number of dices for a country. Country 1 has 3 dices.
int[] dices = {2, 3, 2, 3, 1, 3, 1, 1, 3};
/* Test area, should be possible to test at least some methods here */
/*
out.println(hasBorders(.. fill in data that results in true...));w
*/
out.println("Welcome to Dice Wars \"lite!\"");
out.println();
int attacker = rand.nextInt(players.length);
plotMap(map, owners, dices, players);
// ******* Write code here *************
while (!done) {
System.out.println("the current attacker is: " + players[attacker]);
while (!q1) {
System.out.print("action((a)ttack/ (e)nd turn): ");
// player choose to attack or to end his turn
String ans1 = sc.nextLine();
//sc.nextLine();
System.out.println(" ");
if (ans1.equals("a")) {
while (!q2) {
System.out.print("Attack from: ");
// player choose a land that he playerOwns()
// player will start to invade his neighbors from here.
int ans2 = sc.nextInt();
sc.nextLine();
System.out.println(" ");
if (playerOwns(attacker, ans2, owners)) {
while (!q3) {
System.out.print("Attack to: ");
// Player choose a neighbor to invade
// an attackable neighbor is the one player has border with
int ans3 = sc.nextInt();
//sc.nextLine();
if (hasBorder(ans2, ans3, map)) {
// main game play:
//1. player and the chosen neighbor castTheDice(). The one with more score wins
// Method is done
int[] result = castTheDice(ans2, ans3, dices);
//2. diceCastWinner/ Looser:
int dicesWinner = result[0];
int dicesLooser = result[1];
//3. the winner takeOverLands()
// Method is done
takeOverLands(dicesWinner, dicesLooser, owners);
//3.1 the winner moveDicePoints()
moveDicePoints(dicesWinner, dicesLooser, dices);
//4. show the new map and break back to loopQ1
// Method was done by the teacher
plotMap(map, owners, dices, players);
break;
}else{ q3 = false;}
}
break;
}else{ q2 = false;}
}
}else if (ans1.equals("e")){
endTurn = true;
}
else{q1 = false;}
if (endTurn) {
//dices are randomly spreadOut() over the winner's lands
contributeDices(attacker, owners, dices);
plotMap(map, owners, dices, players);
attacker = (attacker + 1) % 3;
break;
}else if (weHaveGotAWinner(owners)) {
loopDone = true;
break;
} else {break;}
}
if (loopDone) {break;}
}
int indexWinner = owners[1];
out.println("Game over");
out.println("Winner is " + players[indexWinner]);
}
// ------ Write methods below this -------------------
//1. Done
public static boolean playerOwns(int attacker, int ans1, int[] onwers){
// write a method that defies if a land is owned by player
if (attacker == onwers[ans1]) {
return true;
}else{
return false;
}
}
//2. Done
public static boolean hasBorder(int from, int to, int[] map) {
// Yes, if country from has border to country to
int borders = map[from];
while (borders > 1) {
if (borders % 10 == to) { return true;
}else{
borders = borders / 10;
}
}
return false;
}
//3. Done
public static int[] castTheDice(int from, int to, int[] dices) {
int attackerPoints;
int neighborPoints;
int[] result = {0,0};
attackerPoints = (rand.nextInt(6) + 1) * (dices[from]);
neighborPoints = (rand.nextInt(6) + 1) * (dices[to]);
int winner = 0;
int looser = 0;
if (attackerPoints == neighborPoints || attackerPoints < neighborPoints) {
winner = to;
looser = from;
}else if(attackerPoints > neighborPoints) {
winner = from;
looser = to;
}
result[0] = winner;
result[1] = looser;
return result;
}
//4. Done
public static int[] takeOverLands(int diceCastWinner, int diceCastLooser, int[] owners) {
// write a method that overwrites new owners onto old owners
owners[diceCastLooser] = owners[diceCastWinner];
int[] newMap = owners;
return newMap;
}
//4.1 Done
public static int[] moveDicePoints(int diceCastWinner, int diceCastLooser,int[] dices) {
dices[diceCastLooser] = dices[diceCastWinner] - 1;
dices[diceCastWinner] = 1;
return dices;
}
//5. Done?
public static int[] contributeDices(int winner, int[] owners, int[] dices) {
// Write a method that spread out the dices over player's lands
int i;
for (i = 0; i < 9; i ++) {
if (owners[i] == winner) {dices[i] = rand.nextInt(12) + dices[winner];}
else {dices[i] = dices[i] + 0;}
}
return dices;
}
//7. Done
public static boolean weHaveGotAWinner(int[] owners) {
// when all the elements in owners[] have a same value, the current attacker is the winner
//boolean something = true;
for (int i = 0; i < owners.length - 1; i++) {
if (owners[i] != owners[i + 1]) {
//something = false;
return false;
}
}
return true;
}
// ---- Nothing to do below -----------------------
// Plot map (as a graph) using ASCII chars
void plotMap(int[] map, int[] owners, int[] dices, String[] players) {
int n = (int) sqrt(map.length);
for (int row = 0; row < 2 * n - 1; row += 2) {
// One row with horizontal connections
for (int col = 0; col < n; col++) {
int i = 3 * row / 2 + col;
out.print(players[owners[i]] + ":" + dices[i]);
if (hasBorder(i, i + 1, map)) {
out.print("--");
} else {
out.print(" ");
}
}
out.println();
// Another row with vertical connections
for (int col = 0; col < n; col++) {
int i = 3 * row / 2 + col;
if (hasBorder(i, i + n, map)
&& hasBorder(i, i + n - 1, map)
&& hasBorder(i, i + n + 1, map)) {
out.print(" / | \\ ");
} else if (hasBorder(i, i + n, map)
&& hasBorder(i, i + n - 1, map)) {
out.print("/ | ");
} else if (hasBorder(i, i + n, map)
&& hasBorder(i, i + n + 1, map)) {
out.print(" | \\ ");
} else if (hasBorder(i, i + n - 1, map)) {
out.print(" / ");
} else if (hasBorder(i, i + n + 1, map)) {
out.print(" \\ ");
} else if (hasBorder(i, i + n, map)) {
out.print(" | ");
} else {
out.print(" ");
}
}
out.println();
}
out.println("-----------------------------------------");
}
}
|
[
"kennyle1996@hotmail.com"
] |
kennyle1996@hotmail.com
|
0cfb115c2d40fd40862ae5fed2550b805e8d7ec4
|
c5005a5f3dd855d8a79c135f4bb65e73b25c0ae7
|
/school/src/org/action/TecFindClassAction.java
|
8b75e990df99f89b4ec4775458a1873f6d327552
|
[] |
no_license
|
chenda576/EAS
|
f609bb60e546cfafc854dda276d14ad8295ee2b9
|
042fa9fb89beef0dc251907c27155786ddc16bca
|
refs/heads/master
| 2021-01-02T22:40:33.265956
| 2017-08-04T16:58:23
| 2017-08-04T16:58:23
| 99,363,098
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,622
|
java
|
package org.action;
import java.util.List;
import java.util.Map;
import org.model.X;
import org.model.C;
import org.model.T;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.util.HibernateSessionFactory;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class TecFindClassAction extends ActionSupport{
private String no;
private T tec;
private String error;
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public T getTec() {
return tec;
}
public void setTec(T tec) {
this.tec = tec;
}
public String execute() throws Exception{
try{
Session session=HibernateSessionFactory.getSession();
// 调用HibernateSessionFactory的getSession方法创建Session对象
Transaction ts=session.beginTransaction();// 创建事务对象
Query queryT=session.createQuery("from T where tNo=?");
queryT.setParameter(0,no);
queryT.setMaxResults(1);
T xk_t=(T)queryT.uniqueResult();
tec=xk_t;
Query query=session.createQuery("from O where tNo=?");
query.setParameter(0,no);
List<?> colist=query.list();
Map request=(Map)ActionContext.getContext().get("request");
request.put("colist",colist);
ts.commit(); // 提交事务
HibernateSessionFactory.closeSession();// 关闭Session
return SUCCESS;
}
catch(Exception e){
System.out.println(e);
this.setError(e.toString());
return ERROR;
}
}
}
|
[
"1522280984@qq.com"
] |
1522280984@qq.com
|
42f8c709fbb0049c53d2fc5edfc9ae008fd64f07
|
bab1314b5e2d11745e33499e9177f13c4c63c68c
|
/src/main/java/eu/fbk/dh/gigaword/jsonPair/Snippet.java
|
73a13ccfc25ce057bdd6276c39e235506b893136
|
[] |
no_license
|
ziorufus/gigaword
|
f75573e737ce88a81f616757e38687199345093f
|
678fc301e215718f61be08c4f6d80d7e34a47a17
|
refs/heads/master
| 2020-12-31T00:30:40.748243
| 2017-04-18T14:45:34
| 2017-04-18T14:45:34
| 86,553,181
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 398
|
java
|
package eu.fbk.dh.gigaword.jsonPair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
* Created by alessio on 18/04/17.
*/
public class Snippet {
private static final Logger LOGGER = LoggerFactory.getLogger(Snippet.class);
String speaker;
List<Sentence> sentences;
public List<Sentence> getSentences() {
return sentences;
}
}
|
[
"alessio@apnetwork.it"
] |
alessio@apnetwork.it
|
966a930a7cd38a2633813bcb2628e3ea289542a9
|
396033b5a2eba91f4fa375c8946beff7c8d478c7
|
/src/com/onebill/module_test1/music_palyer_application/Show_Song.java
|
7a06047aba8e8e4c7765736ad78faa73a649f98e
|
[] |
no_license
|
karthika-onebill/Music_Player_Application
|
18ac22b761a5bb8c43fdb73230cb155d5749d35c
|
a24a486c004ca4079400fd50662f05dd5f9061eb
|
refs/heads/master
| 2023-04-25T23:43:45.042706
| 2021-06-03T10:29:42
| 2021-06-03T10:29:42
| 373,456,761
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 733
|
java
|
/*
*
* Play all songs one by one
*/
package com.onebill.module_test1.music_palyer_application;
public class Show_Song extends HenchForth {
static void play_all_songs() {
Search_Song s = new Search_Song();
try {
// 3.issue the queries
String query = "select * from MusicFiles order by Song_Title asc";
stat = con.createStatement();
// 4.process the result
res = stat.executeQuery(query);
s.displayViewTable(res);
/*
* while (res.next()) { String song_title = res.getString("Song_Title");
* System.err.println("Playing song................."+song_title);
* Thread.sleep(20); }
*/
} catch (Exception e) {
System.err.println("Coudn't reach the server!! Try again!");
}
}
}
|
[
"karthikavel2000@gmail.com"
] |
karthikavel2000@gmail.com
|
c6c2b73ae60de2b28f376fc0ffc579f376bfed00
|
68cdc687b788aa1ec3aff8aca96627e5e16010b9
|
/src/main/java/com/github/developer/weapons/model/official/Fan.java
|
3966fd69c99bc4bfaaaba78ab48917d2243ee046
|
[] |
no_license
|
developer-weapons/wechat-spring-boot-starter
|
c75b933a551cc79fb66cdac3d026e90f6b39a263
|
323c9f2493204b976416b24ce2f596af87c9fc3c
|
refs/heads/master
| 2022-06-23T10:38:01.292191
| 2021-11-07T01:43:32
| 2021-11-07T01:43:32
| 253,949,509
| 28
| 11
| null | 2022-06-17T03:05:56
| 2020-04-08T01:01:48
|
Java
|
UTF-8
|
Java
| false
| false
| 294
|
java
|
package com.github.developer.weapons.model.official;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Fan {
private Long total;
private Long count;
@JSONField(name = "next_openid")
private String nextOpenId;
private FanData data;
}
|
[
"gwangchunlei@gmail.com"
] |
gwangchunlei@gmail.com
|
4f8fef8566127583fc13503bc1cbfc0d481772ad
|
71981de12c4b213feb7fb7cb264c9fc651f2658b
|
/Java/For Loops/src/RunForLoops.java
|
f9e777dbdf3ae9524c0aee358d4e29a96174e5e1
|
[] |
no_license
|
LucaKoval/Java-Space-Shooter
|
f2e4202d4e012ab22d163402837bd336f325bdd2
|
5b0bac0fa73ae1fc4735e2825c21944746d2c5d8
|
refs/heads/master
| 2021-05-29T16:31:06.096161
| 2015-11-06T01:12:52
| 2015-11-06T01:12:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 222
|
java
|
public class RunForLoops {
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int value = 13; value > 0; value = value - 2){
System.out.println(value);
}
}
}
|
[
"Luca@Lucas-MacBook-Pro.local"
] |
Luca@Lucas-MacBook-Pro.local
|
ce151ba71c724e417bc64306ebbe055b3ed829ba
|
90731af6d14ed1c1a56c9c8e9eed193c7cd6b5d9
|
/Jay_workspace/Spring_Annotation/src/com/aop/aop/LogAspects.java
|
1861846d33d305d5b4904b5acf06b0aaa650d76b
|
[] |
no_license
|
kiss78832/jay_project
|
02792fc92c6b01940ab67eba2bc5ddb8d7351a9b
|
f4c9884b3c7f376140b50e432c68d7e1faf444bd
|
refs/heads/master
| 2022-12-21T14:08:57.032808
| 2021-08-02T04:07:56
| 2021-08-02T04:07:56
| 239,050,781
| 0
| 0
| null | 2022-12-16T09:42:13
| 2020-02-08T01:18:14
|
Java
|
BIG5
|
Java
| false
| false
| 2,405
|
java
|
package com.aop.aop;
import java.util.Arrays;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
/*
* @Aspect : 告訴Spring當前類別是一個切面類別
*/
@Aspect
public class LogAspects {
/*
* 抽取公共切入點表達式
* a).本類別引用。
* b).其他的切面引用。
*/
@Pointcut("execution(public int com.aop.aop.MathCalculator.*(..))") //一個點[.]代表一個參數
public void pointCut() {}
/*
* 1.@Before在目標方法之前切入 : 切入點表達式(指定在哪個方法切入)
* 2.★★★ JoinPoint一定要排在參數列表第一位 ,錯誤示範:(public void logStart(Object obj,JoinPoint joinPoint))
* 3.execution("表達式")
*/
@Before("execution(public int com.aop.aop.MathCalculator.*(..))")//第一種寫法直接寫
public void logStart(JoinPoint joinPoint) {
Object[] args = joinPoint.getArgs();
System.out.println("(LogAspects.java) "+joinPoint.getSignature().getName()+" 除法執行...取得參數 : {"+Arrays.asList(args)+"}");
}
@After("pointCut()")//第二種寫法,寫在變數裡面利用@PointCut()引用
public void logEnd(JoinPoint joinPoint) {
Object[] args = joinPoint.getArgs();
System.out.println("(LogAspects.java) "+joinPoint.getSignature().getName()+" 除法結束...取得參數 : {"+Arrays.asList(args)+"}");
}
/*
* value = 若未設定@AfterReturning("pointCut()") 預設就是value
* returning = obj -> 告訴Spring把返回值封裝到參數obj身上
*/
@AfterReturning(value = "pointCut()",returning = "obj") //
public void logReturn(JoinPoint joinPoint,Object obj) {
System.out.println("(LogAspects.java)除法正常返回...參數返回結果 : {"+obj+"}");
}
/*
* throwing = ex -> 告訴Spring把返回錯誤封裝到參數ex身上
* 測試請改為 athCalculatorBean.div(1, 0);
*/
@AfterThrowing(value = "pointCut()", throwing = "ex")
public void logException(JoinPoint joinPoint,Exception ex) {
System.out.println("(LogAspects.java) "+joinPoint.getSignature().getName()+" 除法異常...返回Exception : {"+ex+"}");
}
}
|
[
"59165393+kiss78832@users.noreply.github.com"
] |
59165393+kiss78832@users.noreply.github.com
|
70f1be1ac3cd6989e0e5e4ffb7bd552c758e2a8e
|
af810df7ce36461ec2cfc6f572748ba56e1eea06
|
/testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/rx/RxCompletionStageClientAsyncTest.java
|
5039664ffca189e7f99a7d45f88207fb40b29ce0
|
[
"Apache-2.0"
] |
permissive
|
benjamin-chapoton/Resteasy
|
07f47ee432bd5e6cfc09edae125f916e69e8afa6
|
9b78c494b84d33a556034ff0c5638be8767d2d4a
|
refs/heads/master
| 2020-03-29T15:36:15.265508
| 2018-09-20T10:43:27
| 2018-09-20T10:43:27
| 150,071,698
| 0
| 0
| null | 2018-09-24T08:06:59
| 2018-09-24T08:06:59
| null |
UTF-8
|
Java
| false
| false
| 18,713
|
java
|
package org.jboss.resteasy.test.rx;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import javax.ws.rs.client.CompletionStageRxInvoker;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.internal.CompletionStageRxInvokerProvider;
import org.jboss.resteasy.test.rx.resource.RxScheduledExecutorService;
import org.jboss.resteasy.test.rx.resource.TestException;
import org.jboss.resteasy.test.rx.resource.TestExceptionMapper;
import org.jboss.resteasy.test.rx.resource.Thing;
import org.jboss.resteasy.test.rx.resource.SimpleResourceImpl;
import org.jboss.resteasy.utils.PortProviderUtil;
import org.jboss.resteasy.utils.TestUtil;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* @tpSubChapter Reactive classes
* @tpChapter Integration tests
* @tpSince RESTEasy 4.0
*
* These tests run asynchronously on client, calling a CompletionStageRxInvoker.
* The server creates and returns objects synchronously.
*/
@RunWith(Arquillian.class)
@RunAsClient
public class RxCompletionStageClientAsyncTest {
private static ResteasyClient client;
private static List<Thing> xThingList = new ArrayList<Thing>();
private static List<Thing> aThingList = new ArrayList<Thing>();
private static Entity<String> aEntity = Entity.entity("a", MediaType.TEXT_PLAIN_TYPE);
private static GenericType<List<Thing>> LIST_OF_THING = new GenericType<List<Thing>>() {};
static {
for (int i = 0; i < 3; i++) {xThingList.add(new Thing("x"));}
for (int i = 0; i < 3; i++) {aThingList.add(new Thing("a"));}
}
@Deployment
public static Archive<?> deploy() {
WebArchive war = TestUtil.prepareArchive(RxCompletionStageClientAsyncTest.class.getSimpleName());
war.addClass(Thing.class);
war.addClass(RxScheduledExecutorService.class);
war.addClass(TestException.class);
return TestUtil.finishContainerPrepare(war, null, SimpleResourceImpl.class, TestExceptionMapper.class);
}
private static String generateURL(String path) {
return PortProviderUtil.generateURL(path, RxCompletionStageClientAsyncTest.class.getSimpleName());
}
//////////////////////////////////////////////////////////////////////////////
@BeforeClass
public static void beforeClass() throws Exception {
client = new ResteasyClientBuilder().build();
}
@AfterClass
public static void after() throws Exception {
client.close();
}
//////////////////////////////////////////////////////////////////////////////
@Test
public void testGet() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.get();
Assert.assertEquals("x", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
public void testGetString() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<String> completionStage = invoker.get(String.class);
Assert.assertEquals("x", completionStage.toCompletableFuture().get());
}
@Test
public void testGetThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/get/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.get(Thing.class);
Assert.assertEquals(new Thing("x"), completionStage.toCompletableFuture().get());
}
@Test
public void testGetThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/get/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.get(LIST_OF_THING);
Assert.assertEquals(xThingList, completionStage.toCompletableFuture().get());
}
@Test
public void testPut() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/put/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.put(aEntity);
Assert.assertEquals("a", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
public void testPutThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/put/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.put(aEntity, Thing.class);
Assert.assertEquals(new Thing("a"), completionStage.toCompletableFuture().get());
}
@Test
public void testPutThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/put/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.put(aEntity, LIST_OF_THING);
Assert.assertEquals(aThingList, completionStage.toCompletableFuture().get());
}
@Test
public void testPost() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/post/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.post(aEntity);
Assert.assertEquals("a", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
public void testPostThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/post/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.post(aEntity, Thing.class);
Assert.assertEquals(new Thing("a"), completionStage.toCompletableFuture().get());
}
@Test
public void testPostThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/post/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.post(aEntity, LIST_OF_THING);
Assert.assertEquals(aThingList, completionStage.toCompletableFuture().get());
}
@Test
public void testDelete() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/delete/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.delete();
Assert.assertEquals("x", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
public void testDeleteThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/delete/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.delete(Thing.class);
Assert.assertEquals(new Thing("x"), completionStage.toCompletableFuture().get());
}
@Test
public void testDeleteThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/delete/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.delete(LIST_OF_THING);
Assert.assertEquals(xThingList, completionStage.toCompletableFuture().get());
}
@Test
public void testHead() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/head/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.head();
Response response = completionStage.toCompletableFuture().get();
Assert.assertEquals(200, response.getStatus());
}
@Test
public void testOptions() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/options/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.options();
Assert.assertEquals("x", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
public void testOptionsThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/options/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.options(Thing.class);
Assert.assertEquals(new Thing("x"), completionStage.toCompletableFuture().get());
}
@Test
public void testOptionsThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/options/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.options(LIST_OF_THING);
Assert.assertEquals(xThingList, completionStage.toCompletableFuture().get());
}
@Test
@Ignore // TRACE is disabled by default in Wildfly
public void testTrace() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/trace/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.trace();
Assert.assertEquals("x", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
@Ignore // TRACE is disabled by default in Wildfly
public void testTraceThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/trace/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.trace(Thing.class);
Assert.assertEquals(new Thing("x"), completionStage.toCompletableFuture().get());
}
@Test
@Ignore // TRACE is disabled by default in Wildfly
public void testTraceThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/trace/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.trace(LIST_OF_THING);
Assert.assertEquals(xThingList, completionStage.toCompletableFuture().get());
}
@Test
public void testMethodGet() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.method("GET");
Assert.assertEquals("x", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
public void testMethodGetThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/get/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.method("GET", Thing.class);
Assert.assertEquals(new Thing("x"), completionStage.toCompletableFuture().get());
}
@Test
public void testMethodGetThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/get/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.method("GET", LIST_OF_THING);
Assert.assertEquals(xThingList, completionStage.toCompletableFuture().get());
}
@Test
public void testMethodPost() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/post/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.method("POST", aEntity);
Assert.assertEquals("a", completionStage.toCompletableFuture().get().readEntity(String.class));
}
@Test
public void testMethodPostThing() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/post/thing")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = invoker.method("POST", aEntity, Thing.class);
Assert.assertEquals(new Thing("a"), completionStage.toCompletableFuture().get());
}
@Test
public void testMethodPostThingList() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/post/thing/list")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<List<Thing>> completionStage = invoker.method("POST", aEntity, LIST_OF_THING);
Assert.assertEquals(aThingList, completionStage.toCompletableFuture().get());
}
@Test
public void testScheduledExecutorService () throws Exception {
{
RxScheduledExecutorService.used = false;
CompletionStageRxInvoker invoker = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.get();
Assert.assertFalse(RxScheduledExecutorService.used);
Assert.assertEquals("x", completionStage.toCompletableFuture().get().readEntity(String.class));
}
{
RxScheduledExecutorService.used = false;
RxScheduledExecutorService executor = new RxScheduledExecutorService();
ResteasyClient client = ((ResteasyClientBuilder) new ResteasyClientBuilder().executorService(executor)).build();
client.register(CompletionStageRxInvokerProvider.class);
CompletionStageRxInvoker invoker = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage = invoker.get();
Assert.assertTrue(RxScheduledExecutorService.used);
Assert.assertEquals("x", completionStage.toCompletableFuture().get().readEntity(String.class));
}
}
@Test
public void testUnhandledException() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/exception/unhandled")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = (CompletionStage<Thing>) invoker.get(Thing.class);
AtomicReference<Throwable> value = new AtomicReference<Throwable>();
CountDownLatch latch = new CountDownLatch(1);
completionStage.whenComplete((Thing t1, Throwable t2) -> {value.set(t2); latch.countDown();});
boolean waitResult = latch.await(30, TimeUnit.SECONDS);
Assert.assertTrue("Waiting for event to be delivered has timed out.", waitResult);
Assert.assertTrue(value.get().getMessage().contains("500"));
}
@Test
public void testHandledException() throws Exception {
CompletionStageRxInvoker invoker = client.target(generateURL("/exception/handled")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Thing> completionStage = (CompletionStage<Thing>) invoker.get(Thing.class);
AtomicReference<Throwable> value = new AtomicReference<Throwable>();
CountDownLatch latch = new CountDownLatch(1);
completionStage.whenComplete((Thing t1, Throwable t2) -> {value.set(t2); latch.countDown();});
boolean waitResult = latch.await(30, TimeUnit.SECONDS);
Assert.assertTrue("Waiting for event to be delivered has timed out.", waitResult);
Assert.assertTrue(value.get().getMessage().contains("444"));
}
@Test
public void testGetTwoClients() throws Exception {
CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<String>();
ResteasyClient client1 = new ResteasyClientBuilder().build();
client1.register(CompletionStageRxInvokerProvider.class);
CompletionStageRxInvoker invoker1 = client1.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage1 = (CompletionStage<Response>) invoker1.get();
ResteasyClient client2 = new ResteasyClientBuilder().build();
client2.register(CompletionStageRxInvokerProvider.class);
CompletionStageRxInvoker invoker2 = client2.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage2 = (CompletionStage<Response>) invoker2.get();
list.add(completionStage1.toCompletableFuture().get().readEntity(String.class));
list.add(completionStage2.toCompletableFuture().get().readEntity(String.class));
Assert.assertEquals(2, list.size());
for (int i = 0; i < 2; i++) {
Assert.assertEquals("x", list.get(i));
}
}
@Test
public void testGetTwoInvokers() throws Exception {
CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<String>();
CompletionStageRxInvoker invoker1 = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage1 = (CompletionStage<Response>) invoker1.get();
CompletionStageRxInvoker invoker2 = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage2 = (CompletionStage<Response>) invoker2.get();
list.add(completionStage1.toCompletableFuture().get().readEntity(String.class));
list.add(completionStage2.toCompletableFuture().get().readEntity(String.class));
Assert.assertEquals(2, list.size());
for (int i = 0; i < 2; i++) {
Assert.assertEquals("x", list.get(i));
}
}
@Test
public void testGetTwoCompletionStages() throws Exception {
CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<String>();
CompletionStageRxInvoker invoker = client.target(generateURL("/get/string")).request().rx(CompletionStageRxInvoker.class);
CompletionStage<Response> completionStage1 = (CompletionStage<Response>) invoker.get();
CompletionStage<Response> completionStage2 = (CompletionStage<Response>) invoker.get();
list.add(completionStage1.toCompletableFuture().get().readEntity(String.class));
list.add(completionStage2.toCompletableFuture().get().readEntity(String.class));
Assert.assertEquals(2, list.size());
for (int i = 0; i < 2; i++) {
Assert.assertEquals("x", list.get(i));
}
}
}
|
[
"soldano.servizi@email.it"
] |
soldano.servizi@email.it
|
e8e85c0dc59cc27c23429c4cedef0500be07080b
|
32f7b667867f725098922de2ff107e6dd01cf86e
|
/course/java-experiment-02/src/com/example/Test.java
|
9427694060f6b35597a975769cc9d249231ad202
|
[] |
no_license
|
fuppl/java
|
e3364742c7e95855782185adb641005dc3dc8bdb
|
807702bb4e6ac4bfc0159c1e972890dd2edc158b
|
refs/heads/master
| 2021-02-11T21:40:20.758370
| 2020-03-03T03:54:21
| 2020-03-03T03:54:21
| 244,531,244
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 696
|
java
|
package com.example;
import com.example.entity.Student;
import com.example.service.StudentService;
public class Test {
public static void main(String[] args) {
int mark[]={94,60,55,100,80};
int i;
for(i=0;i<5;i++){
if(mark[i]<60)
System.out.println(mark[i]);
}
for(int e:mark){
if(e<60) System.out.println(e);
}
int classnumber=1,number=123;
Student stu;
stu= StudentService.returnstudent(classnumber, number);
System.out.println("姓名"+stu.getName());
float m=StudentService.average(1);
System.out.println(classnumber+"班平均分为"+m);
}
}
|
[
"2766700872@qq.com"
] |
2766700872@qq.com
|
86e0f00f08a9cc60e0b40256933048d75a7835b9
|
c27b302b11b562f1a1d45549ac598e4821d2cb71
|
/src/main/java/方法调用1/NameClass.java
|
01986f644c457715869bebc9e715403c98f0d93e
|
[] |
no_license
|
buerbl/javaPool
|
46e7b07d8653be7f2a613403fee932f31dfb4fab
|
2f950cecfe2ac01ceb72a2b85cc01e0e1d7320d0
|
refs/heads/master
| 2022-07-01T18:17:42.517872
| 2022-03-10T09:31:51
| 2022-03-10T09:31:51
| 229,268,564
| 1
| 0
| null | 2022-06-21T02:29:27
| 2019-12-20T13:19:19
|
Java
|
UTF-8
|
Java
| false
| false
| 630
|
java
|
package 方法调用1;
import lombok.Getter;
import lombok.Setter;
import org.junit.Test;
/**
* @author boolean
* Date: 2019/5/28 17:07
* description:
*/
public class NameClass {
private String name = "chen";
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void test1(NameClass nameClass){
nameClass.setName("chenwen");
}
@Test
public void test(){
NameClass nameClass = new NameClass();
test1(nameClass);
// nameClass.name
System.out.println(nameClass.getName());
}
}
|
[
"837751454@qq.com"
] |
837751454@qq.com
|
dc9430d023a27a28890e11724a45352411618a12
|
ad64a14fac1f0d740ccf74a59aba8d2b4e85298c
|
/linkwee-oss/src/main/java/com/linkwee/activity/model/RedpacketCal.java
|
2ae7b0ac115de1f9699875d3b1f0cadaa7262382
|
[] |
no_license
|
zhangjiayin/supermarket
|
f7715aa3fdd2bf202a29c8683bc9322b06429b63
|
6c37c7041b5e1e32152e80564e7ea4aff7128097
|
refs/heads/master
| 2020-06-10T16:57:09.556486
| 2018-10-30T07:03:15
| 2018-10-30T07:03:15
| 193,682,975
| 0
| 1
| null | 2019-06-25T10:03:03
| 2019-06-25T10:03:03
| null |
UTF-8
|
Java
| false
| false
| 3,220
|
java
|
package com.linkwee.activity.model;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonFormat;
public class RedpacketCal implements Serializable{
private static final long serialVersionUID = -4141279311355008348L;
@JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
private Date calDate; // 日期
private Integer sendRedpacketlcsCounts; //发放红包的理财师人数
private Integer lcsSendRedpacketCounts; //理财师发放的红包数量
private Integer lcsSendRedpacketCustomerCounts; //理财师发放红包的客户数量
private Double lcsSendRedpacketAmount; //理财师发放红包金额
private Integer useRedpacketCustomerCounts; //使用红包的客户数量
private Integer redpacketUseCounts; //红包使用数量
private Double redpacketUseAmount; //红包使用金额
private Double redpacketYearAmount; //红包产生的年化投资金额
public Date getCalDate() {
return calDate;
}
public void setCalDate(Date calDate) {
this.calDate = calDate;
}
public Integer getSendRedpacketlcsCounts() {
return sendRedpacketlcsCounts;
}
public void setSendRedpacketlcsCounts(Integer sendRedpacketlcsCounts) {
this.sendRedpacketlcsCounts = sendRedpacketlcsCounts;
}
public Integer getLcsSendRedpacketCounts() {
return lcsSendRedpacketCounts;
}
public void setLcsSendRedpacketCounts(Integer lcsSendRedpacketCounts) {
this.lcsSendRedpacketCounts = lcsSendRedpacketCounts;
}
public Integer getLcsSendRedpacketCustomerCounts() {
return lcsSendRedpacketCustomerCounts;
}
public void setLcsSendRedpacketCustomerCounts(
Integer lcsSendRedpacketCustomerCounts) {
this.lcsSendRedpacketCustomerCounts = lcsSendRedpacketCustomerCounts;
}
public Double getLcsSendRedpacketAmount() {
return lcsSendRedpacketAmount;
}
public void setLcsSendRedpacketAmount(Double lcsSendRedpacketAmount) {
this.lcsSendRedpacketAmount = lcsSendRedpacketAmount;
}
public Integer getUseRedpacketCustomerCounts() {
return useRedpacketCustomerCounts;
}
public void setUseRedpacketCustomerCounts(Integer useRedpacketCustomerCounts) {
this.useRedpacketCustomerCounts = useRedpacketCustomerCounts;
}
public Integer getRedpacketUseCounts() {
return redpacketUseCounts;
}
public void setRedpacketUseCounts(Integer redpacketUseCounts) {
this.redpacketUseCounts = redpacketUseCounts;
}
public Double getRedpacketUseAmount() {
return redpacketUseAmount;
}
public void setRedpacketUseAmount(Double redpacketUseAmount) {
this.redpacketUseAmount = redpacketUseAmount;
}
public Double getRedpacketYearAmount() {
return redpacketYearAmount;
}
public void setRedpacketYearAmount(Double redpacketYearAmount) {
this.redpacketYearAmount = redpacketYearAmount;
}
@Override
public String toString() {
return JSON.toJSONString(this, SerializerFeature.UseISO8601DateFormat);
}
}
|
[
"liqimoon@qq.com"
] |
liqimoon@qq.com
|
d66ad643fb84e77b2c19c48bef200555dee191e0
|
7cbbb95dd4f9f4b9b153573af13ab6b55fefb6e1
|
/scheduling_system/src/main/java/com/zhiyou/dto/AdminInfo.java
|
28f69d0ac39c51f5560b759b7f8d3d46cef36da8
|
[] |
no_license
|
161360238/Scheduling
|
248f2b26be09cb19104b373011d2690207c470c7
|
abcc1f3b0d62314271e089c7c09d87db976ee49e
|
refs/heads/master
| 2023-08-09T07:15:12.414505
| 2019-08-09T03:24:56
| 2019-08-09T03:24:56
| 201,381,555
| 0
| 0
| null | 2023-07-22T13:10:28
| 2019-08-09T03:24:21
|
Java
|
UTF-8
|
Java
| false
| false
| 923
|
java
|
/**
*
*/
package com.zhiyou.dto;
import org.hibernate.validator.constraints.NotBlank;
/**
* @author zhailiang
*
*/
public class AdminInfo {
private Long id;
/**
* 角色id
*/
@NotBlank(message = "角色id不能为空")
private Long roleId;
/**
* 用户名
*/
@NotBlank(message = "用户名不能为空")
private String username;
/**
* @return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return the roleId
*/
public Long getRoleId() {
return roleId;
}
/**
* @param roleId the roleId to set
*/
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
/**
* @return the username
*/
public String getUsername() {
return username;
}
/**
* @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
}
|
[
"wweixiaoxhf@163.com"
] |
wweixiaoxhf@163.com
|
49633ac89ea607ca6087c538895751f9a7ff696c
|
966861218bbe8676a2968be735673ca6ef916300
|
/rosalind/src/binf/W4_E2_B.java
|
4a2a9dc977cf2a4dde4d20dd0498307e156cd6c2
|
[] |
no_license
|
azun5290/Java
|
253c0ba08e8ddcebf9d24153c0f89d43f4f80a9f
|
cd398219754975dbeaaaa47315f013e9c3dd3d06
|
refs/heads/master
| 2021-01-20T18:07:49.014440
| 2016-06-02T06:04:47
| 2016-06-02T06:04:47
| 60,233,450
| 0
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 3,224
|
java
|
package binf;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
public class W4_E2_B {
/**
* @param args
*
*
* PartialDigest (L)
* 1 width � Maximum element in L
* 2 DELETE
* (width, L)
* 3 X � {0, width}
* 4 PLACE (L, X)
*
* PLACE (L, X)
* 1 if L is empty
* 2 output X
* 3 return
* 4 y � Maximum element in L
* 5 if ∆(y, X) ⊆L
* 6 Add y to X and remove lengths ∆(y , X ) from L
* 7 PLACE (L, X)
* 8 Remove y from X and add lengths ∆(y, X) to L
* 9 if ∆(width −y, X) ⊆L
* 10 Add width −y to X and remove lengths ∆(width−y, X) from L
* 11 PLACE (L, X)
* 12 Remove width −y from X and add lengths ∆(width−y, X) to L
* 13 return
*
*
*/
public static void PartialDigest(int[] L) {
int max = 0;
int width = max;
// function delete width from L
//L = L - width;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<Integer> L_list = new ArrayList<Integer>();
ArrayList<Integer> X_list = new ArrayList<Integer>();
int[] L = new int[] { 2, 2, 3, 3, 4, 5, 6, 7, 8, 10 };
int max = 0;
int width = 0;
int r= 2;
int n = L.length/2;
System.out.println(L.length);
/* int factN = fact(n);
int factR = fact(r);
int sub = n-r;
int facSub = fact(sub);*/
//int LenToFind = factN/(factR*facSub);
int LenToFind = fact(n)/(((fact(r))*(fact(n-r))))/2;
System.out.println(LenToFind);
int[] X = new int[LenToFind];
// fill in L_list
for (int i = 0; i < L.length; i++) {
L_list.add(L[i]);
}
// fill in X_list
/*
* for (int i = 0; i < L.length; i++) { X_list.add(X[i]);
*
* }
*/
if (L.length == 0) {
Collections.sort(X_list);
System.out.println(X_list);
return;
}
// ArrayList<Integer> data = new ArrayList<Integer>();
// ArrayList<Integer> lenghts = new ArrayList<Integer>();
// pdigest(L)
for (int i = 0; i < L.length; i++) {
if (L[i] > L[max]) {
max = i;
}
}
width = L[max];
System.out.println("NOW L has:");
Collections.sort(L_list);
System.out.println(L_list);
L = (int[]) ArrayUtils.removeElement(L, width);
//L_list.remove(L_list.get(width));
System.out.println("And NOW L has:");
for (int i = 0; i < L.length; i++){
System.out.println(L[i]);
}
/* Collections.sort(L_list);
System.out.println(L_list.remove(L_list.get(width)));*/
X[0] = 0;
X[4] = width;
System.out.println("NOW X has:");
// fill in X_list
for (int i = 0; i < X.length; i++) { X_list.add(X[i]);
}
Collections.sort(X_list);
System.out.println(X_list);
//System.out.println(X[0]);
//System.out.println(X[4]);
// place(L,X)
}
private static int fact(int x) {
// TODO Auto-generated method stub
if (x<=1)return 1;
else return x*fact(x-1);
}
}
|
[
"azun5290@uni.sydney.edu.au"
] |
azun5290@uni.sydney.edu.au
|
6fe9e67e423a859aab30c35dc6e618fedd5e6a2b
|
07ae5b6657f7efc905287be75f31c57214ffe8b3
|
/src/ch03/CompoundInterest.java
|
5d3015ee33239b6a23cc6ac0df370b8d532c043d
|
[] |
no_license
|
jlehocz/CJICH03
|
b4c96737b9f2b7f92e8a3c7b468f52e39b750867
|
41f31518a2a4da7c94ce51cbcc7bad9225e2a56f
|
refs/heads/master
| 2020-03-30T05:40:43.188323
| 2014-07-07T21:15:06
| 2014-07-07T21:15:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,601
|
java
|
package ch03;
/**
* This program shows how to store tabular data in a 2D array.
* @version 1.40 2004-02-10
* @author Cay Horstmann
*/
public class CompoundInterest
{
public static void main(String[] args)
{
final double STARTRATE = 10;
final int NRATES = 6;
final int NYEARS = 10;
//Version 1.1
// set interest rates to 10 . . . 15%
double[] interestRate = new double[NRATES];
for (int j = 0; j < interestRate.length; j++)
interestRate[j] = (STARTRATE + j) / 100.0;
double[][] balances = new double[NYEARS][NRATES];
// set initial balances to 10000
for (int j = 0; j < balances[0].length; j++)
balances[0][j] = 10000;
// compute interest for future years
for (int i = 1; i < balances.length; i++)
{
for (int j = 0; j < balances[i].length; j++)
{
// get last year's balances from previous row
double oldBalance = balances[i - 1][j];
// compute interest
double interest = oldBalance * interestRate[j];
// compute this year's balances
balances[i][j] = oldBalance + interest;
}
}
// print one row of interest rates
for (int j = 0; j < interestRate.length; j++)
System.out.printf("%9.0f%%", 100 * interestRate[j]);
System.out.println();
// print balance table
for (double[] row : balances)
{
// print table row
for (double b : row)
System.out.printf("%10.2f", b);
System.out.println();
}
}
}
|
[
"apa@Aspire-5530"
] |
apa@Aspire-5530
|
8afaf9aca50a4a0544e7375dcddc4e9fd28471e8
|
208ba847cec642cdf7b77cff26bdc4f30a97e795
|
/x/src/main/java/org.wp.x/ui/stats/models/VisitsModel.java
|
9aef205652a932575f991f8a56662ad808d7ee4e
|
[] |
no_license
|
kageiit/perf-android-large
|
ec7c291de9cde2f813ed6573f706a8593be7ac88
|
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
|
refs/heads/master
| 2021-01-12T14:00:19.468063
| 2016-09-27T13:10:42
| 2016-09-27T13:10:42
| 69,685,305
| 0
| 0
| null | 2016-09-30T16:59:49
| 2016-09-30T16:59:48
| null |
UTF-8
|
Java
| false
| false
| 4,770
|
java
|
package org.wp.x.ui.stats.models;
import android.text.TextUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.wp.x.util.AppLog;
import org.wp.x.util.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class VisitsModel extends BaseStatsModel {
private String mFields; // Holds a JSON Object
private String mUnit;
private String mDate;
private String mBlogID;
private List<VisitModel> mVisits;
public VisitsModel(String blogID, JSONObject response) throws JSONException {
this.setBlogID(blogID);
this.setDate(response.getString("date"));
this.setUnit(response.getString("unit"));
this.setFields(response.getJSONArray("fields").toString());
JSONArray dataJSON;
try {
dataJSON = response.getJSONArray("data");
} catch (JSONException e) {
AppLog.e(AppLog.T.STATS, this.getClass().getName() + " cannot convert the data field to a JSON array", e);
dataJSON = new JSONArray();
}
if (dataJSON == null || dataJSON.length() == 0) {
mVisits = new ArrayList<>(0);
} else {
// Read the position/index of each field in the response
HashMap<String, Integer> columnsMapping = new HashMap<>(6);
final JSONArray fieldsJSON = getFieldsJSON();
if (fieldsJSON == null || fieldsJSON.length() == 0) {
mVisits = new ArrayList<>(0);
} else {
try {
for (int i = 0; i < fieldsJSON.length(); i++) {
final String field = fieldsJSON.getString(i);
columnsMapping.put(field, i);
}
} catch (JSONException e) {
AppLog.e(AppLog.T.STATS, "Cannot read the parameter fields from the JSON response." +
"Response: " + response.toString(), e);
mVisits = new ArrayList<>(0);
}
}
int viewsColumnIndex = columnsMapping.get("views");
int visitorsColumnIndex = columnsMapping.get("visitors");
int likesColumnIndex = columnsMapping.get("likes");
int commentsColumnIndex = columnsMapping.get("comments");
int periodColumnIndex = columnsMapping.get("period");
int numPoints = dataJSON.length();
mVisits = new ArrayList<>(numPoints);
for (int i = 0; i < numPoints; i++) {
try {
JSONArray currentDayData = dataJSON.getJSONArray(i);
VisitModel currentVisitModel = new VisitModel();
currentVisitModel.setBlogID(getBlogID());
currentVisitModel.setPeriod(currentDayData.getString(periodColumnIndex));
currentVisitModel.setViews(currentDayData.getInt(viewsColumnIndex));
currentVisitModel.setVisitors(currentDayData.getInt(visitorsColumnIndex));
currentVisitModel.setComments(currentDayData.getInt(commentsColumnIndex));
currentVisitModel.setLikes(currentDayData.getInt(likesColumnIndex));
mVisits.add(currentVisitModel);
} catch (JSONException e) {
AppLog.e(AppLog.T.STATS, "Cannot read the Visit item at index " + i
+ " Response: " + response.toString(), e);
}
}
}
}
public List<VisitModel> getVisits() {
return mVisits;
}
public String getBlogID() {
return mBlogID;
}
private void setBlogID(String blogID) {
this.mBlogID = blogID;
}
public String getDate() {
return mDate;
}
private void setDate(String date) {
this.mDate = date;
}
public String getUnit() {
return mUnit;
}
private void setUnit(String unit) {
this.mUnit = unit;
}
private JSONArray getFieldsJSON() {
JSONArray jArray;
try {
String categories = StringUtils.unescapeHTML(this.getFields() != null ? this.getFields() : "[]");
if (TextUtils.isEmpty(categories)) {
jArray = new JSONArray();
} else {
jArray = new JSONArray(categories);
}
} catch (JSONException e) {
AppLog.e(AppLog.T.STATS, this.getClass().getName() + " cannot convert the string to JSON", e);
return null;
}
return jArray;
}
private void setFields(String fields) {
this.mFields = fields;
}
private String getFields() {
return mFields;
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
59d1393bce32bf88b3876e7d8cab63ea5b912cc2
|
36f7c3e42e22cafb4db45391410fb886cb069e61
|
/src/Vincita.java
|
123d74d0d72188ea73f646be6dc3313eed976086
|
[] |
no_license
|
gian2798/Tombola
|
3d75878a7e4b7599a7f6ba00c58c9ad74676342b
|
ed917c5a809b6e039286f3fae7994dc966f6df4f
|
refs/heads/master
| 2021-01-17T21:20:42.577523
| 2017-03-11T10:00:25
| 2017-03-11T10:00:25
| 84,176,024
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,177
|
java
|
/*
Copyright (C) 2015-2016 Mario Cianciolo <mr.udda@gmail.com>
This file is part of Tombola.
Tombola is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Tombola is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tombola. If not, see <http://www.gnu.org/licenses/>.
*/
public enum Vincita {
Ambo,
Terna,
Quaterna,
Cinquina,
Tombola;
// restituisce la vincita successiva a quella indicata
public static Vincita next(final Vincita v) {
if (v == null)
return Ambo;
else if (v == Ambo)
return Terna;
else if (v == Terna)
return Quaterna;
else if (v == Quaterna)
return Cinquina;
else if (v == Cinquina)
return Tombola;
else // if (v == Tombola)
return null;
}
}
|
[
"bordinbiadenegianpao@Lab06_07.itseinaudi.local"
] |
bordinbiadenegianpao@Lab06_07.itseinaudi.local
|
f3c2ee465657ec202b94a2cc6d76ea7fd98273a5
|
9e41e8988c7b2b5eaf46d581c8f7ad2ca4eb3541
|
/android-logcat-record-tools/src/com/iweigame/logcat/MainActivity.java
|
c3703736b0351ec623eb34a93db98eaf2b2fb57c
|
[] |
no_license
|
Georgekibet/anroid-logcat-record-tools
|
7009ede03cf5b32c8b1f316f6b8309b9a251a73b
|
f06043760de03d350a3c2c6b0fe1581bf078bb47
|
refs/heads/master
| 2020-05-18T02:55:05.927646
| 2011-12-01T06:33:13
| 2011-12-01T06:33:13
| 34,218,993
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 890
|
java
|
package com.iweigame.logcat;
import java.io.File;
import android.app.Activity;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import com.iweigame.logcat.R;
import com.iweigame.logcat.util.LogCatUtil;
public class MainActivity extends Activity {
LogCatUtil logUtil = new LogCatUtil("droidlog", "tag", "D");
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.v("tag", ">>>>>>>>>>>>>>>>>>>>"
+ Environment.getExternalStorageDirectory().getPath()
.toString());
logUtil.writeLogToFile();
//
}
}
|
[
"jiessiedyh@gmail.com@7a5b0728-96a5-5be7-0168-6efbe4433c43"
] |
jiessiedyh@gmail.com@7a5b0728-96a5-5be7-0168-6efbe4433c43
|
d4b166030382eecb0ac24d5cba0ce2263e5fcfee
|
39f94c542420b3f525be01e8de94d313c9695f98
|
/LastHourOfHaven/src/Hero/Hero_fly.java
|
3ada0c496475fde42c23408483c0038c754d0f31
|
[] |
no_license
|
alsebr/LHoH
|
28a7d638c8709c0a9887807756d7f7c01accc3fa
|
627fd53c7f89b1cb32bbeddb92b9e89a3e92b768
|
refs/heads/master
| 2021-01-01T05:33:33.821051
| 2014-03-15T18:18:38
| 2014-03-15T18:18:38
| null | 0
| 0
| null | null | null | null |
WINDOWS-1251
|
Java
| false
| false
| 1,360
|
java
|
package Hero;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import LHoH.Hero;
import LHoH.HeroStat;
public class Hero_fly extends Hero {
public Hero_fly() {
super();
String name="Муха";
double costGold=16;
double costSoul=3;
double costTear=0;
double deltaExp=5;
double strp=23;
double vitp=72;
double intp=9;
double statPointPerLvl=39;
double strToPowerRatio=1;
double vitToTTLRatio=2;
String htmlTextHeroTip = "Миньон";
htmlTextHeroTip += "<br> Призвана Повелителем";
Image image=null;
try {
image = ImageIO.read(new File("data/image/hero/demon10.gif"));
} catch (IOException e) {
}
HeroStat heroStatRatio=new HeroStat(0.33, 0.34, 0.33); // summ ==1
HeroStat heroStat=new HeroStat(strp, vitp, intp);
//public void init(String name, Image inImage, double inDeltaExp, double statPointPerLvl, HeroStat heroStat, HeroStat heroStatRatio,double strToPowerRatio,double vitToTTLRatio) {
init(name, image, deltaExp, statPointPerLvl,heroStat,heroStatRatio,strToPowerRatio,vitToTTLRatio,htmlTextHeroTip,costGold,costSoul,costTear);
//LHoH.gameScreen.heroAbilityStock.useAllAbilityByHero(heroId);
}
public void addHeroAbilities(){
}
}
|
[
"User@x-team"
] |
User@x-team
|
07ef152abdb448e42b2642fd4c1f9dfc33971f8b
|
1fa323920aebb60c5a31f53cc0190ea6ccf426d8
|
/src/main/java/com/morris/util/mybatis/MybatisUtil.java
|
667d7b7f97d9c822a1f6e02f40b7acdf3530a7a9
|
[] |
no_license
|
morris131/morris-tool
|
9c46b00f4ef2943b941c21ee630c2d68aed90348
|
a9c6648fe37cbe0363f09b4a6c65b27acf6cd589
|
refs/heads/master
| 2021-01-13T02:10:53.759846
| 2016-01-25T09:22:12
| 2016-01-25T09:22:12
| 41,678,236
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,521
|
java
|
package com.morris.util.mybatis;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Map.Entry;
import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.api.ProgressCallback;
import org.mybatis.generator.config.CommentGeneratorConfiguration;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.Context;
import org.mybatis.generator.config.JDBCConnectionConfiguration;
import org.mybatis.generator.config.JavaClientGeneratorConfiguration;
import org.mybatis.generator.config.JavaModelGeneratorConfiguration;
import org.mybatis.generator.config.PluginConfiguration;
import org.mybatis.generator.config.SqlMapGeneratorConfiguration;
import org.mybatis.generator.config.TableConfiguration;
import org.mybatis.generator.exception.InvalidConfigurationException;
import org.mybatis.generator.internal.DefaultShellCallback;
/**
* mybatis自动生成xml,entity,entityExample,dao文件
* @author morris
*
*/
public class MybatisUtil {
public static void generate(MybatisBean bean) {
Configuration config = new Configuration();
Context context = new Context(null);
context.setId("table");
context.setTargetRuntime("com.morris.util.mybatis.IntrospectedTableImpl");
// 数据库连接
JDBCConnectionConfiguration jdbc = new JDBCConnectionConfiguration();
jdbc.setDriverClass(bean.getDriverClass());
jdbc.setConnectionURL(bean.getConnectionUrl());
jdbc.setUserId(bean.getUserName());
jdbc.setPassword(bean.getPassword());
jdbc.addProperty("remarksReporting","true"); // oracle加上此字段才能访问到注释
context.setJdbcConnectionConfiguration(jdbc);
// 去掉注释
CommentGeneratorConfiguration comment = new CommentGeneratorConfiguration();
comment.addProperty("suppressAllComments", "true");
context.setCommentGeneratorConfiguration(comment);
// 插件
// 序列化插件
PluginConfiguration serializablePlugin = new PluginConfiguration();
serializablePlugin.setConfigurationType("com.morris.util.mybatis.plugin.SerializablePlugin");
context.addPluginConfiguration(serializablePlugin);
// 注释插件
PluginConfiguration tableCommentPlugin = new PluginConfiguration();
tableCommentPlugin.setConfigurationType("com.morris.util.mybatis.plugin.TableCommentPlugin");
context.addPluginConfiguration(tableCommentPlugin);
// 分页插件
PluginConfiguration rowBoundsPlugin = new PluginConfiguration();
rowBoundsPlugin.setConfigurationType("org.mybatis.generator.plugins.RowBoundsPlugin");
context.addPluginConfiguration(rowBoundsPlugin);
// toString插件
PluginConfiguration toStringPlugin = new PluginConfiguration();
toStringPlugin.setConfigurationType("org.mybatis.generator.plugins.ToStringPlugin");
context.addPluginConfiguration(toStringPlugin);
// like插件 生成like查询
PluginConfiguration likePlugin = new PluginConfiguration();
likePlugin.setConfigurationType("org.mybatis.generator.plugins.CaseInsensitiveLikePlugin");
context.addPluginConfiguration(likePlugin);
// service接口插件
PluginConfiguration serviceInterPluginPlugin = new PluginConfiguration();
serviceInterPluginPlugin.setConfigurationType("com.morris.util.mybatis.plugin.ServiceInterPlugin");
context.addPluginConfiguration(serviceInterPluginPlugin);
// service实现插件
PluginConfiguration serviceImplPluginPlugin = new PluginConfiguration();
serviceImplPluginPlugin.setConfigurationType("com.morris.util.mybatis.plugin.ServiceImplPlugin");
context.addPluginConfiguration(serviceImplPluginPlugin);
// dao 插件
PluginConfiguration daoPlugin = new PluginConfiguration();
daoPlugin.setConfigurationType("com.morris.util.mybatis.plugin.DaoPlugin");
context.addPluginConfiguration(daoPlugin);
// controller 插件
PluginConfiguration controllerPlugin = new PluginConfiguration();
controllerPlugin.setConfigurationType("com.morris.util.mybatis.plugin.ControllerPlugin");
context.addPluginConfiguration(controllerPlugin);
// 实体类的生成
JavaModelGeneratorConfiguration model = new JavaModelGeneratorConfiguration();
model.setTargetPackage(bean.getEntityPackage());
model.setTargetProject(bean.getEntityPath());
context.setJavaModelGeneratorConfiguration(model );
// xml文件的生成
SqlMapGeneratorConfiguration mapper = new SqlMapGeneratorConfiguration();
mapper.setTargetPackage(bean.getXmlPackage());
mapper.setTargetProject(bean.getXmlPath());
context.setSqlMapGeneratorConfiguration(mapper);
// dao的生成
JavaClientGeneratorConfiguration dao = new JavaClientGeneratorConfiguration();
dao.setTargetPackage(bean.getDaoPackage());
dao.setTargetProject(bean.getDaoPath());
dao.setConfigurationType("XMLMAPPER");
context.setJavaClientGeneratorConfiguration(dao);
// 添加多个表
TableConfiguration tableConfiguration = null;
for (Entry<String, String> entry : bean.getTableMap().entrySet()) {
tableConfiguration = new TableConfiguration(context);
tableConfiguration.setTableName(entry.getKey());
tableConfiguration.setDomainObjectName(entry.getValue());
context.addTableConfiguration(tableConfiguration);
}
context.addProperty("entityPackage", bean.getEntityPackage());
context.addProperty("entityPath", bean.getEntityPath());
context.addProperty("daoPackage", bean.getDaoPackage());
context.addProperty("daoPath", bean.getDaoPath());
context.addProperty("serviceInterPackage", bean.getServiceInterPackage());
context.addProperty("serviceInterPath", bean.getServiceInterPath());
context.addProperty("serviceImplPackage", bean.getServiceImplPackage());
context.addProperty("serviceImplPath", bean.getServiceImplPath());
context.addProperty("controllerPackage", bean.getControllerPackage());
context.addProperty("controllerPath", bean.getControllerPath());
config.addContext(context);
DefaultShellCallback callback = new DefaultShellCallback(true);
MyBatisGenerator myBatisGenerator;
try {
myBatisGenerator = new MyBatisGenerator(config,callback, null);
ProgressCallback progressCallback = new MyProgressCallback();
myBatisGenerator.generate(progressCallback);
} catch (InvalidConfigurationException | SQLException | IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
|
[
"morris131@163.com"
] |
morris131@163.com
|
9a9aebb398b8d3fef0cec53d27803beb6dd6fd09
|
1da2f63c8b2952ea3609b89d3585201b5264a1e7
|
/SERVLET/src/artifac/GetordenasResponse.java
|
71a654ba072ce5304cea681ce02e544d901128be
|
[] |
no_license
|
danimite94/Tiered-enterprise-apps-web-services-web-front-end-data-persistence-tool-EJB-
|
ce6576064ce8d0a24d879d53c07f4a402b15029d
|
3de823acd66bb42f9a77f6adc95f2584178d3425
|
refs/heads/master
| 2021-09-04T19:19:52.704240
| 2018-01-21T16:58:39
| 2018-01-21T16:58:39
| 118,348,187
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,877
|
java
|
package artifac;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for getordenasResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="getordenasResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://webser/}publicationoficial" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getordenasResponse", propOrder = {
"_return"
})
public class GetordenasResponse {
@XmlElement(name = "return")
protected List<Publicationoficial> _return;
/**
* Gets the value of the return property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the return property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReturn().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Publicationoficial }
*
*
*/
public List<Publicationoficial> getReturn() {
if (_return == null) {
_return = new ArrayList<Publicationoficial>();
}
return this._return;
}
}
|
[
"danisilva944.ds@gmail.com"
] |
danisilva944.ds@gmail.com
|
817a7f58dc1b53722ce48bc8a6103388e697a2ad
|
bb653971747889bfa77d06a3e5ede86c656133ee
|
/PblJava/PBL4/PBL4/PBL4/test/ecomp/uefs/br/util/GrafoTest.java
|
7633cff76dc09c12b136f6862b9298a3d18c8a6b
|
[] |
no_license
|
UEFS-Estudos/PBL
|
abdad1c8db4b763ea09140cfa14a58d1e3e6a03f
|
578c9f064b69c4b50c5820325c2ca0277d1b3853
|
refs/heads/master
| 2021-07-18T02:47:19.417540
| 2017-10-26T00:56:12
| 2017-10-26T00:56:12
| 108,342,704
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,769
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Componente Curricular: Módulo Integrado de Programação 2 Autor: Kayo Costa de
* Santana e Washington Paggoto Data: 23/07/2014 Declaro que este código foi
* elaborado por mim de forma individual e não contém nenhum trecho de código de
* outro colega ou de outro autor, tais como provindos de livros e apostilas, e
* páginas ou documentos eletrônicos da Internet. Qualquer trecho de código de
* outra autoria que uma citação para o não a minha está destacado com autor e a
* fonte do código, e estou ciente que estes trechos não serão considerados para
* fins de avaliação. Alguns trechos do código podem coincidir com de outros
* colegas pois estes foram discutidos em sessões tutorias..
*/
package ecomp.uefs.br.util;
import ecomp.uefs.br.model.Vertice;
import ecomp.uefs.br.model.Aresta;
import ecomp.uefs.br.util.Grafo;
import java.util.Iterator;
import java.util.LinkedList;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Washington
*/
public class GrafoTest {
private Grafo grafo;
private Vertice Q1, Q2,Q3,Q4;
private Aresta w,x,c,v;
private LinkedList arestas;
private LinkedList vertices;
@Before
public void setUp() throws Exception{
Q1= new Vertice("Q1");
Q2= new Vertice("Q2");
Q3= new Vertice("Q3");
Q4= new Vertice("Q4");
w= new Aresta(Q1,Q2,20);
x= new Aresta(Q1,Q3,15);
v= new Aresta(Q3, Q4, 10);
c= new Aresta(Q3,Q2, 7);
vertices= new LinkedList ();
arestas= new LinkedList();
vertices.add(Q1);
vertices.add(Q2);
vertices.add(Q3);
vertices.add(Q4);
arestas.add(w);
arestas.add(x);
arestas.add(v);
arestas.add(c);
// grafo.
grafo= new Grafo(4,arestas,vertices);
}
@Test
public void testBasic() {
LinkedList aux=grafo.caminhoDistancia(Q4, Q2);
assertTrue(aux.get(0)== Q4);
assertTrue(aux.get(1)==Q3);
assertTrue(aux.get(2) == Q2);
assertTrue(aux.size() == 3);
LinkedList h= grafo.calcularMenorNumeroNos(Q1, Q4);
assertTrue(h.get(0) == Q1);
assertTrue(h.get(1)== Q3);
assertTrue(h.get(2)== Q4);
assertTrue(h.size() == 3);
int m= grafo.distancia(Q2,Q4);
assertEquals(m,17);
}
}
|
[
"wstroks@gmail.com"
] |
wstroks@gmail.com
|
d2d1fa0420029c593ee0749b7138e4152ff5e0f3
|
e2cf357149702a78fe6f35777049458478976eb3
|
/src/cn/com/digiwin/justsharecloud/commonfunctions/ParamsParseInt.java
|
797f9ea429cbc49cb55b94da70216acdb3e9d137
|
[] |
no_license
|
aqiangtester/xiaozhiyuan.autotest
|
126fb4a2b2c7eec10b6cfbfd7cb67d7213135d03
|
124135b0bd0da7e378d03489dc8bc1d82d3d6ff9
|
refs/heads/master
| 2023-01-23T04:55:02.029697
| 2020-12-03T09:36:14
| 2020-12-03T09:36:14
| 317,153,684
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 193
|
java
|
package cn.com.digiwin.justsharecloud.commonfunctions;
public class ParamsParseInt {
public static int paramsParseInt(String str){
int i = Integer.parseInt(str);
return i;
}
}
|
[
"tonytian@digiwin.biz"
] |
tonytian@digiwin.biz
|
eb90b75564dc56ae798fc5be9ef682af14ea7369
|
fd1767f9b065c0e77ae0dd175928e006e6ae0d15
|
/so/Process.java
|
0313c99502adbf8a647f1fccc26bc1890226157c
|
[] |
no_license
|
dennermiranda/so
|
429ca3a52e2de130df76f59e6315706fda5d7073
|
96ba8a9465a4a8a5febd3c656290e0bbbe63b586
|
refs/heads/master
| 2021-01-10T12:01:27.574992
| 2015-12-05T01:03:38
| 2015-12-05T01:03:38
| 47,431,137
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,159
|
java
|
import java.util.Comparator;
public class Process {
int arrivalTime;
String pID;
int burstTime;
int priority;
int turnaround;
int waitingTime;
int responseTime;
int throughput;
int contextSwitchCount;
int remainingBurstTime;
Process(String[] parts) {
this.arrivalTime = Integer.parseInt(parts[0]);
this.pID = parts[1];
this.burstTime = Integer.parseInt(parts[2]);
this.priority = Integer.parseInt(parts[3]);
this.turnaround = 0;
this.waitingTime = 0;
this.responseTime = 0;
this.throughput = 0;
this.contextSwitchCount = 0;
this.remainingBurstTime = burstTime;
}
}
class ArrivalTimeComparator implements Comparator<Process> {
@Override
public int compare(Process p1, Process p2) {
return p1.arrivalTime - p2.arrivalTime;
}
}
class RemainingBurstTimeComparator implements Comparator<Process> {
@Override
public int compare(Process p1, Process p2) {
return p1.remainingBurstTime - p2.remainingBurstTime;
}
}
class PriorityComparator implements Comparator<Process> {
@Override
public int compare(Process p1, Process p2) {
return p1.priority - p2.priority;
}
}
|
[
"denner.miranda@gmail.com"
] |
denner.miranda@gmail.com
|
4e2c1bb86c6423bdeb0326bb7b2e9698f30e75d2
|
825b08155eac337524139f50e35d83e0540c329e
|
/test-automation-library/src/main/java/com/etouch/taf/core/config/TafConfig.java
|
c4edbfc37b0aa26ba663faebc69b4859e4691562
|
[] |
no_license
|
sonamM/april-test-jacoco
|
61953e61c9182d70bc3c457bf22db5e7f193d318
|
eee44c6d9548927f81f829d66629859695c068f1
|
refs/heads/master
| 2020-07-02T00:45:29.276306
| 2015-04-07T21:34:52
| 2015-04-07T21:34:52
| 33,569,472
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,462
|
java
|
package com.etouch.taf.core.config;
import java.util.List;
import com.etouch.taf.core.TestBed;
// TODO: Auto-generated Javadoc
/**
* The Class TestAutomationFramework Config
*/
public abstract class TafConfig {
/** The hub. */
private String hub;
/** The port. */
private String port;
/** The tool. */
private String tool;
/** The current test beds. */
private String[] currentTestBeds;
/** The test env. */
private String testEnv;
/** The testClass */
private String[] testClass;
/** The test beds. */
private List<TestBedConfig> testBeds;
/**
* Gets the hub.
*
* @return the hub
*/
public String getHub() {
return hub;
}
/**
* Sets the hub.
*
* @param hub the new hub
*/
public void setHub(String hub) {
this.hub = hub;
}
/**
* Gets the port.
*
* @return the port
*/
public String getPort() {
return port;
}
/**
* Sets the port.
*
* @param port the new port
*/
public void setPort(String port) {
this.port = port;
}
/**
* Gets the tool.
*
* @return the tool
*/
public String getTool() {
return tool;
}
/**
* Sets the tool.
*
* @param tool the new tool
*/
public void setTool(String tool) {
this.tool = tool;
}
/**
* Gets the current test beds.
*
* @return the current test beds
*/
public String[] getCurrentTestBeds() {
return currentTestBeds;
}
/**
* Sets the current test beds.
*
* @param currentTestBeds the new current test beds
*/
public void setCurrentTestBeds(String[] currentTestBeds) {
this.currentTestBeds = currentTestBeds;
}
/**
* Gets the test beds.
*
* @return the test beds
*/
public List<TestBedConfig> getTestBeds() {
return testBeds;
}
/**
* Sets the test beds.
*
* @param testBeds the new test beds
*/
public void setTestBeds(List<TestBedConfig> testBeds) {
this.testBeds = testBeds;
}
/**
* Gets the test env.
*
* @return the test env
*/
public String getTestEnv() {
return testEnv;
}
/**
* Sets the test env.
*
* @param testEnv the new test env
*/
public void setTestEnv(String testEnv) {
this.testEnv = testEnv;
}
public String[] getTestClass() {
return testClass;
}
public void setTestClass(String[] testClass) {
this.testClass = testClass;
}
}
|
[
"sonam.manohar@gmail.com"
] |
sonam.manohar@gmail.com
|
1dd8e114e3ad82bccb898c932f93359bcca6a0f0
|
92e137883bb09808e95f98722ec50ea4da75f7a4
|
/Danawabang/src/board/controller/BoardOTODetailServlet.java
|
53ce4455412da697d4011580298f20e83d5b4539
|
[] |
no_license
|
oryung/SEMI
|
461423dc9837ce05a639575c99159c7cdb801b5b
|
c6a3b0a195fa8458b628219a80d933a29783d15c
|
refs/heads/master
| 2023-06-17T13:50:45.343330
| 2021-07-06T12:02:27
| 2021-07-06T12:02:27
| 369,998,863
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,920
|
java
|
package board.controller;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import board.model.service.BoardService;
import board.model.vo.Board;
import board.model.vo.BoardAttachment;
import board.model.vo.Reply;
/**
* Servlet implementation class BoardOTODetailServlet
*/
@WebServlet("/boardOTODetail.bo")
public class BoardOTODetailServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public BoardOTODetailServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int bId = Integer.parseInt(request.getParameter("bId"));
Board board = new BoardService().selectOTOBoard(bId);
ArrayList<Reply> replyList = new BoardService().selectOTOReplyList(bId);
String page = null;
if(board != null) {
page = "WEB-INF/views/board/boardOTODetail.jsp";
request.setAttribute("board", board);
request.setAttribute("replyList", replyList);
} else {
page = "WEB-INF/views/common/errorPage.jsp";
request.setAttribute("msg", "1대1게시판 상세조회에 실패하였습니다.");
}
request.getRequestDispatcher(page).forward(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
|
[
"07135296sh@gmail.com"
] |
07135296sh@gmail.com
|
d4820038d4a1988087842db2de4738b5d11dceaf
|
88480a333f74dd34b7ba591ab9e7bce6caf52fe0
|
/src/main/java/es/enolgor/app/auth/JWTAuthenticationProvider.java
|
2bb8a30a18ec38ac1488695c49d800b059a5a545
|
[
"MIT"
] |
permissive
|
enolgor/jax-rs-template
|
1d750a363139e15f06f81bc9cfc915819b196a0d
|
d67c94a54beaea6aaa819e9e127d1304a6b113ab
|
refs/heads/master
| 2022-06-26T07:03:20.556449
| 2019-08-01T10:36:27
| 2019-08-01T10:36:27
| 174,490,276
| 0
| 0
|
MIT
| 2022-06-21T01:32:04
| 2019-03-08T07:33:37
|
Java
|
UTF-8
|
Java
| false
| false
| 3,437
|
java
|
package es.enolgor.app.auth;
import java.security.Key;
import java.util.Base64;
import java.util.Date;
import java.util.UUID;
import es.enolgor.app.datasource.DataSource;
import es.enolgor.configuration.Configuration;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.JwtException;
import io.jsonwebtoken.JwtParser;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.security.Keys;
public class JWTAuthenticationProvider implements TokenAuthenticationProvider {
private final JwtBuilder jwtBuilder;
private final JwtParser jwtParser;
private final long accessTokenDuration;
private final long refreshTokenDuration;
private final DataSource dataSource;
private static final String ISSUER_ACCESS = "access";
private static final String ISSUER_REFRESH = "refresh";
public JWTAuthenticationProvider(Configuration config, DataSource dataSource) {
byte [] keyBytes = Base64.getDecoder().decode(config.getSecurityConfiguration().getJWTSecret());
Key key = Keys.hmacShaKeyFor(keyBytes);
this.jwtBuilder = Jwts.builder().signWith(key);
this.jwtParser = Jwts.parser().setSigningKey(key);
this.accessTokenDuration = ((long) config.getSecurityConfiguration().getAccessTokenDurationSeconds()) * 1000L;
this.refreshTokenDuration = ((long) config.getSecurityConfiguration().getRefreshTokenDurationDays()) * 24L * 60L * 60L * 1000L;
this.dataSource = dataSource;
}
@Override
public String authenticateAccessToken(String token) throws AuthenticationException {
try {
Claims claims = this.jwtParser.parseClaimsJws(token).getBody();
String user = claims.getSubject();
Date date = claims.getExpiration();
Date now = new Date(System.currentTimeMillis());
String issuer = claims.getIssuer();
if(!issuer.contentEquals(ISSUER_ACCESS)) {
throw AuthenticationException.INCORRECTTOKEN;
}
if(now.after(date)) {
throw AuthenticationException.TOKENEXPIRED;
}
// String tokenId = claims.getId();
return user;
}catch(JwtException e) {
throw AuthenticationException.UNTRUSTEDTOKEN;
}
}
@Override
public String authenticateRefreshToken(String token) throws AuthenticationException {
try {
Claims claims = this.jwtParser.parseClaimsJws(token).getBody();
String user = claims.getSubject();
Date date = claims.getExpiration();
Date now = new Date(System.currentTimeMillis());
String issuer = claims.getIssuer();
if(!issuer.contentEquals(ISSUER_REFRESH)) {
throw AuthenticationException.INCORRECTTOKEN;
}
if(now.after(date)) {
throw AuthenticationException.TOKENEXPIRED;
}
if(!this.dataSource.getUserTokenManager().tokenExists(user, token)) {
throw AuthenticationException.TOKENNOTFOUND;
}
// String tokenId = claims.getId();
return user;
}catch(JwtException e) {
throw AuthenticationException.UNTRUSTEDTOKEN;
}
}
@Override
public String generateAccessToken(String username) {
return jwtBuilder
.setSubject(username)
.setExpiration(new Date(System.currentTimeMillis() + this.accessTokenDuration))
.setId(UUID.randomUUID().toString())
.setIssuer(ISSUER_ACCESS)
.compact();
}
@Override
public String generateRefreshToken(String username) {
return jwtBuilder
.setSubject(username)
.setExpiration(new Date(System.currentTimeMillis() + this.refreshTokenDuration))
.setId(UUID.randomUUID().toString())
.setIssuer(ISSUER_REFRESH)
.compact();
}
}
|
[
"enolgor@teleco.upv.es"
] |
enolgor@teleco.upv.es
|
eb77a45cdded4afa1bc6db5fdd2fb4f149aaba7b
|
b2d876c83a99dabc557bb2b52ede95ee45ae6c25
|
/SKZ-ejb/src/java/dhz/skz/citaci/SatniIterator.java
|
4bd794f0fc12a3774ecf5d2f2b942f15e41c3d4d
|
[] |
no_license
|
kluksa/SKZ
|
8821221015f2b4bf1633f09e7b67bfdf4b90d34d
|
8a4777a53570611680d42ae76991909eff8fe913
|
refs/heads/master
| 2020-04-12T08:43:37.964490
| 2018-11-26T20:58:44
| 2018-11-26T20:58:44
| 22,107,075
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,426
|
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 dhz.skz.citaci;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
/**
*
* @author kraljevic
*/
public class SatniIterator {
private final Calendar trenutni_termin;
private final Calendar zadnji_termin;
public SatniIterator(final Date pocetak, final Date kraj, final TimeZone tz) {
trenutni_termin = new GregorianCalendar(tz);
trenutni_termin.setTime(pocetak);
trenutni_termin.set(Calendar.MINUTE, 0);
trenutni_termin.set(Calendar.SECOND, 0);
trenutni_termin.set(Calendar.MILLISECOND, 0);
zadnji_termin = new GregorianCalendar(tz);
zadnji_termin.setTime(kraj);
zadnji_termin.set(Calendar.MINUTE, 0);
zadnji_termin.set(Calendar.SECOND, 0);
zadnji_termin.set(Calendar.MILLISECOND, 0);
}
public boolean next(){
trenutni_termin.add(Calendar.HOUR, 1);
return !trenutni_termin.after(zadnji_termin);
}
public boolean previous(){
trenutni_termin.add(Calendar.HOUR, -1);
return !trenutni_termin.before(zadnji_termin);
}
public Date getVrijeme(){
return trenutni_termin.getTime();
}
}
|
[
"kraljevic@cirus.dhz.hr"
] |
kraljevic@cirus.dhz.hr
|
e28a19110f6d6afe531eef63ee06c03f668913e5
|
e338ed8a9502ccaf30a101a7da88c05a1d242d54
|
/src/main/java/aplicacion/interfaces/dao/imp/ProductoListDAOImp.java
|
5ca6a37ffbfa5d8ee1499d6bc874582b1da6685d
|
[] |
no_license
|
Masterzhord/ProductoLista_Funcional
|
7c7a4ed80de27fdd8f2acd2fc89aaf1a36b93af2
|
fc0cd086414f225b8fd565316a3c7bc97d9e529d
|
refs/heads/master
| 2020-05-24T17:45:31.407646
| 2019-05-19T02:21:40
| 2019-05-19T02:21:40
| 187,394,068
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,073
|
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 aplicacion.interfaces.dao.imp;
import aplicacion.interfaces.dao.IProductoDAO;
import aplicacion.modelo.dominio.Producto;
import aplicacion.modelo.util.ListaProducto;
import java.io.Serializable;
import java.text.ParseException;
import java.util.List;
/**
*
* @author Masterzhord
*/
public class ProductoListDAOImp implements Serializable, IProductoDAO{
private ListaProducto listaproducto;
//Contructor vacio
public ProductoListDAOImp() throws ParseException {
listaproducto = new ListaProducto();
}
//crea un producto y a agrega a la lista
@Override
public void crearProducto (Producto producto){
listaproducto.agregarProductos(producto);
}
//Lista todos los productos
@Override
public List<Producto> obtener(){
return listaproducto.getProductos();
}
}
|
[
"Esteban@LAPTOP-BJLUVR8F.mshome.net"
] |
Esteban@LAPTOP-BJLUVR8F.mshome.net
|
dfe80b40997c62d47d7d930f6b267ef0b337d218
|
4f532e01922dacf72b3a99926d20867a3ef9ef4e
|
/app/src/main/java/com/nelson/weather/adapter/WorldCityAdapter.java
|
df46eef6b9b3a0f4265163d28bd0daeb91215852
|
[] |
no_license
|
Nelsonly/weatherApp
|
1db61d4c6b041cd082f0a8138e38631e0c2f8a6c
|
cf56b067170d371573a96d9fda9f4d2886891c64
|
refs/heads/main
| 2023-05-02T01:15:11.926883
| 2021-05-11T08:22:47
| 2021-05-11T08:22:47
| 350,187,105
| 0
| 0
| null | 2021-05-24T15:42:49
| 2021-03-22T02:55:29
|
Java
|
UTF-8
|
Java
| false
| false
| 855
|
java
|
package com.nelson.weather.adapter;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.nelson.weather.bean.WorldCityResponse;
import com.nelson.weather.R;
import java.util.List;
/**
* 国家/地区中的城市适配器
*
* @author
*/
public class WorldCityAdapter extends BaseQuickAdapter<WorldCityResponse.TopCityListBean, BaseViewHolder> {
public WorldCityAdapter(int layoutResId, @Nullable List<WorldCityResponse.TopCityListBean> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, WorldCityResponse.TopCityListBean item) {
//名称
helper.setText(R.id.tv_city, item.getName());
//点击事件
helper.addOnClickListener(R.id.tv_city);
}
}
|
[
"zhangyuhong@irigel.com"
] |
zhangyuhong@irigel.com
|
a6bca899b4abb501a15bde4b4d6ea35af40696a3
|
cc0cb1007d62835583571969142cdbd9325d3025
|
/StarWars/src/starwars/StarWars.java
|
c7ce8c101e15b48eaa01d64ca178cafbf969cf22
|
[] |
no_license
|
The-F00L/Java
|
a7e9b25c09d5c85b685edd1de65202748a63e10b
|
4d08924d71ba8dfd0ae21bbafd4b9c1a0c66d85c
|
refs/heads/master
| 2022-03-27T08:22:10.863343
| 2020-01-06T09:58:38
| 2020-01-06T09:58:38
| 213,341,691
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,860
|
java
|
package starwars;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author JRZ
*/
public class StarWars {
public static ArrayList<EroErzekeny> lista=new ArrayList<EroErzekeny>();
public static void main(String[] args) {
try{
szereplok("be.txt");
sithek();
}catch(Exception ex){
System.out.println("Hiba történt.");
}
}
public static void szereplok(String ut) throws FileNotFoundException, IOException{
try (BufferedReader br = new BufferedReader(new FileReader(ut) )) {
String line = br.readLine () ;
while ( line != null ) {
String[] szavak = line.split (" ") ;
if(szavak[0].equals("Anakin") ) {
AnakinSkywalker as =new AnakinSkywalker();
for (int i =0; i < Integer.parseInt(szavak[1]) ; i ++) {
as.engeddElAHargod();
}
lista.add( as );
}else if (szavak[0].equals("Uralkodo") ) {
Uralkodo u =new Uralkodo () ;
for (int i =0; i < Integer.parseInt(szavak[1]) ; i ++) {
u.engeddElAHargod();
}
lista.add(u);
}else {
System.out.println (" Rossz sor ");
}
line = br . readLine () ;
}
}
}
public static void sithek(){
for (int i = 0; i < lista.size(); i++) {
System.out.println(lista.get(i).toString());
}
}
}
|
[
"noreply@github.com"
] |
noreply@github.com
|
dd4e42a61cad3ad4a79f2ed3a4466a5e29c32a14
|
2636b9ce828a7862d93ca19521bfec89e8530a2c
|
/turms-server-common/src/main/java/im/turms/server/common/storage/mongo/entity/Zone.java
|
31cf3d07c96fc4f06204b8d5652d154a04d4ffbe
|
[
"LicenseRef-scancode-proprietary-license",
"Apache-2.0",
"AGPL-3.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"SSPL-1.0"
] |
permissive
|
turms-im/turms
|
f1ccbc78175a176b3f5edf34b2b2badc901dcece
|
33bef70a5737c23adea72c6ba150b851bee6bfb6
|
refs/heads/develop
| 2023-09-01T17:02:03.053493
| 2023-08-23T13:53:21
| 2023-08-23T14:04:20
| 191,290,973
| 1,506
| 217
|
Apache-2.0
| 2023-04-25T02:38:02
| 2019-06-11T04:01:39
|
Java
|
UTF-8
|
Java
| false
| false
| 791
|
java
|
/*
* Copyright (C) 2019 The Turms Project
* https://github.com/turms-im/turms
*
* 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 im.turms.server.common.storage.mongo.entity;
/**
* @author James Chen
*/
public record Zone(
String creationDateFieldName
) {
}
|
[
"eurekajameschen@gmail.com"
] |
eurekajameschen@gmail.com
|
740fb6d8bf17661c320152022513ecf232ef7925
|
4669ae0a9c105e8c5191de5ee4bd24816e920828
|
/Intent/app/src/main/java/multi/android/intent/exam/ExamSecondActivity.java
|
83b1179c1a043baa9a14d7468585533ae44b5e6e
|
[] |
no_license
|
kim-svadoz/Android
|
505be6a1f05ed88f1a3211eff7fc7ea176dbefdf
|
04ab4c33dea7ed1b265799d786a21ac334a78c9c
|
refs/heads/master
| 2021-05-16T22:11:10.526115
| 2020-05-25T09:49:33
| 2020-05-25T09:49:33
| 250,490,272
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,424
|
java
|
package multi.android.intent.exam;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import multi.android.intent.R;
public class ExamSecondActivity extends AppCompatActivity {
TextView txt;
Button btn;
CheckBox member_state;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.exam_secondview);
txt = findViewById(R.id.exam_result_txt);
btn = findViewById(R.id.exam_close);
member_state = findViewById(R.id.member_state);
final Intent intent = getIntent();
String name = intent.getStringExtra("name");
if(name==null){
User dto = intent.getParcelableExtra("dto");
txt.setText(dto.getName()+","+dto.getTelNum());
}else{
String tel = intent.getStringExtra("tel");
txt.setText("입력한 id: "+name+", 입력한 pass: "+tel);
}
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
intent.putExtra("chkVal", member_state.isChecked());
setResult(RESULT_OK, intent);
finish();
}
});
}
}
|
[
"dhkdghehfdl@gmail.com"
] |
dhkdghehfdl@gmail.com
|
38ba7de4965e774d45b113476f9cc7dc33871f2f
|
c0b5f9622ee1be8cef9b1d36ae83293e0ffd2963
|
/src/edu/gmu/cds/img/ContourPoint.java
|
2524fab6a5fa2a6c4cbbd7f82d23d335fdf62153
|
[
"AFL-2.1",
"LicenseRef-scancode-unknown-license-reference",
"AFL-3.0"
] |
permissive
|
aholinch/MergerEx
|
b77c1351e2a7731f25c361093f1d66cd2296cc92
|
af3355cea51233ed460e513b7221fd7272a3bec3
|
refs/heads/master
| 2022-10-20T19:53:28.653600
| 2022-10-10T22:30:32
| 2022-10-10T22:30:32
| 46,993,898
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 842
|
java
|
/**************************
* MergerEx - see LICENSE
**************************/
package edu.gmu.cds.img;
public class ContourPoint {
public int x;
public int y;
public int ex;
public int ey;
public ContourPoint(ContourPoint pt)
{
x = pt.x;
y = pt.y;
ex = pt.ex;
ey = pt.ey;
}
public ContourPoint(int x, int y, int ex, int ey)
{
this.x = x;
this.y = y;
this.ex = ex;
this.ey = ey;
}
public boolean equals(Object o)
{
if(o == null) return false;
if(o instanceof ContourPoint) return equals((ContourPoint)o);
return false;
}
public boolean equals(ContourPoint pt)
{
if(x == pt.x && y == pt.y)
{
return true;
}
return false;
}
public boolean sameEntry(ContourPoint pt)
{
if(pt.ex == ex && pt.ey == ey)
{
return true;
}
return false;
}
}
|
[
"aholinch@masonlive.gmu.edu"
] |
aholinch@masonlive.gmu.edu
|
267b09ebeb6cb56db1ba87ce6797612e764b03ea
|
7bf3783cb6306eb4547760b97942317270ec1be0
|
/src/com/pom/socket/SocketServerHelloworld.java
|
4bd77c386057285835a9287ac4b745a7bfa50bc8
|
[] |
no_license
|
2070705620/nio
|
e72a8a3e3c9bfa251de1119bc296d811977fb965
|
a4d23a099a6d0fcaff8e86c9af3e401b55a2be27
|
refs/heads/master
| 2022-12-06T08:47:29.419425
| 2020-05-24T10:29:40
| 2020-05-24T10:29:40
| 196,720,356
| 0
| 0
| null | 2022-11-16T11:32:33
| 2019-07-13T12:41:50
|
Java
|
UTF-8
|
Java
| false
| false
| 1,440
|
java
|
package com.pom.socket;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
public class SocketServerHelloworld {
public static void main(String[] args) throws IOException {
int port = 8080;
try(ServerSocketChannel channel = ServerSocketChannel.open();
Selector selector = Selector.open()){
channel.configureBlocking(false);
channel.bind(new InetSocketAddress(port));
System.out.println("server started "+ port);
channel.register(selector, SelectionKey.OP_ACCEPT); //服务器channel仅注册accept
Thread mainThread = Thread.currentThread();
new Thread(()->{
boolean exit =false;
while(!exit) {
Debugger.sleep(5000);
try {
Debugger.file(mainThread);
} catch (Exception e) {
e.printStackTrace();
}
}
}) .start();
while(selector.select() > 0) {
Iterator<SelectionKey> iterator = selector.selectedKeys().iterator();
while(iterator.hasNext()) {
SelectionKey key = iterator.next();
if(key.isAcceptable()) {
SocketChannel clientChannel = ((ServerSocketChannel)key.channel()).accept();
clientChannel.configureBlocking(false);
System.out.println("accept...");
}
iterator.remove();
}
}
}
}
}
|
[
"664089244@qq.com"
] |
664089244@qq.com
|
28c28a250747c8dc31adb0840f507e7983d8d804
|
b6e1f9d6ee95f81c06e9b2cc770423ab526d76bc
|
/app/src/androidTest/java/com/doctorandonuts/taskwarrior/ApplicationTest.java
|
585272c9e168f8955d113de78813f7b873ee4eb8
|
[] |
no_license
|
Doctor-Andonuts/TaskWarrior
|
d5adc87496cf563c96ce8fcd148c34abe20718b9
|
8fb9f7064d9351f48ae3d2db0eeece2eef6c8ad6
|
refs/heads/master
| 2021-01-15T23:11:57.022655
| 2015-08-07T20:29:44
| 2015-08-07T20:29:44
| 39,856,006
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 361
|
java
|
package com.doctorandonuts.taskwarrior;
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);
}
}
|
[
"doctor-andonuts@users.noreply.github.com"
] |
doctor-andonuts@users.noreply.github.com
|
eeb4bc99f790c22114c6a5905b3d5d729b9d7556
|
fb7ca0eafdddedf76fe1fe5dcce2e895ec4525a3
|
/main/java/com/fundooproject/service/ILabelService.java
|
3b21a461ab2e0e4a3c57d42e427675f808328136
|
[] |
no_license
|
nandiniswaraj/FundooNoteApi
|
79b2d81535cce6e4e18951f0ea69e88a0551cf6c
|
2e3155157c1d6900439debc8508e53bb030d64e6
|
refs/heads/master
| 2022-08-03T07:39:40.656895
| 2020-05-27T10:40:27
| 2020-05-27T10:40:27
| 267,289,288
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 803
|
java
|
package com.fundooproject.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.fundooproject.configuration.Response;
import com.fundooproject.dto.LabelDto;
import com.fundooproject.exception.NoteException;
import com.fundooproject.model.Label;
@Service
public interface ILabelService {
//Response addLabel(String token,LabelDto labelDto);
Response addLabelToNote(String token,LabelDto labelDto, long noteId);
Response deleteLabel(String token,long labelId) throws NoteException;
Response updateLabel(String token,LabelDto labelDto, long labelId) throws NoteException;
//List<Label> getAllLabel(long userId);
List<Label> getAllLabel(String token,long noteId);
Response mapLabelToNote(String token,long noteId, long labelId) throws NoteException;
}
|
[
"nandiniswaraj1995@gmail.com"
] |
nandiniswaraj1995@gmail.com
|
4d5abfa9be2843cc94f9ba701fb0d5ce31c73972
|
822e3ac8c666ce0beaa061e304c8cfe4fbaa9030
|
/bookweb/src/cn/bookweb/user/servlet/UpdateUserInfoServlet.java
|
78d6ac73e9a34f8fdf90f3ca1b0241002e6d64fd
|
[] |
no_license
|
easyandeasy/myExample
|
0d7590e91efb9a4bd4aec4c46319153649e3df37
|
5e49174cb38a6e54e56941cf9935381148f942ab
|
refs/heads/master
| 2021-01-20T00:07:55.635066
| 2017-08-24T09:18:28
| 2017-08-24T09:18:28
| 101,270,020
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,396
|
java
|
package cn.bookweb.user.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Date;
import java.text.SimpleDateFormat;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.bookweb.user.entity.User;
import cn.bookweb.user.service.IUserService;
import cn.bookweb.user.serviceimpl.UserServiceImpl;
/**
* 修改用户信息控制器
* @author tang
*
*/
public class UpdateUserInfoServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
IUserService service = new UserServiceImpl();//实例化业务层对象
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM--dd");
String uid = request.getParameter("uid");//用户编号
String uname = request.getParameter("uname");//用户名
String unickname = request.getParameter("unickname");//昵称
String uphone = request.getParameter("uphone");//联系电话
String email = request.getParameter("email");//邮箱
String uidcard = request.getParameter("uidcard");//身份证号
String uindate = request.getParameter("uindate");//注册时间
String ustatus = request.getParameter("ustatus");//状态
int status = Integer.parseInt(ustatus);
if(uid!=null || uid!= ""){//判断用户编号是否为空
User u = new User();//实例化用户对象,将获取到的数据添加到对象中
//Date date = (Date)formatter.parse(uindate);//将字符串转换成Date类型
u.setUid(Integer.parseInt(uid));
u.setUname(uname);
u.setUnickname(unickname);
u.setUphone(uphone);
u.setEmail(email);
u.setUidcard(uidcard);
u.setUindate(uindate);
u.setUstatus(status);
//System.out.println(uid+"-"+uname+"-"+unickname+"-"+uphone+"-"+email+"-"+uidcard+"-"+uindate+"-"+status);
boolean flag = service.replaceUserInfoByUid(u);//调用业务层实现修改操作
if(flag){//判断是否修改成功
out.println("修改成功!");
}else{
out.println("修改失败!");
}
}
}
}
|
[
"397900803@qq.com"
] |
397900803@qq.com
|
6ad0c42d29162d4749cf13b3d4a89a3b9bd11337
|
015fa633ea034d2be6aaa92aa3e1c663b38877e9
|
/src/main/java/generics/sozdanie_ekzempliarov_tipov/ClassAsFactory.java
|
efcc1c4d9a80f6957e5ea4fd5705341b427bb7eb
|
[] |
no_license
|
programming-practices/java-core
|
b510a5104f417e670d74b94d62b6beff8d829b44
|
7680e92adc6bb9310ecc401b3768fc66b3ee66c2
|
refs/heads/main
| 2023-03-15T09:44:59.469839
| 2021-03-01T11:53:50
| 2021-03-01T11:53:50
| 303,077,639
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 428
|
java
|
package generics.sozdanie_ekzempliarov_tipov;
public class ClassAsFactory<T> {
T x;
public ClassAsFactory(Class<T> kind) {
try {
x = kind.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
[
"tsyupryk.roman@gmail.com"
] |
tsyupryk.roman@gmail.com
|
ea5a27f3065b924c646a97a055ba1c75b6f90c04
|
a50c762055f73a84a9032e559fb8e3fc7f37cec5
|
/src/com/colorcloud/agent/ManagerAgent.java
|
27034051fdaae7cbbe271bd4b0be5a365eeab0f9
|
[] |
no_license
|
rvganesh/wifi-direct-chat
|
b87502296f86972f37178d50aaf43851f2fc8116
|
26c36cb772b50e33dda06a34db2641daa9a68204
|
refs/heads/master
| 2021-01-18T08:21:07.795790
| 2013-12-10T11:03:18
| 2013-12-10T11:03:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,777
|
java
|
package com.colorcloud.agent;
import com.colorcloud.wifichat.WifiDirectUtils;
import jade.android.AndroidHelper;
import jade.content.lang.Codec;
import jade.content.lang.sl.SLCodec;
import jade.core.AID;
import jade.core.Agent;
import jade.core.behaviours.CyclicBehaviour;
import jade.core.behaviours.OneShotBehaviour;
import jade.lang.acl.ACLMessage;
import jade.util.leap.Set;
import jade.util.leap.SortedSetImpl;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.p2p.WifiP2pInfo;
import android.os.Message;
import android.util.Log;
import android.widget.Toast;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ManagerAgent extends Agent implements ManagerInterface {
private static final String TAG = "ReceivedMessage";
private static final long serialVersionUID = 1594371294421614291L;
private Set participants = new SortedSetImpl();
private Codec codec = new SLCodec();
private Context context;
private String ipAddress = "133.19.63.184";
private String agentName = "manager";
protected void setup() {
Object[] args = getArguments();
if (args != null && args.length > 0) {
if (args[0] instanceof Context) {
context = (Context) args[0];
}
}
// Activate the GUI
registerO2AInterface(ManagerInterface.class, this);
addBehaviour(new ParticipantsManager(this));
Intent broadcast = new Intent();
broadcast.setAction("jade.demo.agent.SEND_MESSAGE");
Log.i(TAG, "@@@Sending broadcast " + broadcast.getAction());
context.sendBroadcast(broadcast);
}
class ParticipantsManager extends CyclicBehaviour {
private static final long serialVersionUID = -7712839879652888139L;
ParticipantsManager(Agent a) {
super(a);
}
public void onStart() {
//Start cyclic
}
public void action() {
// Listening for incomming
ACLMessage msg = myAgent.receive();
if (msg != null) {
try {
//Get message
String content = msg.getContent();
if (content == null || "".equals(content)) {
msg.getSender().getName();
String localName = msg.getSender().getName();
if (localName.contains("@") && localName.contains(":")) {
WifiDirectUtils.OTHER_DEVICE_ADDRESS = localName.split(":")[0].split("@")[1];
}
//Start chat fragment
} else {
//Show content at chat fragment
}
Log.d(TAG, "@@@ other device address:" + WifiDirectUtils.OTHER_DEVICE_ADDRESS);
} catch (Exception e) {
e.printStackTrace();
}
} else {
block();
}
}
}
class OneShotMessage extends OneShotBehaviour {
private static final long serialVersionUID = 7197253550536422665L;
private String mMessage;
private String mAddress;
public OneShotMessage(String address) {
mAddress = address;
}
@Override
public void action() {
ACLMessage message = new ACLMessage(ACLMessage.INFORM);
message.setLanguage(codec.getName());
String convId = "C-" + myAgent.getLocalName();
message.setConversationId(convId);
message.setContent(mMessage);
AID dummyAid = new AID();
dummyAid.setName(agentName + "@" + mAddress + ":1099/JADE");
dummyAid.addAddresses("http://" + mAddress + ":7778/acc");
message.addReceiver(dummyAid);
myAgent.send(message);
Log.i(TAG, "@@@Send message:" + message.getContent());
}
}
protected void takeDown() {
}
@Override
public void sendMessageToOtherManager(WifiP2pInfo info) {
Toast.makeText(context, "send message to Other manager", Toast.LENGTH_SHORT).show();
Log.d(TAG, "@@@send message to Other manager");
if (!info.isGroupOwner) {
//Not a group owner
addBehaviour(new OneShotMessage(info.groupOwnerAddress.toString().replace("/", "")));
//Update other device address
WifiDirectUtils.OTHER_DEVICE_ADDRESS = info.groupOwnerAddress.toString().replace("/","");
Toast.makeText(context, "Other device ip:" + WifiDirectUtils.OTHER_DEVICE_ADDRESS, Toast.LENGTH_LONG).show();
} else {
//Group owner
//Do nothing, just receiver message to update client ip address
Toast.makeText(context, "is group owner", Toast.LENGTH_SHORT).show();
}
}
}
|
[
"hoang8f@gmail.com"
] |
hoang8f@gmail.com
|
7ac94f605fc40e289eb6b9b71e853b27775d708b
|
d20e23b83d0e7b373bc1144ec473ef40b9b32403
|
/src/Collection.java
|
c10ee00b6723e340559ff9d36783ebc162238b7e
|
[] |
no_license
|
kent10636/Java_Practices
|
b7e17053a83b2e4dec014595a976c0d1aec62905
|
2681e9a175f0e664a87ad7a90f382b91cceb5ab3
|
refs/heads/master
| 2020-03-19T12:11:07.590152
| 2018-06-18T07:47:34
| 2018-06-18T07:47:34
| 136,502,227
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 293
|
java
|
//import java.util.TreeSet;
//import java.util.Stack;
//import java.util.LinkedList;
//import java.util.HashMap;
//
//public class Collection {
// Collection a = new TreeSet();
// Collection b = new LinkedList();
// Collection c = new Stack();
// Collection d = new HashMap();
//}
|
[
"767188747@qq.com"
] |
767188747@qq.com
|
0f4f033ce48935fdbdaf0e3cbeddf807b93214b5
|
391093ac04638bb4ffebf096ab5f51393ddcd917
|
/src/main/java/com/songhaozhi/mayday/web/controller/admin/OptionsController.java
|
0b2c3e8baeda3df036ed235ee5791d1be640376d
|
[
"MIT"
] |
permissive
|
18601344960/my-blog
|
f74ba089ad33c6fc3ae42068ed0d87f71b5a7ae2
|
0d2135f32585af0b2e2e93a01e3e4eade9276950
|
refs/heads/master
| 2022-06-21T11:09:23.088754
| 2020-03-15T11:34:21
| 2020-03-15T11:34:21
| 247,439,477
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,990
|
java
|
package com.songhaozhi.mayday.web.controller.admin;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.songhaozhi.mayday.model.domain.Options;
import com.songhaozhi.mayday.model.dto.JsonResult;
import com.songhaozhi.mayday.model.dto.MaydayConst;
import com.songhaozhi.mayday.model.enums.MaydayEnums;
import com.songhaozhi.mayday.service.OptionsService;
/**
* @author : 宋浩志
* @createDate : 2018年10月12日
*/
@Controller
@RequestMapping("/admin/option")
@Slf4j
public class OptionsController extends BaseController {
@Autowired
private OptionsService optionsService;
/**
* 所有设置选项
*
* @param model
* @return
*/
@GetMapping
public String option(Model model) {
return "admin/admin_options";
}
/**
* 保存设置
*
* @param map
* @return
*/
@PostMapping(value = "/save")
@ResponseBody
public JsonResult save(@RequestParam Map<String, String> map) {
try {
optionsService.save(map);
MaydayConst.OPTIONS.clear();
List<Options> listMap = optionsService.selectMap();
for (Options options : listMap) {
MaydayConst.OPTIONS.put(options.getOptionName(), options.getOptionValue());
}
} catch (Exception e) {
log.error(e.getMessage());
return new JsonResult(MaydayEnums.PRESERVE_ERROR.isFlag(), MaydayEnums.PRESERVE_ERROR.getMessage());
}
return new JsonResult(MaydayEnums.PRESERVE_SUCCESS.isFlag(), MaydayEnums.PRESERVE_SUCCESS.getMessage());
}
}
|
[
"365114869@qq.com"
] |
365114869@qq.com
|
8021ee629b4df35601362a1b04d40b89a719d200
|
685a669ed37a5c7773709b748d79dff61b98042f
|
/v1.0.0-commons/src/main/java/com/goeckeler/bootcamp/domain/products/dao/ProductRepository.java
|
77f822fcabb9ab5ec61e4b5fc65fb001907c4403
|
[
"Apache-2.0"
] |
permissive
|
goeckeler/spring-boot-camp
|
c12b50611d5310d44fea4c11a14d169236d2a276
|
be70d0365b2a0a51dfc8d1f2ef0f084a1d9518cb
|
refs/heads/master
| 2021-07-04T04:37:47.604406
| 2021-06-10T18:02:47
| 2021-06-10T18:02:47
| 61,245,121
| 1
| 0
|
Apache-2.0
| 2020-06-15T20:52:10
| 2016-06-15T22:25:00
|
Java
|
UTF-8
|
Java
| false
| false
| 348
|
java
|
package com.goeckeler.bootcamp.domain.products.dao;
import org.springframework.data.repository.CrudRepository;
import com.goeckeler.bootcamp.domain.products.object.Product;
/**
* DAO for entity {@link Product}.
*/
public interface ProductRepository extends CrudRepository<Product, Long>
{
Product findByNameIgnoreCase(String productName);
}
|
[
"thorsten@goeckeler.com"
] |
thorsten@goeckeler.com
|
fc5251b76ef938db8f93d0a6a5e937321e00ef2d
|
42bb99b8e3402d12cbde8ca896ea5b1faa4cf5aa
|
/twtter/src/User.java
|
39f1df5fff4f01579ba6cb51808f1fc94046d756
|
[] |
no_license
|
rodriguies/TomileCodigo-
|
dbea0422fc494f19c8b0c00bcc09705293d2730d
|
46a8c1b278c8475a08fc85325e5d7b86fc79fd55
|
refs/heads/master
| 2020-05-03T12:18:16.372132
| 2019-07-02T15:33:03
| 2019-07-02T15:33:03
| 178,622,208
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,289
|
java
|
import javax.print.attribute.standard.JobOriginatingUserName;
import java.util.ArrayList;
import java.util.List;
public class User {
// naoLidos: int timeline: Tweet[] myTweets: Tweet[] seguidores: User[] seguidos: User[]
private int naoLidos;
private List<Tweet> timeline;
private List<Tweet> mytweets;
protected List<User> seguidores;
protected List<User> seguidos;
public User(String username){ //def constructor(username): # nao esqueca de inicializar nenhum atributo
this.naoLidos = naoLidos;
this.timeline = new ArrayList<Tweet>();
this.mytweets = new ArrayList<Tweet>();
this.seguidores = new ArrayList<User>();
this.seguidos = new ArrayList<User>();
}
//def twittar(tweet):
public void twittar(Tweet){
mytweets = Tweet ;
}
//def follow(other: User):
public void follow(User User){
}
//def darLike(idTw):
public <idTw> void darLoke(idTw){ //rever
}
//def get unread():
public int getNaoLidos() {
return naoLidos;
}
//def get timeline():
public List<Tweet> getTimeline() {
return timeline;
}
public String toString(){
return this.username;
}
}
|
[
"luksrodrigues1046@gmail.com"
] |
luksrodrigues1046@gmail.com
|
ff0b295bcea45543dba51b87f8bce8b7ddf45362
|
eb74de728d26a613c75aa04851676cff25783e7b
|
/HelloWorld/src/adapterPattern/PilotPen.java
|
0e1513b6975e6618062281a61499163545b07df4
|
[
"MIT"
] |
permissive
|
ijhajj/JavaRepository
|
57eee291c1a14992f67be35897dd91772c31d016
|
b686cd8fb09eda00396c6c69bea6a7b36b08016f
|
refs/heads/master
| 2020-08-14T23:49:05.885003
| 2020-01-06T04:41:40
| 2020-01-06T04:41:40
| 215,248,482
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 157
|
java
|
package adapterPattern;
//This class has no relation with Pen class
public class PilotPen {
public void mark(String str) {
System.out.println(str);
}
}
|
[
"i.jhajj@gmail.com"
] |
i.jhajj@gmail.com
|
a679913042b8f5bd7fd2a2882e6ef0149a8880e2
|
e8e86dd32d0be4a97b02383799fa82bc205011a0
|
/WebProject/VoiceNote/src/main/wxUtils/WxSolve.java
|
36cc1fad942e4110a2a422571bb76a80f946e75f
|
[] |
no_license
|
zeroLJ/GraduationDesign
|
caa3f201348e6e9813d3a55cdcf56c21d1ead47d
|
57aebd88e10de41ee25a8f69ac72fb9fa9178e6f
|
refs/heads/master
| 2021-04-30T14:10:34.818659
| 2019-03-14T09:28:14
| 2019-03-14T09:28:14
| 121,211,048
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,082
|
java
|
package main.wxUtils;
import main.util.ObjUtils;
/**
* 公众号回复工具类
* @author ljl
*/
public class WxSolve {
public static String getResult(WxMessage message) {
switch (ObjUtils.objToStr(message.MsgType)) {
case "event":
return getEventResult(message);
default:
return getOtherResult(message);
}
}
/**
* 获取event事件要返回的字符串
* @param message
* @return
*/
private static String getEventResult(WxMessage message) {
if (message.Event!=null) {
switch (message.Event) {
case "subscribe"://关注
return getSubscribeResult(message);
case "unsubscribe"://取消关注
break;
case "CLICK":
return getClickResult(message);
default:
break;
}
}
return "";
}
/**
* 获取除event事件外要返回的字符串
* @param message
* @return
*/
private static String getOtherResult(WxMessage message) {
StringBuilder s = new StringBuilder();
if (message.Content!=null) {
String result = "你也"+message.Content;
s.append("<xml>");
s.append(" <ToUserName><![CDATA[").append(message.FromUserName).append("]]></ToUserName>");
s.append(" <FromUserName><![CDATA[").append(message.ToUserName).append("]]></FromUserName>");
s.append(" <CreateTime>").append(System.currentTimeMillis()).append("</CreateTime>");
s.append(" <MsgType><![CDATA[").append("text").append("]]></MsgType>");
s.append(" <Content><![CDATA[").append(result).append("]]></Content>");
s.append("</xml>");
}
return s.toString();
}
/**
* 获取关注事件需要返回的字符串
* @param message
* @return
*/
private static String getSubscribeResult(WxMessage message) {
StringBuilder s = new StringBuilder();
s.append("<xml>");
s.append(" <ToUserName><![CDATA[").append(message.FromUserName).append("]]></ToUserName>");
s.append(" <FromUserName><![CDATA[").append(message.ToUserName).append("]]></FromUserName>");
s.append(" <CreateTime>").append(System.currentTimeMillis()).append("</CreateTime>");
s.append(" <MsgType><![CDATA[").append("text").append("]]></MsgType>");
s.append(" <Content><![CDATA[").append("感谢关注").append("]]></Content>");
s.append("</xml>");
return s.toString();
}
/**
* 获取点击事件需要返回的字符串
* @param message
* @return
*/
private static String getClickResult(WxMessage message) {
String msg = "";
switch (ObjUtils.objToStr(message.EventKey)) {
case "":
break;
default:
msg = message.EventKey;
break;
}
StringBuilder s = new StringBuilder();
s.append("<xml>");
s.append(" <ToUserName><![CDATA[").append(message.FromUserName).append("]]></ToUserName>");
s.append(" <FromUserName><![CDATA[").append(message.ToUserName).append("]]></FromUserName>");
s.append(" <CreateTime>").append(System.currentTimeMillis()).append("</CreateTime>");
s.append(" <MsgType><![CDATA[").append("text").append("]]></MsgType>");
s.append(" <Content><![CDATA[").append(msg).append("]]></Content>");
s.append("</xml>");
return s.toString();
}
}
|
[
"940034240@qq.com"
] |
940034240@qq.com
|
b34f4451edb0981639ba78d1021448218c3233a4
|
028cbe18b4e5c347f664c592cbc7f56729b74060
|
/external/modules/bean-validator/hibernate-validator/5.0.0.Final/project/engine/src/main/java/org/hibernate/validator/constraints/br/CNPJ.java
|
716806a57aafdc7b11d5d1f7d967b33785f02026
|
[
"Apache-2.0"
] |
permissive
|
dmatej/Glassfish-SVN-Patched
|
8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e
|
269e29ba90db6d9c38271f7acd2affcacf2416f1
|
refs/heads/master
| 2021-05-28T12:55:06.267463
| 2014-11-11T04:21:44
| 2014-11-11T04:21:44
| 23,610,469
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,448
|
java
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* 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 org.hibernate.validator.constraints.br;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.ModCheck;
import org.hibernate.validator.constraints.ModCheck.List;
import org.hibernate.validator.constraints.ModCheck.ModType;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Validates a CNPJ (Cadastro de Pessoa Jur\u00eddica - Brazilian corporate tax payer registry number).
*
* @author George Gastaldi
*/
@Pattern(regexp = "([0-9]{2}[.]?[0-9]{3}[.]?[0-9]{3}[/]?[0-9]{4}[-]?[0-9]{2})")
@List({
@ModCheck(modType = ModType.MOD11,
checkDigitPosition = 12,
multiplier = 9,
endIndex = 12),
@ModCheck(modType = ModType.MOD11,
checkDigitPosition = 13,
multiplier = 9,
endIndex = 13)
})
@ReportAsSingleViolation
@Documented
@Constraint(validatedBy = { })
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
public @interface CNPJ {
String message() default "{org.hibernate.validator.constraints.br.CNPJ.message}";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default { };
}
|
[
"mtaube@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] |
mtaube@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
|
35b2b037d0aae9807b3d986916e8932314109ed6
|
329a17be7e88befbb6c4c6f4969eb9bd8f91701f
|
/src/androidTest/java/pl/mg6/testsupport/data/Parceler.java
|
231d47a8400a23822d8d9c496dd66b8f016e7d2b
|
[
"MIT"
] |
permissive
|
mg6maciej/parcelable-test-support
|
c8139693cab74184ca253cc7b405b890c764519b
|
9b0ee9762931becde62a0fc6bc3481da1d2f0a75
|
refs/heads/master
| 2020-06-01T04:35:24.256160
| 2015-04-04T10:50:46
| 2015-04-04T10:50:46
| 33,380,798
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 258
|
java
|
package pl.mg6.testsupport.data;
import org.parceler.Parcel;
@Parcel
public class Parceler {
long id;
String name;
public Parceler() {
}
public Parceler(long id, String name) {
this.id = id;
this.name = name;
}
}
|
[
"maciek.gorski@gmail.com"
] |
maciek.gorski@gmail.com
|
03f6597495cd5a5713615cdd0bc2c09577ee2896
|
1d905c1b53c0dbb4bd816f292bf200a487b8e106
|
/src/com/igrandee/product/ecloud/action/pages/admin/AdminCoursesAction.java
|
2aaa5832cbb53b3753e25a864e083d6b25a9ab97
|
[] |
no_license
|
karthikeyanats/OLMPortal
|
595445170e9ab491c07012d737880f7d7f539185
|
3c6eed2df82dbe747458dff74eec27695e3ce0c5
|
refs/heads/master
| 2020-03-29T02:14:14.640157
| 2018-09-19T09:49:31
| 2018-09-19T09:49:31
| 149,426,349
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,853
|
java
|
package com.igrandee.product.ecloud.action.pages.admin;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.igrandee.product.ecloud.action.MasterActionSupport;
import com.igrandee.product.ecloud.service.Pages.admin.AdminCoursesService;
import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.core.InjectParam;
@Path("/admincourses")
public class AdminCoursesAction extends MasterActionSupport {
private static final long serialVersionUID = 1L;
@InjectParam
AdminCoursesService acs;
@GET
@Path("/counts")
@Produces
public Response getAuthorCourseCounts(){
try{
List<?> authorCoursesList = acs.loadAuthorCoursesCountForAdmin(getAttribute("organizationid"), getAttribute("orgpersonid"));
if(authorCoursesList.size()!=0){
return Response.status(Status.OK).entity(authorCoursesList).build();
}else{
return Response.status(Status.OK).entity(Status.NO_CONTENT).build();
}
}catch(Exception e){
e.printStackTrace();
return Response.status(Status.OK).entity(Status.INTERNAL_SERVER_ERROR).build();
}
}
@GET
@Path("/courses/{status}")
@Produces(MediaType.APPLICATION_JSON)
public Response getAuthorCourses(@PathParam("status") String status){
try{
List<?> authorCoursesList = acs.loadAuthorCoursesForAdmin(getAttribute("organizationid"), getAttribute("orgpersonid"), status);
if(authorCoursesList.size()!=0){
return Response.status(Status.OK).entity(authorCoursesList).build();
}else{
return Response.status(Status.OK).entity(Status.NO_CONTENT).build();
}
}catch(Exception e){
e.printStackTrace();
return Response.status(Status.OK).entity(Status.INTERNAL_SERVER_ERROR).build();
}
}
}
|
[
"gpkarthikeyan@gmail.com"
] |
gpkarthikeyan@gmail.com
|
f31f8ff69d2b193149847347aeb7e267f92be1c0
|
bb5d6dc0095dcb03a16a99d013c8805b6f43417a
|
/03_FactoryPattern/src/Example0302/Ingredient/ParmesanCheese.java
|
533601592c81932803f71e69e272051f0bce9c47
|
[] |
no_license
|
chinatragedy/LearnDesignPattern
|
e3675fd09a0fcd82ad54a4b0028f0dba6bc88856
|
609e7a1072d17d7ccfdcae2c98a610b8eabc50db
|
refs/heads/master
| 2022-04-05T10:23:24.731030
| 2020-03-06T11:01:16
| 2020-03-06T11:01:16
| 130,633,961
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 186
|
java
|
package Example0302.Ingredient;
import Example0302.Ingredient.Cheese;
public class ParmesanCheese implements Cheese {
public String toString() {
return "+ Shredded Parmesan";
}
}
|
[
"zhangjinghow@gmail.com"
] |
zhangjinghow@gmail.com
|
d3c9eaacabc34a2558e09bf886b367bc8fc4c50a
|
f0d3f9efcbf831db19c338afc884dfb41cbb8489
|
/src/game/controller/GameStatus.java
|
46f13a19226f825d78ac3392de7247d93817a091
|
[] |
no_license
|
AnmoleC/Weiss-Schwarz
|
39f5c8e04647adca9b937e5461cb43127503f0fc
|
52e4e4b4d8c6c42e10ec038b7f7fa6bdb21bdc32
|
refs/heads/master
| 2020-05-22T18:55:54.726618
| 2018-10-26T15:43:49
| 2018-10-26T15:43:49
| 186,469,425
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 102
|
java
|
package game.controller;
public enum GameStatus {
INITIALISED, PLAYING, INTERUPTED, FINISHED
}
|
[
"Quansheng.Xiong@TRNTOR40170.fdmgroup.local"
] |
Quansheng.Xiong@TRNTOR40170.fdmgroup.local
|
3dc53ed788f143996a28cff99216b7437123381f
|
2fc7e341bf68d7da91505cb9e08701ca18fd9217
|
/java7sdk/src/javax/swing/plaf/basic/BasicBorders.java
|
cfcf9ab62bebeb412ae4eba77f1c29b1e1a2230b
|
[] |
no_license
|
Zir0-93/java7-sdk
|
70c190c059f22bac1721139382d018590be1b1cb
|
227e04ea027bd2400ab3e9d2fa3ce5576c6f7239
|
refs/heads/master
| 2021-01-10T14:43:08.338197
| 2016-03-07T21:21:11
| 2016-03-07T21:21:11
| 53,359,588
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 23,922
|
java
|
/*===========================================================================
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
*
* IBM SDK, Java(tm) Technology Edition, v7
* (C) Copyright IBM Corp. 2014, 2014. All Rights Reserved
*
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*===========================================================================
*/
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.swing.plaf.basic;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.plaf.*;
import javax.swing.text.JTextComponent;
import java.awt.Component;
import java.awt.Insets;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Color;
import java.awt.Graphics;
/**
* Factory object that can vend Borders appropriate for the basic L & F.
* @author Georges Saab
* @author Amy Fowler
*/
public class BasicBorders {
public static Border getButtonBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border buttonBorder = new BorderUIResource.CompoundBorderUIResource(
new BasicBorders.ButtonBorder(
table.getColor("Button.shadow"),
table.getColor("Button.darkShadow"),
table.getColor("Button.light"),
table.getColor("Button.highlight")),
new MarginBorder());
return buttonBorder;
}
public static Border getRadioButtonBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border radioButtonBorder = new BorderUIResource.CompoundBorderUIResource(
new BasicBorders.RadioButtonBorder(
table.getColor("RadioButton.shadow"),
table.getColor("RadioButton.darkShadow"),
table.getColor("RadioButton.light"),
table.getColor("RadioButton.highlight")),
new MarginBorder());
return radioButtonBorder;
}
public static Border getToggleButtonBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
new BasicBorders.ToggleButtonBorder(
table.getColor("ToggleButton.shadow"),
table.getColor("ToggleButton.darkShadow"),
table.getColor("ToggleButton.light"),
table.getColor("ToggleButton.highlight")),
new MarginBorder());
return toggleButtonBorder;
}
public static Border getMenuBarBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border menuBarBorder = new BasicBorders.MenuBarBorder(
table.getColor("MenuBar.shadow"),
table.getColor("MenuBar.highlight")
);
return menuBarBorder;
}
public static Border getSplitPaneBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border splitPaneBorder = new BasicBorders.SplitPaneBorder(
table.getColor("SplitPane.highlight"),
table.getColor("SplitPane.darkShadow"));
return splitPaneBorder;
}
/**
* Returns a border instance for a JSplitPane divider
* @since 1.3
*/
public static Border getSplitPaneDividerBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border splitPaneBorder = new BasicBorders.SplitPaneDividerBorder(
table.getColor("SplitPane.highlight"),
table.getColor("SplitPane.darkShadow"));
return splitPaneBorder;
}
public static Border getTextFieldBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border textFieldBorder = new BasicBorders.FieldBorder(
table.getColor("TextField.shadow"),
table.getColor("TextField.darkShadow"),
table.getColor("TextField.light"),
table.getColor("TextField.highlight"));
return textFieldBorder;
}
public static Border getProgressBarBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border progressBarBorder = new BorderUIResource.LineBorderUIResource(Color.green, 2);
return progressBarBorder;
}
public static Border getInternalFrameBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border internalFrameBorder = new BorderUIResource.CompoundBorderUIResource(
new BevelBorder(BevelBorder.RAISED,
table.getColor("InternalFrame.borderLight"),
table.getColor("InternalFrame.borderHighlight"),
table.getColor("InternalFrame.borderDarkShadow"),
table.getColor("InternalFrame.borderShadow")),
BorderFactory.createLineBorder(
table.getColor("InternalFrame.borderColor"), 1));
return internalFrameBorder;
}
/**
* Special thin border for rollover toolbar buttons.
* @since 1.4
*/
public static class RolloverButtonBorder extends ButtonBorder {
public RolloverButtonBorder(Color shadow, Color darkShadow,
Color highlight, Color lightHighlight) {
super(shadow, darkShadow, highlight, lightHighlight);
}
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel();
Color shade = shadow;
Component p = b.getParent();
if (p != null && p.getBackground().equals(shadow)) {
shade = darkShadow;
}
if ((model.isRollover() && !(model.isPressed() && !model.isArmed())) ||
model.isSelected()) {
Color oldColor = g.getColor();
g.translate(x, y);
if (model.isPressed() && model.isArmed() || model.isSelected()) {
// Draw the pressd button
g.setColor(shade);
g.drawRect(0, 0, w-1, h-1);
g.setColor(lightHighlight);
g.drawLine(w-1, 0, w-1, h-1);
g.drawLine(0, h-1, w-1, h-1);
} else {
// Draw a rollover button
g.setColor(lightHighlight);
g.drawRect(0, 0, w-1, h-1);
g.setColor(shade);
g.drawLine(w-1, 0, w-1, h-1);
g.drawLine(0, h-1, w-1, h-1);
}
g.translate(-x, -y);
g.setColor(oldColor);
}
}
}
/**
* A border which is like a Margin border but it will only honor the margin
* if the margin has been explicitly set by the developer.
*
* Note: This is identical to the package private class
* MetalBorders.RolloverMarginBorder and should probably be consolidated.
*/
static class RolloverMarginBorder extends EmptyBorder {
public RolloverMarginBorder() {
super(3,3,3,3); // hardcoded margin for JLF requirements.
}
public Insets getBorderInsets(Component c, Insets insets) {
Insets margin = null;
if (c instanceof AbstractButton) {
margin = ((AbstractButton)c).getMargin();
}
if (margin == null || margin instanceof UIResource) {
// default margin so replace
insets.left = left;
insets.top = top;
insets.right = right;
insets.bottom = bottom;
} else {
// Margin which has been explicitly set by the user.
insets.left = margin.left;
insets.top = margin.top;
insets.right = margin.right;
insets.bottom = margin.bottom;
}
return insets;
}
}
public static class ButtonBorder extends AbstractBorder implements UIResource {
protected Color shadow;
protected Color darkShadow;
protected Color highlight;
protected Color lightHighlight;
public ButtonBorder(Color shadow, Color darkShadow,
Color highlight, Color lightHighlight) {
this.shadow = shadow;
this.darkShadow = darkShadow;
this.highlight = highlight;
this.lightHighlight = lightHighlight;
}
public void paintBorder(Component c, Graphics g, int x, int y,
int width, int height) {
boolean isPressed = false;
boolean isDefault = false;
if (c instanceof AbstractButton) {
AbstractButton b = (AbstractButton)c;
ButtonModel model = b.getModel();
isPressed = model.isPressed() && model.isArmed();
if (c instanceof JButton) {
isDefault = ((JButton)c).isDefaultButton();
}
}
BasicGraphicsUtils.drawBezel(g, x, y, width, height,
isPressed, isDefault, shadow,
darkShadow, highlight, lightHighlight);
}
public Insets getBorderInsets(Component c, Insets insets) {
// leave room for default visual
insets.set(2, 3, 3, 3);
return insets;
}
}
public static class ToggleButtonBorder extends ButtonBorder {
public ToggleButtonBorder(Color shadow, Color darkShadow,
Color highlight, Color lightHighlight) {
super(shadow, darkShadow, highlight, lightHighlight);
}
public void paintBorder(Component c, Graphics g, int x, int y,
int width, int height) {
BasicGraphicsUtils.drawBezel(g, x, y, width, height,
false, false,
shadow, darkShadow,
highlight, lightHighlight);
}
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(2, 2, 2, 2);
return insets;
}
}
public static class RadioButtonBorder extends ButtonBorder {
public RadioButtonBorder(Color shadow, Color darkShadow,
Color highlight, Color lightHighlight) {
super(shadow, darkShadow, highlight, lightHighlight);
}
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
if (c instanceof AbstractButton) {
AbstractButton b = (AbstractButton)c;
ButtonModel model = b.getModel();
if (model.isArmed() && model.isPressed() || model.isSelected()) {
BasicGraphicsUtils.drawLoweredBezel(g, x, y, width, height,
shadow, darkShadow,
highlight, lightHighlight);
} else {
BasicGraphicsUtils.drawBezel(g, x, y, width, height,
false, b.isFocusPainted() && b.hasFocus(),
shadow, darkShadow,
highlight, lightHighlight);
}
} else {
BasicGraphicsUtils.drawBezel(g, x, y, width, height, false, false,
shadow, darkShadow, highlight, lightHighlight);
}
}
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(2, 2, 2, 2);
return insets;
}
}
public static class MenuBarBorder extends AbstractBorder implements UIResource {
private Color shadow;
private Color highlight;
public MenuBarBorder(Color shadow, Color highlight) {
this.shadow = shadow;
this.highlight = highlight;
}
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Color oldColor = g.getColor();
g.translate(x, y);
g.setColor(shadow);
g.drawLine(0, height-2, width, height-2);
g.setColor(highlight);
g.drawLine(0, height-1, width, height-1);
g.translate(-x,-y);
g.setColor(oldColor);
}
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(0, 0, 2, 0);
return insets;
}
}
public static class MarginBorder extends AbstractBorder implements UIResource {
public Insets getBorderInsets(Component c, Insets insets) {
Insets margin = null;
//
// Ideally we'd have an interface defined for classes which
// support margins (to avoid this hackery), but we've
// decided against it for simplicity
//
if (c instanceof AbstractButton) {
AbstractButton b = (AbstractButton)c;
margin = b.getMargin();
} else if (c instanceof JToolBar) {
JToolBar t = (JToolBar)c;
margin = t.getMargin();
} else if (c instanceof JTextComponent) {
JTextComponent t = (JTextComponent)c;
margin = t.getMargin();
}
insets.top = margin != null? margin.top : 0;
insets.left = margin != null? margin.left : 0;
insets.bottom = margin != null? margin.bottom : 0;
insets.right = margin != null? margin.right : 0;
return insets;
}
}
public static class FieldBorder extends AbstractBorder implements UIResource {
protected Color shadow;
protected Color darkShadow;
protected Color highlight;
protected Color lightHighlight;
public FieldBorder(Color shadow, Color darkShadow,
Color highlight, Color lightHighlight) {
this.shadow = shadow;
this.highlight = highlight;
this.darkShadow = darkShadow;
this.lightHighlight = lightHighlight;
}
public void paintBorder(Component c, Graphics g, int x, int y,
int width, int height) {
BasicGraphicsUtils.drawEtchedRect(g, x, y, width, height,
shadow, darkShadow,
highlight, lightHighlight);
}
public Insets getBorderInsets(Component c, Insets insets) {
Insets margin = null;
if (c instanceof JTextComponent) {
margin = ((JTextComponent)c).getMargin();
}
insets.top = margin != null? 2+margin.top : 2;
insets.left = margin != null? 2+margin.left : 2;
insets.bottom = margin != null? 2+margin.bottom : 2;
insets.right = margin != null? 2+margin.right : 2;
return insets;
}
}
/**
* Draws the border around the divider in a splitpane
* (when BasicSplitPaneUI is used). To get the appropriate effect, this
* needs to be used with a SplitPaneBorder.
*/
static class SplitPaneDividerBorder implements Border, UIResource {
Color highlight;
Color shadow;
SplitPaneDividerBorder(Color highlight, Color shadow) {
this.highlight = highlight;
this.shadow = shadow;
}
public void paintBorder(Component c, Graphics g, int x, int y,
int width, int height) {
if (!(c instanceof BasicSplitPaneDivider)) {
return;
}
Component child;
Rectangle cBounds;
JSplitPane splitPane = ((BasicSplitPaneDivider)c).
getBasicSplitPaneUI().getSplitPane();
Dimension size = c.getSize();
child = splitPane.getLeftComponent();
// This is needed for the space between the divider and end of
// splitpane.
g.setColor(c.getBackground());
g.drawRect(x, y, width - 1, height - 1);
if(splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
if(child != null) {
g.setColor(highlight);
g.drawLine(0, 0, 0, size.height);
}
child = splitPane.getRightComponent();
if(child != null) {
g.setColor(shadow);
g.drawLine(size.width - 1, 0, size.width - 1, size.height);
}
} else {
if(child != null) {
g.setColor(highlight);
g.drawLine(0, 0, size.width, 0);
}
child = splitPane.getRightComponent();
if(child != null) {
g.setColor(shadow);
g.drawLine(0, size.height - 1, size.width,
size.height - 1);
}
}
}
public Insets getBorderInsets(Component c) {
Insets insets = new Insets(0,0,0,0);
if (c instanceof BasicSplitPaneDivider) {
BasicSplitPaneUI bspui = ((BasicSplitPaneDivider)c).
getBasicSplitPaneUI();
if (bspui != null) {
JSplitPane splitPane = bspui.getSplitPane();
if (splitPane != null) {
if (splitPane.getOrientation() ==
JSplitPane.HORIZONTAL_SPLIT) {
insets.top = insets.bottom = 0;
insets.left = insets.right = 1;
return insets;
}
// VERTICAL_SPLIT
insets.top = insets.bottom = 1;
insets.left = insets.right = 0;
return insets;
}
}
}
insets.top = insets.bottom = insets.left = insets.right = 1;
return insets;
}
public boolean isBorderOpaque() { return true; }
}
/**
* Draws the border around the splitpane. To work correctly you shoudl
* also install a border on the divider (property SplitPaneDivider.border).
*/
public static class SplitPaneBorder implements Border, UIResource {
protected Color highlight;
protected Color shadow;
public SplitPaneBorder(Color highlight, Color shadow) {
this.highlight = highlight;
this.shadow = shadow;
}
public void paintBorder(Component c, Graphics g, int x, int y,
int width, int height) {
if (!(c instanceof JSplitPane)) {
return;
}
// The only tricky part with this border is that the divider is
// not positioned at the top (for horizontal) or left (for vert),
// so this border draws to where the divider is:
// -----------------
// |xxxxxxx xxxxxxx|
// |x --- x|
// |x | | x|
// |x |D| x|
// |x | | x|
// |x --- x|
// |xxxxxxx xxxxxxx|
// -----------------
// The above shows (rather excessively) what this looks like for
// a horizontal orientation. This border then draws the x's, with
// the SplitPaneDividerBorder drawing its own border.
Component child;
Rectangle cBounds;
JSplitPane splitPane = (JSplitPane)c;
child = splitPane.getLeftComponent();
// This is needed for the space between the divider and end of
// splitpane.
g.setColor(c.getBackground());
g.drawRect(x, y, width - 1, height - 1);
if(splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
if(child != null) {
cBounds = child.getBounds();
g.setColor(shadow);
g.drawLine(0, 0, cBounds.width + 1, 0);
g.drawLine(0, 1, 0, cBounds.height + 1);
g.setColor(highlight);
g.drawLine(0, cBounds.height + 1, cBounds.width + 1,
cBounds.height + 1);
}
child = splitPane.getRightComponent();
if(child != null) {
cBounds = child.getBounds();
int maxX = cBounds.x + cBounds.width;
int maxY = cBounds.y + cBounds.height;
g.setColor(shadow);
g.drawLine(cBounds.x - 1, 0, maxX, 0);
g.setColor(highlight);
g.drawLine(cBounds.x - 1, maxY, maxX, maxY);
g.drawLine(maxX, 0, maxX, maxY + 1);
}
} else {
if(child != null) {
cBounds = child.getBounds();
g.setColor(shadow);
g.drawLine(0, 0, cBounds.width + 1, 0);
g.drawLine(0, 1, 0, cBounds.height);
g.setColor(highlight);
g.drawLine(1 + cBounds.width, 0, 1 + cBounds.width,
cBounds.height + 1);
g.drawLine(0, cBounds.height + 1, 0, cBounds.height + 1);
}
child = splitPane.getRightComponent();
if(child != null) {
cBounds = child.getBounds();
int maxX = cBounds.x + cBounds.width;
int maxY = cBounds.y + cBounds.height;
g.setColor(shadow);
g.drawLine(0, cBounds.y - 1, 0, maxY);
g.drawLine(maxX, cBounds.y - 1, maxX, cBounds.y - 1);
g.setColor(highlight);
g.drawLine(0, maxY, cBounds.width + 1, maxY);
g.drawLine(maxX, cBounds.y, maxX, maxY);
}
}
}
public Insets getBorderInsets(Component c) {
return new Insets(1, 1, 1, 1);
}
public boolean isBorderOpaque() { return true; }
}
}
|
[
"muntazir@live.ca"
] |
muntazir@live.ca
|
5248522243d57e5e8e2a7bdbe762d69130245e90
|
28f5dc8fe5f549af8cdeab9bdbff2701f51e380d
|
/app/src/main/java/com/beacon/moive/Adapters/MoiveBriefRecyclerViewAdapter.java
|
c0224f007b792d7cbfcbb990e8019101eded0663
|
[] |
no_license
|
qumoy/BeaconMoive
|
ab705c9bfa496c078ead594c0f3b92296dded79c
|
8efdf8c72bb8120ea29102a9e46ce1bcd710a0dd
|
refs/heads/master
| 2021-01-07T02:07:12.268577
| 2020-05-07T11:18:38
| 2020-05-07T11:18:38
| 241,547,947
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,526
|
java
|
package com.beacon.moive.Adapters;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.beacon.moive.Beans.BeaconDevice;
import com.beacon.moive.Beans.MoiveBean;
import com.beacon.moive.R;
import java.io.File;
import java.util.Collections;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Author Qumoy
* Create Date 2020/2/3
* Description:
* Modifier:
* Modify Date:
* Bugzilla Id:
* Modify Content:
*/
public class MoiveBriefRecyclerViewAdapter extends RecyclerView.Adapter<MoiveBriefRecyclerViewAdapter.MoiveViewHolder> {
public void setMoiveList(List<MoiveBean> mMoiveList) {
//对数组进行排序根据rssi值
Collections.sort(mMoiveList);
this.mMoiveList = mMoiveList;
}
private List<MoiveBean> mMoiveList;
public MoiveBriefRecyclerViewAdapter() {
}
@NonNull
@Override
public MoiveViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_moive_brief, viewGroup, false);
MoiveViewHolder bleViewHolder = new MoiveViewHolder(view);
return bleViewHolder;
}
@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull MoiveViewHolder viewHolder, int i) {
viewHolder.mTvName.setText(mMoiveList.get(i).getMoiveName());
viewHolder.mTvActor.setText("演员:" + mMoiveList.get(i).getMoiveActor());
viewHolder.mTvType.setText("类型:" + mMoiveList.get(i).getMoiveType());
File file = new File(mMoiveList.get(i).getMoivePic());
Bitmap bm = BitmapFactory.decodeFile(Uri.fromFile(file).getPath());
viewHolder.mIvPic.setImageBitmap(bm);
viewHolder.mLayout.setOnClickListener(new MyOnClickListener(mMoiveList.get(i)));
}
@Override
public int getItemCount() {
return mMoiveList.size();
}
class MoiveViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.iv_moive_brief_image)
ImageView mIvPic;
@BindView(R.id.tv_moive_brief_name)
TextView mTvName;
@BindView(R.id.tv_moive_brief_actor)
TextView mTvActor;
@BindView(R.id.tv_moive_brief_type)
TextView mTvType;
@BindView(R.id.ll_moive_brief)
LinearLayout mLayout;
MoiveViewHolder(View view) {
super(view);
ButterKnife.bind(this, view);
}
}
private class MyOnClickListener implements View.OnClickListener {
private MoiveBean mMoiveBean;
public MyOnClickListener(MoiveBean MoiveBean) {
this.mMoiveBean = MoiveBean;
}
@Override
public void onClick(View v) {
onItemClickListener.OnItemClick(v, mMoiveBean);
}
}
public void setOnItemClickListener(MoiveBriefRecyclerViewAdapter.onItemClickListener onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
private onItemClickListener onItemClickListener;
public interface onItemClickListener {
void OnItemClick(View view, MoiveBean MoiveBean);
}
}
|
[
"749902455@qq.com"
] |
749902455@qq.com
|
826e69c101c7b4e02ed07385bcdf742d28258d55
|
f2ce19f815c6d880eb70195df69277675154085b
|
/Java/immutable1.java
|
12797c9bdca5c2422eb1511d121d7d59896dbd53
|
[] |
no_license
|
terence4wilbert/Programs
|
b7d652e6fa54e91fc8ea5e38981d8368ee9146c1
|
87de6308a613d261fdba5cd59d15343e95417ed9
|
refs/heads/master
| 2021-01-22T21:13:30.625390
| 2019-01-01T20:25:31
| 2019-01-01T20:25:31
| 24,546,025
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 593
|
java
|
// immutable class practice
public final class Person {
private final String name;
private final int age;
private final Collection<String> friends;
// constructor
public Person(String name, int age, Collection<String> friends){
this.name = name;
this.age = age;
this.friends = new ArrayList(friends);
}
public String getName(){
return this.name;
}
public String getAge(){
return this.age;
}
public Collection<String> getFriends(){
return Collections.unmodifiableCollection(this.friends);
}
}
|
[
"terence4wilbert@gmail.com"
] |
terence4wilbert@gmail.com
|
15773d433b2a96fdbc4cbf47b713cdca490717de
|
1c2f9a6fbe73df6c663c7d08ceaffd5e202e55ff
|
/hanbit/src/main/java/com/hanbit/web/admin/AdminServiceImpl.java
|
7621119a26db5fc0aa17e8657bd870a93d7d6508
|
[] |
no_license
|
HT-K/hanbit_sts_grade
|
962836400596d92070fab57af6ddb42ec8ed5b70
|
b77f6dc6a79ffe788a24bba250534b08b43cdac9
|
refs/heads/master
| 2021-01-19T22:20:46.429408
| 2016-04-26T06:57:09
| 2016-04-26T06:57:18
| 65,425,564
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,671
|
java
|
package com.hanbit.web.admin;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hanbit.web.grade.GradeMemberDTO;
import com.hanbit.web.mapper.AdminMapper;
@Service
public class AdminServiceImpl implements AdminService{
private static final Logger logger = LoggerFactory.getLogger(AdminService.class);
private static AdminService instance = new AdminServiceImpl();
@Autowired SqlSession session;
@Autowired AdminDTO admin;
public static AdminService getInstance() {
return instance;
}
@Override
public List<GradeMemberDTO> getMemberList() {
// TODO Auto-generated method stub
return null;
}
@Override
public int addScore(GradeMemberDTO bean) {
// TODO Auto-generated method stub
return 0;
}
@Override
public AdminDTO getAdmin(AdminDTO param) {
AdminDTO temp = new AdminDTO();
temp = null;
if (temp != null) {
System.out.println("어드민 서비스 : 관리자가 널이 아님");
return temp;
} else {
System.out.println("어드민 서비스 : 관리자가 널임");
return null;
}
}
@Override
public AdminDTO login(AdminDTO param) {
logger.info("memberService : login() 진입 후 id = {}",param.getId());
AdminMapper mapper = session.getMapper(AdminMapper.class);
admin = mapper.login(param);
if (admin != null) {
logger.info("memberService : login() 성공 후 id = {}",admin.getId());
return admin;
} else {
logger.info("memberService : login() 실패, 널 반환");
return null;
}
}
}
|
[
"pakjkwan@gmail.com"
] |
pakjkwan@gmail.com
|
738875d7fdda022aed8bd45b805430e45ada0b26
|
3b6e92f54c37e78fef714b82e5a517228dd69551
|
/Lab06/app/src/main/java/edu/calvin/cs262/bdr22/lab06/MainActivity.java
|
9a935485e0db452ca443a97c1cef36fc914b670a
|
[] |
no_license
|
britzema/cs262
|
c533adabfea6a8721e1516f84efaa4b3bcfc6c32
|
d69fb76a684b8acdccc48fad51cf0cb2e510a9aa
|
refs/heads/master
| 2020-07-29T15:14:00.086042
| 2019-11-15T20:35:20
| 2019-11-15T20:35:20
| 209,857,951
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,366
|
java
|
package edu.calvin.cs262.bdr22.lab06;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import edu.calvin.cs262.bdr22.lab06.OrderActivity;
import edu.calvin.cs262.bdr22.lab06.AppCompatPreferenceActivity;
import edu.calvin.cs262.bdr22.lab06.SettingsActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
PreferenceManager.setDefaultValues(this, R.xml.pref_general, false);
PreferenceManager.setDefaultValues(this, R.xml.pref_notification, false);
PreferenceManager.setDefaultValues(this, R.xml.pref_data_sync, false);
SharedPreferences sharedPref =
PreferenceManager.getDefaultSharedPreferences(this);
String marketPref = sharedPref.getString("sync_frequency", "-1");
Toast.makeText(this, marketPref, Toast.LENGTH_SHORT).show();
}
@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_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_favorites:
displayToast(getString(R.string.action_favorites_message));
return true;
case R.id.action_contact:
displayToast(getString(R.string.action_contact_message));
return true;
case R.id.action_settings:
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
return true;
default:
// Do nothing
}
return super.onOptionsItemSelected(item);
}
public void displayToast(String message) {
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
}
/**
* Shows a message that the donut image was clicked.
*/
public void showDonutOrder(View view) {
showFoodOrder(getString(R.string.donut_order_message));
}
/**
* Shows a message that the ice cream sandwich image was clicked.
*/
public void showIceCreamOrder(View view) {
showFoodOrder(getString(R.string.ice_cream_order_message));
}
/**
* Shows a message that the froyo image was clicked.
*/
public void showFroyoOrder(View view) {
showFoodOrder(getString(R.string.froyo_order_message));
}
/**
* Displays a toast message for the food order
* and starts the OrderActivity activity.
*
* @param message Message to display.
*/
public void showFoodOrder(String message) {
displayToast(message);
Intent intent = new Intent(this, OrderActivity.class);
startActivity(intent);
}
}
|
[
"bradritzema@gmail.com"
] |
bradritzema@gmail.com
|
5d9b76daed1cfae0f56256a75b895c719baf6e05
|
d2524c887db95311cafe887c7edbe761089235fc
|
/guns-base-support/guns-core/src/main/java/cn/stylefeng/guns/core/exception/enums/abs/AbstractBaseExceptionEnum.java
|
cd58752e2ef290653707379ce18bbba6361540af
|
[] |
no_license
|
CrazypDan/guns-separation
|
60bb90799a08b56b0d07f9eb4599ca3b2a03d569
|
4a8ed7b51327a6fccf63a4724816a23efcb7eaec
|
refs/heads/main
| 2023-03-24T16:38:14.994618
| 2021-03-19T09:05:48
| 2021-03-19T09:05:48
| 349,357,510
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 510
|
java
|
package cn.stylefeng.guns.core.exception.enums.abs;
/**
* 异常枚举格式规范
*
* @author stylefeng
* @date 2017/12/17 22:22
*/
public interface AbstractBaseExceptionEnum {
/**
* 获取异常的状态码
*
* @return 状态码
* @author stylefeng
* @date 2020/7/9 14:28
*/
Integer getCode();
/**
* 获取异常的提示信息
*
* @return 提示信息
* @author stylefeng
* @date 2020/7/9 14:28
*/
String getMessage();
}
|
[
"da.feng@tcl.com"
] |
da.feng@tcl.com
|
71c1312d80468301be150cc733d0c384a7dd78fd
|
66c789cdc1d6df15f87380e9ef8e135681ffb407
|
/kalyan -sql/src/com/dot/Skills/SkillsUtils.java
|
3cece5240e3d3247e8f2effdf3c49a175ac3d896
|
[] |
no_license
|
prashantshivam/Project-DOT
|
a0661c66d6f107bd5a46b224849a65f3bd3e003d
|
18cec9b9eb27f079f3f506be829cfe5ddca2fbd2
|
refs/heads/master
| 2021-09-10T02:56:14.753817
| 2018-03-20T20:03:21
| 2018-03-20T20:03:21
| 126,075,204
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,424
|
java
|
package com.dot.Skills;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.*;
import com.dot.DbUtils;
public class SkillsUtils {
public static List selectSkill(HttpServletRequest request,
HttpServletResponse response) throws ClassNotFoundException,
IOException
{
Connection con = null;
PreparedStatement ps = null;
ResultSet r = null;
String sql4 = "select * from skills,has_skills where mid=? and skills.sid=has_skills.sid";
int n = 0;
try {
n = Integer.parseInt(request.getParameter("mid"));
} catch (Exception e) {
HttpSession session = request.getSession(true); // to get the mid of
// the
n = (Integer) session.getAttribute("mid");
}
List<Skills> list = new ArrayList<Skills>();
//List<Skills> list4 = new ArrayList<Skills>();
try {
/*Class.forName(driverName);
con = DriverManager.getConnection(url, user, dbpsw);*/
con = DbUtils.getConnection();
ps = con.prepareStatement(sql4);
ps.setInt(1, n);
r = ps.executeQuery();
while (r.next()) {
int sid = r.getInt("sid");
String skill = r.getString("skill");
int mid = r.getInt("mid");
Skills sk = new Skills(sid, skill, mid);
list.add(sk);
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
public static List selectnotSkill(HttpServletRequest request,
HttpServletResponse response) throws ClassNotFoundException,
IOException
{
Connection con = null;
PreparedStatement ps = null;
ResultSet r = null;
String sql4 = "select * from skills where sid not in(select has_skills.sid from has_skills where mid=?)";
int n = 0;
try {
n = Integer.parseInt(request.getParameter("mid"));
} catch (Exception e) {
HttpSession session = request.getSession(true); // to get the mid of
// the
n = (Integer) session.getAttribute("mid");
}
List<NotSkills> list = new ArrayList<NotSkills>();
try {
//Class.forName(driverName);
//con = DriverManager.getConnection(url, user, dbpsw);
con = DbUtils.getConnection();
ps = con.prepareStatement(sql4);
ps.setInt(1, n);
r = ps.executeQuery();
while (r.next()) {
int sid = r.getInt("sid");
String skill = r.getString("skill");
NotSkills sk = new NotSkills(sid, skill);
list.add(sk);
}
} catch (Exception e) {
e.printStackTrace();
System.out.println("home" + e);
}
return list;
}
public static void insertSkill(HttpServletRequest request,
HttpServletResponse response) throws ClassNotFoundException,
IOException {
System.out.println("hi");
HttpSession session = request.getSession(true); // to get the mid of the
// session
String mid1 = session.getAttribute("mid").toString();
int mid = Integer.parseInt(mid1);
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
// ResultSet rs1[] = null;
String skill = request.getParameter("skill");
// out.println("skill="+skill);
int sid = 0;
// out.println(sid1);
String sql1 = "select sid from skills where skill=?";
System.out.println("hi");
try {
con = DbUtils.getConnection();
ps = con.prepareStatement(sql1);
ps.setString(1, skill);
rs = ps.executeQuery();
while (rs.next()) {
sid = rs.getInt("sid");
}
ps.close();
} catch (SQLException sqe) {
sqe.printStackTrace();
}
System.out.println("hi");
String sql = "insert into has_skills (sid,mid) values (?,?)";
System.out.println("hi");
if (mid != 0) {
try {
//Class.forName(driverName);
//con = DriverManager.getConnection(url, user, dbpsw);
con = DbUtils.getConnection();
ps = con.prepareStatement(sql);
ps.setInt(1, sid);
ps.setInt(2, mid);
ps.execute();
ps.close();
response.sendRedirect("/dot/college/profile/welcome.jsp");
} catch (SQLException sqe) {
sqe.printStackTrace();
}
}
}
}
|
[
"prashant.kumar@iiitdmj.ac.in"
] |
prashant.kumar@iiitdmj.ac.in
|
4f5a8e3f14a42920add430806a8451eb023a92e2
|
16540136d0072c1040a23d891b902d1f71c0e98d
|
/Chapter8/Chapter8Examples/Countable.java
|
207796c8be5088ea1bd01a3d77a1653bf11e2840
|
[] |
no_license
|
nicolljc/JavaPrivate
|
4bf5f08bc8a1d784e18d93b13bd2b07ab43b2edf
|
95d12257342f5d71b56c8b149ac06013522762e3
|
refs/heads/master
| 2021-01-20T10:05:08.193292
| 2017-06-14T22:47:40
| 2017-06-14T22:47:40
| 90,203,411
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 541
|
java
|
/**
This class demonstrates a static field.
*/
public class Countable
{
private static int instanceCount = 0;
/**
The constructor increments the static
field instanceCount. This keeps track
of the number of instances of this
class that are created.
*/
public Countable()
{
instanceCount++;
}
/**
The getInstanceCount method returns
the number of instances of this class
that have been created.
@return The value in the instanceCount field.
*/
public int getInstanceCount()
{
return instanceCount;
}
}
|
[
"jesse.nicoll@fountainheadcollege.com"
] |
jesse.nicoll@fountainheadcollege.com
|
36b9c83f884a6a826979284528c42fe05d09170e
|
896cca57024190fc3fbb62f2bd0188fff24b24c8
|
/2.7.x/choicemaker-cm/choicemaker-modeling/com.wcohen.ss/src/main/java/com/wcohen/ss/api/StringWrapper.java
|
1cd0b16341cbaf4ebe206fb658e8fe4b4973f51e
|
[] |
no_license
|
fgregg/cm
|
0d4f50f92fde2a0bed465f2bec8eb7f2fad8362c
|
c0ab489285938f14cdf0a6ed64bbda9ac4d04532
|
refs/heads/master
| 2021-01-10T11:27:00.663407
| 2015-08-11T19:35:00
| 2015-08-11T19:35:00
| 55,807,163
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 536
|
java
|
package com.wcohen.ss.api;
import java.io.Serializable;
/**
* Something that implements some of the functionality of Java's
* string class, but which is a non-final class, and hence can also
* cache additional information to facilitate later processing.
*/
public interface StringWrapper extends Serializable {
/** Return the string that is wrapped. */
public String unwrap();
/** Return the i-th char of the wrapped string */
public char charAt(int i);
/** Return the length of the wrapped string */
public int length();
}
|
[
"rick@rphall.com"
] |
rick@rphall.com
|
5af933c57b170cfcf9b2ba9bd7fcb8621bf6d055
|
64bf7a8ed11260ebec3e31df2663fbb7d21df2ed
|
/app/src/main/java/com/example/finalproject/Fragments/LoginFragment.java
|
526cfb38cb2cd7bda4509ec213cb361a10d928d4
|
[] |
no_license
|
lptnkv/FinalProject
|
af769778b036806a26877dc92739ab8ef0413c99
|
e8c51bc504f5320eaafb6d9067f0d3722f4608cd
|
refs/heads/master
| 2023-05-07T12:36:23.600945
| 2021-05-27T08:20:59
| 2021-05-27T08:20:59
| 364,868,072
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,713
|
java
|
package com.example.finalproject.Fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.example.finalproject.Database.AppDatabase;
import com.example.finalproject.Database.Entities.User;
import com.example.finalproject.MainActivity;
import com.example.finalproject.databinding.LoginFragmentBinding;
public class LoginFragment extends Fragment {
LoginFragmentBinding binding;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = LoginFragmentBinding.inflate(inflater, container, false);
binding.startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String nickname = binding.nameTextView.getText().toString();
if (!nickname.isEmpty()){
User currentUser = new User(nickname);
AppDatabase.databaseWriteExecutor.execute(()->{
AppDatabase.getDatabase(getContext()).userDao().insert(currentUser);
});
MainActivity.getInstance().setCurrentUser(currentUser);
MainActivity.getInstance().login();
} else {
Toast.makeText(getContext(), "Введите никнейм", Toast.LENGTH_SHORT).show();
}
}
});
return binding.getRoot();
}
}
|
[
"lipatnikov.ks@gmail.com"
] |
lipatnikov.ks@gmail.com
|
dde5658c4213ad7c0c6cf51c785cd7a703445b63
|
9575a87448cf581097fd6026f35b218712de5b94
|
/src/main/java/com/plenigo/sdk/PlenigoException.java
|
869b114e7bb3ac87dc8e78c9eaaf780194cefc07
|
[] |
no_license
|
plenigo/plenigo_java_sdk_commons
|
de5822634a0cd830827fa3f3efd2d4a57138370d
|
31fdbdc761e8574c67021fa515f412ac829def73
|
refs/heads/master
| 2021-01-10T20:29:02.389843
| 2018-09-04T18:30:07
| 2018-09-04T18:30:07
| 34,792,458
| 3
| 0
| null | 2017-05-02T09:37:28
| 2015-04-29T12:26:59
|
Java
|
UTF-8
|
Java
| false
| false
| 2,683
|
java
|
package com.plenigo.sdk;
import com.plenigo.sdk.internal.ErrorCode;
import com.plenigo.sdk.models.ErrorDetail;
import java.util.LinkedList;
import java.util.List;
/**
* <p>
* This represents any exception that can come from
* the plenigo API or SDK.
* </p>
* <p>
* <strong>Thread safety:</strong> This class is thread safe and can be injected.
* </p>
*/
public class PlenigoException extends Exception {
/**
* The response code that came from the server.
*/
private String responseCode;
/**
* List of errors.
*/
private List<ErrorDetail> errorDetails;
/**
* This constructor is used when an error code
* has been obtained from the server.
*
* @param rspCode The response code
* @param msg The response message
*/
public PlenigoException(final String rspCode, final String msg) {
super(msg);
this.responseCode = rspCode;
this.errorDetails = new LinkedList<ErrorDetail>();
}
/**
* This constructor is used when an error code
* has been obtained from the server.
*
* @param rspCode The response code
* @param msg The response message
* @param errorDetails The error details
*/
public PlenigoException(String rspCode, String msg, List<ErrorDetail> errorDetails) {
super(msg);
this.responseCode = rspCode;
this.errorDetails = errorDetails;
}
/**
* The resulting Response Code of a plenigo API Request.
*
* @return Response Code
*/
public String getResponseCode() {
return responseCode;
}
/**
* This constructor is used when there is no error code
* but there was an error during server communication or a process.
*
* @param message the message to send
* @param e the thrown exception
*/
public PlenigoException(final String message, final Throwable e) {
super(message, e);
}
/**
* This constructor is used when there is no error code
* but there was an error during server communication or a process.
*
* @param message the message to send
* @param e the thrown exception
* @param errorCode the errorCode for this exception
*/
public PlenigoException(final ErrorCode errorCode, final String message, final Throwable e) {
this(message, e);
this.responseCode = errorCode.getCode();
}
/**
* The list of additional detailed errors that came as a response from the server.
*
* @return List of errors.
*/
public List<ErrorDetail> getErrors() {
return errorDetails;
}
}
|
[
"rtorres@okkralabs.com"
] |
rtorres@okkralabs.com
|
32f7eec034406018df7c927edfad897e4e703bc5
|
46b352e3b970b6c1f7fc35cf011d03cafb16e32d
|
/FINAL/SearchTrees - final/src/TreePackage/DecisionTree.java
|
02dc9b9a70665f1a7eb0e1f791f1e108174632cf
|
[] |
no_license
|
FlatFishPrincess/data_structure
|
f8b7836691e1116e6743590104c42fcb5c034aac
|
5df96bf135b2b653070bee79c29a3b7ccefb5357
|
refs/heads/master
| 2020-04-30T20:09:12.473427
| 2019-11-27T06:05:26
| 2019-11-27T06:05:26
| 177,058,035
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,663
|
java
|
package TreePackage;
/**
* A class that implements a decision tree by extending BinaryTree.
*
* @author Frank M. Carrano
* @author Timothy M. Henry
* @version 5.0
*/
public class DecisionTree<T> extends BinaryTree<T> implements DecisionTreeInterface<T> {
private BinaryNode<T> currentNode; // Tracks where we are in the tree
public DecisionTree() {
super();
resetCurrentNode();
} // end default constructor
public DecisionTree(T rootData) {
super(rootData);
resetCurrentNode();
} // end constructor
public DecisionTree(T rootData, DecisionTree<T> leftTree, DecisionTree<T> rightTree) {
setTree(rootData, leftTree, rightTree);
resetCurrentNode();
} // end constructor
public DecisionTree(T rootData, T responseForNo, T responseForYes) {
DecisionTree<T> leftTree = new DecisionTree<>(responseForNo);
DecisionTree<T> rightTree = new DecisionTree<>(responseForYes);
setTree(rootData, leftTree, rightTree);
resetCurrentNode();
} // end constructor
public T getCurrentData() {
if (currentNode != null)
return currentNode.getData();
else
return null;
} // end getCurrentData
public void setCurrentData(T newData) {
if (currentNode != null)
currentNode.setData(newData);
else
throw new NullPointerException();
} // end setCurrentData
public void setResponses(T responseForNo, T responseForYes) {
if (currentNode == null)
throw new NullPointerException();
else if (currentNode.hasLeftChild()) {
BinaryNode<T> leftChild = currentNode.getLeftChild();
leftChild.setData(responseForNo);
} else {
BinaryNode<T> newLeftChild = new BinaryNode<>(responseForNo);
currentNode.setLeftChild(newLeftChild);
} // end if
if (currentNode.hasRightChild()) {
BinaryNode<T> rightChild = currentNode.getRightChild();
rightChild.setData(responseForYes);
} else {
BinaryNode<T> newRightChild = new BinaryNode<>(responseForYes);
currentNode.setRightChild(newRightChild);
} // end if
} // end setResponses
public boolean isAnswer() {
if (currentNode != null)
return currentNode.isLeaf();
else
return false;
} // end isAnswer
public void advanceToNo() {
if (currentNode == null)
throw new NullPointerException();
else
currentNode = currentNode.getLeftChild();
} // end advanceToNo
public void advanceToYes() {
if (currentNode == null)
throw new NullPointerException();
else
currentNode = currentNode.getRightChild();
} // end advanceToYes
public void resetCurrentNode() {
currentNode = getRootNode();
} // end resetCurrentNode
protected BinaryNode<T> getCurrentNode() {
return currentNode;
} // end getCurrentNode
} // end DecisionTree
|
[
"jiweon.park@gracehanin.org"
] |
jiweon.park@gracehanin.org
|
0b9e65865b9993429c5e38acbe011e8ef072581f
|
fe383bb4dd4148bf5e4ac63a337af16cbd524630
|
/src/main/java/com/medic/mastersControllers/BrandProductMapping/BrandProductMappingController.java
|
f1ca6d4b778ebb43af88c2f62e0a3f1c9635eaf3
|
[] |
no_license
|
ashishgaur00/MedicShish
|
559f063a372ca422c05dadc2157475abf98dfc3d
|
5f095c208bd2a7138c5b12437466d974ce1b1dac
|
refs/heads/main
| 2023-08-07T21:31:01.365024
| 2021-09-29T17:27:13
| 2021-09-29T17:27:13
| 411,754,831
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,508
|
java
|
package com.medic.mastersControllers.BrandProductMapping;
import com.medic.MasterEntityVO.wareInsert.Brands;
import com.medic.MasterEntityVO.wareInsert.ProductsMapping;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/brandProductMappingController")
public class BrandProductMappingController {
@RequestMapping("/create")
public ModelAndView create(){
ModelAndView returnedPage = new ModelAndView("productMappingCreate");
returnedPage.addObject("brand", new Brands());
returnedPage.addObject("productsMapping", new ProductsMapping());
return returnedPage;
}
@RequestMapping("/view")
public ModelAndView view(){
ModelAndView returnedPage = new ModelAndView("productMappingCreate");
return returnedPage;
}
@RequestMapping("/save")
public ModelAndView save(@ModelAttribute Brands Brand,
BindingResult result , String productJson){
ModelAndView returnedPage = new ModelAndView("wareInsertDatatable");
return returnedPage;
}
@RequestMapping("/update")
public ModelAndView update(){
ModelAndView returnedPage = new ModelAndView("productMappingCreate");
return returnedPage;
}
}
|
[
"91624981+ashishgaur00@users.noreply.github.com"
] |
91624981+ashishgaur00@users.noreply.github.com
|
8174545444752271bf896db6dd9a0890ecce0312
|
7016cec54fb7140fd93ed805514b74201f721ccd
|
/src/java/com/echothree/control/user/accounting/server/command/CreateGlResourceTypeCommand.java
|
b092dd3a38e080cd334a26a5971e6cd2587ad01a
|
[
"MIT",
"Apache-1.1",
"Apache-2.0"
] |
permissive
|
echothreellc/echothree
|
62fa6e88ef6449406d3035de7642ed92ffb2831b
|
bfe6152b1a40075ec65af0880dda135350a50eaf
|
refs/heads/master
| 2023-09-01T08:58:01.429249
| 2023-08-21T11:44:08
| 2023-08-21T11:44:08
| 154,900,256
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,510
|
java
|
// --------------------------------------------------------------------------------
// Copyright 2002-2023 Echo Three, 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.
// --------------------------------------------------------------------------------
package com.echothree.control.user.accounting.server.command;
import com.echothree.control.user.accounting.common.form.CreateGlResourceTypeForm;
import com.echothree.model.control.accounting.server.control.AccountingControl;
import com.echothree.model.control.party.common.PartyTypes;
import com.echothree.model.control.security.common.SecurityRoleGroups;
import com.echothree.model.control.security.common.SecurityRoles;
import com.echothree.model.data.accounting.server.entity.GlResourceType;
import com.echothree.model.data.user.common.pk.UserVisitPK;
import com.echothree.util.common.message.ExecutionErrors;
import com.echothree.util.common.validation.FieldDefinition;
import com.echothree.util.common.validation.FieldType;
import com.echothree.util.common.command.BaseResult;
import com.echothree.util.server.control.BaseSimpleCommand;
import com.echothree.util.server.control.CommandSecurityDefinition;
import com.echothree.util.server.control.PartyTypeDefinition;
import com.echothree.util.server.control.SecurityRoleDefinition;
import com.echothree.util.server.persistence.Session;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class CreateGlResourceTypeCommand
extends BaseSimpleCommand<CreateGlResourceTypeForm> {
private final static CommandSecurityDefinition COMMAND_SECURITY_DEFINITION;
private final static List<FieldDefinition> FORM_FIELD_DEFINITIONS;
static {
COMMAND_SECURITY_DEFINITION = new CommandSecurityDefinition(Collections.unmodifiableList(Arrays.asList(
new PartyTypeDefinition(PartyTypes.UTILITY.name(), null),
new PartyTypeDefinition(PartyTypes.EMPLOYEE.name(), Collections.unmodifiableList(Arrays.asList(
new SecurityRoleDefinition(SecurityRoleGroups.GlResourceType.name(), SecurityRoles.Create.name())
)))
)));
FORM_FIELD_DEFINITIONS = Collections.unmodifiableList(Arrays.asList(
new FieldDefinition("GlResourceTypeName", FieldType.ENTITY_NAME, true, null, null),
new FieldDefinition("IsDefault", FieldType.BOOLEAN, true, null, null),
new FieldDefinition("SortOrder", FieldType.SIGNED_INTEGER, true, null, null),
new FieldDefinition("Description", FieldType.STRING, false, 1L, 132L)
));
}
/** Creates a new instance of CreateGlResourceTypeCommand */
public CreateGlResourceTypeCommand(UserVisitPK userVisitPK, CreateGlResourceTypeForm form) {
super(userVisitPK, form, COMMAND_SECURITY_DEFINITION, FORM_FIELD_DEFINITIONS, false);
}
@Override
protected BaseResult execute() {
var accountingControl = Session.getModelController(AccountingControl.class);
String glResourceTypeName = form.getGlResourceTypeName();
GlResourceType glResourceType = accountingControl.getGlResourceTypeByName(glResourceTypeName);
if(glResourceType == null) {
var partyPK = getPartyPK();
var isDefault = Boolean.valueOf(form.getIsDefault());
var sortOrder = Integer.valueOf(form.getSortOrder());
var description = form.getDescription();
glResourceType = accountingControl.createGlResourceType(glResourceTypeName, isDefault, sortOrder, partyPK);
if(description != null) {
accountingControl.createGlResourceTypeDescription(glResourceType, getPreferredLanguage(), description, partyPK);
}
} else {
addExecutionError(ExecutionErrors.DuplicateGlResourceTypeName.name(), glResourceTypeName);
}
return null;
}
}
|
[
"rich@echothree.com"
] |
rich@echothree.com
|
85c447b42ff953eb08642510da4d5d53863232ad
|
0597062dd87235acfdaf08ccb997427121eb732e
|
/IODevice.java
|
4bb09c3be82c4e5951289d9d0f67ccc53e7a0b2f
|
[] |
no_license
|
dalalalali37/Operating_system_jobs_project
|
5d19b7d42597dc6accc7ee74985ad58ef9e4a8e0
|
43aeb6fd244245ff122941fb4c8f7432594f2c2e
|
refs/heads/master
| 2022-12-03T04:10:07.251877
| 2020-08-21T19:31:59
| 2020-08-21T19:31:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,433
|
java
|
public class IODevice {
private static String IOD_State;
public static void set_IO_State(String iO_State) {
IOD_State = iO_State;
}
public static String get_IO_State() {
return IOD_State;
}
//constructure
public IODevice(String state) {
IODevice.IOD_State = state;
}
//1.5. A busy I/O device may generate an interrupt to signal its job completion and its availability
//with a probability 20%. In this case, the process currently occupying it returns to the Ready
//Queue, and the process at the I/O Queue head is assigned the device.
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
public static boolean IO_Termination(int D_Terimante) {
boolean device_is_Not_Terminated = true;
if(80 <= D_Terimante) {
set_IO_State("Device Is Terminated");
device_is_Not_Terminated = false;
}
else
set_IO_State("Device Is Not Terminated");
return true;
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx we deleted this methos
/////////////// is it deleted???? if not how did you change it in class job ??
/* public static void IO_ISR(Job job) {
int waitingTime = 0;
boolean DState = false;
job.setCPUBound(false);
while(!DState) {
DState = IO_Termination((int) (Math.random() * 100 + 1));
waitingTime++;
}
} */
}
|
[
"dalalali453@gmail.com"
] |
dalalali453@gmail.com
|
3d7888d62ff2346dbc567d49570b939f604711a0
|
38c4451ab626dcdc101a11b18e248d33fd8a52e0
|
/tokens/xalan-j-2.7.1/src/org/apache/xalan/xsltc/compiler/Number.java
|
1bc525741e46dacad7cae23d2e90ac959c8942fb
|
[] |
no_license
|
habeascorpus/habeascorpus-data
|
47da7c08d0f357938c502bae030d5fb8f44f5e01
|
536d55729f3110aee058ad009bcba3e063b39450
|
refs/heads/master
| 2020-06-04T10:17:20.102451
| 2013-02-19T15:19:21
| 2013-02-19T15:19:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 67,246
|
java
|
package TokenNamepackage
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
java TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
ArrayList TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
classfile TokenNameIdentifier
. TokenNameDOT
Field TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
ALOAD TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
ASTORE TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
BranchHandle TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
CHECKCAST TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
ConstantPoolGen TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
GETFIELD TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
GOTO TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
IFNONNULL TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
INVOKESPECIAL TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
INVOKESTATIC TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
INVOKEVIRTUAL TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
InstructionList TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
D2I TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
LocalVariableGen TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
NEW TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
PUSH TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
PUTFIELD TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
ClassGenerator TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
MatchGenerator TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
MethodGenerator TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
NodeCounterGenerator TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
RealType TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
TypeCheckError TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
Util TokenNameIdentifier
; TokenNameSEMICOLON
final TokenNamefinal
class TokenNameclass
Number TokenNameIdentifier
extends TokenNameextends
Instruction TokenNameIdentifier
implements TokenNameimplements
Closure TokenNameIdentifier
{ TokenNameLBRACE
private TokenNameprivate
static TokenNamestatic
final TokenNamefinal
int TokenNameint
LEVEL_SINGLE TokenNameIdentifier
= TokenNameEQUAL
0 TokenNameIntegerLiteral
; TokenNameSEMICOLON
private TokenNameprivate
static TokenNamestatic
final TokenNamefinal
int TokenNameint
LEVEL_MULTIPLE TokenNameIdentifier
= TokenNameEQUAL
1 TokenNameIntegerLiteral
; TokenNameSEMICOLON
private TokenNameprivate
static TokenNamestatic
final TokenNamefinal
int TokenNameint
LEVEL_ANY TokenNameIdentifier
= TokenNameEQUAL
2 TokenNameIntegerLiteral
; TokenNameSEMICOLON
static TokenNamestatic
final TokenNamefinal
private TokenNameprivate
String TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
ClassNames TokenNameIdentifier
= TokenNameEQUAL
{ TokenNameLBRACE
"org.apache.xalan.xsltc.dom.SingleNodeCounter" TokenNameStringLiteral
, TokenNameCOMMA
"org.apache.xalan.xsltc.dom.MultipleNodeCounter" TokenNameStringLiteral
, TokenNameCOMMA
"org.apache.xalan.xsltc.dom.AnyNodeCounter" TokenNameStringLiteral
} TokenNameRBRACE
; TokenNameSEMICOLON
static TokenNamestatic
final TokenNamefinal
private TokenNameprivate
String TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
FieldNames TokenNameIdentifier
= TokenNameEQUAL
{ TokenNameLBRACE
"___single_node_counter" TokenNameStringLiteral
, TokenNameCOMMA
"___multiple_node_counter" TokenNameStringLiteral
, TokenNameCOMMA
"___any_node_counter" TokenNameStringLiteral
} TokenNameRBRACE
; TokenNameSEMICOLON
private TokenNameprivate
Pattern TokenNameIdentifier
_from TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
Pattern TokenNameIdentifier
_count TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
Expression TokenNameIdentifier
_value TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
AttributeValueTemplate TokenNameIdentifier
_lang TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
AttributeValueTemplate TokenNameIdentifier
_format TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
AttributeValueTemplate TokenNameIdentifier
_letterValue TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
AttributeValueTemplate TokenNameIdentifier
_groupingSeparator TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
AttributeValueTemplate TokenNameIdentifier
_groupingSize TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
int TokenNameint
_level TokenNameIdentifier
= TokenNameEQUAL
LEVEL_SINGLE TokenNameIdentifier
; TokenNameSEMICOLON
private TokenNameprivate
boolean TokenNameboolean
_formatNeeded TokenNameIdentifier
= TokenNameEQUAL
false TokenNamefalse
; TokenNameSEMICOLON
private TokenNameprivate
String TokenNameIdentifier
_className TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
private TokenNameprivate
ArrayList TokenNameIdentifier
_closureVars TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
public TokenNamepublic
boolean TokenNameboolean
inInnerClass TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
( TokenNameLPAREN
_className TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
Closure TokenNameIdentifier
getParentClosure TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
null TokenNamenull
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
String TokenNameIdentifier
getInnerClassName TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
_className TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
void TokenNamevoid
addVariable TokenNameIdentifier
( TokenNameLPAREN
VariableRefBase TokenNameIdentifier
variableRef TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
if TokenNameif
( TokenNameLPAREN
_closureVars TokenNameIdentifier
== TokenNameEQUAL_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_closureVars TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
ArrayList TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
! TokenNameNOT
_closureVars TokenNameIdentifier
. TokenNameDOT
contains TokenNameIdentifier
( TokenNameLPAREN
variableRef TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_closureVars TokenNameIdentifier
. TokenNameDOT
add TokenNameIdentifier
( TokenNameLPAREN
variableRef TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
public TokenNamepublic
void TokenNamevoid
parseContents TokenNameIdentifier
( TokenNameLPAREN
Parser TokenNameIdentifier
parser TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
final TokenNamefinal
int TokenNameint
count TokenNameIdentifier
= TokenNameEQUAL
_attributes TokenNameIdentifier
. TokenNameDOT
getLength TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
for TokenNamefor
( TokenNameLPAREN
int TokenNameint
i TokenNameIdentifier
= TokenNameEQUAL
0 TokenNameIntegerLiteral
; TokenNameSEMICOLON
i TokenNameIdentifier
< TokenNameLESS
count TokenNameIdentifier
; TokenNameSEMICOLON
i TokenNameIdentifier
++ TokenNamePLUS_PLUS
) TokenNameRPAREN
{ TokenNameLBRACE
final TokenNamefinal
String TokenNameIdentifier
name TokenNameIdentifier
= TokenNameEQUAL
_attributes TokenNameIdentifier
. TokenNameDOT
getQName TokenNameIdentifier
( TokenNameLPAREN
i TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
String TokenNameIdentifier
value TokenNameIdentifier
= TokenNameEQUAL
_attributes TokenNameIdentifier
. TokenNameDOT
getValue TokenNameIdentifier
( TokenNameLPAREN
i TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"value" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_value TokenNameIdentifier
= TokenNameEQUAL
parser TokenNameIdentifier
. TokenNameDOT
parseExpression TokenNameIdentifier
( TokenNameLPAREN
this TokenNamethis
, TokenNameCOMMA
name TokenNameIdentifier
, TokenNameCOMMA
null TokenNamenull
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"count" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_count TokenNameIdentifier
= TokenNameEQUAL
parser TokenNameIdentifier
. TokenNameDOT
parsePattern TokenNameIdentifier
( TokenNameLPAREN
this TokenNamethis
, TokenNameCOMMA
name TokenNameIdentifier
, TokenNameCOMMA
null TokenNamenull
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"from" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_from TokenNameIdentifier
= TokenNameEQUAL
parser TokenNameIdentifier
. TokenNameDOT
parsePattern TokenNameIdentifier
( TokenNameLPAREN
this TokenNamethis
, TokenNameCOMMA
name TokenNameIdentifier
, TokenNameCOMMA
null TokenNamenull
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"level" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
if TokenNameif
( TokenNameLPAREN
value TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"single" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_level TokenNameIdentifier
= TokenNameEQUAL
LEVEL_SINGLE TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
value TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"multiple" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_level TokenNameIdentifier
= TokenNameEQUAL
LEVEL_MULTIPLE TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
value TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"any" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_level TokenNameIdentifier
= TokenNameEQUAL
LEVEL_ANY TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"format" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_format TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
AttributeValueTemplate TokenNameIdentifier
( TokenNameLPAREN
value TokenNameIdentifier
, TokenNameCOMMA
parser TokenNameIdentifier
, TokenNameCOMMA
this TokenNamethis
) TokenNameRPAREN
; TokenNameSEMICOLON
_formatNeeded TokenNameIdentifier
= TokenNameEQUAL
true TokenNametrue
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"lang" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_lang TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
AttributeValueTemplate TokenNameIdentifier
( TokenNameLPAREN
value TokenNameIdentifier
, TokenNameCOMMA
parser TokenNameIdentifier
, TokenNameCOMMA
this TokenNamethis
) TokenNameRPAREN
; TokenNameSEMICOLON
_formatNeeded TokenNameIdentifier
= TokenNameEQUAL
true TokenNametrue
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"letter-value" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_letterValue TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
AttributeValueTemplate TokenNameIdentifier
( TokenNameLPAREN
value TokenNameIdentifier
, TokenNameCOMMA
parser TokenNameIdentifier
, TokenNameCOMMA
this TokenNamethis
) TokenNameRPAREN
; TokenNameSEMICOLON
_formatNeeded TokenNameIdentifier
= TokenNameEQUAL
true TokenNametrue
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"grouping-separator" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_groupingSeparator TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
AttributeValueTemplate TokenNameIdentifier
( TokenNameLPAREN
value TokenNameIdentifier
, TokenNameCOMMA
parser TokenNameIdentifier
, TokenNameCOMMA
this TokenNamethis
) TokenNameRPAREN
; TokenNameSEMICOLON
_formatNeeded TokenNameIdentifier
= TokenNameEQUAL
true TokenNametrue
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
name TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
"grouping-size" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
_groupingSize TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
AttributeValueTemplate TokenNameIdentifier
( TokenNameLPAREN
value TokenNameIdentifier
, TokenNameCOMMA
parser TokenNameIdentifier
, TokenNameCOMMA
this TokenNamethis
) TokenNameRPAREN
; TokenNameSEMICOLON
_formatNeeded TokenNameIdentifier
= TokenNameEQUAL
true TokenNametrue
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
} TokenNameRBRACE
public TokenNamepublic
Type TokenNameIdentifier
typeCheck TokenNameIdentifier
( TokenNameLPAREN
SymbolTable TokenNameIdentifier
stable TokenNameIdentifier
) TokenNameRPAREN
throws TokenNamethrows
TypeCheckError TokenNameIdentifier
{ TokenNameLBRACE
if TokenNameif
( TokenNameLPAREN
_value TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
Type TokenNameIdentifier
tvalue TokenNameIdentifier
= TokenNameEQUAL
_value TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
tvalue TokenNameIdentifier
instanceof TokenNameinstanceof
RealType TokenNameIdentifier
== TokenNameEQUAL_EQUAL
false TokenNamefalse
) TokenNameRPAREN
{ TokenNameLBRACE
_value TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
CastExpr TokenNameIdentifier
( TokenNameLPAREN
_value TokenNameIdentifier
, TokenNameCOMMA
Type TokenNameIdentifier
. TokenNameDOT
Real TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_count TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_count TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_from TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_from TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_format TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_format TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_lang TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_lang TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_letterValue TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_letterValue TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_groupingSeparator TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_groupingSeparator TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_groupingSize TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_groupingSize TokenNameIdentifier
. TokenNameDOT
typeCheck TokenNameIdentifier
( TokenNameLPAREN
stable TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
return TokenNamereturn
Type TokenNameIdentifier
. TokenNameDOT
Void TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
boolean TokenNameboolean
hasValue TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
_value TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
boolean TokenNameboolean
isDefault TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
_from TokenNameIdentifier
== TokenNameEQUAL_EQUAL
null TokenNamenull
&& TokenNameAND_AND
_count TokenNameIdentifier
== TokenNameEQUAL_EQUAL
null TokenNamenull
; TokenNameSEMICOLON
} TokenNameRBRACE
private TokenNameprivate
void TokenNamevoid
compileDefault TokenNameIdentifier
( TokenNameLPAREN
ClassGenerator TokenNameIdentifier
classGen TokenNameIdentifier
, TokenNameCOMMA
MethodGenerator TokenNameIdentifier
methodGen TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
int TokenNameint
index TokenNameIdentifier
; TokenNameSEMICOLON
ConstantPoolGen TokenNameIdentifier
cpg TokenNameIdentifier
= TokenNameEQUAL
classGen TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
InstructionList TokenNameIdentifier
il TokenNameIdentifier
= TokenNameEQUAL
methodGen TokenNameIdentifier
. TokenNameDOT
getInstructionList TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
int TokenNameint
[ TokenNameLBRACKET
] TokenNameRBRACKET
fieldIndexes TokenNameIdentifier
= TokenNameEQUAL
getXSLTC TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
. TokenNameDOT
getNumberFieldIndexes TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
fieldIndexes TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
== TokenNameEQUAL_EQUAL
- TokenNameMINUS
1 TokenNameIntegerLiteral
) TokenNameRPAREN
{ TokenNameLBRACE
Field TokenNameIdentifier
defaultNode TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
Field TokenNameIdentifier
( TokenNameLPAREN
ACC_PRIVATE TokenNameIdentifier
, TokenNameCOMMA
cpg TokenNameIdentifier
. TokenNameDOT
addUtf8 TokenNameIdentifier
( TokenNameLPAREN
FieldNames TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
) TokenNameRPAREN
, TokenNameCOMMA
cpg TokenNameIdentifier
. TokenNameDOT
addUtf8 TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER_SIG TokenNameIdentifier
) TokenNameRPAREN
, TokenNameCOMMA
null TokenNamenull
, TokenNameCOMMA
cpg TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
classGen TokenNameIdentifier
. TokenNameDOT
addField TokenNameIdentifier
( TokenNameLPAREN
defaultNode TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
fieldIndexes TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addFieldref TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
. TokenNameDOT
getClassName TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
, TokenNameCOMMA
FieldNames TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
, TokenNameCOMMA
NODE_COUNTER_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
. TokenNameDOT
loadTranslet TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
GETFIELD TokenNameIdentifier
( TokenNameLPAREN
fieldIndexes TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
BranchHandle TokenNameIdentifier
ifBlock1 TokenNameIdentifier
= TokenNameEQUAL
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
IFNONNULL TokenNameIdentifier
( TokenNameLPAREN
null TokenNamenull
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
ClassNames TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
, TokenNameCOMMA
"getDefaultNodeCounter" TokenNameStringLiteral
, TokenNameCOMMA
"(" TokenNameStringLiteral
+ TokenNamePLUS
TRANSLET_INTF_SIG TokenNameIdentifier
+ TokenNamePLUS
DOM_INTF_SIG TokenNameIdentifier
+ TokenNamePLUS
NODE_ITERATOR_SIG TokenNameIdentifier
+ TokenNamePLUS
")" TokenNameStringLiteral
+ TokenNamePLUS
NODE_COUNTER_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
. TokenNameDOT
loadTranslet TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
methodGen TokenNameIdentifier
. TokenNameDOT
loadDOM TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
methodGen TokenNameIdentifier
. TokenNameDOT
loadIterator TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKESTATIC TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
DUP TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
. TokenNameDOT
loadTranslet TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
SWAP TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUTFIELD TokenNameIdentifier
( TokenNameLPAREN
fieldIndexes TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
BranchHandle TokenNameIdentifier
ifBlock2 TokenNameIdentifier
= TokenNameEQUAL
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
GOTO TokenNameIdentifier
( TokenNameLPAREN
null TokenNamenull
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
ifBlock1 TokenNameIdentifier
. TokenNameDOT
setTarget TokenNameIdentifier
( TokenNameLPAREN
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
. TokenNameDOT
loadTranslet TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
GETFIELD TokenNameIdentifier
( TokenNameLPAREN
fieldIndexes TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
ifBlock2 TokenNameIdentifier
. TokenNameDOT
setTarget TokenNameIdentifier
( TokenNameLPAREN
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
NOP TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
private TokenNameprivate
void TokenNamevoid
compileConstructor TokenNameIdentifier
( TokenNameLPAREN
ClassGenerator TokenNameIdentifier
classGen TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
MethodGenerator TokenNameIdentifier
cons TokenNameIdentifier
; TokenNameSEMICOLON
final TokenNamefinal
InstructionList TokenNameIdentifier
il TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
InstructionList TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
ConstantPoolGen TokenNameIdentifier
cpg TokenNameIdentifier
= TokenNameEQUAL
classGen TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
cons TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
MethodGenerator TokenNameIdentifier
( TokenNameLPAREN
ACC_PUBLIC TokenNameIdentifier
, TokenNameCOMMA
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
. TokenNameDOT
VOID TokenNameIdentifier
, TokenNameCOMMA
new TokenNamenew
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
{ TokenNameLBRACE
Util TokenNameIdentifier
. TokenNameDOT
getJCRefType TokenNameIdentifier
( TokenNameLPAREN
TRANSLET_INTF_SIG TokenNameIdentifier
) TokenNameRPAREN
, TokenNameCOMMA
Util TokenNameIdentifier
. TokenNameDOT
getJCRefType TokenNameIdentifier
( TokenNameLPAREN
DOM_INTF_SIG TokenNameIdentifier
) TokenNameRPAREN
, TokenNameCOMMA
Util TokenNameIdentifier
. TokenNameDOT
getJCRefType TokenNameIdentifier
( TokenNameLPAREN
NODE_ITERATOR_SIG TokenNameIdentifier
) TokenNameRPAREN
} TokenNameRBRACE
, TokenNameCOMMA
new TokenNamenew
String TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
{ TokenNameLBRACE
"dom" TokenNameStringLiteral
, TokenNameCOMMA
"translet" TokenNameStringLiteral
, TokenNameCOMMA
"iterator" TokenNameStringLiteral
} TokenNameRBRACE
, TokenNameCOMMA
"<init>" TokenNameStringLiteral
, TokenNameCOMMA
_className TokenNameIdentifier
, TokenNameCOMMA
il TokenNameIdentifier
, TokenNameCOMMA
cpg TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
ALOAD_0 TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
ALOAD_1 TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
ALOAD_2 TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
ALOAD TokenNameIdentifier
( TokenNameLPAREN
3 TokenNameIntegerLiteral
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
int TokenNameint
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
ClassNames TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
, TokenNameCOMMA
"<init>" TokenNameStringLiteral
, TokenNameCOMMA
"(" TokenNameStringLiteral
+ TokenNamePLUS
TRANSLET_INTF_SIG TokenNameIdentifier
+ TokenNamePLUS
DOM_INTF_SIG TokenNameIdentifier
+ TokenNamePLUS
NODE_ITERATOR_SIG TokenNameIdentifier
+ TokenNamePLUS
")V" TokenNameStringLiteral
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKESPECIAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
RETURN TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
classGen TokenNameIdentifier
. TokenNameDOT
addMethod TokenNameIdentifier
( TokenNameLPAREN
cons TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
private TokenNameprivate
void TokenNamevoid
compileLocals TokenNameIdentifier
( TokenNameLPAREN
NodeCounterGenerator TokenNameIdentifier
nodeCounterGen TokenNameIdentifier
, TokenNameCOMMA
MatchGenerator TokenNameIdentifier
matchGen TokenNameIdentifier
, TokenNameCOMMA
InstructionList TokenNameIdentifier
il TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
int TokenNameint
field TokenNameIdentifier
; TokenNameSEMICOLON
LocalVariableGen TokenNameIdentifier
local TokenNameIdentifier
; TokenNameSEMICOLON
ConstantPoolGen TokenNameIdentifier
cpg TokenNameIdentifier
= TokenNameEQUAL
nodeCounterGen TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
local TokenNameIdentifier
= TokenNameEQUAL
matchGen TokenNameIdentifier
. TokenNameDOT
addLocalVariable TokenNameIdentifier
( TokenNameLPAREN
"iterator" TokenNameStringLiteral
, TokenNameCOMMA
Util TokenNameIdentifier
. TokenNameDOT
getJCRefType TokenNameIdentifier
( TokenNameLPAREN
NODE_ITERATOR_SIG TokenNameIdentifier
) TokenNameRPAREN
, TokenNameCOMMA
null TokenNamenull
, TokenNameCOMMA
null TokenNamenull
) TokenNameRPAREN
; TokenNameSEMICOLON
field TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addFieldref TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER TokenNameIdentifier
, TokenNameCOMMA
"_iterator" TokenNameStringLiteral
, TokenNameCOMMA
ITERATOR_FIELD_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
ALOAD_0 TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
GETFIELD TokenNameIdentifier
( TokenNameLPAREN
field TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
local TokenNameIdentifier
. TokenNameDOT
setStart TokenNameIdentifier
( TokenNameLPAREN
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
ASTORE TokenNameIdentifier
( TokenNameLPAREN
local TokenNameIdentifier
. TokenNameDOT
getIndex TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
matchGen TokenNameIdentifier
. TokenNameDOT
setIteratorIndex TokenNameIdentifier
( TokenNameLPAREN
local TokenNameIdentifier
. TokenNameDOT
getIndex TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
local TokenNameIdentifier
= TokenNameEQUAL
matchGen TokenNameIdentifier
. TokenNameDOT
addLocalVariable TokenNameIdentifier
( TokenNameLPAREN
"translet" TokenNameStringLiteral
, TokenNameCOMMA
Util TokenNameIdentifier
. TokenNameDOT
getJCRefType TokenNameIdentifier
( TokenNameLPAREN
TRANSLET_SIG TokenNameIdentifier
) TokenNameRPAREN
, TokenNameCOMMA
null TokenNamenull
, TokenNameCOMMA
null TokenNamenull
) TokenNameRPAREN
; TokenNameSEMICOLON
field TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addFieldref TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER TokenNameIdentifier
, TokenNameCOMMA
"_translet" TokenNameStringLiteral
, TokenNameCOMMA
"Lorg/apache/xalan/xsltc/Translet;" TokenNameStringLiteral
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
ALOAD_0 TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
GETFIELD TokenNameIdentifier
( TokenNameLPAREN
field TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
CHECKCAST TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
. TokenNameDOT
addClass TokenNameIdentifier
( TokenNameLPAREN
TRANSLET_CLASS TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
local TokenNameIdentifier
. TokenNameDOT
setStart TokenNameIdentifier
( TokenNameLPAREN
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
ASTORE TokenNameIdentifier
( TokenNameLPAREN
local TokenNameIdentifier
. TokenNameDOT
getIndex TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
nodeCounterGen TokenNameIdentifier
. TokenNameDOT
setTransletIndex TokenNameIdentifier
( TokenNameLPAREN
local TokenNameIdentifier
. TokenNameDOT
getIndex TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
local TokenNameIdentifier
= TokenNameEQUAL
matchGen TokenNameIdentifier
. TokenNameDOT
addLocalVariable TokenNameIdentifier
( TokenNameLPAREN
"document" TokenNameStringLiteral
, TokenNameCOMMA
Util TokenNameIdentifier
. TokenNameDOT
getJCRefType TokenNameIdentifier
( TokenNameLPAREN
DOM_INTF_SIG TokenNameIdentifier
) TokenNameRPAREN
, TokenNameCOMMA
null TokenNamenull
, TokenNameCOMMA
null TokenNamenull
) TokenNameRPAREN
; TokenNameSEMICOLON
field TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addFieldref TokenNameIdentifier
( TokenNameLPAREN
_className TokenNameIdentifier
, TokenNameCOMMA
"_document" TokenNameStringLiteral
, TokenNameCOMMA
DOM_INTF_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
ALOAD_0 TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
GETFIELD TokenNameIdentifier
( TokenNameLPAREN
field TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
local TokenNameIdentifier
. TokenNameDOT
setStart TokenNameIdentifier
( TokenNameLPAREN
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
ASTORE TokenNameIdentifier
( TokenNameLPAREN
local TokenNameIdentifier
. TokenNameDOT
getIndex TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
matchGen TokenNameIdentifier
. TokenNameDOT
setDomIndex TokenNameIdentifier
( TokenNameLPAREN
local TokenNameIdentifier
. TokenNameDOT
getIndex TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
private TokenNameprivate
void TokenNamevoid
compilePatterns TokenNameIdentifier
( TokenNameLPAREN
ClassGenerator TokenNameIdentifier
classGen TokenNameIdentifier
, TokenNameCOMMA
MethodGenerator TokenNameIdentifier
methodGen TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
int TokenNameint
current TokenNameIdentifier
; TokenNameSEMICOLON
int TokenNameint
field TokenNameIdentifier
; TokenNameSEMICOLON
LocalVariableGen TokenNameIdentifier
local TokenNameIdentifier
; TokenNameSEMICOLON
MatchGenerator TokenNameIdentifier
matchGen TokenNameIdentifier
; TokenNameSEMICOLON
NodeCounterGenerator TokenNameIdentifier
nodeCounterGen TokenNameIdentifier
; TokenNameSEMICOLON
_className TokenNameIdentifier
= TokenNameEQUAL
getXSLTC TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
. TokenNameDOT
getHelperClassName TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
nodeCounterGen TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
NodeCounterGenerator TokenNameIdentifier
( TokenNameLPAREN
_className TokenNameIdentifier
, TokenNameCOMMA
ClassNames TokenNameIdentifier
[ TokenNameLBRACKET
_level TokenNameIdentifier
] TokenNameRBRACKET
, TokenNameCOMMA
toString TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
, TokenNameCOMMA
ACC_PUBLIC TokenNameIdentifier
| TokenNameOR
ACC_SUPER TokenNameIdentifier
, TokenNameCOMMA
null TokenNamenull
, TokenNameCOMMA
classGen TokenNameIdentifier
. TokenNameDOT
getStylesheet TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
InstructionList TokenNameIdentifier
il TokenNameIdentifier
= TokenNameEQUAL
null TokenNamenull
; TokenNameSEMICOLON
ConstantPoolGen TokenNameIdentifier
cpg TokenNameIdentifier
= TokenNameEQUAL
nodeCounterGen TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
int TokenNameint
closureLen TokenNameIdentifier
= TokenNameEQUAL
( TokenNameLPAREN
_closureVars TokenNameIdentifier
== TokenNameEQUAL_EQUAL
null TokenNamenull
) TokenNameRPAREN
? TokenNameQUESTION
0 TokenNameIntegerLiteral
: TokenNameCOLON
_closureVars TokenNameIdentifier
. TokenNameDOT
size TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
for TokenNamefor
( TokenNameLPAREN
int TokenNameint
i TokenNameIdentifier
= TokenNameEQUAL
0 TokenNameIntegerLiteral
; TokenNameSEMICOLON
i TokenNameIdentifier
< TokenNameLESS
closureLen TokenNameIdentifier
; TokenNameSEMICOLON
i TokenNameIdentifier
++ TokenNamePLUS_PLUS
) TokenNameRPAREN
{ TokenNameLBRACE
VariableBase TokenNameIdentifier
var TokenNameIdentifier
= TokenNameEQUAL
( TokenNameLPAREN
( TokenNameLPAREN
VariableRefBase TokenNameIdentifier
) TokenNameRPAREN
_closureVars TokenNameIdentifier
. TokenNameDOT
get TokenNameIdentifier
( TokenNameLPAREN
i TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
. TokenNameDOT
getVariable TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
nodeCounterGen TokenNameIdentifier
. TokenNameDOT
addField TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
Field TokenNameIdentifier
( TokenNameLPAREN
ACC_PUBLIC TokenNameIdentifier
, TokenNameCOMMA
cpg TokenNameIdentifier
. TokenNameDOT
addUtf8 TokenNameIdentifier
( TokenNameLPAREN
var TokenNameIdentifier
. TokenNameDOT
getEscapedName TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
, TokenNameCOMMA
cpg TokenNameIdentifier
. TokenNameDOT
addUtf8 TokenNameIdentifier
( TokenNameLPAREN
var TokenNameIdentifier
. TokenNameDOT
getType TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
. TokenNameDOT
toSignature TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
, TokenNameCOMMA
null TokenNamenull
, TokenNameCOMMA
cpg TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
compileConstructor TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
_from TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
il TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
InstructionList TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
matchGen TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
MatchGenerator TokenNameIdentifier
( TokenNameLPAREN
ACC_PUBLIC TokenNameIdentifier
| TokenNameOR
ACC_FINAL TokenNameIdentifier
, TokenNameCOMMA
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
. TokenNameDOT
BOOLEAN TokenNameIdentifier
, TokenNameCOMMA
new TokenNamenew
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
{ TokenNameLBRACE
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
. TokenNameDOT
INT TokenNameIdentifier
, TokenNameCOMMA
} TokenNameRBRACE
, TokenNameCOMMA
new TokenNamenew
String TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
{ TokenNameLBRACE
"node" TokenNameStringLiteral
, TokenNameCOMMA
} TokenNameRBRACE
, TokenNameCOMMA
"matchesFrom" TokenNameStringLiteral
, TokenNameCOMMA
_className TokenNameIdentifier
, TokenNameCOMMA
il TokenNameIdentifier
, TokenNameCOMMA
cpg TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
compileLocals TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
, TokenNameCOMMA
matchGen TokenNameIdentifier
, TokenNameCOMMA
il TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
matchGen TokenNameIdentifier
. TokenNameDOT
loadContextNode TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
_from TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
, TokenNameCOMMA
matchGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
_from TokenNameIdentifier
. TokenNameDOT
synthesize TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
, TokenNameCOMMA
matchGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
IRETURN TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
nodeCounterGen TokenNameIdentifier
. TokenNameDOT
addMethod TokenNameIdentifier
( TokenNameLPAREN
matchGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_count TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
il TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
InstructionList TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
matchGen TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
MatchGenerator TokenNameIdentifier
( TokenNameLPAREN
ACC_PUBLIC TokenNameIdentifier
| TokenNameOR
ACC_FINAL TokenNameIdentifier
, TokenNameCOMMA
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
. TokenNameDOT
BOOLEAN TokenNameIdentifier
, TokenNameCOMMA
new TokenNamenew
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
{ TokenNameLBRACE
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
bcel TokenNameIdentifier
. TokenNameDOT
generic TokenNameIdentifier
. TokenNameDOT
Type TokenNameIdentifier
. TokenNameDOT
INT TokenNameIdentifier
, TokenNameCOMMA
} TokenNameRBRACE
, TokenNameCOMMA
new TokenNamenew
String TokenNameIdentifier
[ TokenNameLBRACKET
] TokenNameRBRACKET
{ TokenNameLBRACE
"node" TokenNameStringLiteral
, TokenNameCOMMA
} TokenNameRBRACE
, TokenNameCOMMA
"matchesCount" TokenNameStringLiteral
, TokenNameCOMMA
_className TokenNameIdentifier
, TokenNameCOMMA
il TokenNameIdentifier
, TokenNameCOMMA
cpg TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
compileLocals TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
, TokenNameCOMMA
matchGen TokenNameIdentifier
, TokenNameCOMMA
il TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
matchGen TokenNameIdentifier
. TokenNameDOT
loadContextNode TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
_count TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
, TokenNameCOMMA
matchGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
_count TokenNameIdentifier
. TokenNameDOT
synthesize TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
, TokenNameCOMMA
matchGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
IRETURN TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
nodeCounterGen TokenNameIdentifier
. TokenNameDOT
addMethod TokenNameIdentifier
( TokenNameLPAREN
matchGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
getXSLTC TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
. TokenNameDOT
dumpClass TokenNameIdentifier
( TokenNameLPAREN
nodeCounterGen TokenNameIdentifier
. TokenNameDOT
getJavaClass TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
cpg TokenNameIdentifier
= TokenNameEQUAL
classGen TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
= TokenNameEQUAL
methodGen TokenNameIdentifier
. TokenNameDOT
getInstructionList TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
int TokenNameint
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
_className TokenNameIdentifier
, TokenNameCOMMA
"<init>" TokenNameStringLiteral
, TokenNameCOMMA
"(" TokenNameStringLiteral
+ TokenNamePLUS
TRANSLET_INTF_SIG TokenNameIdentifier
+ TokenNamePLUS
DOM_INTF_SIG TokenNameIdentifier
+ TokenNamePLUS
NODE_ITERATOR_SIG TokenNameIdentifier
+ TokenNamePLUS
")V" TokenNameStringLiteral
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
NEW TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
. TokenNameDOT
addClass TokenNameIdentifier
( TokenNameLPAREN
_className TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
DUP TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
. TokenNameDOT
loadTranslet TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
methodGen TokenNameIdentifier
. TokenNameDOT
loadDOM TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
methodGen TokenNameIdentifier
. TokenNameDOT
loadIterator TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKESPECIAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
for TokenNamefor
( TokenNameLPAREN
int TokenNameint
i TokenNameIdentifier
= TokenNameEQUAL
0 TokenNameIntegerLiteral
; TokenNameSEMICOLON
i TokenNameIdentifier
< TokenNameLESS
closureLen TokenNameIdentifier
; TokenNameSEMICOLON
i TokenNameIdentifier
++ TokenNamePLUS_PLUS
) TokenNameRPAREN
{ TokenNameLBRACE
final TokenNamefinal
VariableRefBase TokenNameIdentifier
varRef TokenNameIdentifier
= TokenNameEQUAL
( TokenNameLPAREN
VariableRefBase TokenNameIdentifier
) TokenNameRPAREN
_closureVars TokenNameIdentifier
. TokenNameDOT
get TokenNameIdentifier
( TokenNameLPAREN
i TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
VariableBase TokenNameIdentifier
var TokenNameIdentifier
= TokenNameEQUAL
varRef TokenNameIdentifier
. TokenNameDOT
getVariable TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
Type TokenNameIdentifier
varType TokenNameIdentifier
= TokenNameEQUAL
var TokenNameIdentifier
. TokenNameDOT
getType TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
DUP TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
var TokenNameIdentifier
. TokenNameDOT
loadInstruction TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUTFIELD TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
. TokenNameDOT
addFieldref TokenNameIdentifier
( TokenNameLPAREN
_className TokenNameIdentifier
, TokenNameCOMMA
var TokenNameIdentifier
. TokenNameDOT
getEscapedName TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
, TokenNameCOMMA
varType TokenNameIdentifier
. TokenNameDOT
toSignature TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
public TokenNamepublic
void TokenNamevoid
translate TokenNameIdentifier
( TokenNameLPAREN
ClassGenerator TokenNameIdentifier
classGen TokenNameIdentifier
, TokenNameCOMMA
MethodGenerator TokenNameIdentifier
methodGen TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
int TokenNameint
index TokenNameIdentifier
; TokenNameSEMICOLON
final TokenNamefinal
ConstantPoolGen TokenNameIdentifier
cpg TokenNameIdentifier
= TokenNameEQUAL
classGen TokenNameIdentifier
. TokenNameDOT
getConstantPool TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
final TokenNamefinal
InstructionList TokenNameIdentifier
il TokenNameIdentifier
= TokenNameEQUAL
methodGen TokenNameIdentifier
. TokenNameDOT
getInstructionList TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
. TokenNameDOT
loadTranslet TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
hasValue TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
compileDefault TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
_value TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUSH TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
, TokenNameCOMMA
0.5 TokenNameDoubleLiteral
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
DADD TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
MATH_CLASS TokenNameIdentifier
, TokenNameCOMMA
"floor" TokenNameStringLiteral
, TokenNameCOMMA
"(D)D" TokenNameStringLiteral
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKESTATIC TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER TokenNameIdentifier
, TokenNameCOMMA
"setValue" TokenNameStringLiteral
, TokenNameCOMMA
"(D)" TokenNameStringLiteral
+ TokenNamePLUS
NODE_COUNTER_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKEVIRTUAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
if TokenNameif
( TokenNameLPAREN
isDefault TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
compileDefault TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
{ TokenNameLBRACE
compilePatterns TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
! TokenNameNOT
hasValue TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
methodGen TokenNameIdentifier
. TokenNameDOT
loadContextNode TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER TokenNameIdentifier
, TokenNameCOMMA
SET_START_NODE TokenNameIdentifier
, TokenNameCOMMA
"(I)" TokenNameStringLiteral
+ TokenNamePLUS
NODE_COUNTER_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKEVIRTUAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_formatNeeded TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
if TokenNameif
( TokenNameLPAREN
_format TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_format TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
{ TokenNameLBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUSH TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
, TokenNameCOMMA
"1" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_lang TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_lang TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
{ TokenNameLBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUSH TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
, TokenNameCOMMA
"en" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_letterValue TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_letterValue TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
{ TokenNameLBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUSH TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
, TokenNameCOMMA
Constants TokenNameIdentifier
. TokenNameDOT
EMPTYSTRING TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_groupingSeparator TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_groupingSeparator TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
{ TokenNameLBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUSH TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
, TokenNameCOMMA
Constants TokenNameIdentifier
. TokenNameDOT
EMPTYSTRING TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
if TokenNameif
( TokenNameLPAREN
_groupingSize TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
_groupingSize TokenNameIdentifier
. TokenNameDOT
translate TokenNameIdentifier
( TokenNameLPAREN
classGen TokenNameIdentifier
, TokenNameCOMMA
methodGen TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
{ TokenNameLBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
PUSH TokenNameIdentifier
( TokenNameLPAREN
cpg TokenNameIdentifier
, TokenNameCOMMA
"0" TokenNameStringLiteral
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER TokenNameIdentifier
, TokenNameCOMMA
"getCounter" TokenNameStringLiteral
, TokenNameCOMMA
"(" TokenNameStringLiteral
+ TokenNamePLUS
STRING_SIG TokenNameIdentifier
+ TokenNamePLUS
STRING_SIG TokenNameIdentifier
+ TokenNamePLUS
STRING_SIG TokenNameIdentifier
+ TokenNamePLUS
STRING_SIG TokenNameIdentifier
+ TokenNamePLUS
STRING_SIG TokenNameIdentifier
+ TokenNamePLUS
")" TokenNameStringLiteral
+ TokenNamePLUS
STRING_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKEVIRTUAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
else TokenNameelse
{ TokenNameLBRACE
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER TokenNameIdentifier
, TokenNameCOMMA
"setDefaultFormatting" TokenNameStringLiteral
, TokenNameCOMMA
"()" TokenNameStringLiteral
+ TokenNamePLUS
NODE_COUNTER_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKEVIRTUAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
NODE_COUNTER TokenNameIdentifier
, TokenNameCOMMA
"getCounter" TokenNameStringLiteral
, TokenNameCOMMA
"()" TokenNameStringLiteral
+ TokenNamePLUS
STRING_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKEVIRTUAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
methodGen TokenNameIdentifier
. TokenNameDOT
loadHandler TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
index TokenNameIdentifier
= TokenNameEQUAL
cpg TokenNameIdentifier
. TokenNameDOT
addMethodref TokenNameIdentifier
( TokenNameLPAREN
TRANSLET_CLASS TokenNameIdentifier
, TokenNameCOMMA
CHARACTERSW TokenNameIdentifier
, TokenNameCOMMA
CHARACTERSW_SIG TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
il TokenNameIdentifier
. TokenNameDOT
append TokenNameIdentifier
( TokenNameLPAREN
new TokenNamenew
INVOKEVIRTUAL TokenNameIdentifier
( TokenNameLPAREN
index TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
|
[
"pschulam@gmail.com"
] |
pschulam@gmail.com
|
7914abf2e65bdd7dccc123ae6516e1d643d739d1
|
4c0d1f902ff8a8701ab2ac56f4e9f342c1946587
|
/src/main/java/org/gwtbootstrap3/extras/datepicker/client/ui/base/events/ClearDateHandler.java
|
e660320fa693fbe42cca3b02635cae3b0a885264
|
[
"Apache-2.0"
] |
permissive
|
gwtbootstrap3/gwtbootstrap3-extras
|
80206616f84db1098b27f8397577655c8ef638b0
|
3b4c82f547f39fbfcf9d44b4b912ea3fdd61c13b
|
refs/heads/master
| 2021-04-12T12:07:58.800553
| 2019-11-15T15:10:08
| 2019-11-15T15:10:08
| 15,231,680
| 31
| 91
|
Apache-2.0
| 2019-11-14T17:38:11
| 2013-12-16T17:01:41
|
Java
|
UTF-8
|
Java
| false
| false
| 908
|
java
|
package org.gwtbootstrap3.extras.datepicker.client.ui.base.events;
/*
* #%L
* GwtBootstrap3
* %%
* Copyright (C) 2013 - 2014 GwtBootstrap3
* %%
* 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.
* #L%
*/
import com.google.gwt.event.shared.EventHandler;
/**
* @author Matt Davis
*/
public interface ClearDateHandler extends EventHandler {
void onClearDate(final ClearDateEvent evt);
}
|
[
"matt.davis@temis.us"
] |
matt.davis@temis.us
|
c00f300914c6c37eb03448029d5e2dd67aaa259b
|
8b47ffed449ee4e68c0b00db98f49981a2dfbc44
|
/JavaBasic/ExerDemo/src/projectexer/TeamSchedule/domain/employee/Designer.java
|
7d3fde41dc3c5b564abd49e679bb33e0768e804b
|
[] |
no_license
|
Sakai1zumi/JavaTestCode
|
122f88d502a23d9d36a727766fc454e5067d253b
|
446c31065b36395d272d3cac20aaf59c3dbd8838
|
refs/heads/master
| 2023-05-23T03:08:11.636020
| 2021-06-17T02:49:31
| 2021-06-17T02:49:31
| 325,172,004
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 876
|
java
|
package projectexer.TeamSchedule.domain.employee;
import projectexer.TeamSchedule.domain.equipment.Equipment;
/**
* @author TuHong
* @create 2021-02-24 11:30
*/
public class Designer extends Programmer{
private double bonus;
public Designer() {
}
public Designer(int id, String name, int age, double salary, Equipment equipment, double bonus) {
super(id, name, age, salary, equipment);
this.bonus = bonus;
}
public double getBonus() {
return bonus;
}
public void setBonus(double bonus) {
this.bonus = bonus;
}
@Override
public String toString() {
return getDetails() + "\t设计师\t" + getStatus() + '\t' + getBonus() + "\t\t\t" + getEquipment().getDescription();
}
public String getDetailsForTeam(){
return getBaseDetails() + "设计师\t" + getBonus();
}
}
|
[
"izumi0527@126.com"
] |
izumi0527@126.com
|
707ee004264de0db5f1f61024ebf82cf30722388
|
35204133a4e3e6ddc4c8058562914c1392a5292f
|
/Wireframe/src/ru/nsu/fit/g13205/fink/wireframe/SplainPanel.java
|
98c51cabb48f4839d4c781b4af21435c6ddbf7ca
|
[] |
no_license
|
fink-artem/graphics
|
32d9cdf62bfa35d8d63eed44e7444cd8ac66586e
|
ce4fbab95af330c6992e6e4afb495b8f9d9ca8a8
|
refs/heads/master
| 2021-03-24T12:32:43.242960
| 2016-05-25T06:32:21
| 2016-05-25T06:32:21
| 95,908,087
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,073
|
java
|
package ru.nsu.fit.g13205.fink.wireframe;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.util.List;
import javax.swing.JPanel;
public class SplainPanel extends JPanel {
private BufferedImage image;
private final Data data;
private int coordinateNumber = 0;
private int modelNumber = 0;
private boolean taken = false;
public SplainPanel(Data data, InitView initView) {
this.data = data;
addMouseMotionListener(new MouseAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
super.mouseDragged(e);
if (taken) {
Coordinate2D coordinate = Drawer.screenToCoordinate(e.getPoint());
data.setPivotInModel(modelNumber, coordinateNumber, coordinate);
repaint();
initView.repaint();
}
}
});
addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
super.mousePressed(e);
int x = e.getX();
int y = e.getY();
List<Coordinate2D> coordinateList = data.getPivots(modelNumber);
Point p;
Coordinate2D c;
int size = coordinateList.size();
if (e.getButton() == MouseEvent.BUTTON1) {
for (int i = 0; i < size; i++) {
p = Drawer.coordinateToScreen(coordinateList.get(i));
if (Operation.distance(new Coordinate2D(x, y), new Coordinate2D(p.x, p.y)) < Drawer.BIG_RADIUS) {
coordinateNumber = i;
taken = true;
return;
}
}
for (int i = 1; i < size; i++) {
c = new Coordinate2D((coordinateList.get(i).x + coordinateList.get(i - 1).x) / 2, (coordinateList.get(i).y + coordinateList.get(i - 1).y) / 2);
p = Drawer.coordinateToScreen(c);
if (Operation.distance(new Coordinate2D(x, y), new Coordinate2D(p.x, p.y)) < Drawer.SMALL_RADIUS) {
coordinateNumber = i;
data.addNewPivotInModel(modelNumber, coordinateNumber, c);
taken = true;
repaint();
initView.repaint();
return;
}
}
} else if (e.getButton() == MouseEvent.BUTTON3) {
for (int i = 0; i < size; i++) {
p = Drawer.coordinateToScreen(coordinateList.get(i));
if (Operation.distance(new Coordinate2D(x, y), new Coordinate2D(p.x, p.y)) < Drawer.BIG_RADIUS) {
data.deletePivotFromModel(modelNumber, i);
repaint();
initView.repaint();
return;
}
}
}
}
@Override
public void mouseReleased(MouseEvent e) {
super.mouseReleased(e);
taken = false;
}
});
}
@Override
public void paint(Graphics g) {
super.paintComponents(g);
Dimension size = getSize();
image = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
image.getGraphics().drawLine(size.width / 2, 0, size.width / 2, size.height - 1);
image.getGraphics().drawLine(0, size.height / 2, size.width - 1, size.height / 2);
Drawer.drawSplain(image, data, modelNumber);
g.drawImage(image, 0, 0, this);
}
public void setModelNumber(int modelNumber) {
this.modelNumber = modelNumber;
}
}
|
[
"author@mail.ru"
] |
author@mail.ru
|
46cccab6e486c0fc84ac7671377958f674e7e0a0
|
43d7c7a753cd929e3f40dedde42651210baf937f
|
/lib/rhino/src/org/mozilla/javascript/ast/SwitchStatement.java
|
7fd289fbf33b38002c197d930db67eaed562d1af
|
[
"MPL-2.0",
"Apache-2.0",
"MPL-1.1",
"MIT",
"BSD-3-Clause",
"GPL-1.0-or-later",
"CPL-1.0",
"NPL-1.1"
] |
permissive
|
pietrobraione/sushi-experiments-closure01
|
33b45c45c9385c39551ffb2b56fa2b040e373602
|
8f6321a23148cbff1e272cd8039dfece33373a39
|
refs/heads/master
| 2021-07-14T11:02:55.221688
| 2021-07-12T18:01:27
| 2021-07-12T18:01:27
| 71,781,378
| 1
| 0
|
Apache-2.0
| 2019-04-27T18:44:19
| 2016-10-24T11:17:52
|
Java
|
UTF-8
|
Java
| false
| false
| 4,475
|
java
|
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.javascript.ast;
import org.mozilla.javascript.Token;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Switch statement AST node type.
* Node type is {@link Token#SWITCH}.<p>
*
* <pre><i>SwitchStatement</i> :
* <b>switch</b> ( Expression ) CaseBlock
* <i>CaseBlock</i> :
* { [CaseClauses] }
* { [CaseClauses] DefaultClause [CaseClauses] }
* <i>CaseClauses</i> :
* CaseClause
* CaseClauses CaseClause
* <i>CaseClause</i> :
* <b>case</b> Expression : [StatementList]
* <i>DefaultClause</i> :
* <b>default</b> : [StatementList]</pre>
*/
public class SwitchStatement extends Jump {
private static final List<SwitchCase> NO_CASES =
Collections.unmodifiableList(new ArrayList<SwitchCase>());
private AstNode expression;
private List<SwitchCase> cases;
private int lp = -1;
private int rp = -1;
{
type = Token.SWITCH;
}
public SwitchStatement() {
}
public SwitchStatement(int pos) {
// can't call super (Jump) for historical reasons
position = pos;
}
public SwitchStatement(int pos, int len) {
position = pos;
length = len;
}
/**
* Returns the switch discriminant expression
*/
public AstNode getExpression() {
return expression;
}
/**
* Sets the switch discriminant expression, and sets its parent
* to this node.
* @throws IllegalArgumentException} if expression is {@code null}
*/
public void setExpression(AstNode expression) {
assertNotNull(expression);
this.expression = expression;
expression.setParent(this);
}
/**
* Returns case statement list. If there are no cases,
* returns an immutable empty list.
*/
public List<SwitchCase> getCases() {
return cases != null ? cases : NO_CASES;
}
/**
* Sets case statement list, and sets the parent of each child
* case to this node.
* @param cases list, which may be {@code null} to remove all the cases
*/
public void setCases(List<SwitchCase> cases) {
if (cases == null) {
this.cases = null;
} else {
if (this.cases != null)
this.cases.clear();
for (SwitchCase sc : cases)
addCase(sc);
}
}
/**
* Adds a switch case statement to the end of the list.
* @throws IllegalArgumentException} if switchCase is {@code null}
*/
public void addCase(SwitchCase switchCase) {
assertNotNull(switchCase);
if (cases == null) {
cases = new ArrayList<SwitchCase>();
}
cases.add(switchCase);
switchCase.setParent(this);
}
/**
* Returns left paren position, -1 if missing
*/
public int getLp() {
return lp;
}
/**
* Sets left paren position
*/
public void setLp(int lp) {
this.lp = lp;
}
/**
* Returns right paren position, -1 if missing
*/
public int getRp() {
return rp;
}
/**
* Sets right paren position
*/
public void setRp(int rp) {
this.rp = rp;
}
/**
* Sets both paren positions
*/
public void setParens(int lp, int rp) {
this.lp = lp;
this.rp = rp;
}
@Override
public String toSource(int depth) {
String pad = makeIndent(depth);
StringBuilder sb = new StringBuilder();
sb.append(pad);
sb.append("switch (");
sb.append(expression.toSource(0));
sb.append(") {\n");
for (SwitchCase sc : cases) {
sb.append(sc.toSource(depth + 1));
}
sb.append(pad);
sb.append("}\n");
return sb.toString();
}
/**
* Visits this node, then the switch-expression, then the cases
* in lexical order.
*/
@Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
expression.visit(v);
for (SwitchCase sc: getCases()) {
sc.visit(v);
}
}
}
}
|
[
"pietro.braione@gmail.com"
] |
pietro.braione@gmail.com
|
c9cded8e2a1ee2a9be5f8eaf12407ec3fee0718b
|
0bf8a01ba1c90bd0783018232bd3a83c8fdedf4e
|
/gtk-devops-common/src/main/java/com/gtk/common/safe/DESUtils.java
|
cac03c55cff30af72c4912f71cba2dce1de8510f
|
[] |
no_license
|
gaoqisen/gtk-devops-scd
|
738aa8891a44dbedfd0c5158653e59f48105e7e8
|
c4df46016402d99902c6a6f58dc958eb2fd963bb
|
refs/heads/master
| 2023-06-23T00:58:34.068071
| 2023-06-19T14:59:43
| 2023-06-19T14:59:43
| 238,143,223
| 0
| 1
| null | 2023-03-08T17:31:56
| 2020-02-04T06:57:36
|
Java
|
UTF-8
|
Java
| false
| false
| 2,927
|
java
|
package com.gtk.common.safe;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;
/**
* @ClassName DES
* @Author gaoqisen
* @Date 2019-12-01
* @Version 1.0
*/
public class DESUtils {
/**
* @Author gaoqisen
* @Description //TODO 解密数据
* @Date 2019-12-01 17:07
* @Param [message, key]
* @return java.lang.GString
**/
public static String decrypt(String message,String key) {
try {
byte[] bytesrc =convertHexString(message);
Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
DESKeySpec desKeySpec = new DESKeySpec(key.getBytes("UTF-8"));
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey secretKey = keyFactory.generateSecret(desKeySpec);
IvParameterSpec iv = new IvParameterSpec(key.getBytes("UTF-8"));
cipher.init(Cipher.DECRYPT_MODE, secretKey, iv);
byte[] retByte = cipher.doFinal(bytesrc);
return toHexString(retByte).toUpperCase();
}catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* @Author gaoqisen
* @Description //TODO 加密数据
* @Date 2019-12-01 17:08
* @Param [message, key]
* @return byte[]
**/
public static String encrypt(String message, String key) {
try {
Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
DESKeySpec desKeySpec = new DESKeySpec(key.getBytes("UTF-8"));
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey secretKey = keyFactory.generateSecret(desKeySpec);
IvParameterSpec iv = new IvParameterSpec(key.getBytes("UTF-8"));
cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv);
return toHexString(cipher.doFinal(message.getBytes("UTF-8"))).toUpperCase();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String toHexString(byte b[]) {
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < b.length; i++) {
String plainText = Integer.toHexString(0xff & b[i]);
if (plainText.length() < 2) {
plainText = "0" + plainText;
}
hexString.append(plainText);
}
return hexString.toString();
}
public static byte[] convertHexString(String ss)
{
byte digest[] = new byte[ss.length() / 2];
for(int i = 0; i < digest.length; i++)
{
String byteString = ss.substring(2 * i, 2 * i + 2);
int byteValue = Integer.parseInt(byteString, 16);
digest[i] = (byte)byteValue;
}
return digest;
}
}
|
[
"1073825890@qq.com"
] |
1073825890@qq.com
|
3b1a37c5a3853cb888b3f144c880501764549cf7
|
76e4d7de2e7326f5fe20b41e37bc174618daf8d7
|
/app/src/main/java/com/sharmastech/skillhouettes/Animations/FullscreenVideoView.java
|
6a6ae2f7d148e123e0f4030f7410ac8e8a38eec0
|
[] |
no_license
|
prudhvibsecure/SKILLHOUETTES
|
750061d5d0a5fc6b17da9d8267ebb4d9e6ae5723
|
9f227b9c67afb96c928a3d957b4bc966d42bd8ed
|
refs/heads/master
| 2021-01-11T14:44:13.680182
| 2017-02-01T12:46:28
| 2017-02-01T12:46:28
| 80,201,620
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 28,754
|
java
|
package com.sharmastech.skillhouettes.Animations;
/**
* Created by w7u on 1/7/2017.
*/
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnInfoListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.media.MediaPlayer.OnSeekCompleteListener;
import android.media.MediaPlayer.OnVideoSizeChangedListener;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import java.io.IOException;
public class FullscreenVideoView extends RelativeLayout implements SurfaceHolder.Callback, OnPreparedListener, OnErrorListener, OnSeekCompleteListener, OnCompletionListener, OnInfoListener, OnVideoSizeChangedListener, OnBufferingUpdateListener {
/**
* Debug Tag for use logging debug output to LogCat
*/
private final static String TAG = "FullscreenVideoView";
protected Context context;
protected Activity activity; // Used when orientation changes is not static
protected MediaPlayer mediaPlayer;
protected SurfaceHolder surfaceHolder;
protected SurfaceView surfaceView;
protected boolean videoIsReady, surfaceIsReady;
protected boolean detachedByFullscreen;
protected State currentState;
protected State lastState; // Tells onSeekCompletion what to do
protected View onProgressView;
protected ViewGroup parentView; // Controls fullscreen container
protected ViewGroup.LayoutParams currentLayoutParams;
protected boolean fullscreen;
protected boolean shouldAutoplay;
protected int initialConfigOrientation;
protected int initialMovieWidth, initialMovieHeight;
protected String videoPath;
protected Uri videoUri;
protected OnBufferingUpdateListener bufferingUpdateListener;
protected OnCompletionListener completionListener;
protected OnErrorListener errorListener;
protected OnInfoListener infoListener;
protected OnPreparedListener preparedListener;
protected OnSeekCompleteListener seekCompleteListener;
protected OnVideoSizeChangedListener videoSizeChangedListener;
public enum State {
IDLE,
INITIALIZED,
PREPARED,
PREPARING,
STARTED,
STOPPED,
PAUSED,
PLAYBACKCOMPLETED,
ERROR,
END
}
public FullscreenVideoView(Context context) {
super(context);
this.context = context;
init();
}
public FullscreenVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
init();
}
public FullscreenVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
init();
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
resize();
}
@Override
public Parcelable onSaveInstanceState() {
Log.d(TAG, "onSaveInstanceState");
return super.onSaveInstanceState();
}
@Override
public void onRestoreInstanceState(Parcelable state) {
Log.d(TAG, "onRestoreInstanceState");
super.onRestoreInstanceState(state);
}
@Override
protected void onDetachedFromWindow() {
Log.d(TAG, "onDetachedFromWindow - detachedByFullscreen: " + detachedByFullscreen);
super.onDetachedFromWindow();
if (!detachedByFullscreen) {
if (mediaPlayer != null) {
this.mediaPlayer.setOnBufferingUpdateListener(null);
this.mediaPlayer.setOnPreparedListener(null);
this.mediaPlayer.setOnErrorListener(null);
this.mediaPlayer.setOnSeekCompleteListener(null);
this.mediaPlayer.setOnCompletionListener(null);
this.mediaPlayer.setOnInfoListener(null);
this.mediaPlayer.setOnVideoSizeChangedListener(null);
releaseObjects();
mediaPlayer.release();
mediaPlayer = null;
}
videoIsReady = false;
surfaceIsReady = false;
currentState = State.END;
}
detachedByFullscreen = false;
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
Log.d(TAG, "onAttachedToWindow");
if (this.mediaPlayer == null &&
this.currentState == State.END) {
initObjects();
try {
if (this.videoPath != null)
setVideoPath(this.videoPath);
else if (this.videoUri != null)
setVideoURI(this.videoUri);
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
synchronized public void surfaceCreated(SurfaceHolder holder) {
Log.d(TAG, "surfaceCreated called = " + currentState);
if (this.mediaPlayer != null) {
this.mediaPlayer.setDisplay(surfaceHolder);
// If is not prepared yet - tryToPrepare()
if (!this.surfaceIsReady) {
this.surfaceIsReady = true;
if (this.currentState != State.PREPARED &&
this.currentState != State.PAUSED &&
this.currentState != State.STARTED &&
this.currentState != State.PLAYBACKCOMPLETED)
tryToPrepare();
}
}
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.d(TAG, "surfaceChanged called");
resize();
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.d(TAG, "surfaceDestroyed called");
if (mediaPlayer != null && mediaPlayer.isPlaying())
mediaPlayer.pause();
surfaceIsReady = false;
}
@Override
synchronized public void onPrepared(MediaPlayer mp) {
Log.d(TAG, "onPrepared called");
videoIsReady = true;
tryToPrepare();
}
@Override
public void onSeekComplete(MediaPlayer mp) {
Log.d(TAG, "onSeekComplete");
stopLoading();
if (lastState != null) {
switch (lastState) {
case STARTED: {
start();
break;
}
case PLAYBACKCOMPLETED: {
currentState = State.PLAYBACKCOMPLETED;
break;
}
case PREPARED: {
currentState = State.PREPARED;
break;
}
}
}
if (this.seekCompleteListener != null)
this.seekCompleteListener.onSeekComplete(mp);
}
@Override
public void onCompletion(MediaPlayer mp) {
if (this.mediaPlayer != null) {
if (this.currentState != State.ERROR) {
Log.d(TAG, "onCompletion");
if (!this.mediaPlayer.isLooping())
this.currentState = State.PLAYBACKCOMPLETED;
else
start();
}
}
if (this.completionListener != null)
this.completionListener.onCompletion(mp);
}
@Override
public boolean onInfo(MediaPlayer mediaPlayer, int what, int extra) {
Log.d(TAG, "onInfo " + what);
if (this.infoListener != null)
return this.infoListener.onInfo(mediaPlayer, what, extra);
return false;
}
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
Log.d(TAG, "onError called - " + what + " - " + extra);
stopLoading();
this.currentState = State.ERROR;
if (this.errorListener != null)
return this.errorListener.onError(mp, what, extra);
return false;
}
@Override
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
Log.d(TAG, "onVideoSizeChanged = " + width + " - " + height);
if (this.initialMovieWidth == 0 && this.initialMovieHeight == 0) {
initialMovieWidth = width;
initialMovieHeight = height;
resize();
}
if (this.videoSizeChangedListener != null)
this.videoSizeChangedListener.onVideoSizeChanged(mp, width, height);
}
@Override
public void onBufferingUpdate(MediaPlayer mp, int percent) {
Log.d(TAG, "onBufferingUpdate = " + percent);
if (this.bufferingUpdateListener != null)
this.bufferingUpdateListener.onBufferingUpdate(mp, percent);
}
protected void init() {
if (isInEditMode())
return;
this.shouldAutoplay = false;
this.currentState = State.IDLE;
this.fullscreen = false;
this.initialConfigOrientation = -1;
this.setBackgroundColor(Color.BLACK);
initObjects();
}
protected void initObjects() {
Log.d(TAG, "initObjects");
if (this.mediaPlayer == null)
this.mediaPlayer = new MediaPlayer();
RelativeLayout.LayoutParams layoutParams;
if (this.surfaceView == null) {
this.surfaceView = new SurfaceView(context);
layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
layoutParams.addRule(CENTER_IN_PARENT);
this.surfaceView.setLayoutParams(layoutParams);
addView(this.surfaceView);
}
if (this.surfaceHolder == null) {
this.surfaceHolder = this.surfaceView.getHolder();
//noinspection deprecation
this.surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
this.surfaceHolder.addCallback(this);
}
// Try not reset onProgressView
if (this.onProgressView == null)
this.onProgressView = new ProgressBar(context);
layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
layoutParams.addRule(CENTER_IN_PARENT);
this.onProgressView.setLayoutParams(layoutParams);
addView(this.onProgressView);
this.currentState = State.IDLE;
}
protected void releaseObjects() {
if (this.surfaceHolder != null) {
this.surfaceHolder.removeCallback(this);
this.surfaceHolder = null;
}
if (this.mediaPlayer != null) {
this.mediaPlayer.reset();
}
if (this.surfaceView != null) {
removeView(this.surfaceView);
this.surfaceView = null;
}
if (this.onProgressView != null) {
removeView(this.onProgressView);
}
}
protected void prepare() throws IllegalStateException {
startLoading();
this.videoIsReady = false;
this.initialMovieHeight = -1;
this.initialMovieWidth = -1;
this.mediaPlayer.setOnPreparedListener(this);
this.mediaPlayer.setOnErrorListener(this);
this.mediaPlayer.setOnSeekCompleteListener(this);
this.mediaPlayer.setOnInfoListener(this);
this.mediaPlayer.setOnVideoSizeChangedListener(this);
this.mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
this.currentState = State.PREPARING;
this.mediaPlayer.prepareAsync();
}
protected void tryToPrepare() {
if (this.surfaceIsReady && this.videoIsReady) {
if (this.mediaPlayer != null) {
this.initialMovieWidth = this.mediaPlayer.getVideoWidth();
this.initialMovieHeight = this.mediaPlayer.getVideoHeight();
}
resize();
stopLoading();
currentState = State.PREPARED;
if (shouldAutoplay)
start();
if (this.preparedListener != null)
this.preparedListener.onPrepared(mediaPlayer);
}
}
protected void startLoading() {
if (this.onProgressView != null)
this.onProgressView.setVisibility(View.VISIBLE);
}
protected void stopLoading() {
if (this.onProgressView != null)
this.onProgressView.setVisibility(View.GONE);
}
/**
* Get the current {@link FullscreenVideoView.State}.
*
* @return Current {@link FullscreenVideoView.State}
*/
synchronized public State getCurrentState() {
return currentState;
}
/**
* Returns if VideoView is in fullscreen mode
*
* @return true if is in fullscreen mode otherwise false
* @since 1.1
*/
public boolean isFullscreen() {
return fullscreen;
}
/**
* Turn VideoView fulllscreen mode on or off.
*
* @param fullscreen true to turn on fullscreen mode or false to turn off
* @throws RuntimeException In case of mediaPlayer doesn't exist or illegal state exception
* @since 1.1
*/
public void setFullscreen(final boolean fullscreen) throws RuntimeException {
if (mediaPlayer == null)
throw new RuntimeException("Media Player is not initialized");
if (this.currentState != State.ERROR) {
if (FullscreenVideoView.this.fullscreen == fullscreen) return;
FullscreenVideoView.this.fullscreen = fullscreen;
final boolean wasPlaying = mediaPlayer.isPlaying();
if (wasPlaying)
pause();
if (FullscreenVideoView.this.fullscreen) {
if (activity != null)
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
View rootView = getRootView();
View v = rootView.findViewById(android.R.id.content);
ViewParent viewParent = getParent();
if (viewParent instanceof ViewGroup) {
if (parentView == null)
parentView = (ViewGroup) viewParent;
// Prevents MediaPlayer to became invalidated and released
detachedByFullscreen = true;
// Saves the last state (LayoutParams) of view to restore after
currentLayoutParams = FullscreenVideoView.this.getLayoutParams();
parentView.removeView(FullscreenVideoView.this);
} else
Log.e(TAG, "Parent View is not a ViewGroup");
if (v instanceof ViewGroup) {
((ViewGroup) v).addView(FullscreenVideoView.this);
} else
Log.e(TAG, "RootView is not a ViewGroup");
} else {
if (activity != null)
activity.setRequestedOrientation(initialConfigOrientation);
ViewParent viewParent = getParent();
if (viewParent instanceof ViewGroup) {
// Check if parent view is still available
boolean parentHasParent = false;
if (parentView != null && parentView.getParent() != null) {
parentHasParent = true;
detachedByFullscreen = true;
}
((ViewGroup) viewParent).removeView(FullscreenVideoView.this);
if (parentHasParent) {
parentView.addView(FullscreenVideoView.this);
FullscreenVideoView.this.setLayoutParams(currentLayoutParams);
}
}
}
resize();
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
if (wasPlaying && mediaPlayer != null)
start();
}
});
}
}
/**
* Binds an Activity to VideoView. This is necessary to keep tracking on orientation changes
*
* @param activity The activity that VideoView is related to
*/
public void setActivity(Activity activity) {
this.activity = activity;
this.initialConfigOrientation = activity.getRequestedOrientation();
}
public void resize() {
if (initialMovieHeight == -1 || initialMovieWidth == -1 || surfaceView == null)
return;
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
View currentParent = (View) getParent();
if (currentParent != null) {
float videoProportion = (float) initialMovieWidth / (float) initialMovieHeight;
int screenWidth = currentParent.getWidth();
int screenHeight = currentParent.getHeight();
float screenProportion = (float) screenWidth / (float) screenHeight;
int newWidth, newHeight;
if (videoProportion > screenProportion) {
newWidth = screenWidth;
newHeight = (int) ((float) screenWidth / videoProportion);
} else {
newWidth = (int) (videoProportion * (float) screenHeight);
newHeight = screenHeight;
}
ViewGroup.LayoutParams lp = surfaceView.getLayoutParams();
lp.width = newWidth;
lp.height = newHeight;
surfaceView.setLayoutParams(lp);
Log.d(TAG, "Resizing: initialMovieWidth: " + initialMovieWidth + " - initialMovieHeight: " + initialMovieHeight);
Log.d(TAG, "Resizing: screenWidth: " + screenWidth + " - screenHeight: " + screenHeight);
}
}
});
}
/**
* Tells if application should autoplay videos as soon as it is prepared
*
* @return true if application are going to play videos as soon as it is prepared
*/
public boolean isShouldAutoplay() {
return shouldAutoplay;
}
/**
* Tells application that it should begin playing as soon as buffering
* is ok
*
* @param shouldAutoplay If true, call start() method when getCurrentState() == PREPARED. Default is false.
*/
public void setShouldAutoplay(boolean shouldAutoplay) {
this.shouldAutoplay = shouldAutoplay;
}
/**
* Toggles view to fullscreen mode
* It saves currentState and calls pause() method.
* When fullscreen is finished, it calls the saved currentState before pause()
* In practice, it only affects STARTED state.
* If currenteState was STARTED when fullscreen() is called, it calls start() method
* after fullscreen() has ended.
*
* @deprecated As of release 1.1.0, replaced by {@link #setFullscreen(boolean)}
*/
@Deprecated
public void fullscreen() throws IllegalStateException {
setFullscreen(!fullscreen);
}
/**
* MediaPlayer method (getCurrentPosition)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#getCurrentPosition%28%29">getCurrentPosition</a>
*/
public int getCurrentPosition() {
if (mediaPlayer != null)
return mediaPlayer.getCurrentPosition();
else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (getDuration)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#getDuration%28%29">getDuration</a>
*/
public int getDuration() {
if (mediaPlayer != null)
return mediaPlayer.getDuration();
else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (getVideoHeight)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#getVideoHeight%28%29">getVideoHeight</a>
*/
public int getVideoHeight() {
if (mediaPlayer != null)
return mediaPlayer.getVideoHeight();
else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (getVideoWidth)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#getVideoWidth%28%29">getVideoWidth</a>
*/
public int getVideoWidth() {
if (mediaPlayer != null)
return mediaPlayer.getVideoWidth();
else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (isLooping)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#isLooping%28%29">isLooping</a>
*/
public boolean isLooping() {
if (mediaPlayer != null)
return mediaPlayer.isLooping();
else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (isPlaying)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#isPlaying%28%29">isPlaying</a>
*/
public boolean isPlaying() throws IllegalStateException {
if (mediaPlayer != null)
return mediaPlayer.isPlaying();
else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (pause)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#pause%28%29">pause</a>
*/
public void pause() throws IllegalStateException {
Log.d(TAG, "pause");
if (mediaPlayer != null) {
currentState = State.PAUSED;
mediaPlayer.pause();
} else throw new RuntimeException("Media Player is not initialized");
}
/**
* Due to a lack of access of SurfaceView, it rebuilds mediaPlayer and all
* views to update SurfaceView canvas
*/
public void reset() {
Log.d(TAG, "reset");
releaseObjects();
initObjects();
}
/**
* MediaPlayer method (start)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#start%28%29">start</a>
*/
public void start() throws IllegalStateException {
Log.d(TAG, "start");
if (mediaPlayer != null) {
currentState = State.STARTED;
mediaPlayer.setOnCompletionListener(this);
mediaPlayer.start();
} else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (stop)
*
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#stop%28%29">stop</a>
*/
public void stop() throws IllegalStateException {
Log.d(TAG, "stop");
if (mediaPlayer != null) {
currentState = State.STOPPED;
mediaPlayer.stop();
} else throw new RuntimeException("Media Player is not initialized");
}
/**
* MediaPlayer method (seekTo)
* It calls pause() method before calling MediaPlayer.seekTo()
*
* @param msec the offset in milliseconds from the start to seek to
* @throws IllegalStateException if the internal player engine has not been initialized
* @see <a href="http://developer.android.com/reference/android/media/MediaPlayer.html#seekTo%28%29">seekTo</a>
*/
public void seekTo(int msec) throws IllegalStateException {
Log.d(TAG, "seekTo = " + msec);
if (mediaPlayer != null) {
// No live streaming
if (mediaPlayer.getDuration() > -1 && msec <= mediaPlayer.getDuration()) {
lastState = currentState;
pause();
mediaPlayer.seekTo(msec);
startLoading();
}
} else throw new RuntimeException("Media Player is not initialized");
}
public void setOnCompletionListener(OnCompletionListener l) {
if (mediaPlayer != null)
this.completionListener = l;
else throw new RuntimeException("Media Player is not initialized");
}
public void setOnErrorListener(OnErrorListener l) {
if (mediaPlayer != null)
errorListener = l;
else throw new RuntimeException("Media Player is not initialized");
}
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
if (mediaPlayer != null) {
this.bufferingUpdateListener = l;
this.mediaPlayer.setOnBufferingUpdateListener(this);
} else throw new RuntimeException("Media Player is not initialized");
}
public void setOnInfoListener(OnInfoListener l) {
if (mediaPlayer != null)
this.infoListener = l;
else throw new RuntimeException("Media Player is not initialized");
}
public void setOnSeekCompleteListener(OnSeekCompleteListener l) {
if (mediaPlayer != null)
this.seekCompleteListener = l;
else throw new RuntimeException("Media Player is not initialized");
}
public void setOnVideoSizeChangedListener(OnVideoSizeChangedListener l) {
if (mediaPlayer != null)
this.videoSizeChangedListener = l;
else throw new RuntimeException("Media Player is not initialized");
}
public void setOnPreparedListener(OnPreparedListener l) {
if (mediaPlayer != null)
this.preparedListener = l;
else throw new RuntimeException("Media Player is not initialized");
}
public void setLooping(boolean looping) {
if (mediaPlayer != null)
mediaPlayer.setLooping(looping);
else throw new RuntimeException("Media Player is not initialized");
}
public void setVolume(float leftVolume, float rightVolume) {
if (mediaPlayer != null)
mediaPlayer.setVolume(leftVolume, rightVolume);
else throw new RuntimeException("Media Player is not initialized");
}
/**
* VideoView method (setVideoPath)
*/
public void setVideoPath(String path) throws IOException, IllegalStateException, SecurityException, IllegalArgumentException, RuntimeException {
if (mediaPlayer != null) {
if (currentState != State.IDLE)
throw new IllegalStateException("FullscreenVideoView Invalid State: " + currentState);
this.videoPath = path;
this.videoUri = null;
this.mediaPlayer.setDataSource(path);
this.currentState = State.INITIALIZED;
prepare();
} else throw new RuntimeException("Media Player is not initialized");
}
/**
* VideoView method (setVideoURI)
*/
public void setVideoURI(Uri uri) throws IOException, IllegalStateException, SecurityException, IllegalArgumentException, RuntimeException {
if (mediaPlayer != null) {
if (currentState != State.IDLE)
throw new IllegalStateException("FullscreenVideoView Invalid State: " + currentState);
this.videoUri = uri;
this.videoPath = null;
this.mediaPlayer.setDataSource(context, uri);
this.currentState = State.INITIALIZED;
prepare();
} else throw new RuntimeException("Media Player is not initialized");
}
/**
* Overwrite the default ProgressView to represent loading progress state
* It is controlled by stopLoading and startLoading methods, that only sets it to VISIBLE and GONE
* <p>
* Remember to set RelativeLayout.LayoutParams before setting the view.
*
* @param v The custom View that will be used as progress view.
* Set it to null to remove the default one
*/
public void setOnProgressView(View v) {
if (this.onProgressView != null)
removeView(this.onProgressView);
this.onProgressView = v;
if (this.onProgressView != null)
addView(this.onProgressView);
}
}
|
[
"prudhvi.bsecure@gmail.com"
] |
prudhvi.bsecure@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.