blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
583e1d449bfa21f97cea8999a34f6b646dc7a1f0
97d593af96c666a3a843df6375ab4d1a4036d72e
/src/com/hepta/cliquemedicos/dto/ServicoDTO.java
b460960836a254ead82efe22cf84cab493634d07
[]
no_license
brunocarneiro312/clique-medicos
fb4e49a21ec43f327e166ee046273723548cc729
4b262900def82dea3ad651de1637ccfa89c855c5
refs/heads/master
2022-12-04T07:31:16.529339
2019-07-12T19:27:44
2019-07-12T19:27:44
196,634,082
0
0
null
2022-11-24T07:52:26
2019-07-12T19:24:41
JavaScript
UTF-8
Java
false
false
4,746
java
package com.hepta.cliquemedicos.dto; import java.time.format.DateTimeFormatter; import com.fasterxml.jackson.annotation.JsonProperty; import com.hepta.cliquemedicos.entity.Servico; public class ServicoDTO { private String prestador; private String credenciado; private String pessoaEndereco; // Campo para diferenciar a localidade que o medico atende no AMHP private String especialidade; private String nomeBeneficiario; private String matriculaBeneficiario; private String emailBeneficiario; private String telefoneBeneficiario; private String inicio; @JsonProperty("ordemChegada") private Boolean ordemDeChegada; @JsonProperty("podeAgendar") private Boolean agendavel; private Integer idServicoAMHP; // TODO: verificar JsonProperty (bruno.carneiro) public ServicoDTO() { super(); } public ServicoDTO(CompraDTO a) { //TODO //this.setMatriculaBeneficiario(a.getUsuario().getStr_cpf()); this.setMatriculaBeneficiario(a.getUsuario().getId_usuario().toString()); this.setEmailBeneficiario(a.getUsuario().getStr_email()); this.setNomeBeneficiario(a.getUsuario().getStr_nome()); this.setTelefoneBeneficiario(a.getUsuario().getStr_telefone()); this.setPrestador(a.getStr_matricula_prestador()); this.setCredenciado(a.getStr_matricula_credenciado()); this.setInicio(a.getDate_consulta().format(DateTimeFormatter.ISO_DATE_TIME)); this.setPessoaEndereco(a.getStr_associado_endereco()); this.setEspecialidade(a.getStr_especialidade()); this.setOrdemDeChegada(a.getOrdemDeChegada()); } public ServicoDTO(ServicoDTO a) { super(); this.setMatriculaBeneficiario(a.getMatriculaBeneficiario()); this.setCredenciado(a.getCredenciado()); this.setEmailBeneficiario(a.getEmailBeneficiario()); this.setEspecialidade(a.getEspecialidade()); this.setInicio(a.getInicio()); this.setNomeBeneficiario(a.getNomeBeneficiario()); this.setPessoaEndereco(a.getPessoaEndereco()); this.setPrestador(a.getPrestador()); this.setTelefoneBeneficiario(a.getTelefoneBeneficiario()); this.setOrdemDeChegada(a.getOrdemDeChegada()); } public ServicoDTO(Servico a) { super(); //this.setMatriculaBeneficiario(a.getStr_cpf_beneficiario()); this.setMatriculaBeneficiario(a.getCompra().getUsuario().getId_usuario().toString()); this.setCredenciado(a.getStr_credenciado()); this.setEmailBeneficiario(a.getStr_email_beneficiario()); this.setEspecialidade(a.getStr_especialidade()); this.setInicio(a.getDate_inicio().format(DateTimeFormatter.ISO_DATE_TIME)); this.setNomeBeneficiario(a.getStr_nome_beneficiario()); this.setPessoaEndereco(a.getStr_pessoa_endereco()); this.setPrestador(a.getStr_prestador()); this.setTelefoneBeneficiario(a.getStr_telefone_beneficiario()); this.setOrdemDeChegada(a.getBool_ordem_chegada()); } public Boolean getOrdemDeChegada() { return ordemDeChegada; } public void setOrdemDeChegada(Boolean ordemDeChegada) { this.ordemDeChegada = ordemDeChegada; } public String getPrestador() { return prestador; } public void setPrestador(String prestador) { this.prestador = prestador; } public String getCredenciado() { return credenciado; } public void setCredenciado(String credenciado) { this.credenciado = credenciado; } public String getPessoaEndereco() { return pessoaEndereco; } public void setPessoaEndereco(String pessoaEndereco) { this.pessoaEndereco = pessoaEndereco; } public String getEspecialidade() { return especialidade; } public void setEspecialidade(String especialidade) { this.especialidade = especialidade; } public String getNomeBeneficiario() { return nomeBeneficiario; } public void setNomeBeneficiario(String nomeBeneficiario) { this.nomeBeneficiario = nomeBeneficiario; } public String getMatriculaBeneficiario() { return matriculaBeneficiario; } public void setMatriculaBeneficiario(String matriculaBeneficiario) { this.matriculaBeneficiario = matriculaBeneficiario; } public String getEmailBeneficiario() { return emailBeneficiario; } public void setEmailBeneficiario(String emailBeneficiario) { this.emailBeneficiario = emailBeneficiario; } public String getTelefoneBeneficiario() { return telefoneBeneficiario; } public void setTelefoneBeneficiario(String telefoneBeneficiario) { this.telefoneBeneficiario = telefoneBeneficiario; } public String getInicio() { return inicio; } public void setInicio(String inicio) { this.inicio = inicio; } public Boolean getAgendavel() { return agendavel; } public void setAgendavel(Boolean agendavel) { this.agendavel = agendavel; } public Integer getIdServicoAMHP() { return idServicoAMHP; } public void setIdServicoAMHP(Integer idServicoAMHP) { this.idServicoAMHP = idServicoAMHP; } }
[ "bruno.carneiro312@gmail.com" ]
bruno.carneiro312@gmail.com
bc0e20bbc7097987068289ebbd24f30c639837e6
d4ad30e07d68601f8c9d149953c896511a28a57c
/EduMaking-Backend/src/main/java/co/unab/edu/models/entity/Pais.java
34098924f9b2670e512fd88b184ae484eec48c8f
[]
no_license
gelverargel/Sprint4
654cbdd61d09aa57156db9bac96e17f4b9db0c07
9c6149c45b4f17d1b08560db486287c919ee26fa
refs/heads/main
2023-08-24T14:46:19.778543
2021-10-22T10:31:07
2021-10-22T10:31:07
414,426,190
0
0
null
null
null
null
UTF-8
Java
false
false
1,072
java
package co.unab.edu.models.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "paises") public class Pais { @Id @Column(name = "id_pais") private String id; @Column(name = "nom_pais") private String nombre; @Column(name = "continente_pais") private String continente; @Column(name = "codigo_pais") private String codigo; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getContinente() { return continente; } public void setContinente(String continente) { this.continente = continente; } public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } @Override public String toString() { return "Pais [id=" + id + ", nombre=" + nombre + ", continente=" + continente + ", codigo=" + codigo + "]"; } }
[ "90213786+gelverargel@users.noreply.github.com" ]
90213786+gelverargel@users.noreply.github.com
e18995341e0950d38345e518ec7684200e1542b6
aa45989bb82b254a13ff111ea63e5bcd50f2c98f
/app/src/main/java/com/androidmarket/pdfcreator/fragment/HistoryFragment.java
79301ebc9ed87e88454f49bc9efc672c2c0dcb2b
[]
no_license
pepelawycliffe/PDF-Converter-Android-app-
b6e5c46177476806f1215517dea59105f71364da
9b0f45b471ab6d038eedb357d6b155665e326bd3
refs/heads/main
2023-08-22T22:18:30.347959
2021-10-12T08:52:04
2021-10-12T08:52:04
416,251,334
7
0
null
null
null
null
UTF-8
Java
false
false
8,743
java
package com.androidmarket.pdfcreator.fragment; import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.Intent; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.RelativeLayout; import com.afollestad.materialdialogs.MaterialDialog; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import androidmarket.R; import com.androidmarket.pdfcreator.activities.HomeActivity; import com.androidmarket.pdfcreator.adapter.AdapterHistory; import com.androidmarket.pdfcreator.db.AppDatabase; import com.androidmarket.pdfcreator.db.History; import com.androidmarket.pdfcreator.util.AdsUtility; import com.androidmarket.pdfcreator.util.DialogUtils; import com.androidmarket.pdfcreator.util.FileUtils; import com.androidmarket.pdfcreator.util.PermissionsUtils; import com.androidmarket.pdfcreator.util.StringUtils; import com.androidmarket.pdfcreator.util.ViewFilesDividerItemDecoration; import static com.androidmarket.pdfcreator.Constants.REQUEST_CODE_FOR_WRITE_PERMISSION; import static com.androidmarket.pdfcreator.Constants.WRITE_PERMISSIONS; import static com.androidmarket.pdfcreator.Constants.appName; public class HistoryFragment extends Fragment implements AdapterHistory.OnClickListener { @BindView(R.id.emptyStatusView) RelativeLayout mEmptyStatusLayout; @BindView(R.id.historyRecyclerView) RecyclerView mHistoryRecyclerView; private Activity mActivity; private List<History> mHistoryList; private AdapterHistory mAdapterHistory; private boolean[] mFilterOptionState; @Override public void onAttach(Context context) { super.onAttach(context); mActivity = (Activity) context; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_history, container, false); ButterKnife.bind(this, root); mFilterOptionState = new boolean[getResources().getStringArray(R.array.filter_options_history).length]; Arrays.fill(mFilterOptionState, Boolean.TRUE); //by default all options should be selected // by default all operations should be shown, so pass empty array new LoadHistory(mActivity).execute(new String[0]); getRuntimePermissions(); FrameLayout nativeAdFrameOne = root.findViewById(R.id.nativeAdFrameLayout); AdsUtility.loadNativeAd(getActivity(), nativeAdFrameOne); ImageView ivBack = root.findViewById(R.id.ivBack); ivBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(getActivity(), HomeActivity.class)); getActivity().finish(); } }); return root; } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu_history_fragment, menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.actionDeleteHistory: deleteHistory(); break; case R.id.actionFilterHistory: openFilterDialog(); break; } return super.onOptionsItemSelected(item); } private void openFilterDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); String[] options = getResources().getStringArray(R.array.filter_options_history); builder.setMultiChoiceItems(options, mFilterOptionState, (dialogInterface, index, isChecked) -> mFilterOptionState[index] = isChecked); builder.setTitle(getString(R.string.title_filter_history_dialog)); builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> { ArrayList<String> selectedOptions = new ArrayList<>(); for (int j = 0; j < mFilterOptionState.length; j++) { if (mFilterOptionState[j]) { //only apply those operations whose state is true i.e selected checkbox selectedOptions.add(options[j]); } } new LoadHistory(mActivity).execute(selectedOptions.toArray(new String[0])); }); builder.setNeutralButton(getString(R.string.select_all), (dialogInterface, i) -> { Arrays.fill(mFilterOptionState, Boolean.TRUE); //reset state new LoadHistory(mActivity).execute(new String[0]); }); builder.create().show(); } private void deleteHistory() { MaterialDialog.Builder builder = DialogUtils.getInstance().createWarningDialog(mActivity, R.string.delete_history_message); builder.onPositive((dialog2, which) -> new DeleteHistory().execute()) .show(); } @Override public void onItemClick(String path) { FileUtils fileUtils = new FileUtils(mActivity); File file = new File(path); if (file.exists()) { fileUtils.openFile(path, FileUtils.FileType.e_PDF); } else { StringUtils.getInstance().showSnackbar(mActivity, R.string.pdf_does_not_exist_message); } } @SuppressLint("StaticFieldLeak") private class LoadHistory extends AsyncTask<String[], Void, Void> { private final Context mContext; LoadHistory(Context mContext) { this.mContext = mContext; } @Override protected Void doInBackground(String[]... args) { AppDatabase db = AppDatabase.getDatabase(mActivity.getApplicationContext()); if (args[0].length == 0) { mHistoryList = db.historyDao().getAllHistory(); } else { String[] filters = args[0]; mHistoryList = db.historyDao().getHistoryByOperationType(filters); } return null; } @Override protected void onPostExecute(Void aVoid) { if (mHistoryList != null && !mHistoryList.isEmpty()) { mEmptyStatusLayout.setVisibility(View.GONE); mAdapterHistory = new AdapterHistory(mActivity, mHistoryList, HistoryFragment.this); RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(mContext); mHistoryRecyclerView.setLayoutManager(mLayoutManager); mHistoryRecyclerView.setAdapter(mAdapterHistory); mHistoryRecyclerView.addItemDecoration(new ViewFilesDividerItemDecoration(mContext)); } else { mEmptyStatusLayout.setVisibility(View.VISIBLE); } super.onPostExecute(aVoid); } } @SuppressLint("StaticFieldLeak") private class DeleteHistory extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... voids) { AppDatabase db = AppDatabase.getDatabase(mActivity.getApplicationContext()); db.historyDao().deleteHistory(); return null; } @Override protected void onPostExecute(Void aVoid) { if (mAdapterHistory != null) { mAdapterHistory.deleteHistory(); } mEmptyStatusLayout.setVisibility(View.VISIBLE); } } /*** * check runtime permissions for storage and camera ***/ private void getRuntimePermissions() { if (Build.VERSION.SDK_INT < 29) { PermissionsUtils.getInstance().requestRuntimePermissions(this, WRITE_PERMISSIONS, REQUEST_CODE_FOR_WRITE_PERMISSION); } } }
[ "wycliffepepela01@gmail.com" ]
wycliffepepela01@gmail.com
16fcb11085b6939e145ca13342a28416f42a3643
b89603fb579a80af6200154b278fdf4a4841be7b
/Invoicing2/src/main/java/org/jzen/invoicing/config/EmailConfig.java
aa7ac263f12a786f6e547a3cf1e451b53655c091
[]
no_license
gjrocks/Spring-work
9c7e67ef4914be51b295aefebfa8e5fa68dd8158
385e53053e456a6fb12978f8b8e18f2238cebdb0
refs/heads/master
2023-04-26T16:15:56.891418
2020-01-13T05:55:14
2020-01-13T05:55:14
137,060,771
0
0
null
2023-04-14T17:50:01
2018-06-12T11:15:13
Java
UTF-8
Java
false
false
679
java
package org.jzen.invoicing.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; @Configuration public class EmailConfig { /* * FreeMarker configuration. */ @Bean @Primary public FreeMarkerConfigurationFactoryBean getFreeMarkerConfiguration() { FreeMarkerConfigurationFactoryBean bean = new FreeMarkerConfigurationFactoryBean(); bean.setTemplateLoaderPath("/WEB-INF/templates/"); return bean; } }
[ "ganesh.jadhav@mastek.com" ]
ganesh.jadhav@mastek.com
e26041c0a40efb329fda06b3fbc083e68910aeab
6e2d505c1cf0461fcc3a937023d218114d892fca
/SYAndroidApp/gen/com/example/syandroidapp/R.java
264fce9087b5d4385eee76e525c2a1e1cce1ca3c
[]
no_license
jinsein/1001
f58147fcd3a47f6de430d6b7680044c608849130
5f265584872fbe8b89016b14e5937c1a1161edac
refs/heads/master
2016-09-08T01:16:15.161607
2015-04-10T00:36:32
2015-04-10T00:36:32
24,698,048
0
0
null
null
null
null
UTF-8
Java
false
false
2,596
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.example.syandroidapp; public final class R { public static final class attr { } public static final class dimen { /** Default screen margins, per the Android Design guidelines. Example customization of dimensions originally defined in res/values/dimens.xml (such as screen margins) for screens with more than 820dp of available width. This would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). */ public static final int activity_horizontal_margin=0x7f040000; public static final int activity_vertical_margin=0x7f040001; } public static final class drawable { public static final int ic_launcher=0x7f020000; } public static final class id { public static final int action_settings=0x7f080001; public static final int greetingMessage=0x7f080000; } public static final class layout { public static final int activity_main=0x7f030000; } public static final class menu { public static final int main=0x7f070000; } public static final class string { public static final int action_settings=0x7f050002; public static final int app_name=0x7f050000; public static final int hello_world=0x7f050001; } public static final class style { /** Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. API 11 theme customizations can go here. Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f060000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f060001; } }
[ "yoo.youngwook@gmail.com" ]
yoo.youngwook@gmail.com
b6c9cc0c79200ba474254379e12895c71e0600cc
fb027abef467a41434f8da752f18e8250365c9ca
/contrib/grpc-contrib/src/main/java/com/salesforce/grpc/contrib/MoreDurations.java
230de0aa827841bfe62f108ebe7dc8108638b772
[ "BSD-3-Clause" ]
permissive
salesforce/grpc-java-contrib
26dd5cbead2f80c8fbf89f0026cfcc4309cfc47c
6492a47abfa642bad59d9d6dd6a4e090515bf7ad
refs/heads/master
2023-08-29T01:48:44.147938
2023-04-12T21:12:29
2023-04-12T21:12:29
87,590,893
229
42
BSD-3-Clause
2023-06-26T17:07:29
2017-04-07T22:14:22
Java
UTF-8
Java
false
false
1,455
java
/* * Copyright (c) 2019, Salesforce.com, Inc. * All rights reserved. * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ package com.salesforce.grpc.contrib; import javax.annotation.Nonnull; import static com.google.common.base.Preconditions.*; /** * Utility methods for converting between Protocol Buffer {@link com.google.protobuf.Duration} objects and JDK 8 * java.time classes. * * <p>This class intentionally omits conversions to and from {@link java.time.Period}. Converting to and from Period * requires context-specific knowledge about how to handle things like daylight savings time and different calendars. */ public final class MoreDurations { private MoreDurations() { // private static constructor } public static java.time.Duration toJdkDuration(@Nonnull com.google.protobuf.Duration pbDuration) { checkNotNull(pbDuration, "pbDuration"); return java.time.Duration.ofSeconds(pbDuration.getSeconds(), pbDuration.getNanos()); } public static com.google.protobuf.Duration fromJdkDuration(@Nonnull java.time.Duration jdkDuration) { checkNotNull(jdkDuration, "jdkDuration"); return com.google.protobuf.Duration.newBuilder() .setSeconds(jdkDuration.getSeconds()) .setNanos(jdkDuration.getNano()) .build(); } }
[ "rmichela@salesforce.com" ]
rmichela@salesforce.com
f7d75ed01bd613a65cab4010994a9123a3e67f81
977ebe395f2d9c1a80d6f6c505bde157f7d088f6
/target/generated/src/main/java/com/esb/bme/cbsinterface/cbs/businessmgr/BatchOperationRequest.java
5a9783f5fee5ed6e7f11984b3129b3ba177d6d96
[]
no_license
EOnyenezido/esb
5bc8e394809d8db46772c1e814dded69c1caa802
64b82667e253f03c9e18b4ff1be37264399d26b9
refs/heads/master
2020-03-28T06:13:37.875748
2018-09-14T12:44:04
2018-09-14T12:44:04
147,821,707
0
0
null
null
null
null
UTF-8
Java
false
false
90,749
java
package com.esb.bme.cbsinterface.cbs.businessmgr; import java.io.Serializable; 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 BatchOperationRequest complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="BatchOperationRequest"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="BatchNewSubscriber" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="Customer" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}IndividualCustomer" minOccurs="0"/&gt; * &lt;element name="Subscriber"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}SubscriberBasic"&gt; * &lt;sequence&gt; * &lt;element name="CBPID" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="SCPID" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="Password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="Account" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Account" minOccurs="0"/&gt; * &lt;element name="Product" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchDeleteSubscriber" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchSubscribe" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="EffectiveDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ExpireDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ValidMode" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}ValidMode"/&gt; * &lt;element name="Product" maxOccurs="unbounded"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;sequence&gt; * &lt;element name="Service" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Service" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="HandlingChargeFlag" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchUnSubscribe" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ExpireDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ValidMode" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}ValidMode"/&gt; * &lt;element name="Product" maxOccurs="unbounded"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="ProductID" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ProductOrderKey" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="Service" maxOccurs="unbounded" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="Id" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="SimpleProperty" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}SimpleProperty" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchChangeService" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="Service" maxOccurs="unbounded"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Service"&gt; * &lt;sequence&gt; * &lt;element name="OperationType" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}OperationType"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchChangeMainProduct" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="NewMainProductId" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ValidMode" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}ValidMode"/&gt; * &lt;element name="EffectiveDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="Product" maxOccurs="unbounded" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="HandlingChargeFlag" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="RemovedProduct" maxOccurs="unbounded" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;sequence&gt; * &lt;element name="ProductOrderKey" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="NewBrandId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ppsAcctCredit" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;element name="posAcctCredit" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;element name="ppsAcctInitBal" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;element name="PosAcctInitBal" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchModifySubValidity" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ValidityIncrement" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="ModifyType" minOccurs="0"&gt; * &lt;simpleType&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}int"&gt; * &lt;enumeration value="0"/&gt; * &lt;enumeration value="1"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * &lt;/element&gt; * &lt;element name="OperationDes" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchModifyVoucherState" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="CardFlag" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="OperationDes" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchReplaceProduct" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchActiveSubscriber" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}anyType"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="BatchModAcctExt" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ModifyMode" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "BatchOperationRequest", propOrder = { "batchNewSubscriber", "batchDeleteSubscriber", "batchSubscribe", "batchUnSubscribe", "batchChangeService", "batchChangeMainProduct", "batchModifySubValidity", "batchModifyVoucherState", "batchReplaceProduct", "batchActiveSubscriber", "batchModAcctExt" }) public class BatchOperationRequest implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "BatchNewSubscriber") protected BatchOperationRequest.BatchNewSubscriber batchNewSubscriber; @XmlElement(name = "BatchDeleteSubscriber") protected BatchOperationRequest.BatchDeleteSubscriber batchDeleteSubscriber; @XmlElement(name = "BatchSubscribe") protected BatchOperationRequest.BatchSubscribe batchSubscribe; @XmlElement(name = "BatchUnSubscribe") protected BatchOperationRequest.BatchUnSubscribe batchUnSubscribe; @XmlElement(name = "BatchChangeService") protected BatchOperationRequest.BatchChangeService batchChangeService; @XmlElement(name = "BatchChangeMainProduct") protected BatchOperationRequest.BatchChangeMainProduct batchChangeMainProduct; @XmlElement(name = "BatchModifySubValidity") protected BatchOperationRequest.BatchModifySubValidity batchModifySubValidity; @XmlElement(name = "BatchModifyVoucherState") protected BatchOperationRequest.BatchModifyVoucherState batchModifyVoucherState; @XmlElement(name = "BatchReplaceProduct") protected BatchOperationRequest.BatchReplaceProduct batchReplaceProduct; @XmlElement(name = "BatchActiveSubscriber") protected BatchOperationRequest.BatchActiveSubscriber batchActiveSubscriber; @XmlElement(name = "BatchModAcctExt") protected BatchOperationRequest.BatchModAcctExt batchModAcctExt; /** * Gets the value of the batchNewSubscriber property. * * @return * possible object is * {@link BatchOperationRequest.BatchNewSubscriber } * */ public BatchOperationRequest.BatchNewSubscriber getBatchNewSubscriber() { return batchNewSubscriber; } /** * Sets the value of the batchNewSubscriber property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchNewSubscriber } * */ public void setBatchNewSubscriber(BatchOperationRequest.BatchNewSubscriber value) { this.batchNewSubscriber = value; } /** * Gets the value of the batchDeleteSubscriber property. * * @return * possible object is * {@link BatchOperationRequest.BatchDeleteSubscriber } * */ public BatchOperationRequest.BatchDeleteSubscriber getBatchDeleteSubscriber() { return batchDeleteSubscriber; } /** * Sets the value of the batchDeleteSubscriber property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchDeleteSubscriber } * */ public void setBatchDeleteSubscriber(BatchOperationRequest.BatchDeleteSubscriber value) { this.batchDeleteSubscriber = value; } /** * Gets the value of the batchSubscribe property. * * @return * possible object is * {@link BatchOperationRequest.BatchSubscribe } * */ public BatchOperationRequest.BatchSubscribe getBatchSubscribe() { return batchSubscribe; } /** * Sets the value of the batchSubscribe property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchSubscribe } * */ public void setBatchSubscribe(BatchOperationRequest.BatchSubscribe value) { this.batchSubscribe = value; } /** * Gets the value of the batchUnSubscribe property. * * @return * possible object is * {@link BatchOperationRequest.BatchUnSubscribe } * */ public BatchOperationRequest.BatchUnSubscribe getBatchUnSubscribe() { return batchUnSubscribe; } /** * Sets the value of the batchUnSubscribe property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchUnSubscribe } * */ public void setBatchUnSubscribe(BatchOperationRequest.BatchUnSubscribe value) { this.batchUnSubscribe = value; } /** * Gets the value of the batchChangeService property. * * @return * possible object is * {@link BatchOperationRequest.BatchChangeService } * */ public BatchOperationRequest.BatchChangeService getBatchChangeService() { return batchChangeService; } /** * Sets the value of the batchChangeService property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchChangeService } * */ public void setBatchChangeService(BatchOperationRequest.BatchChangeService value) { this.batchChangeService = value; } /** * Gets the value of the batchChangeMainProduct property. * * @return * possible object is * {@link BatchOperationRequest.BatchChangeMainProduct } * */ public BatchOperationRequest.BatchChangeMainProduct getBatchChangeMainProduct() { return batchChangeMainProduct; } /** * Sets the value of the batchChangeMainProduct property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchChangeMainProduct } * */ public void setBatchChangeMainProduct(BatchOperationRequest.BatchChangeMainProduct value) { this.batchChangeMainProduct = value; } /** * Gets the value of the batchModifySubValidity property. * * @return * possible object is * {@link BatchOperationRequest.BatchModifySubValidity } * */ public BatchOperationRequest.BatchModifySubValidity getBatchModifySubValidity() { return batchModifySubValidity; } /** * Sets the value of the batchModifySubValidity property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchModifySubValidity } * */ public void setBatchModifySubValidity(BatchOperationRequest.BatchModifySubValidity value) { this.batchModifySubValidity = value; } /** * Gets the value of the batchModifyVoucherState property. * * @return * possible object is * {@link BatchOperationRequest.BatchModifyVoucherState } * */ public BatchOperationRequest.BatchModifyVoucherState getBatchModifyVoucherState() { return batchModifyVoucherState; } /** * Sets the value of the batchModifyVoucherState property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchModifyVoucherState } * */ public void setBatchModifyVoucherState(BatchOperationRequest.BatchModifyVoucherState value) { this.batchModifyVoucherState = value; } /** * Gets the value of the batchReplaceProduct property. * * @return * possible object is * {@link BatchOperationRequest.BatchReplaceProduct } * */ public BatchOperationRequest.BatchReplaceProduct getBatchReplaceProduct() { return batchReplaceProduct; } /** * Sets the value of the batchReplaceProduct property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchReplaceProduct } * */ public void setBatchReplaceProduct(BatchOperationRequest.BatchReplaceProduct value) { this.batchReplaceProduct = value; } /** * Gets the value of the batchActiveSubscriber property. * * @return * possible object is * {@link BatchOperationRequest.BatchActiveSubscriber } * */ public BatchOperationRequest.BatchActiveSubscriber getBatchActiveSubscriber() { return batchActiveSubscriber; } /** * Sets the value of the batchActiveSubscriber property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchActiveSubscriber } * */ public void setBatchActiveSubscriber(BatchOperationRequest.BatchActiveSubscriber value) { this.batchActiveSubscriber = value; } /** * Gets the value of the batchModAcctExt property. * * @return * possible object is * {@link BatchOperationRequest.BatchModAcctExt } * */ public BatchOperationRequest.BatchModAcctExt getBatchModAcctExt() { return batchModAcctExt; } /** * Sets the value of the batchModAcctExt property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchModAcctExt } * */ public void setBatchModAcctExt(BatchOperationRequest.BatchModAcctExt value) { this.batchModAcctExt = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}anyType"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName" }) public static class BatchActiveSubscriber implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected Object fileName; /** * Gets the value of the fileName property. * * @return * possible object is * {@link Object } * */ public Object getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link Object } * */ public void setFileName(Object value) { this.fileName = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="NewMainProductId" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ValidMode" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}ValidMode"/&gt; * &lt;element name="EffectiveDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="Product" maxOccurs="unbounded" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="HandlingChargeFlag" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="RemovedProduct" maxOccurs="unbounded" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;sequence&gt; * &lt;element name="ProductOrderKey" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="NewBrandId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ppsAcctCredit" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;element name="posAcctCredit" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;element name="ppsAcctInitBal" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;element name="PosAcctInitBal" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "newMainProductId", "validMode", "effectiveDate", "product", "handlingChargeFlag", "removedProduct", "newBrandId", "ppsAcctCredit", "posAcctCredit", "ppsAcctInitBal", "posAcctInitBal" }) public static class BatchChangeMainProduct implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "NewMainProductId", required = true) protected String newMainProductId; @XmlElement(name = "ValidMode", required = true) protected String validMode; @XmlElement(name = "EffectiveDate") protected String effectiveDate; @XmlElement(name = "Product") protected List<BatchOperationRequest.BatchChangeMainProduct.Product> product; @XmlElement(name = "HandlingChargeFlag") protected Integer handlingChargeFlag; @XmlElement(name = "RemovedProduct") protected List<BatchOperationRequest.BatchChangeMainProduct.RemovedProduct> removedProduct; @XmlElement(name = "NewBrandId") protected String newBrandId; protected Long ppsAcctCredit; protected Long posAcctCredit; protected Long ppsAcctInitBal; @XmlElement(name = "PosAcctInitBal") protected Long posAcctInitBal; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the newMainProductId property. * * @return * possible object is * {@link String } * */ public String getNewMainProductId() { return newMainProductId; } /** * Sets the value of the newMainProductId property. * * @param value * allowed object is * {@link String } * */ public void setNewMainProductId(String value) { this.newMainProductId = value; } /** * Gets the value of the validMode property. * * @return * possible object is * {@link String } * */ public String getValidMode() { return validMode; } /** * Sets the value of the validMode property. * * @param value * allowed object is * {@link String } * */ public void setValidMode(String value) { this.validMode = value; } /** * Gets the value of the effectiveDate property. * * @return * possible object is * {@link String } * */ public String getEffectiveDate() { return effectiveDate; } /** * Sets the value of the effectiveDate property. * * @param value * allowed object is * {@link String } * */ public void setEffectiveDate(String value) { this.effectiveDate = value; } /** * Gets the value of the product 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 product property. * * <p> * For example, to add a new item, do as follows: * <pre> * getProduct().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BatchOperationRequest.BatchChangeMainProduct.Product } * * */ public List<BatchOperationRequest.BatchChangeMainProduct.Product> getProduct() { if (product == null) { product = new ArrayList<BatchOperationRequest.BatchChangeMainProduct.Product>(); } return this.product; } /** * Gets the value of the handlingChargeFlag property. * * @return * possible object is * {@link Integer } * */ public Integer getHandlingChargeFlag() { return handlingChargeFlag; } /** * Sets the value of the handlingChargeFlag property. * * @param value * allowed object is * {@link Integer } * */ public void setHandlingChargeFlag(Integer value) { this.handlingChargeFlag = value; } /** * Gets the value of the removedProduct 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 removedProduct property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRemovedProduct().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BatchOperationRequest.BatchChangeMainProduct.RemovedProduct } * * */ public List<BatchOperationRequest.BatchChangeMainProduct.RemovedProduct> getRemovedProduct() { if (removedProduct == null) { removedProduct = new ArrayList<BatchOperationRequest.BatchChangeMainProduct.RemovedProduct>(); } return this.removedProduct; } /** * Gets the value of the newBrandId property. * * @return * possible object is * {@link String } * */ public String getNewBrandId() { return newBrandId; } /** * Sets the value of the newBrandId property. * * @param value * allowed object is * {@link String } * */ public void setNewBrandId(String value) { this.newBrandId = value; } /** * Gets the value of the ppsAcctCredit property. * * @return * possible object is * {@link Long } * */ public Long getPpsAcctCredit() { return ppsAcctCredit; } /** * Sets the value of the ppsAcctCredit property. * * @param value * allowed object is * {@link Long } * */ public void setPpsAcctCredit(Long value) { this.ppsAcctCredit = value; } /** * Gets the value of the posAcctCredit property. * * @return * possible object is * {@link Long } * */ public Long getPosAcctCredit() { return posAcctCredit; } /** * Sets the value of the posAcctCredit property. * * @param value * allowed object is * {@link Long } * */ public void setPosAcctCredit(Long value) { this.posAcctCredit = value; } /** * Gets the value of the ppsAcctInitBal property. * * @return * possible object is * {@link Long } * */ public Long getPpsAcctInitBal() { return ppsAcctInitBal; } /** * Sets the value of the ppsAcctInitBal property. * * @param value * allowed object is * {@link Long } * */ public void setPpsAcctInitBal(Long value) { this.ppsAcctInitBal = value; } /** * Gets the value of the posAcctInitBal property. * * @return * possible object is * {@link Long } * */ public Long getPosAcctInitBal() { return posAcctInitBal; } /** * Sets the value of the posAcctInitBal property. * * @param value * allowed object is * {@link Long } * */ public void setPosAcctInitBal(Long value) { this.posAcctInitBal = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class Product extends com.esb.bme.cbsinterface.cbs.businessmgr.Product implements Serializable { private final static long serialVersionUID = 11082013L; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;sequence&gt; * &lt;element name="ProductOrderKey" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "productOrderKey" }) public static class RemovedProduct extends com.esb.bme.cbsinterface.cbs.businessmgr.Product implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "ProductOrderKey") protected String productOrderKey; /** * Gets the value of the productOrderKey property. * * @return * possible object is * {@link String } * */ public String getProductOrderKey() { return productOrderKey; } /** * Sets the value of the productOrderKey property. * * @param value * allowed object is * {@link String } * */ public void setProductOrderKey(String value) { this.productOrderKey = value; } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="Service" maxOccurs="unbounded"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Service"&gt; * &lt;sequence&gt; * &lt;element name="OperationType" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}OperationType"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "service" }) public static class BatchChangeService implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "Service", required = true) protected List<BatchOperationRequest.BatchChangeService.Service> service; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the service 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 service property. * * <p> * For example, to add a new item, do as follows: * <pre> * getService().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BatchOperationRequest.BatchChangeService.Service } * * */ public List<BatchOperationRequest.BatchChangeService.Service> getService() { if (service == null) { service = new ArrayList<BatchOperationRequest.BatchChangeService.Service>(); } return this.service; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Service"&gt; * &lt;sequence&gt; * &lt;element name="OperationType" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}OperationType"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "operationType" }) public static class Service extends com.esb.bme.cbsinterface.cbs.businessmgr.Service implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "OperationType", required = true) protected String operationType; /** * Gets the value of the operationType property. * * @return * possible object is * {@link String } * */ public String getOperationType() { return operationType; } /** * Sets the value of the operationType property. * * @param value * allowed object is * {@link String } * */ public void setOperationType(String value) { this.operationType = value; } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName" }) public static class BatchDeleteSubscriber implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ModifyMode" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "modifyMode" }) public static class BatchModAcctExt implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "ModifyMode") protected Integer modifyMode; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the modifyMode property. * * @return * possible object is * {@link Integer } * */ public Integer getModifyMode() { return modifyMode; } /** * Sets the value of the modifyMode property. * * @param value * allowed object is * {@link Integer } * */ public void setModifyMode(Integer value) { this.modifyMode = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ValidityIncrement" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="ModifyType" minOccurs="0"&gt; * &lt;simpleType&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}int"&gt; * &lt;enumeration value="0"/&gt; * &lt;enumeration value="1"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * &lt;/element&gt; * &lt;element name="OperationDes" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "validityIncrement", "modifyType", "operationDes" }) public static class BatchModifySubValidity implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "ValidityIncrement") protected int validityIncrement; @XmlElement(name = "ModifyType") protected Integer modifyType; @XmlElement(name = "OperationDes") protected String operationDes; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the validityIncrement property. * */ public int getValidityIncrement() { return validityIncrement; } /** * Sets the value of the validityIncrement property. * */ public void setValidityIncrement(int value) { this.validityIncrement = value; } /** * Gets the value of the modifyType property. * * @return * possible object is * {@link Integer } * */ public Integer getModifyType() { return modifyType; } /** * Sets the value of the modifyType property. * * @param value * allowed object is * {@link Integer } * */ public void setModifyType(Integer value) { this.modifyType = value; } /** * Gets the value of the operationDes property. * * @return * possible object is * {@link String } * */ public String getOperationDes() { return operationDes; } /** * Sets the value of the operationDes property. * * @param value * allowed object is * {@link String } * */ public void setOperationDes(String value) { this.operationDes = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="CardFlag" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="OperationDes" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "cardFlag", "operationDes" }) public static class BatchModifyVoucherState implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "CardFlag") protected int cardFlag; @XmlElement(name = "OperationDes") protected String operationDes; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the cardFlag property. * */ public int getCardFlag() { return cardFlag; } /** * Sets the value of the cardFlag property. * */ public void setCardFlag(int value) { this.cardFlag = value; } /** * Gets the value of the operationDes property. * * @return * possible object is * {@link String } * */ public String getOperationDes() { return operationDes; } /** * Sets the value of the operationDes property. * * @param value * allowed object is * {@link String } * */ public void setOperationDes(String value) { this.operationDes = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="Customer" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}IndividualCustomer" minOccurs="0"/&gt; * &lt;element name="Subscriber"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}SubscriberBasic"&gt; * &lt;sequence&gt; * &lt;element name="CBPID" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="SCPID" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="Password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="Account" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Account" minOccurs="0"/&gt; * &lt;element name="Product" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "customer", "subscriber", "account", "product" }) public static class BatchNewSubscriber implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "Customer") protected IndividualCustomer customer; @XmlElement(name = "Subscriber", required = true) protected BatchOperationRequest.BatchNewSubscriber.Subscriber subscriber; @XmlElement(name = "Account") protected Account account; @XmlElement(name = "Product") protected List<com.esb.bme.cbsinterface.cbs.businessmgr.Product> product; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the customer property. * * @return * possible object is * {@link IndividualCustomer } * */ public IndividualCustomer getCustomer() { return customer; } /** * Sets the value of the customer property. * * @param value * allowed object is * {@link IndividualCustomer } * */ public void setCustomer(IndividualCustomer value) { this.customer = value; } /** * Gets the value of the subscriber property. * * @return * possible object is * {@link BatchOperationRequest.BatchNewSubscriber.Subscriber } * */ public BatchOperationRequest.BatchNewSubscriber.Subscriber getSubscriber() { return subscriber; } /** * Sets the value of the subscriber property. * * @param value * allowed object is * {@link BatchOperationRequest.BatchNewSubscriber.Subscriber } * */ public void setSubscriber(BatchOperationRequest.BatchNewSubscriber.Subscriber value) { this.subscriber = value; } /** * Gets the value of the account property. * * @return * possible object is * {@link Account } * */ public Account getAccount() { return account; } /** * Sets the value of the account property. * * @param value * allowed object is * {@link Account } * */ public void setAccount(Account value) { this.account = value; } /** * Gets the value of the product 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 product property. * * <p> * For example, to add a new item, do as follows: * <pre> * getProduct().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link com.esb.bme.cbsinterface.cbs.businessmgr.Product } * * */ public List<com.esb.bme.cbsinterface.cbs.businessmgr.Product> getProduct() { if (product == null) { product = new ArrayList<com.esb.bme.cbsinterface.cbs.businessmgr.Product>(); } return this.product; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}SubscriberBasic"&gt; * &lt;sequence&gt; * &lt;element name="CBPID" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="SCPID" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;element name="Password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "cbpid", "scpid", "password" }) public static class Subscriber extends SubscriberBasic implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "CBPID") protected Integer cbpid; @XmlElement(name = "SCPID") protected Integer scpid; @XmlElement(name = "Password") protected String password; /** * Gets the value of the cbpid property. * * @return * possible object is * {@link Integer } * */ public Integer getCBPID() { return cbpid; } /** * Sets the value of the cbpid property. * * @param value * allowed object is * {@link Integer } * */ public void setCBPID(Integer value) { this.cbpid = value; } /** * Gets the value of the scpid property. * * @return * possible object is * {@link Integer } * */ public Integer getSCPID() { return scpid; } /** * Sets the value of the scpid property. * * @param value * allowed object is * {@link Integer } * */ public void setSCPID(Integer value) { this.scpid = value; } /** * Gets the value of the password property. * * @return * possible object is * {@link String } * */ public String getPassword() { return password; } /** * Sets the value of the password property. * * @param value * allowed object is * {@link String } * */ public void setPassword(String value) { this.password = value; } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName" }) public static class BatchReplaceProduct implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="EffectiveDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ExpireDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ValidMode" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}ValidMode"/&gt; * &lt;element name="Product" maxOccurs="unbounded"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;sequence&gt; * &lt;element name="Service" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Service" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="HandlingChargeFlag" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "effectiveDate", "expireDate", "validMode", "product", "handlingChargeFlag" }) public static class BatchSubscribe implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "EffectiveDate") protected String effectiveDate; @XmlElement(name = "ExpireDate") protected String expireDate; @XmlElement(name = "ValidMode", required = true) protected String validMode; @XmlElement(name = "Product", required = true) protected List<BatchOperationRequest.BatchSubscribe.Product> product; @XmlElement(name = "HandlingChargeFlag") protected Integer handlingChargeFlag; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the effectiveDate property. * * @return * possible object is * {@link String } * */ public String getEffectiveDate() { return effectiveDate; } /** * Sets the value of the effectiveDate property. * * @param value * allowed object is * {@link String } * */ public void setEffectiveDate(String value) { this.effectiveDate = value; } /** * Gets the value of the expireDate property. * * @return * possible object is * {@link String } * */ public String getExpireDate() { return expireDate; } /** * Sets the value of the expireDate property. * * @param value * allowed object is * {@link String } * */ public void setExpireDate(String value) { this.expireDate = value; } /** * Gets the value of the validMode property. * * @return * possible object is * {@link String } * */ public String getValidMode() { return validMode; } /** * Sets the value of the validMode property. * * @param value * allowed object is * {@link String } * */ public void setValidMode(String value) { this.validMode = value; } /** * Gets the value of the product 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 product property. * * <p> * For example, to add a new item, do as follows: * <pre> * getProduct().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BatchOperationRequest.BatchSubscribe.Product } * * */ public List<BatchOperationRequest.BatchSubscribe.Product> getProduct() { if (product == null) { product = new ArrayList<BatchOperationRequest.BatchSubscribe.Product>(); } return this.product; } /** * Gets the value of the handlingChargeFlag property. * * @return * possible object is * {@link Integer } * */ public Integer getHandlingChargeFlag() { return handlingChargeFlag; } /** * Sets the value of the handlingChargeFlag property. * * @param value * allowed object is * {@link Integer } * */ public void setHandlingChargeFlag(Integer value) { this.handlingChargeFlag = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Product"&gt; * &lt;sequence&gt; * &lt;element name="Service" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}Service" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "service" }) public static class Product extends com.esb.bme.cbsinterface.cbs.businessmgr.Product implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "Service") protected List<com.esb.bme.cbsinterface.cbs.businessmgr.Service> service; /** * Gets the value of the service 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 service property. * * <p> * For example, to add a new item, do as follows: * <pre> * getService().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link com.esb.bme.cbsinterface.cbs.businessmgr.Service } * * */ public List<com.esb.bme.cbsinterface.cbs.businessmgr.Service> getService() { if (service == null) { service = new ArrayList<com.esb.bme.cbsinterface.cbs.businessmgr.Service>(); } return this.service; } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="FileName" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ExpireDate" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="ValidMode" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}ValidMode"/&gt; * &lt;element name="Product" maxOccurs="unbounded"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="ProductID" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ProductOrderKey" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="Service" maxOccurs="unbounded" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="Id" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="SimpleProperty" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}SimpleProperty" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "fileName", "expireDate", "validMode", "product" }) public static class BatchUnSubscribe implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "FileName", required = true) protected String fileName; @XmlElement(name = "ExpireDate") protected String expireDate; @XmlElement(name = "ValidMode", required = true) protected String validMode; @XmlElement(name = "Product", required = true) protected List<BatchOperationRequest.BatchUnSubscribe.Product> product; /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ public String getFileName() { return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { this.fileName = value; } /** * Gets the value of the expireDate property. * * @return * possible object is * {@link String } * */ public String getExpireDate() { return expireDate; } /** * Sets the value of the expireDate property. * * @param value * allowed object is * {@link String } * */ public void setExpireDate(String value) { this.expireDate = value; } /** * Gets the value of the validMode property. * * @return * possible object is * {@link String } * */ public String getValidMode() { return validMode; } /** * Sets the value of the validMode property. * * @param value * allowed object is * {@link String } * */ public void setValidMode(String value) { this.validMode = value; } /** * Gets the value of the product 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 product property. * * <p> * For example, to add a new item, do as follows: * <pre> * getProduct().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BatchOperationRequest.BatchUnSubscribe.Product } * * */ public List<BatchOperationRequest.BatchUnSubscribe.Product> getProduct() { if (product == null) { product = new ArrayList<BatchOperationRequest.BatchUnSubscribe.Product>(); } return this.product; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="ProductID" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="ProductOrderKey" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;element name="Service" maxOccurs="unbounded" minOccurs="0"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="Id" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="SimpleProperty" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}SimpleProperty" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "productID", "productOrderKey", "service" }) public static class Product implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "ProductID", required = true) protected String productID; @XmlElement(name = "ProductOrderKey") protected String productOrderKey; @XmlElement(name = "Service") protected List<BatchOperationRequest.BatchUnSubscribe.Product.Service> service; /** * Gets the value of the productID property. * * @return * possible object is * {@link String } * */ public String getProductID() { return productID; } /** * Sets the value of the productID property. * * @param value * allowed object is * {@link String } * */ public void setProductID(String value) { this.productID = value; } /** * Gets the value of the productOrderKey property. * * @return * possible object is * {@link String } * */ public String getProductOrderKey() { return productOrderKey; } /** * Sets the value of the productOrderKey property. * * @param value * allowed object is * {@link String } * */ public void setProductOrderKey(String value) { this.productOrderKey = value; } /** * Gets the value of the service 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 service property. * * <p> * For example, to add a new item, do as follows: * <pre> * getService().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BatchOperationRequest.BatchUnSubscribe.Product.Service } * * */ public List<BatchOperationRequest.BatchUnSubscribe.Product.Service> getService() { if (service == null) { service = new ArrayList<BatchOperationRequest.BatchUnSubscribe.Product.Service>(); } return this.service; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="Id" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="SimpleProperty" type="{http://www.esb.com/bme/cbsinterface/cbs/businessmgr}SimpleProperty" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "id", "simpleProperty" }) public static class Service implements Serializable { private final static long serialVersionUID = 11082013L; @XmlElement(name = "Id", required = true) protected String id; @XmlElement(name = "SimpleProperty", required = true) protected List<SimpleProperty> simpleProperty; /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } /** * Gets the value of the simpleProperty 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 simpleProperty property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSimpleProperty().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link SimpleProperty } * * */ public List<SimpleProperty> getSimpleProperty() { if (simpleProperty == null) { simpleProperty = new ArrayList<SimpleProperty>(); } return this.simpleProperty; } } } } }
[ "e.onyenezido@karixchange.com" ]
e.onyenezido@karixchange.com
b5192ef00d64b4c6d8b8c47ab2d415eb27121110
5064b475f073e40fca1a1190b3e83679e8557540
/src/main/java/com/blogchong/webmite/company/AnalyUrl.java
da5f531bd905fb4b11b04c45b1d6a017c1fe0dbd
[]
no_license
luckytina/webmite
7fff155dffa65e9de06dedd6675a35e88a6c8658
c4fb87caf1953c9a8dfeea44ee41a2f70a666e2f
refs/heads/master
2021-01-21T08:46:11.601325
2015-04-08T06:26:11
2015-04-08T06:26:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,930
java
package com.blogchong.webmite.company; import java.util.Set; import org.json.JSONArray; import org.json.JSONObject; import com.blogchong.webmite.util.MacroDef; /** * @Author: blogchong * @Blog: www.blogchong.com * @Mailbox: blogchong@163.com * @QQGroup: 191321336 * @Weixin: blogchong * @CreateTime:2015年1月14日 下午3:09:01 * @Description: 过滤出无企业网站的公司 */ public class AnalyUrl { @SuppressWarnings("unchecked") public static JSONObject analyUrl(String url) { JSONObject obj_ret = new JSONObject(); Set<String> set = GetCompanyFromZhilian.getCompanyFromZl(url); for (String str : set) { GetUrlFrom360 getUrlFrom360 = new GetUrlFrom360(); JSONObject obj = getUrlFrom360.getUrlFrom360(str); Set<String> keys = obj.keySet(); // 是否有首页的标识 boolean index_flag = false; // 其他是否为空标识 boolean other_flag = false; // 存储非首页网址 JSONArray jar_not = new JSONArray(); for (String key : keys) { JSONArray jar = obj.getJSONArray(key); if (key.equals(MacroDef.INDEX_FLAG) && jar.length() == 0) { index_flag = true; } else if (key.equals(MacroDef.OTHER_FLAG) && jar.length() == 0) { other_flag = true; } for (int i = 0; i < jar.length(); i++) { if (key.equals(MacroDef.OTHER_FLAG)) { jar_not.put(jar.getString(i)); } } } if (index_flag && !other_flag) { obj_ret.put(str, jar_not); } } return obj_ret; } @SuppressWarnings("unchecked") public static void main(String[] args) { String url = "http://sou.zhaopin.com/jobs/searchresult.ashx?in=210500%3B160400%3B160000%3B160500%3B160200%3B300100%3B160100%3B160600&jl=%E5%8C%97%E4%BA%AC&sm=0&p=1&sf=0&st=99999&cs=1&isadv=1"; JSONObject obj = analyUrl(url); Set<String> keys = obj.keySet(); for (String key : keys) { System.out.println(key + ":(" + obj.get(key) + ")"); } } }
[ "huangcy@csdn.net" ]
huangcy@csdn.net
f7a301434c03716004f5c3475618360798d989c9
982c6b06d72d646c809d5a12866359f720305067
/subprojects/core-model/src/main/java/dev/nokee/internal/provider/ProviderConvertibleInternal.java
ca71d1714a1e7242e786ef64b0e1dd1d6b102a41
[ "Apache-2.0" ]
permissive
nokeedev/gradle-native
e46709a904e20183ca09ff64b92d222d3c888df2
6e6ee42cefa69d81fd026b2cfcb7e710dd62d569
refs/heads/master
2023-05-30T02:27:59.371101
2023-05-18T15:36:49
2023-05-23T14:43:18
243,841,556
52
9
Apache-2.0
2023-05-23T14:58:33
2020-02-28T19:42:28
Java
UTF-8
Java
false
false
1,715
java
/* * Copyright 2021 the original author or authors. * * 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 * * https://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 dev.nokee.internal.provider; import dev.nokee.provider.ProviderConvertible; import org.gradle.api.provider.Provider; import java.util.concurrent.Callable; /** * An object that can be converted to a {@link Provider} compatible with Gradle {@literal Callable} aware APIs. * * @param <T> type of value represented by the provider */ public interface ProviderConvertibleInternal<T> extends ProviderConvertible<T>, Callable<Object> { /** * Gradle-compatible {@literal Callable} provider conversion. * * Some Gradle APIs, i.e. {@link org.gradle.api.Project#files(Object...)} and {@link org.gradle.api.Task#dependsOn(Object...)}, * accept {@link Callable} types as a legacy mechanic to the {@link Provider} API. * In the majority of the cases, the API also accepts {@link Provider}. * Gradle will unpack the {@link Callable} and use any resulting value. * In our {@literal ProviderConvertible} case, it will result in an automatic {@link Provider} conversion. * * @return a {@link Provider}, never null */ @Override default Object call() { return asProvider(); } }
[ "lacasseio@users.noreply.github.com" ]
lacasseio@users.noreply.github.com
bd62f5c6afb1311255f2d7c0e4ae0073d140016f
e75be673baeeddee986ece49ef6e1c718a8e7a5d
/submissions/blizzard/Corpus/eclipse.jdt.core/5038.java
af9af6585385a0c326d57d7926629a3af57522a2
[ "MIT" ]
permissive
zhendong2050/fse18
edbea132be9122b57e272a20c20fae2bb949e63e
f0f016140489961c9e3c2e837577f698c2d4cf44
refs/heads/master
2020-12-21T11:31:53.800358
2018-07-23T10:10:57
2018-07-23T10:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
71
java
package p5; public class X { public class Inner { } }
[ "tim.menzies@gmail.com" ]
tim.menzies@gmail.com
042522fa5111b4cb3104d75873d0652ce87d903d
57172ec074ba1015ae72e10670d830273921a5bc
/Design Patterns/src/com/patterns/builder/Burger.java
c748efb07c9bcc05809505d32a80438714f87bb1
[]
no_license
mananpreets-optimus/Java-Induction
4d889f1ea2f8e27fe4fdbe02b7c05e9127299fdd
e0848adc537b72b9d80b67219fc30cb3da030da1
refs/heads/master
2021-01-23T17:32:14.368026
2015-10-20T11:33:16
2015-10-20T11:33:16
39,013,533
0
0
null
null
null
null
UTF-8
Java
false
false
497
java
/** * Package com.patterns.builder: contains classes and interfaces for implementation of Builder design pattern. */ package com.patterns.builder; /** * Abstract Class Burger implements interface Item */ public abstract class Burger implements Item { /** Method pack() : type of packing. * @return Wrapper() wrapper class object */ @Override public Packing packing() { return new Wrapper(); } /** Method name : price of product.*/ @Override public abstract float price(); }
[ "mananpreets-optimus@optimusinfo.com" ]
mananpreets-optimus@optimusinfo.com
26a70d8009097cbc54a75d8800cd5f0dba0ea089
cadd582cc26c6bfea77f020369992ace3fa3d9b1
/springboot-wxmini/src/main/java/top/wx/pojo/User.java
b159800066729d34724cb4fa866f554e2e646f38
[]
no_license
liyongqi0913/springboot-wxmini-master
0071212704f5ec1c733daaa511ab93f547ede8fa
5d5fcd7f0d89b1bfd763e7572de2393a46046c0e
refs/heads/master
2023-01-05T22:36:12.533175
2020-10-26T16:07:28
2020-10-26T16:07:28
307,429,613
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package top.wx.pojo; public class User { private String uid; private String username; private String password; public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "liyongqi0913@163.com" ]
liyongqi0913@163.com
f1efcc72d1f1e90497eeb3133db7b122d7174513
7204d38be5cbfbf05ed74de6bc073758ef008d85
/planRoute/PlanRoute.java
e19ca01e73829afd404efb289261689a20cd4bb5
[]
no_license
TegueM/prg381
4629279f0dfa1d1cd779fddbf4e9f232e884dd37
51a0d395651bfc2cca9ec1d02776d60b13b45022
refs/heads/master
2023-03-10T21:58:56.349906
2021-02-25T08:12:00
2021-02-25T08:12:00
341,826,721
0
0
null
null
null
null
UTF-8
Java
false
false
112
java
package planRoute; public interface PlanRoute { public void BuiltRoute(String a, String b) ; }
[ "576341@student.belgiumcampus.ac.za" ]
576341@student.belgiumcampus.ac.za
43f29f40c5e09ae4befafa7b3e41b97dd2b1cbe9
0b37c181c758c85a4d27baff1ed06ee4365d8599
/gradle-demo/src/test/java/kangwoojin/github/io/gradledemo/GradleDemoApplicationTests.java
11e235ade6b47ed39e9428ec0164a68edd394eea
[]
no_license
KangWooJin/spring-study
27a9a80b9b999be8235943724a77a78f0956f2b5
431530034bca13116f259e334b403fbfde1b03af
refs/heads/master
2023-05-11T03:31:11.822261
2020-10-18T10:47:47
2020-10-18T10:47:47
245,826,249
11
1
null
2023-05-08T06:22:03
2020-03-08T14:09:31
Java
UTF-8
Java
false
false
236
java
package kangwoojin.github.io.gradledemo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class GradleDemoApplicationTests { @Test void contextLoads() { } }
[ "woojin.kang@linecorp.com" ]
woojin.kang@linecorp.com
69d8518b8cd6fcb5127bc3c583704c2ee30b7c16
d653029a119100465a908e663bf795c4dedfe43a
/src/main/java/com/common/system/sys/entity/RcRoleWrapper.java
3108b3516024ad829901ad4f809223b5b888c82d
[]
no_license
MengleiZhao/bg_perfm-main
d59740a42995e3b39c5ddbd0df710d87798f3e80
38751d15947984159da0069b54c8db547c55bbb3
refs/heads/master
2023-05-01T01:54:00.791997
2021-05-08T05:51:39
2021-05-08T05:51:39
365,401,842
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package com.common.system.sys.entity; /** * Created by Mr.Yangxiufeng on 2017/9/11. * Time:21:48 * ProjectName:bg_perfm */ public class RcRoleWrapper extends RcRole { private boolean checked; public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; } }
[ "649387483@qq.com" ]
649387483@qq.com
f7a755fc35eef26af7c5a6d67810cf9587112e1f
881ec42c677f2d954fdc2317ad582c88fb87c752
/stsworkspace/EqualsAndHashcode/src/com/skilldistillery/equalsandhashcode/solutions/Triangle2.java
75732b699f2dbe14fbad08b8f36da9b86f167dfc
[]
no_license
stoprefresh/archive
f51119220fbcb4bccc82306c0483903502f1859e
0bde3917fb9cb7e002d3abb18088fee9df4371ec
refs/heads/master
2022-12-21T20:33:08.251833
2019-10-17T14:13:10
2019-10-17T14:13:10
215,808,299
0
0
null
2022-12-16T09:52:36
2019-10-17T14:08:48
Java
UTF-8
Java
false
false
1,146
java
package com.skilldistillery.equalsandhashcode.solutions; public class Triangle2 { private int base; private int height; public Triangle2(int b, int h) { this.base = b; this.height = h; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + base; result = prime * result + height; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Triangle2 other = (Triangle2) obj; if (base != other.base) return false; if (height != other.height) return false; return true; } // public boolean equals(Object obj) { // if (obj == this) { // return true; // } // if (obj == null) { // return false; // } // if (obj.getClass() != this.getClass()) { // return false; // } // Triangle2 other = (Triangle2) obj; // if (other.base == this.base // && other.height == this.height) { // return true; // } // return false; // } }
[ "marsigliamiguel@protonmail.com" ]
marsigliamiguel@protonmail.com
ce33580d09e8ee52baf25c4e14198cd3c7941a03
c10f0d4e55f1e9b7e30dd439f58e3d89308d60e0
/app/src/main/java/br/edu/unoesc/pdm/offtrail/ui/PrincipalActivity.java
0675e736ec66655f76a8e5c6279d82a6007b0c9d
[]
no_license
MatheusEH/FitnessHealthy
06c773792139d167cac009689014a1519c94061b
91b18ca704d9eb0f267c47133af4ce189c78700f
refs/heads/master
2020-04-08T13:38:09.915168
2018-11-27T21:14:07
2018-11-27T21:14:07
159,399,518
1
0
null
null
null
null
UTF-8
Java
false
false
1,700
java
package br.edu.unoesc.pdm.offtrail.ui; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.widget.Toast; import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.Bean; import org.androidannotations.annotations.Click; import org.androidannotations.annotations.EActivity; import br.edu.unoesc.pdm.offtrail.R; import br.edu.unoesc.pdm.offtrail.dao.DatabaseHelper; import br.edu.unoesc.pdm.offtrail.model.Usuario; @EActivity(R.layout.activity_principal) public class PrincipalActivity extends AppCompatActivity { @Bean DatabaseHelper dh; //login @AfterViews public void inicilaizar(){ Usuario u = (Usuario)getIntent().getSerializableExtra("usuario"); Toast.makeText(this, "Seja bem-vindo " + u.getLogin(),Toast.LENGTH_LONG).show(); } //tela sobre o app - fh @Click(R.id.btnSobre) public void sobre(){ Intent itSobre = new Intent(this, SobreActivity_.class); startActivity(itSobre); } ///botoes de tipo de exercicio //tipo1 @Click(R.id.btnEx1) public void Ex1(){ Intent itExercicio1 = new Intent(this, Ex1Activity_.class); startActivity(itExercicio1); } //tipo2 @Click(R.id.btnEx2) public void Ex2(){ Intent itExercicio2 = new Intent(this, Ex2Activity_.class); startActivity(itExercicio2); } //tipo3 @Click(R.id.btnEx3) public void Ex3(){ Intent itExercicio3 = new Intent(this, Ex3Activity_.class); startActivity(itExercicio3); } //sair @Click(R.id.btnSair) public void sair(){ finish(); System.exit(0); } }
[ "matheusendler@hotmail.com" ]
matheusendler@hotmail.com
5651ae052d7cf9e0afc6cb85f2c3c118220c5799
90a1b9d09b13a2437b902e5284e088cfc2e0ba6f
/src/main/java/org/sagebionetworks/web/client/widget/table/v2/results/cell/UserIdListRendererCellViewImpl.java
d56e06bb2bef8665c7e68389b31c8cf73df575e1
[ "Apache-2.0" ]
permissive
emmanmills/SynapseWebClient
d4c9d01e2e266c7104cdc3968a773a1756cd900a
90a07b7a34807b7f5fe2fa597bc7dc84910406a3
refs/heads/develop
2023-07-04T16:03:17.917555
2021-08-16T22:22:24
2021-08-16T22:22:24
335,755,204
0
0
Apache-2.0
2023-09-14T18:02:33
2021-02-03T21:06:39
JavaScript
UTF-8
Java
false
false
1,821
java
package org.sagebionetworks.web.client.widget.table.v2.results.cell; import org.gwtbootstrap3.client.ui.html.Div; import org.gwtbootstrap3.client.ui.html.Text; import org.sagebionetworks.schema.adapter.JSONArrayAdapter; import org.sagebionetworks.schema.adapter.JSONObjectAdapter; import org.sagebionetworks.web.client.PortalGinInjector; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Inject; /** * A non editable renderer for a list of user IDs * */ public class UserIdListRendererCellViewImpl implements UserIdListRendererCellView { String v; JSONObjectAdapter adapter; PortalGinInjector ginInjector; Div div = new Div(); @Inject public UserIdListRendererCellViewImpl(JSONObjectAdapter adapter, PortalGinInjector ginInjector) { super(); this.adapter = adapter; this.ginInjector = ginInjector; div.addStyleName("whitespace-nowrap"); div.addAttachHandler(event -> { if (event.isAttached()) { // div has been attached. add the "truncate" style to it's parent (td) div.getParent().addStyleName("truncate"); }; }); } @Override public void setValue(String jsonValue) { this.v = jsonValue; // try to parse out json values div.clear(); if (v != null) { try { JSONArrayAdapter parsedJson = adapter.createNewArray(jsonValue); int arrayLength = parsedJson.length(); for (int i = 0; i < arrayLength; i++) { String userId = parsedJson.get(i).toString(); UserIdCellRenderer renderer = ginInjector.getUserIdCellRenderer(); renderer.setValue(userId); div.add(renderer); } } catch (Exception e) { div.add(new Text(jsonValue)); } } } @Override public Widget asWidget() { return div; } @Override public String getValue() { return v; } }
[ "jay.hodgson@sagebionetworks.org" ]
jay.hodgson@sagebionetworks.org
4782295ecd7bfbc45961067341994e7cf98648e7
5d971249538379ae1c10210856e532b0b10c3bfb
/src/environment/Environment.java
a389a6bb88dc2e1b71efa104eb4ce172c9da5371
[]
no_license
ujansengupta/GameDecisionMaking
792d7c58820f7b30a41f9f946410c65b845df68c
fadf21f53c020e5d09fdc31aeaa16d919c62d5cd
refs/heads/master
2021-01-19T19:50:51.753430
2017-04-27T05:05:22
2017-04-27T05:05:22
88,452,251
0
1
null
null
null
null
UTF-8
Java
false
false
3,102
java
package environment; import processing.core.PApplet; import processing.core.PConstants; import processing.core.PVector; import utility.GameConstants; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; /** * Created by ujansengupta on 3/31/17. */ public class Environment { private static PApplet app; public static List<Obstacle> obstacles; public static Set<Integer> invalidNodes; public static PVector tileSize; public static PVector numTiles; public PVector centerColor = new PVector(255, 0, 0); public static Graph gameGraph; public Environment(PApplet app) { this.app = app; tileSize = GameConstants.TILE_SIZE; numTiles = GameConstants.NUM_TILES; invalidNodes = new HashSet<>(); obstacles = new ArrayList<>(); createObstacles(); gameGraph = new Graph(); gameGraph.buildGraph(invalidNodes); } public void update() { //drawGraph(); //drawInvalidNodes(); drawObstacles(); } /* Getters and Setters */ public Set<Integer> getInvlaidNodes() { return invalidNodes; } public List<Obstacle> getObstacles() { return obstacles; } public Graph getGameGraph() { return gameGraph; } /* Helper methods */ public void drawGraph() { app.rectMode(PConstants.CORNER); for (int i = 0; i < numTiles.y; i++) { for (int j = 0; j < numTiles.x; j++) { app.noFill(); app.rect(j * tileSize.x, i * tileSize.y, tileSize.x, tileSize.y); } } app.rectMode(PConstants.CENTER); } private void createObstacles() { /* Clockwise from left */ /* Outer layer */ obstacles.add(new Obstacle(app, new PVector(0.5f * numTiles.x, 0.2f * numTiles.y), new PVector(15, 5))); //top obstacles.add(new Obstacle(app, new PVector(0.2f * numTiles.x, 0.5f * numTiles.y), new PVector(5, 17))); //left obstacles.add(new Obstacle(app, new PVector(0.8f * numTiles.x, 0.5f * numTiles.y), new PVector(5, 17))); //right obstacles.add(new Obstacle(app, new PVector(0.5f * numTiles.x, 0.8f * numTiles.y), new PVector(15, 5))); //bot /* Tooth nodes are not considered invalid */ for (Obstacle obstacle : obstacles) invalidNodes.addAll(obstacle.getTileIndices()); } private void drawObstacles() { obstacles.forEach(Obstacle::draw); } private void drawInvalidNodes() { for (int i : invalidNodes) colorNode(i, new PVector(255, 0, 0), 255); } public static void colorNode(int index, PVector color, float alpha) { app.rectMode(PConstants.CORNER); app.fill(color.x, color.y, color.z, alpha); app.rect((index % numTiles.x) * tileSize.x, (float)Math.floor(index / numTiles.y) * tileSize.y, tileSize.x, tileSize.y); app.noFill(); app.rectMode(PConstants.CENTER); } }
[ "usengup@ncsu.edu" ]
usengup@ncsu.edu
9c76cb4a1a481499f4211d4b674b8e8f42460374
bdb2dacb7d7fdcb019cdf4efe43847d9dc537c75
/src/AmazonDynamoDBSample.java
3062f1df6468ca5fe6109d4216ce0efd6bd4aa68
[]
no_license
davidbuick/ElasticSearch
95811a0f7d2995132a4b06fc7c15a6aee958ade0
b406a9abd9d7d534144f21ffc51f803f8b01a37f
refs/heads/master
2021-01-10T21:17:59.618807
2014-07-07T23:42:20
2014-07-07T23:42:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,325
java
/* * Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ import java.util.HashMap; import java.util.Map; import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.regions.Region; import com.amazonaws.regions.Regions; import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient; import com.amazonaws.services.dynamodbv2.model.AttributeDefinition; import com.amazonaws.services.dynamodbv2.model.AttributeValue; import com.amazonaws.services.dynamodbv2.model.ComparisonOperator; import com.amazonaws.services.dynamodbv2.model.Condition; import com.amazonaws.services.dynamodbv2.model.CreateTableRequest; import com.amazonaws.services.dynamodbv2.model.DescribeTableRequest; import com.amazonaws.services.dynamodbv2.model.KeySchemaElement; import com.amazonaws.services.dynamodbv2.model.KeyType; import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput; import com.amazonaws.services.dynamodbv2.model.PutItemRequest; import com.amazonaws.services.dynamodbv2.model.PutItemResult; import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType; import com.amazonaws.services.dynamodbv2.model.ScanRequest; import com.amazonaws.services.dynamodbv2.model.ScanResult; import com.amazonaws.services.dynamodbv2.model.TableDescription; import com.amazonaws.services.dynamodbv2.util.Tables; /** * This sample demonstrates how to perform a few simple operations with the * Amazon DynamoDB service. */ public class AmazonDynamoDBSample { /* * WANRNING: * To avoid accidental leakage of your credentials, DO NOT keep * the credentials file in your source directory. */ static AmazonDynamoDBClient dynamoDB; /** * The only information needed to create a client are security credentials * consisting of the AWS Access Key ID and Secret Access Key. All other * configuration, such as the service endpoints, are performed * automatically. Client parameters, such as proxies, can be specified in an * optional ClientConfiguration object when constructing a client. * * @see com.amazonaws.auth.BasicAWSCredentials * @see com.amazonaws.auth.ProfilesConfigFile * @see com.amazonaws.ClientConfiguration */ private static void init() throws Exception { /* * The ProfileCredentialsProvider will return your [default] * credential profile by reading from the credentials file located at * (/home/local/ANT/waha/.aws/credentials). */ AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider("default").getCredentials(); } catch (Exception e) { throw new AmazonClientException( "Cannot load the credentials from the credential profiles file. " + "Please make sure that your credentials file is at the correct " + "location (/home/local/ANT/waha/.aws/credentials), and is in valid format.", e); } dynamoDB = new AmazonDynamoDBClient(credentials); Region usEast1 = Region.getRegion(Regions.US_EAST_1); dynamoDB.setRegion(usEast1); } public static void main(String[] args) throws Exception { init(); try { String tableName = "my-favorite-movies-table"; // Create table if it does not exist yet if (Tables.doesTableExist(dynamoDB, tableName)) { System.out.println("Table " + tableName + " is already ACTIVE"); } else { // Create a table with a primary hash key named 'name', which holds a string CreateTableRequest createTableRequest = new CreateTableRequest().withTableName(tableName) .withKeySchema(new KeySchemaElement().withAttributeName("name").withKeyType(KeyType.HASH)) .withAttributeDefinitions(new AttributeDefinition().withAttributeName("name").withAttributeType(ScalarAttributeType.S)) .withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(1L).withWriteCapacityUnits(1L)); TableDescription createdTableDescription = dynamoDB.createTable(createTableRequest).getTableDescription(); System.out.println("Created Table: " + createdTableDescription); // Wait for it to become active System.out.println("Waiting for " + tableName + " to become ACTIVE..."); Tables.waitForTableToBecomeActive(dynamoDB, tableName); } // Describe our new table DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName); TableDescription tableDescription = dynamoDB.describeTable(describeTableRequest).getTable(); System.out.println("Table Description: " + tableDescription); // Add an item Map<String, AttributeValue> item = newItem("Bill & Ted's Excellent Adventure", 1989, "****", "James", "Sara"); PutItemRequest putItemRequest = new PutItemRequest(tableName, item); PutItemResult putItemResult = dynamoDB.putItem(putItemRequest); System.out.println("Result: " + putItemResult); // Add another item item = newItem("Airplane", 1980, "*****", "James", "Billy Bob"); putItemRequest = new PutItemRequest(tableName, item); putItemResult = dynamoDB.putItem(putItemRequest); System.out.println("Result: " + putItemResult); // Scan items for movies with a year attribute greater than 1985 HashMap<String, Condition> scanFilter = new HashMap<String, Condition>(); Condition condition = new Condition() .withComparisonOperator(ComparisonOperator.GT.toString()) .withAttributeValueList(new AttributeValue().withN("1985")); scanFilter.put("year", condition); ScanRequest scanRequest = new ScanRequest(tableName).withScanFilter(scanFilter); ScanResult scanResult = dynamoDB.scan(scanRequest); System.out.println("Result: " + scanResult); } catch (AmazonServiceException ase) { System.out.println("Caught an AmazonServiceException, which means your request made it " + "to AWS, but was rejected with an error response for some reason."); System.out.println("Error Message: " + ase.getMessage()); System.out.println("HTTP Status Code: " + ase.getStatusCode()); System.out.println("AWS Error Code: " + ase.getErrorCode()); System.out.println("Error Type: " + ase.getErrorType()); System.out.println("Request ID: " + ase.getRequestId()); } catch (AmazonClientException ace) { System.out.println("Caught an AmazonClientException, which means the client encountered " + "a serious internal problem while trying to communicate with AWS, " + "such as not being able to access the network."); System.out.println("Error Message: " + ace.getMessage()); } } private static Map<String, AttributeValue> newItem(String name, int year, String rating, String... fans) { Map<String, AttributeValue> item = new HashMap<String, AttributeValue>(); item.put("name", new AttributeValue(name)); item.put("year", new AttributeValue().withN(Integer.toString(year))); item.put("rating", new AttributeValue(rating)); item.put("fans", new AttributeValue().withSS(fans)); return item; } }
[ "waha@uf8b156e1b8ac5363d819.ant.amazon.com" ]
waha@uf8b156e1b8ac5363d819.ant.amazon.com
5e1837946b864cdb89889c36fbafa933a476f910
1d4848e01214150cbe956f23759800599629246b
/Homework/src/HomeworkFirstBook/Homework17_33/Homework29/Homework29.java
3537b689d8bc83fff58d8f527b1a6a50f99788cb
[]
no_license
AleksLaw/PVThomework_Aleksandr.law-gmail.com
d9fce5eb8eebe0a112b97029036d73a05c3bbf53
80a20afc47d9d3063fb07286029828f4feae8eaa
refs/heads/master
2020-05-17T09:00:28.328752
2019-06-05T11:29:32
2019-06-05T11:29:32
183,621,007
0
0
null
null
null
null
UTF-8
Java
false
false
1,971
java
package HomeworkFirstBook.Homework17_33.Homework29; //Задание имеется текст Составить частотный словарь import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class Homework29 { public static void main(String[] args) { char[] znak = {'.', ',', ':', ';', '?', '!', '(', ')', '-', '«', '»'}; String sad = "раз два раз два раз два раз два 1 1 1 1 2 2 3 3 3 4 4 4 4 , , , раз "; String s = sad.toLowerCase(); char[] text = s.toCharArray(); for (int i = 0; i < text.length; i++) { for (int j = 0; j < znak.length; j++) { if (text[i] == znak[j]) { text[i] = ' '; } } } String b = new String(text); while (b.contains(" ")) { //замена 2 пробела на 1 String e = b.replace(" ", " "); b = e; } String w = b.trim(); //первый и последний пробел List listStart = new ArrayList(); Set setDifferentWord = new HashSet(); List listFinish = new ArrayList(); String[] words = w.split("\\s"); // Разбиение строки на слова с помощью разграничителя (пробел) // Вывод на экран for (int i = 0; i < words.length; i++) { listStart.add(words[i]); } setDifferentWord.addAll(listStart); listFinish.addAll(setDifferentWord); int count = 0; for (int i = 0; i < listFinish.size(); i++) { for (int j = 0; j < listStart.size(); j++) { if (listFinish.get(i).equals(listStart.get(j))) { count++; } } System.out.println(listFinish.get(i) + " " + count); count = 0; } } }
[ "aleksandr.law@gmail.com" ]
aleksandr.law@gmail.com
3ca0f0a5e7e75a0e7ece15a74e4a639872eb10a8
497a67892554c631b76f671463cdbe145dcfe44a
/FlightReservationSystem/FlightReservationSystemLibrary/src/util/exception/FlightNumberDisabledException.java
365277be8aa51165d03f6fc4ea2534810f2bcd4c
[]
no_license
jinghaoong/IS2103-Pair-Project
15f9a7154a464b2b23d8997819d55e472296bea2
3ca1ef9bca7e90fd6380d3ff1a652032281b8107
refs/heads/master
2023-01-10T11:38:06.383391
2020-11-15T15:39:51
2020-11-15T15:39:51
307,594,031
0
0
null
null
null
null
UTF-8
Java
false
false
735
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 util.exception; /** * * @author jinghao */ public class FlightNumberDisabledException extends Exception { /** * Creates a new instance of <code>FlightNumberExistException</code> without * detail message. */ public FlightNumberDisabledException() { } /** * Constructs an instance of <code>FlightNumberExistException</code> with * the specified detail message. * * @param msg the detail message. */ public FlightNumberDisabledException(String msg) { super(msg); } }
[ "jinghaoong@gmail.com" ]
jinghaoong@gmail.com
465a8562e25612d46e8658da38766db717db393f
bcd086dfcfdf39062a852f13f165a27cba0e122e
/src/main/java/com/bishe/model/SalaryDetail.java
43da89f0ae8c2e09eb54bbe73ac5de6755eaed7f
[]
no_license
ttxxss99/bishe
0c3d9ae0c1e6e01c692e9d9eb6c126d03dd24788
2da3d2591b4adbd41dc64453fb587905612d3ab7
refs/heads/master
2023-01-13T06:41:36.947412
2020-05-22T06:46:17
2020-05-22T06:46:17
227,988,907
0
0
null
2023-01-05T11:09:35
2019-12-14T08:15:55
Vue
UTF-8
Java
false
false
1,306
java
package com.bishe.model; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; public class SalaryDetail extends Employee { private Integer id; private Integer eId; private double day; private Integer pId; @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date time; private Integer fine; private Integer logicDel; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer geteId() { return eId; } public void seteId(Integer eId) { this.eId = eId; } public double getDay() { return day; } public void setDay(double day) { this.day = day; } public Integer getpId() { return pId; } public void setpId(Integer pId) { this.pId = pId; } public Date getTime() { return time; } public void setTime(Date time) { this.time = time; } public Integer getFine() { return fine; } public void setFine(Integer fine) { this.fine = fine; } public Integer getLogicDel() { return logicDel; } public void setLogicDel(Integer logicDel) { this.logicDel = logicDel; } }
[ "tangxinsong@hulai" ]
tangxinsong@hulai
f156b1660d206f02a286c80f64d0ec0748e5cd28
103f290ff1387c9649273ab3974702cdffa4cf42
/src/main/java/com/inventory/controller/MakerController.java
d11cea6b129ffb74a21e2259a2830e074c936647
[]
no_license
Arya18/Imgmt
33c8215a29d54cfffc835143b439d23b45c873ab
6406dacdb4db0511cba35fa3c87dc10659275371
refs/heads/master
2021-01-11T04:34:56.434706
2017-02-11T04:06:29
2017-02-11T04:06:29
71,160,334
0
0
null
null
null
null
UTF-8
Java
false
false
12,771
java
package com.inventory.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.inventory.DTO.AdminDTO; import com.inventory.DTO.PurchaseInvoiceDTO; import com.inventory.model.Maker; import com.inventory.model.Product; import com.inventory.model.PurchaseInvoice; import com.inventory.model.Supplier; import com.inventory.services.MakerServices; import com.inventory.services.ProductServices; import com.inventory.services.PurchaseInvoiceServices; import com.inventory.services.SupplierServices; import flexjson.JSONSerializer; @Controller @RequestMapping("/maker") @JsonIgnoreProperties(ignoreUnknown = true) public class MakerController { @Autowired MakerServices makerServices; @Autowired ProductServices productServices; @Autowired SupplierServices supplierServices; @Autowired PurchaseInvoiceServices purchaseInvoiceServices; public static HashMap<String, String> makerMap = new HashMap<String, String>(); @RequestMapping(value = "/login/", method = RequestMethod.POST, headers = "content-type=application/json") public @ResponseBody void login(@RequestBody AdminDTO user,HttpServletRequest request,HttpServletResponse response) throws Exception { Map<String,Object> obj = new HashMap<String,Object>(); String sessionId = null; if(makerServices.login(user)) { HttpSession sessionn = request.getSession(); sessionId = sessionn.getId(); makerMap.put(sessionId, sessionId); Maker checker1 = makerServices.getMakerByUsername(user.getUsername()); String strI = Long.toString((checker1.getId())); String makerId = "makerId"+sessionId; makerMap.put(makerId,strI); obj.put("sessionId", sessionId); obj.put("login", "successful"); } else { obj.put("login", "unsuccessful"); } response.setContentType("application/json; charset=UTF-8"); response.getWriter().print(new JSONSerializer().exclude("class","*.class","authorities").deepSerialize(obj)); } @RequestMapping(value = "/logout/", method = RequestMethod.POST, headers = "content-type=application/json") public @ResponseBody void logout(@RequestBody AdminDTO adminDTO,HttpServletRequest request,HttpServletResponse response) throws Exception { MakerController mc = new MakerController(); HashMap<String, String> user = mc.getMakerMap(); Object key = user.get(adminDTO.getSessionId()); Map<String,Object> obj = new HashMap<String,Object>(); if(key != null){ user.remove(adminDTO.getSessionId()); user.remove("makerId"+adminDTO.getSessionId()); obj.put("logout", "successful"); }else{ obj.put("logout", "unsuccessful"); } response.setContentType("application/json; charset=UTF-8"); response.getWriter().print(new JSONSerializer().exclude("class","*.class","authorities").deepSerialize(obj)); } /*@RequestMapping(value = "/createPurchaseInvoice/", method = RequestMethod.POST, headers = "content-type=application/json") public @ResponseBody void createPurchaseInvoice(@RequestBody PurchaseInvoiceDTO purchaseInvoiceDTO,HttpServletRequest request,HttpServletResponse response) throws Exception { Map<String,Object> obj = new HashMap<String,Object>(); MakerController mc = new MakerController(); HashMap<String, String> user = mc.getMakerMap(); Object key = user.get(purchaseInvoiceDTO.getSessionId()); if(key != null){ Object keyId = user.get("makerId"+purchaseInvoiceDTO.getSessionId()); long checkerId = Long.parseLong(keyId.toString()); Maker maker = makerServices.getMakerById(checkerId); if(maker != null){ Product product = productServices.getProductById(purchaseInvoiceDTO.getProductId()); if(product != null){ Supplier supplier = supplierServices.getSupplierById(purchaseInvoiceDTO.getSupplierId()); if(supplier!=null){ PurchaseInvoice purchaseInvoice = new PurchaseInvoice(purchaseInvoiceDTO); purchaseInvoice.setProduct(product); purchaseInvoice.setSupplier(supplier); //calculate discounted price on one unit double discountRate = product.getDiscountRate(); double unitRate = purchaseInvoiceDTO.getUnitPrice(); double discountedPrice = (discountRate/100)*unitRate; //calculate total discounted price double totalDiscountedPrice = discountedPrice * purchaseInvoiceDTO.getQuantity(); //calculate final payble amount double finalAmount = (purchaseInvoiceDTO.getQuantity()*purchaseInvoiceDTO.getUnitPrice()) - totalDiscountedPrice; purchaseInvoice.setDiscountAmount(totalDiscountedPrice); purchaseInvoice.setFinalAmount(finalAmount); purchaseInvoice.setMaker(maker); if(purchaseInvoiceServices.addOrUpdatePurchaseInvoice(purchaseInvoice)){ obj.put("purchaseInvoice", "added"); }else{ obj.put("purchaseInvoice", "not added"); } }else{ obj.put("purchaseInvoice", "not added"); obj.put("reason", "supplier is not present"); } }else{ obj.put("purchaseInvoice", "not added"); obj.put("reason", "product is not present"); } }else{ obj.put("purchaseInvoice", "not added"); obj.put("reason", "maker is not present"); } } response.setContentType("application/json; charset=UTF-8"); response.getWriter().print(new JSONSerializer().exclude("class","*.class","authorities").deepSerialize(obj)); }*/ //update purchase Invoice by Maker only checker dosen't verify it. /*@RequestMapping(value = "/updatePurchaseInvoice/", method = RequestMethod.POST, headers = "content-type=application/json") public @ResponseBody void updatePurchaseInvoice(@RequestBody PurchaseInvoiceDTO purchaseInvoiceDTO,HttpServletRequest request,HttpServletResponse response) throws Exception { Map<String,Object> obj = new HashMap<String,Object>(); MakerController mc = new MakerController(); HashMap<String, String> user = mc.getMakerMap(); Object key = user.get(purchaseInvoiceDTO.getSessionId()); if(key != null){ Object keyId = user.get("makerId"+purchaseInvoiceDTO.getSessionId()); long checkerId = Long.parseLong(keyId.toString()); Maker maker = makerServices.getMakerById(checkerId); if(maker != null){ PurchaseInvoice oldPurchaseInvoice = purchaseInvoiceServices.getPurchaseInvoiceById(purchaseInvoiceDTO.getInvoiceNo()); if(oldPurchaseInvoice != null){ if(oldPurchaseInvoice.isVerify()){ obj.put("purchaseInvoice", "not updated"); obj.put("reason", "purchase invoice verified by checker"); }else{ Product product = productServices.getProductById(purchaseInvoiceDTO.getProductId()); if(product != null){ Supplier supplier = supplierServices.getSupplierById(purchaseInvoiceDTO.getSupplierId()); if(supplier!=null){ //PurchaseInvoice purchaseInvoice = new PurchaseInvoice(purchaseInvoiceDTO); oldPurchaseInvoice.setProduct(product); oldPurchaseInvoice.setSupplier(supplier); //calculate discounted price on one unit double discountRate = product.getDiscountRate(); double unitRate = purchaseInvoiceDTO.getUnitPrice(); double discountedPrice = (discountRate/100)*unitRate; //calculate total discounted price double totalDiscountedPrice = discountedPrice * purchaseInvoiceDTO.getQuantity(); //calculate final payble amount double finalAmount = (purchaseInvoiceDTO.getQuantity()*purchaseInvoiceDTO.getUnitPrice()) - totalDiscountedPrice; oldPurchaseInvoice.setUnitPrice(purchaseInvoiceDTO.getUnitPrice()); oldPurchaseInvoice.setQuantity(purchaseInvoiceDTO.getQuantity()); oldPurchaseInvoice.setDiscountAmount(totalDiscountedPrice); oldPurchaseInvoice.setFinalAmount(finalAmount); if(purchaseInvoiceServices.addOrUpdatePurchaseInvoice(oldPurchaseInvoice)){ obj.put("purchaseInvoice", "updated"); }else{ obj.put("purchaseInvoice", "not updated"); } }else{ obj.put("purchaseInvoice", "not updated"); obj.put("reason", "supplier is not present"); } } else{ obj.put("purchaseInvoice", "not updated"); obj.put("reason", "product is not present"); } } }else{ obj.put("purchaseInvoice", "not updated"); obj.put("reason", "purchaseInvoice is not present"); } }else{ obj.put("purchaseInvoice", "not updated"); obj.put("reason", "maker is not present"); } } response.setContentType("application/json; charset=UTF-8"); response.getWriter().print(new JSONSerializer().exclude("class","*.class","authorities").deepSerialize(obj)); }*/ /* @RequestMapping(value = "/deletePurchaseInvoice/", method = RequestMethod.POST, headers = "content-type=application/json") public @ResponseBody void deletePurchaseInvoice(@RequestBody PurchaseInvoiceDTO purchaseInvoiceDTO,HttpServletRequest request,HttpServletResponse response) throws Exception { Map<String,Object> obj = new HashMap<String,Object>(); MakerController mc = new MakerController(); HashMap<String, String> user = mc.getMakerMap(); Object key = user.get(purchaseInvoiceDTO.getSessionId()); if(key != null){ Object keyId = user.get("makerId"+purchaseInvoiceDTO.getSessionId()); long checkerId = Long.parseLong(keyId.toString()); Maker maker = makerServices.getMakerById(checkerId); if(maker != null){ PurchaseInvoice oldPurchaseInvoice = purchaseInvoiceServices.getPurchaseInvoiceById(purchaseInvoiceDTO.getInvoiceNo()); if(oldPurchaseInvoice != null){ if(oldPurchaseInvoice.isVerify()){ obj.put("purchaseInvoice", "not deleted"); obj.put("reason", "purchase invoice verified by checker"); }else{ if(purchaseInvoiceServices.deletePurchaseInvoice(purchaseInvoiceDTO.getInvoiceNo())){ obj.put("purchaseInvoice", "deleted"); }else{ obj.put("purchaseInvoice", "fail"); obj.put("reason", "not present"); } } } } response.setContentType("application/json; charset=UTF-8"); response.getWriter().print(new JSONSerializer().exclude("class","*.class","authorities").deepSerialize(obj)); } }*/ /*@RequestMapping(value = "/listPurchaseInvoice/", method = RequestMethod.POST, headers = "content-type=application/json") public @ResponseBody void listPurchaseInvoice(@RequestBody PurchaseInvoiceDTO purchaseInvoiceDTO,HttpServletRequest request,HttpServletResponse response) throws Exception { MakerController mc = new MakerController(); HashMap<String, String> user = mc.getMakerMap(); Object key = user.get(purchaseInvoiceDTO.getSessionId()); if(key != null){ Object keyId = user.get("makerId"+purchaseInvoiceDTO.getSessionId()); long checkerId = Long.parseLong(keyId.toString()); Maker maker = makerServices.getMakerById(checkerId); if(maker != null){ List<PurchaseInvoice> customerList = purchaseInvoiceServices.getPurchaseList(); List<Maker> makerList = makerServices.makerList(maker.getAdmin().getId()); List<Map<String,Object>> list = new ArrayList<Map<String,Object>>(); for (PurchaseInvoice pi : customerList) { for (Maker m : makerList) { if(m.getId() == pi.getMaker().getId()){ Map<String,Object> obj = new HashMap<String,Object>(); obj.put("invoiceNo", pi.getInvoiceNo()); obj.put("invoiceDate", pi.getInoviceDate()); obj.put("productBrand", pi.getProduct().getBrand()); obj.put("modelNo", pi.getProduct().getModelNumber()); obj.put("quantity", pi.getQuantity()); obj.put("unitPrice", pi.getUnitPrice()); obj.put("discount", pi.getProduct().getDiscountRate()); obj.put("discountAmount", pi.getDiscountAmount()); obj.put("finalAmount", pi.getFinalAmount()); list.add(obj); } } } response.setContentType("application/json; charset=UTF-8"); response.getWriter().print(new JSONSerializer().exclude("class","*.class","authorities").deepSerialize(list)); } } }*/ public HashMap<String, String> getMakerMap() { return makerMap; } }
[ "aryanpra16dec@gmail.com" ]
aryanpra16dec@gmail.com
9a7903903cad2242ffe0f9bcef54b0b4a6eed24b
23b6d6971a66cf057d1846e3b9523f2ad4e05f61
/MLMN-Statistics/src/vn/com/vhc/vmsc2/statistics/dao/MnHBscHoQosDAO.java
e38e0059432a080efd1da8e01b2549ce2044a60a
[]
no_license
vhctrungnq/mlmn
943f5a44f24625cfac0edc06a0d1b114f808dfb8
d3ba1f6eebe2e38cdc8053f470f0b99931085629
refs/heads/master
2020-03-22T13:48:30.767393
2018-07-08T05:14:12
2018-07-08T05:14:12
140,132,808
0
1
null
2018-07-08T05:29:27
2018-07-08T02:57:06
Java
UTF-8
Java
false
false
1,746
java
package vn.com.vhc.vmsc2.statistics.dao; import vn.com.vhc.vmsc2.statistics.domain.MnHBscHoQos; public interface MnHBscHoQosDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MN_H_BSC_HO_QOS * * @ibatorgenerated Wed Nov 10 10:03:01 ICT 2010 */ int deleteByPrimaryKey(String bscid, Integer month, Integer year); /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MN_H_BSC_HO_QOS * * @ibatorgenerated Wed Nov 10 10:03:01 ICT 2010 */ void insert(MnHBscHoQos record); /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MN_H_BSC_HO_QOS * * @ibatorgenerated Wed Nov 10 10:03:01 ICT 2010 */ void insertSelective(MnHBscHoQos record); /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MN_H_BSC_HO_QOS * * @ibatorgenerated Wed Nov 10 10:03:01 ICT 2010 */ MnHBscHoQos selectByPrimaryKey(String bscid, Integer month, Integer year); /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MN_H_BSC_HO_QOS * * @ibatorgenerated Wed Nov 10 10:03:01 ICT 2010 */ int updateByPrimaryKeySelective(MnHBscHoQos record); /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MN_H_BSC_HO_QOS * * @ibatorgenerated Wed Nov 10 10:03:01 ICT 2010 */ int updateByPrimaryKey(MnHBscHoQos record); }
[ "trungnq@vhc.com.vn" ]
trungnq@vhc.com.vn
a94e89f9c11052511bbf48c1582a79a4dd05744f
2d7136c8984fbcae92217d8607a981ff97170e19
/src/answer/MaximumGap.java
4bc174e54c915006a44c6296317fbd2669fc77f7
[]
no_license
qunnn41/leetcode
f1f8dc8812a7ad3b4018b2b11ffa0923bf70b4b4
70c3919a05acd1bad52720fe1aac9ffeb316eee0
refs/heads/master
2021-01-19T03:13:34.145886
2016-10-13T11:17:11
2016-10-13T11:17:11
35,317,124
0
0
null
null
null
null
UTF-8
Java
false
false
1,507
java
package answer; import java.util.Arrays; public class MaximumGap { /** * https://leetcode.com/problems/maximum-gap/ */ public int maximumGap(int[] nums) { if (nums.length < 2) return 0; int max = nums[0]; int min = nums[0]; //get the min and max for (int n : nums) { max = Math.max(max, n); min = Math.min(min, n); } //the minimum possible gap, ceiling of the integer division int gap = (int) Math.ceil((double)(max - min) / (nums.length - 1)); //n - 2 numbers which is not equal to min and max, n - 1 bucket //at least one bucket is empty int[] bucketMin = new int[nums.length - 1]; int[] bucketMax = new int[nums.length - 1]; Arrays.fill(bucketMin, Integer.MAX_VALUE); Arrays.fill(bucketMax, Integer.MIN_VALUE); //put numbers into buckets for (int i : nums) { if (i == min || i == max) { continue; } int index = (i - min) / gap; bucketMin[index] = Math.min(i, bucketMin[index]); bucketMax[index] = Math.max(i, bucketMax[index]); } //scan the buckets for the max gap int maxGap = Integer.MIN_VALUE; int previous = min; for (int i = 0; i < nums.length - 1; ++i) { if (bucketMin[i] == Integer.MAX_VALUE && bucketMax[i] == Integer.MIN_VALUE) { //empty continue; } maxGap = Math.max(maxGap, bucketMin[i] - previous); //update previous bucket value previous = bucketMax[i]; } maxGap = Math.max(maxGap, max - previous); return maxGap; } }
[ "wyqun_work@163.com" ]
wyqun_work@163.com
233f01e52e034858b9b891e7f9cb3c4cf70e48f3
49a9340925851268679fdc80309d153d1bdaf0cc
/uilib/src/main/java/com/cyou/ui/wheelView/wheel/widget/adapters/WheelViewAdapter.java
1ac008bde39ed72d502c93115d90927a3852a12c
[ "BSD-3-Clause" ]
permissive
tinggu/Zhimi
a05b943eade40617b7c7a65f9a44fb3f234f426c
6c9e8b5f6bb92377163187eef097a8dcd15ddc7b
refs/heads/master
2020-04-06T07:00:45.965003
2019-12-30T01:56:20
2019-12-30T01:56:20
57,282,771
2
0
null
null
null
null
UTF-8
Java
false
false
2,176
java
/* * Copyright 2011 Yuri Kanivets * * 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.cyou.ui.wheelView.wheel.widget.adapters; import android.database.DataSetObserver; import android.view.View; import android.view.ViewGroup; /** * Wheel items adapter interface */ public interface WheelViewAdapter { /** * Gets items count * * @return the count of wheel items */ public int getItemsCount(); /** * Get a View that displays the data at the specified position in the data * set * * @param index * the item index * @param convertView * the old view to reuse if possible * @param parent * the parent that this view will eventually be attached to * @return the wheel item View */ public View getItem(int index, View convertView, ViewGroup parent); /** * Get a View that displays an empty wheel item placed before the first or * after the last wheel item. * * @param convertView * the old view to reuse if possible * @param parent * the parent that this view will eventually be attached to * @return the empty item View */ public View getEmptyItem(View convertView, ViewGroup parent); /** * Register an observer that is called when changes happen to the data used * by this adapter. * * @param observer * the observer to be registered */ public void registerDataSetObserver(DataSetObserver observer); /** * Unregister an observer that has previously been registered * * @param observer * the observer to be unregistered */ void unregisterDataSetObserver(DataSetObserver observer); }
[ "tinggu@126.com" ]
tinggu@126.com
faab11dbefa8f506051ee40b8630170dcbf8e6d0
7b9c3655bb8378c8be4f65fe3af7f28ec04c7578
/app/src/main/java/project/missiledefender/Missile.java
00abcea58ef2b75e62a8d6727361b587f51b539c
[]
no_license
kvnlineback/Missile-Defender
ab8326fd759b399dd6cc7d70138962a96868b73a
4fd2f6ba9958d1db6e4e7b87807e242b05a883c7
refs/heads/master
2023-02-27T06:30:57.607584
2021-02-04T06:45:35
2021-02-04T06:45:35
335,863,015
0
0
null
null
null
null
UTF-8
Java
false
false
7,131
java
package project.missiledefender; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.util.Log; import android.view.animation.LinearInterpolator; import android.widget.ImageView; class Missile { private MainActivity mainActivity; private ImageView imageView; private AnimatorSet aSet = new AnimatorSet(); private int screenHeight; private int screenWidth; private long screenTime; private static final String TAG = "Missile"; private boolean hit = false; Missile(int screenWidth, int screenHeight, long screenTime, final MainActivity mainActivity) { this.screenWidth = screenWidth; this.screenHeight = screenHeight; this.screenTime = screenTime; this.mainActivity = mainActivity; imageView = new ImageView(mainActivity); imageView.setX(-500); mainActivity.runOnUiThread(new Runnable() { @Override public void run() { mainActivity.layout.addView(imageView); } }); } AnimatorSet setData(final int drawId) { mainActivity.runOnUiThread(new Runnable() { @Override public void run() { imageView.setImageResource(drawId); } }); final int startX = (int) (Math.random() * screenHeight * 0.8); final int endX = (startX + (Math.random() < 0.5 ? 500 : -500)); final int startY = -200; final int endY = (int) (screenHeight * 0.90); ObjectAnimator xAnim = ObjectAnimator.ofFloat(imageView, "x", startX, endX); xAnim.setInterpolator(new LinearInterpolator()); xAnim.setDuration(screenTime); xAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(final Animator animation) { mainActivity.runOnUiThread(new Runnable() { @Override public void run() { if (!hit) { if (mainActivity.nearbyBase(endX, endY)) { makeBaseBlast(); makeGroundBlast(); mainActivity.layout.removeView(imageView); mainActivity.removeMissile(Missile.this); } else { makeGroundBlast(); mainActivity.layout.removeView(imageView); mainActivity.removeMissile(Missile.this); } //check to se if hit base and blow up here } else { mainActivity.layout.removeView(imageView); mainActivity.removeMissile(Missile.this); } Log.d(TAG, "run: NUM VIEWS " + mainActivity.layout.getChildCount()); } }); } }); ObjectAnimator yAnim = ObjectAnimator.ofFloat(imageView, "y", startY, endY); yAnim.setInterpolator(new LinearInterpolator()); yAnim.setDuration(screenTime); float a = calculateAngle(startX, startY, endX, endY); imageView.setRotation(a); aSet.playTogether(xAnim, yAnim); return aSet; } void stop() { aSet.cancel(); } float getX() { return imageView.getX(); } float getY() { return imageView.getY(); } float getWidth() { return imageView.getWidth(); } float getHeight() { return imageView.getHeight(); } void interceptorBlast(float x, float y) { final ImageView iv = new ImageView(mainActivity); iv.setImageResource(R.drawable.explode); iv.setTransitionName("Missile Intercepted Blast"); int w = imageView.getDrawable().getIntrinsicWidth(); int offset = (int) (w * 0.5); iv.setX(x - offset); iv.setY(y - offset); iv.setRotation((float) (360.0 * Math.random())); aSet.cancel(); mainActivity.layout.removeView(imageView); mainActivity.layout.addView(iv); final ObjectAnimator alpha = ObjectAnimator.ofFloat(iv, "alpha", 0.0f); alpha.setInterpolator(new LinearInterpolator()); alpha.setDuration(3000); alpha.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mainActivity.layout.removeView(imageView); } }); alpha.start(); } private float calculateAngle(double x1, double y1, double x2, double y2) { double angle = Math.toDegrees(Math.atan2(x2 - x1, y2 - y1)); angle = angle + Math.ceil(-angle / 360) * 360; return (float) (190.0f - angle); } private void makeGroundBlast() { //SoundPlayer.getInstance().start("interceptor_blast"); final ImageView explodeView = new ImageView(mainActivity); explodeView.setImageResource(R.drawable.explode); explodeView.setTransitionName("Ground blast"); float w = explodeView.getDrawable().getIntrinsicWidth(); explodeView.setX(this.getX() - (w / 4)); explodeView.setY(this.getY() - (w / 4)); explodeView.setZ(-15); mainActivity.layout.addView(explodeView); final ObjectAnimator alpha = ObjectAnimator.ofFloat(explodeView, "alpha", 0.0f); alpha.setInterpolator(new LinearInterpolator()); alpha.setDuration(1500); alpha.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mainActivity.layout.removeView(explodeView); } }); alpha.start(); } private void makeBaseBlast() { SoundPlayer.getInstance().start("base_blast"); final ImageView explodeView = new ImageView(mainActivity); explodeView.setImageResource(R.drawable.blast); explodeView.setTransitionName("Base blast"); float w = explodeView.getDrawable().getIntrinsicWidth(); explodeView.setX(MainActivity.lastBlownBase.getBase().getX() - (w / 4)); explodeView.setY(MainActivity.lastBlownBase.getBase().getY() - (w / 4)); explodeView.setZ(-15); mainActivity.layout.addView(explodeView); final ObjectAnimator alpha = ObjectAnimator.ofFloat(explodeView, "alpha", 0.0f); alpha.setInterpolator(new LinearInterpolator()); alpha.setDuration(1500); alpha.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mainActivity.layout.removeView(explodeView); } }); alpha.start(); } public boolean isHit() { return hit; } public void setHit(boolean hit) { this.hit = hit; } }
[ "kvnlineback@yahoo.com" ]
kvnlineback@yahoo.com
7a7326e09d38ca2f37ff472247a59233998461a3
e3c8861eae2e0c65ef76a58107d3f0d0c4d9595e
/javamars-base/src/test/java/io/github/richardmars/exam/jd/Main.java
b2b5e689e25b6ecc3553d6e494e3ebb0c69ea4e8
[]
no_license
richardmars/javamars
9a2f0251b4b87a37f75087716201ffe0ae1e638e
c58b9b68b39b520be83b52b32becafb3bc9d2006
refs/heads/master
2022-12-26T03:32:03.336297
2020-09-11T11:25:18
2020-09-11T11:25:18
90,506,292
1
0
null
2022-12-16T05:15:45
2017-05-07T03:29:13
Java
UTF-8
Java
false
false
828
java
package io.github.richardmars.exam.jd; import java.util.Scanner; /** * 幸运数 * @author xicod * */ public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int num = scanner.nextShort(); int[] datas = new int[num]; for (int i = 0; i < num; i++) { datas[i] = scanner.nextInt(); } scanner.close(); for (int data : datas) { System.out.println(numOfLuckyData(data)); } } public static int dataSum(int data, int mod) { if (data == 0) { return 0; } else { return data % mod + dataSum(data / mod, mod); } } public static int numOfLuckyData(int data) { if (data == 1) { return 1; } else if(dataSum(data, 10) == dataSum(data, 2)) { return numOfLuckyData(data-1)+1; } else { return numOfLuckyData(data-1); } } }
[ "流云" ]
流云
af4809624f53ed06272ebe0a230c6876d0960dc8
0272d52b9cea868b93fea5e7f70db4cb92bc0608
/HBMClient/src/main/java/org/apache/cordova/device/MyPlugin.java
4c59caca3d40ba413d96026c4299e55826ea1109
[]
no_license
Parmerlee/SomethingImprotant
5f2ad0b0444be9c008eb5c86ed4fb7ed9e3e7476
327afd99801cb1bf2589e17c8cc455dbbec076a5
refs/heads/master
2021-01-11T06:05:07.731483
2017-06-21T10:10:41
2017-06-21T10:10:41
94,990,947
0
0
null
null
null
null
UTF-8
Java
false
false
4,233
java
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.cordova.device; import java.util.LinkedHashMap; import java.util.Map; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaInterface; import org.apache.cordova.CordovaPlugin; import org.apache.cordova.CordovaWebView; import org.apache.cordova.PluginResult; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.content.Context; import android.text.TextUtils; import com.bonc.mobile.common.AppConstant; import com.bonc.mobile.common.User; import com.bonc.mobile.common.net.HttpRequestTask; import com.bonc.mobile.common.util.FileUtils; import com.bonc.mobile.hbmclient.common.Constant; public class MyPlugin extends CordovaPlugin { public static final String TAG = "SharePlugin"; public static final String SHARE = "share"; public static final String FETCH_DATE = "date"; public CallbackContext callbackContext; /** * Constructor. */ public MyPlugin() { } /** * Sets the context of the Command. This can then be used to do things like * get file paths associated with the Activity. * * @param cordova * The context of the main Activity. * @param webView * The CordovaWebView Cordova is running in. */ public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); } /** * Executes the request and returns PluginResult. * * @param action * The action to execute. * @param args * JSONArry of arguments for the plugin. * @param callbackContext * The callback id used when calling back into JavaScript. * @return True if the action was valid, false if not. */ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { if (TextUtils.equals(action, SHARE)) { FileUtils.shareScreen(cordova.getActivity()); return true; } else if (TextUtils.equals(FETCH_DATE, action)) { this.callbackContext = callbackContext; String[] argsArr = getArgs(args); Map<String, String> param = new LinkedHashMap<String, String>(); param.put("user4ACode", User.getInstance().userCode); param.put("sysType", "OA_SYS"); new LoadAccountTask(this.cordova.getActivity()).execute( "/bi/network/analysis/index", param); return true; } else { return false; } } public String[] getArgs(JSONArray args) { String[] argsArr = new String[args.length()]; for (int i = 0; i < args.length(); i++) { try { argsArr[i] = args.getString(i); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return argsArr; } class LoadAccountTask extends HttpRequestTask { public LoadAccountTask(Context context) { super(context, Constant.BASE_PATH); } @Override protected void handleResult(JSONObject result) { if (!AppConstant.SEC_ENH) { System.out.println("result啊啊啊啊啊啊啊啊啊啊:" + result); } // {"flag",true}; JSONObject data = result.optJSONObject("data"); if (data != null) { PluginResult r = new PluginResult(PluginResult.Status.OK, result); callbackContext.sendPluginResult(r); } if (callbackContext != null) callbackContext = null; // startActivity(new Intent(WelcomeActivity.this, Welcome.class)); // finish(); } } }
[ "lijingjing1@bonc.com.cn" ]
lijingjing1@bonc.com.cn
fd2ffddb99580e3bd5848538405ea442dd54ed1d
b42ea6fd5b8d1791410d9f1ad697fb7401f2bd93
/final-project-web/src/main/java/org/velichko/finalproject/controller/command/trainer/ChangeTrainerVerificationDateCommand.java
4095ae86ae541481458936bbdbe19d1983a9928a
[]
no_license
i-velichko/final_project
d909ab79ec5c86f33d2c44073acaeac55ab741e1
ddce68ffd717e089637a2653f37d96f04346e2f1
refs/heads/master
2023-07-16T23:15:18.891519
2021-08-25T11:35:36
2021-08-25T11:35:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,050
java
package org.velichko.finalproject.controller.command.trainer; import jakarta.servlet.http.HttpServletRequest; import org.apache.logging.log4j.Level; import org.velichko.finalproject.controller.Router; import org.velichko.finalproject.controller.command.Command; import org.velichko.finalproject.controller.command.ParamName; import org.velichko.finalproject.logic.exception.ServiceException; import org.velichko.finalproject.logic.service.VerificationService; import static jakarta.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR; import static org.velichko.finalproject.controller.command.ParamName.*; import static org.velichko.finalproject.controller.command.ParamName.ERROR_MESSAGE; /** * @author Ivan Velichko * * The type Change trainer verification date command. */ public class ChangeTrainerVerificationDateCommand implements Command { private final VerificationService verificationService; /** * Instantiates a new Change trainer verification date command. * * @param verificationService the verification service */ public ChangeTrainerVerificationDateCommand(VerificationService verificationService) { this.verificationService = verificationService; } @Override public Router execute(HttpServletRequest request) { Router router = new Router(); Long verificationId = Long.parseLong(request.getParameter(VERIFICATION_ID_PARAM)); String dateTime = request.getParameter(DATE_TIME_PARAM); try { verificationService.changeTrainerVerificationDateById(verificationId, dateTime); } catch (ServiceException e) { LOGGER.log(Level.DEBUG, "Error. Impossible change trainer verification date by this " + verificationId + " verification"); request.setAttribute(ERROR_MESSAGE, e.getMessage()); router.setErrorCode(SC_INTERNAL_SERVER_ERROR); } router.setRouterType(Router.RouterType.REDIRECT); router.setPagePath(request.getHeader(REFERER)); return router; } }
[ "showman.velichko@gmail.com" ]
showman.velichko@gmail.com
2f3979bc6711ee1e345612e62513a616501441be
9b7989519913c162ca5cdbf21706360394df3f74
/junit-mockito-final/demo/src/test/java/com/example/demo/DemoControllerTest.java
a8827ba30e0acc5565b203550f8ce3eaf1ff7ae7
[]
no_license
pyoroichi/java
d966c4c7b9e5be859bfc147f947eb35e0f36e2d6
213e23dd0e35cee0b7f4979cdf57ce6e09b1db94
refs/heads/master
2023-08-24T14:54:38.021651
2021-10-10T03:00:06
2021-10-10T03:00:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,607
java
package com.example.demo; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.ui.Model; import java.time.LocalDateTime; import java.util.Map; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; public class DemoControllerTest { /** * テスト対象のクラス */ @InjectMocks private DemoController demoController; /** * テスト対象のクラス内で呼ばれるクラスのMockオブジェクト */ @Mock private DemoComponent demoComponent; /** * 前処理(各テストケースを実行する前に行われる処理) */ @Before public void init(){ //@Mockアノテーションのモックオブジェクトを初期化 //これを実行しないと@Mockアノテーション、@InjectMocksを付与した //Mockオブジェクトが利用できない MockitoAnnotations.initMocks(this); //Mockの設定 when(demoComponent.getNowDateTime()).thenReturn(getNowDateTimeStr()); when(demoComponent.getNowDateTimeFinal()).thenReturn(getNowDateTimeStr()); } /** * DemoControllerクラスのindexメソッドを確認 */ @Test public void testDemoController(){ //Modelオブジェクトを生成 Model model = DemoControllerTestUtil.getModel(); //テスト対象クラスのメソッドを実行 String strPath = demoController.index(model); //テスト対象クラスのメソッドで設定されたMapオブジェクトを表示 System.out.println(); System.out.println("*** コントローラクラスのindexメソッドで設定されたMapオブジェクト ***"); System.out.println(model.asMap()); System.out.println(); //テスト対象クラスのメソッドの実行結果を確認 assertEquals("index", strPath); Map<String, Object> mapObj = model.asMap(); assertEquals("2020-07-14T20:54:12", mapObj.get("nowDateTime")); assertEquals("2020-07-14T20:54:12", mapObj.get("nowDateTimeFinal")); } /** * 現在時刻を生成し文字列化して返却 * @return 現在時刻の文字列 */ private String getNowDateTimeStr(){ LocalDateTime nowDateTime = LocalDateTime.of( 2020, 7, 14, 20, 54, 12); return nowDateTime.toString(); } }
[ "stanahas@amber.plala.or.jp" ]
stanahas@amber.plala.or.jp
39a4e1d5197b39eae5e5750ff44e300a8e172722
8397ef9d30ed073a70b794934864dc462fdae06b
/src/test/java/OOPsConcepts/SuperConcept.java
e1348d1eb08263aa30e9c6ca4220064809c27ea7
[]
no_license
iracarus/JavaSessions
cf05c84971cbe89f8ca29318c34bda09b698907b
6769257e982fdbfe1f7979a285daa2bfb631d528
refs/heads/master
2023-05-12T04:02:42.051082
2019-10-04T02:39:40
2019-10-04T02:39:40
194,975,717
0
0
null
null
null
null
UTF-8
Java
false
false
1,136
java
package OOPsConcepts; // this() - it is the method which is used for calling a constructor of the same class // super() - it is the method which is used for calling a constructor of the parent class // this() & super() these can only the first statements in any constructor // this() & super() cannot exist simultenously. public class SuperConcept { public SuperConcept() { System.out.println("Super Concept Default Constructor"); } public SuperConcept(int i) { System.out.println("Super Concept Int Constructor"); } } class ChildClass extends SuperConcept { public ChildClass() { super(10); System.out.println("Child Class Default Constructor."); } public ChildClass(int i) { super(); System.out.println("Child Class int Constructor."); } } class TestSuper { public static void main(String[] args) { //ChildClass cc1 = new ChildClass(10); ChildClass cc2 = new ChildClass(); // Super Concept Int Constructor // Child Class Default Constructor. } }
[ "ira.valenzuela@my.tccd.edu" ]
ira.valenzuela@my.tccd.edu
8577990a675e7a90e47c0676ac6c85d48bc9b7d8
00839a80d858c748c8d9a8934ad5a29e6495aa1a
/src/main/java/com/example/springbootbootstrap/service/RoleService.java
81416ab6a302af520a5c4bb7064f058d9d1ea58e
[]
no_license
AnnaSakharova/SpringBootBootstrap
7256d80cf7278300219bb0fa9fce512ccdcc951a
da23691068a7dc3ccb0d41b2bb7292956b5ca8c0
refs/heads/master
2023-05-07T00:02:16.806950
2021-05-28T11:49:35
2021-05-28T11:49:35
371,683,681
0
0
null
null
null
null
UTF-8
Java
false
false
189
java
package com.example.springbootbootstrap.service; import com.example.springbootbootstrap.model.Role; import java.util.List; public interface RoleService { List<Role> getAllRoles(); }
[ "sugarcaramel@yandex.ru" ]
sugarcaramel@yandex.ru
3031522a6a18750ec9cbefa5484f37410893450b
9f2b175034068910a9d5b58a7f759a659bd4a3be
/src/main/java/com/xhg/ops/workorders/model/WorkOrder.java
4aa0fe4ac380a01237088959102ba8ecb3b96251
[]
no_license
zengyiliang/test
fcc44163ef81fbde9aea41e4609bcab77eec3512
fa1af5442166c8aa49c1968c1af260b1d42a02a6
refs/heads/master
2020-05-30T04:20:37.602861
2019-07-31T13:11:25
2019-07-31T13:11:25
189,534,255
0
0
null
2019-10-31T01:31:46
2019-05-31T05:41:25
Java
UTF-8
Java
false
false
4,263
java
package com.xhg.ops.workorders.model; import java.io.Serializable; import java.util.List; import com.xhg.ops.common.BasePojo; /** * 工单实体 * * @author 刘涛 * @date 2018年7月12日 */ public class WorkOrder extends BasePojo implements Serializable { private static final long serialVersionUID = -4501822985278700332L; private String orderNo; // 工单号 private Integer orderType; // 工单类型 private String orderTitle; // 订单描述 private Integer status; // 订单状态 private Integer dataSource; // 订单来源 private Integer level; // 紧急程度 private String contactInfo; // 联系信息 private String deviceId; // 设备ID private String siteCode; // 设备编码 private String siteAreaCode; // 区编码 private String siteLongitude; // 坐标经度 private String siteLatitude; // 坐标纬度 private String siteAddress; // 设备地址 private String remark; // 备注 private String procInstId; // 流程实例ID private Integer procUserId; // 流程处理人 private String procTaskId; // 流程任务ID private String createdUser; // 创建人名称 private Integer faultId; // 故障ID private List<String> attachments; // 附件列表 private List<WorkOrderMaterielApply> materielList; // 物料列表 public Integer getFaultId() { return faultId; } public void setFaultId(Integer faultId) { this.faultId = faultId; } public String getOrderNo() { return orderNo; } public void setOrderNo(String orderNo) { this.orderNo = orderNo; } public Integer getOrderType() { return orderType; } public void setOrderType(Integer orderType) { this.orderType = orderType; } public String getOrderTitle() { return orderTitle; } public void setOrderTitle(String orderTitle) { this.orderTitle = orderTitle; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Integer getDataSource() { return dataSource; } public void setDataSource(Integer dataSource) { this.dataSource = dataSource; } public Integer getLevel() { return level; } public void setLevel(Integer level) { this.level = level; } public String getContactInfo() { return contactInfo; } public void setContactInfo(String contactInfo) { this.contactInfo = contactInfo; } public String getDeviceId() { return deviceId; } public void setDeviceId(String deviceId) { this.deviceId = deviceId; } public String getSiteCode() { return siteCode; } public void setSiteCode(String siteCode) { this.siteCode = siteCode; } public String getSiteAreaCode() { return siteAreaCode; } public void setSiteAreaCode(String siteAreaCode) { this.siteAreaCode = siteAreaCode; } public String getSiteLongitude() { return siteLongitude; } public void setSiteLongitude(String siteLongitude) { this.siteLongitude = siteLongitude; } public String getSiteLatitude() { return siteLatitude; } public void setSiteLatitude(String siteLatitude) { this.siteLatitude = siteLatitude; } public String getSiteAddress() { return siteAddress; } public void setSiteAddress(String siteAddress) { this.siteAddress = siteAddress; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getProcInstId() { return procInstId; } public void setProcInstId(String procInstId) { this.procInstId = procInstId; } public Integer getProcUserId() { return procUserId; } public void setProcUserId(Integer procUserId) { this.procUserId = procUserId; } public String getProcTaskId() { return procTaskId; } public void setProcTaskId(String procTaskId) { this.procTaskId = procTaskId; } public String getCreatedUser() { return createdUser; } public void setCreatedUser(String createdUser) { this.createdUser = createdUser; } public List<String> getAttachments() { return attachments; } public void setAttachments(List<String> attachments) { this.attachments = attachments; } public List<WorkOrderMaterielApply> getMaterielList() { return materielList; } public void setMaterielList(List<WorkOrderMaterielApply> materielList) { this.materielList = materielList; } }
[ "13544361981@163.com" ]
13544361981@163.com
16d804d7e401e8f010fdd5484d74ac18730d7be9
aa7028c5ea2292c694bd71f4c0c253e6efb00f15
/src/main/java/me/nathanpb/Spell/AwakenedTNT.java
abc870ac3d3b7fee17e5b52f87c1541949f2fd69
[]
no_license
NathanPB/Spelling
4f5d339196a5108c07a4185437b411d254c83dbe
ccbded502a99b827f2cb17a84f11f3732fc39de9
refs/heads/master
2021-01-25T05:44:16.115186
2017-06-06T20:44:31
2017-06-06T20:44:31
80,671,170
0
0
null
null
null
null
UTF-8
Java
false
false
1,823
java
package me.nathanpb.Spell; import me.nathanpb.SpellBook.Utils; import me.nathanpb.SpellBook.Utils.SpellArea; import me.nathanpb.Spelling.Spelling; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.Event; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ShapedRecipe; import org.bukkit.util.Vector; public class AwakenedTNT implements Spell{ private final Spelling plugin; public AwakenedTNT(Spelling plugin){ this.plugin = plugin; } @Override public int getManaCost() { return 250; } @Override public ItemStack getSpellItem() { return Utils.Icon(Material.BLAZE_ROD, getSpellName()); } @Override public String getSpellName() { return ChatColor.GOLD+"Awakened TNT"; } @Override public String getSpellDescription() { return "Throws an TNT where are you looking"; } @Override public SpellArea getSpellArea() { return SpellArea.Misc; } @Override public ShapedRecipe getRecipe() { ShapedRecipe recipe = new ShapedRecipe(getSpellItem()); recipe.shape("DND","GTG","DGD"); recipe.setIngredient('D', Material.DIAMOND_BLOCK); recipe.setIngredient('N', Material.NETHER_STAR); recipe.setIngredient('G', Material.SULPHUR); recipe.setIngredient('T', Material.TNT); return recipe; } @Override public void triggeredSpellEvent(Event rawEvent) { if(rawEvent instanceof PlayerInteractEvent){ PlayerInteractEvent e = (PlayerInteractEvent)rawEvent; Player p = e.getPlayer(); Vector looking = p.getEyeLocation().getDirection().multiply(2); TNTPrimed tnt = p.getWorld().spawn(p.getEyeLocation().add(looking.getX(), looking.getY(), looking.getZ()), TNTPrimed.class); tnt.setVelocity(looking); } } }
[ "nathan.pbombana@gmail.com" ]
nathan.pbombana@gmail.com
105946fc78dee73e0673e56512dccc7279c4fc95
46db08f0ced251bf1e1a0902460ae821ffd378da
/app/src/main/java/com/example/administrator/travel_app/adapter/ModuleAdapter.java
0645ba920fd53ee69ce5ad78b0185538397e107a
[]
no_license
3441242166/Travel_App
9e86b682906e4b1322b517d01437469c94923027
63fdbba3de9481aa104f0b926eb349b5f8c1e6e9
refs/heads/master
2020-04-09T22:17:43.002641
2018-12-06T05:39:24
2018-12-06T05:39:24
160,624,603
0
0
null
null
null
null
UTF-8
Java
false
false
1,029
java
package com.example.administrator.travel_app.adapter; import android.content.Context; import android.support.annotation.Nullable; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.example.administrator.travel_app.R; import com.example.administrator.travel_app.bean.GridBean; import com.example.administrator.travel_app.bean.ModuleBean; import java.util.List; public class ModuleAdapter extends BaseQuickAdapter<ModuleBean,BaseViewHolder> { private Context context; public ModuleAdapter(@Nullable List<ModuleBean> data, Context context) { super(R.layout.item_module, data); this.context = context; } @Override protected void convert(BaseViewHolder helper, ModuleBean item) { helper.setText(R.id.item_module_title,item.getTitle()); Glide.with(context).load(item.getImgID()).into((ImageView) helper.getView(R.id.item_module_img)); } }
[ "3441242166@qq.com" ]
3441242166@qq.com
1a21e6d48f9822f18f82652e2bfd5678e030460f
26b7f30c6640b8017a06786e4a2414ad8a4d71dd
/src/number_of_direct_superinterfaces/i49458.java
3aecbd322c79f47b009b055ce465d0b6d67908ce
[]
no_license
vincentclee/jvm-limits
b72a2f2dcc18caa458f1e77924221d585f23316b
2fd1c26d1f7984ea8163bc103ad14b6d72282281
refs/heads/master
2020-05-18T11:18:41.711400
2014-09-14T04:25:18
2014-09-14T04:25:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
69
java
package number_of_direct_superinterfaces; public interface i49458 {}
[ "vincentlee.dolbydigital@yahoo.com" ]
vincentlee.dolbydigital@yahoo.com
4a43a1a01901c9a0347106d4101f1725b7ab10c0
e524accede800c9576ad91063de789c838069ec1
/70-example-full-hibernate/src/main/java/jpaworkshop/model/DesignProject.java
0298bdfe1f0bea4eada0ed0fdd9f0273cc6d6702
[]
no_license
simasch/jpaworkshop
80f8a23dc7fea842cab519c7491831811f97c89d
2686d25ea7877820bb6f43197f8f94be43824ae3
refs/heads/master
2020-12-26T03:44:49.347550
2014-10-02T23:14:15
2014-10-02T23:14:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
117
java
package jpaworkshop.model; import javax.persistence.Entity; @Entity public class DesignProject extends Project { }
[ "dev (at) jonasbandi (dot) net" ]
dev (at) jonasbandi (dot) net
de19ac8af1ff7bcd6d603683dd4fba1241f06423
980017ba079042f4c86eaa7a82ba665f8b2fb896
/src/main/java/ru/ad/tec/bookstore/view/BookstoreNavigator.java
92edc5d9eba4689c753cfce4f198d93626ed951c
[]
no_license
theSemenov/bookstore
930770273ef2d8b1ce9f765cb7985ebfbf61d2a4
4164c69d41d0c15d0abf9cf2f54a0eea915268b3
refs/heads/master
2021-01-19T20:34:01.898291
2018-07-21T16:53:30
2018-07-21T16:53:30
101,229,385
0
0
null
null
null
null
UTF-8
Java
false
false
1,756
java
package ru.ad.tec.bookstore.view; import com.vaadin.navigator.Navigator; import com.vaadin.spring.annotation.UIScope; import com.vaadin.ui.UI; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import ru.ad.tec.bookstore.model.Book; import javax.annotation.PostConstruct; /** * @author Semenov Alexey on 23.08.17 {@literal <theSemenov@gmail.com>}. */ @Component @UIScope public class BookstoreNavigator extends Navigator { public static final String BOOK_LIST_LINK = "bookList"; public static final String BOOK_EDITOR_LINK = "bookEditor"; @Autowired private BookListView bookList; @Autowired private BookEditorView bookEditor; public BookstoreNavigator() { } @PostConstruct public void initLink() { addView(BOOK_LIST_LINK, bookList); addView(BOOK_EDITOR_LINK, bookEditor); bookList.setNavigator(this); bookEditor.setNavigator(this); } public void navigateToBookList() { navigateTo(BOOK_LIST_LINK); } public void navigateToBookEditorForEdit(Book book) { bookEditor.setBook(book); bookEditor.setReadOnly(false); navigateTo(BOOK_EDITOR_LINK); } public Book navigateToBookEditorForCreate() { Book book = new Book(); bookEditor.setBook(new Book()); bookEditor.setReadOnly(false); navigateTo(BOOK_EDITOR_LINK); return book; } public void navigateToBookEditorForPreview(Book book) { bookEditor.setBook(book); bookEditor.setReadOnly(true); navigateTo(BOOK_EDITOR_LINK); } public void initUi(UI ui) { init(ui, null, new SingleComponentContainerViewDisplay(ui)); } }
[ "alalsemenov@at-consulting.ru" ]
alalsemenov@at-consulting.ru
067d219058fb755dc8747e23609189413eaf1fb2
82745b3177852b16a606cc464a4e6aa8b3120c27
/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/ChangeConfigurationConfirmation.java
51e83b847605c4f7f0d0877df2096c60294a5d35
[ "MIT" ]
permissive
JanLapp/Java-OCA-OCPP
7c10bbb5bf8127f4de88a574eef0efeaef97d5e0
e0f87cc3b0e9cd85edf8c449991f578f3ca553a4
refs/heads/master
2020-03-23T12:02:44.134612
2018-07-11T19:13:46
2018-07-11T19:13:46
141,533,485
0
0
MIT
2018-07-19T06:22:43
2018-07-19T06:22:43
null
UTF-8
Java
false
false
2,380
java
package eu.chargetime.ocpp.model.core; import eu.chargetime.ocpp.model.Confirmation; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /* ChargeTime.eu - Java-OCA-OCPP Copyright (C) 2015-2016 Thomas Volden <tv@chargetime.eu> MIT License Copyright (C) 2016-2018 Thomas Volden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * Returned from Charge Point to Central System */ @XmlRootElement(name = "changeConfigurationResponse") public class ChangeConfigurationConfirmation implements Confirmation { private ConfigurationStatus status; /** * Returns whether configuration change has been accepted. * * @return String, the {@link ConfigurationStatus}. */ public ConfigurationStatus getStatus() { return status; } /** * Returns whether configuration change has been accepted. * * @return the {@link ConfigurationStatus}. */ @Deprecated public ConfigurationStatus objStatus() { return status; } /** * Required. Returns whether configuration change has been accepted. * * @param status the {@link ConfigurationStatus}. */ @XmlElement public void setStatus(ConfigurationStatus status) { this.status = status; } @Override public boolean validate() { return status != null; } }
[ "vasevolden@gmail.com" ]
vasevolden@gmail.com
9274184da03c40f9d3bb8836072f8f9a65cf5f21
793c62c2034119829bf18e801ee1912a8b7905a7
/tools/zookeeper/src/test/java/com/luolei/tools/zookeeper/NodeManagerTest.java
6435bd57d3c47bc74758bd6d4e66931da8419ffa
[]
no_license
askluolei/practice
5b087a40535b5fb038fb9aa25831d884476d27c9
044b13781bc876fd2472d7dfc3e709544d26c546
refs/heads/master
2021-09-10T15:15:58.199101
2018-03-28T09:17:57
2018-03-28T09:17:57
108,428,724
0
0
null
null
null
null
UTF-8
Java
false
false
6,600
java
package com.luolei.tools.zookeeper; import com.luolei.tools.zookeeper.cluster.NodeManager; import org.apache.curator.test.TestingServer; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @author 罗雷 * @date 2017/11/7 0007 * @time 10:49 */ public class NodeManagerTest { public static void main(String[] args) throws Exception{ testMultiWithShutdownAndTimeout(); } /** * 测试多节点启动获取节点号 */ public static void testMulti() throws Exception { TestingServer server = new TestingServer(); server.start(); int n = 5; ExecutorService executorService = Executors.newFixedThreadPool(n); for (int i = 0; i < n; i++) { executorService.submit(() -> { NodeManager nodeManager = new NodeManager(server.getConnectString()); nodeManager.initNode(); try { Thread.sleep(10000); } catch (InterruptedException e) { } printStatus(nodeManager); }); } } /** * 测试多节点启动获取节点号 * 其中几个节点模拟 过期 重连 */ public static void testMultiWithTimeout() throws Exception { TestingServer server = new TestingServer(); server.start(); int n = 5; ExecutorService executorService = Executors.newFixedThreadPool(n); for (int i = 0; i < n; i++) { boolean sessionTimeout = i % 2 == 1; executorService.submit(() -> { NodeManager nodeManager = new NodeManager(server.getConnectString(), sessionTimeout); nodeManager.initNode(); try { Thread.sleep(10000); } catch (InterruptedException e) { } printStatus(nodeManager); }); } } /** * 测试多节点启动获取节点号 * 其中几个节点模拟宕机 */ public static void testMultiWithShutdownAdd() throws Exception { TestingServer server = new TestingServer(); server.start(); int n = 5; int m = 3; ExecutorService executorService = Executors.newFixedThreadPool(n + m); for (int i = 0; i < n; i++) { boolean shutdown = i % 2 == 1; executorService.submit(() -> { NodeManager nodeManager = new NodeManager(server.getConnectString(), false, shutdown); nodeManager.initNode(); try { Thread.sleep(10000); } catch (InterruptedException e) { } printStatus(nodeManager); }); } Thread.sleep(30000); for (int i = 0; i < m; i++) { executorService.submit(() -> { NodeManager nodeManager = new NodeManager(server.getConnectString()); nodeManager.initNode(); try { Thread.sleep(10000); } catch (InterruptedException e) { } printStatus(nodeManager); }); } } /** * 测试多节点启动获取节点号 * 其中几个节点模拟宕机 几个节点模拟过期 * 然后补充几个节点 */ public static void testMultiWithShutdownAndTimeout() throws Exception { TestingServer server = new TestingServer(); server.start(); int n = 5; int m = 3; ExecutorService executorService = Executors.newFixedThreadPool(n + m); for (int i = 0; i < n; i++) { boolean shutdown = i % 2 == 1; boolean timeout = i % 2 == 0; executorService.submit(() -> { NodeManager nodeManager = new NodeManager(server.getConnectString(), timeout, shutdown); nodeManager.initNode(); try { Thread.sleep(10000); } catch (InterruptedException e) { } printStatus(nodeManager); }); } Thread.sleep(30000); for (int i = 0; i < m; i++) { executorService.submit(() -> { NodeManager nodeManager = new NodeManager(server.getConnectString()); nodeManager.initNode(); try { Thread.sleep(10000); } catch (InterruptedException e) { } printStatus(nodeManager); }); } } /** * 测试单节点启动获取节点号 */ public static void testSingle() throws Exception { TestingServer server = new TestingServer(); server.start(); NodeManager nodeManager = new NodeManager(server.getConnectString()); nodeManager.initNode(); Thread.sleep(10000); printStatus(nodeManager); } /** * 测试单节点启动获取节点号后模拟session过去 * 重连 */ public static void testSingleWithReconnect() throws Exception { TestingServer server = new TestingServer(); server.start(); NodeManager nodeManager = new NodeManager(server.getConnectString(), true); nodeManager.initNode(); printStatus(nodeManager); } /** * 测试单节点启动获取节点号后 * 模拟宕机 */ public static void testSingleWithShutdown() throws Exception { TestingServer server = new TestingServer(); server.start(); NodeManager nodeManager = new NodeManager(server.getConnectString(), false, true); nodeManager.initNode(); printStatus(nodeManager); } private static void printStatus(NodeManager nodeManager) { try { Thread.sleep(5000); } catch (InterruptedException e) { } System.out.println("节点号为:" + nodeManager.getCurrentNodeID()); System.out.println("是否可支付:" + nodeManager.canPay()); try { Thread.sleep(5000); } catch (InterruptedException e) { } System.out.println("节点号为:" + nodeManager.getCurrentNodeID()); System.out.println("是否可支付:" + nodeManager.canPay()); try { Thread.sleep(5000); } catch (InterruptedException e) { } System.out.println("节点号为:" + nodeManager.getCurrentNodeID()); System.out.println("是否可支付:" + nodeManager.canPay()); } }
[ "askluolei@gmail.com" ]
askluolei@gmail.com
6b4daa50eda55b1efaa24f374d08d3b56fb51cc1
e9acdda1e4d80f2d1d1633b6cffb4cd00453d56e
/palermotenis-webapp/src/main/java/com/palermotenis/controller/struts/actions/admin/crud/CostoAction.java
b3256983f8ee448510292406f126d1661e5636f2
[]
no_license
polysantiago/PalermoTenis
3ad7090ba4ab76a834f19b17eed982010ea5de2f
d41d49f4140bae33b55932d1eec8683f7d0ca4c4
refs/heads/master
2020-07-20T16:21:42.125897
2013-05-28T08:33:23
2013-05-28T08:33:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,748
java
package com.palermotenis.controller.struts.actions.admin.crud; import java.util.Collection; import org.hibernate.HibernateException; import org.springframework.beans.factory.annotation.Autowired; import com.palermotenis.controller.struts.actions.InputStreamActionSupport; import com.palermotenis.model.beans.compras.Costo; import com.palermotenis.model.beans.productos.Producto; import com.palermotenis.model.service.costos.CostoService; import com.palermotenis.model.service.productos.ProductoService; public class CostoAction extends InputStreamActionSupport { private static final long serialVersionUID = -4981608712701371254L; private final String SHOW = "show"; private Collection<Costo> costos; private Integer costoId; private Integer presentacionId; private Integer productoId; private Integer proveedorId; private Integer monedaId; private Double costoVal; private Producto producto; @Autowired private ProductoService productoService; @Autowired private CostoService costoService; public String show() { producto = getProductoById(); costos = getProducto().getCostos(); return SHOW; } public String create() { costoService.createCosto(costoVal, productoId, monedaId, proveedorId, presentacionId); success(); return STREAM; } public String edit() { try { costoService.updateCosto(costoId, costoVal, productoId, monedaId, proveedorId, presentacionId); success(); } catch (HibernateException ex) { failure(ex); } catch (Exception ex) { failure(ex); } return STREAM; } public String destroy() { try { costoService.deleteCosto(costoId); success(); } catch (HibernateException ex) { failure(ex); } return STREAM; } private Producto getProductoById() { return productoService.getProductById(productoId); } public Collection<Costo> getCostos() { return costos; } public void setCostoId(Integer costoId) { this.costoId = costoId; } public void setProductoId(Integer productoId) { this.productoId = productoId; } public void setProveedorId(Integer proveedorId) { this.proveedorId = proveedorId; } public void setMonedaId(Integer monedaId) { this.monedaId = monedaId; } public void setCostoVal(Double costoVal) { this.costoVal = costoVal; } public Producto getProducto() { return producto; } public void setPresentacionId(Integer presentacionId) { this.presentacionId = presentacionId; } }
[ "pablo.santiago@gmail.com" ]
pablo.santiago@gmail.com
5c1ca89cd57ca528af7d675a7dfd64fd8df388d8
605dc9c30222306e971a80519bd1405ae513a381
/old_work/svn/gems/branches/global_em/ecloud/src/main/java/com/emscloud/model/CloudUserAudit.java
a512effb9fe163b8da00b129957e1ee6b94f44a4
[]
no_license
rgabriana/Work
e54da03ff58ecac2e2cd2462e322d92eafd56921
9adb8cd1727fde513bc512426c1588aff195c2d0
refs/heads/master
2021-01-21T06:27:22.073100
2017-02-27T14:31:59
2017-02-27T14:31:59
83,231,847
2
0
null
null
null
null
UTF-8
Java
false
false
3,133
java
package com.emscloud.model; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @Entity @Table(name = "cloud_users_audit", schema = "public") @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class CloudUserAudit implements Serializable { @XmlElement(name = "id") private Long id; @XmlElement(name = "users") private Users users; @XmlElement(name = "username") private String username; @XmlElement(name = "description") private String description; @XmlElement(name = "username") private String actionType; private Date logTime; @XmlElement(name = "ipAddress") private String ipAddress; public CloudUserAudit() { } public CloudUserAudit(Long id, Long userId, String username, String description, String actionType, Date logTime, String ipAddress) { this.id = id; this.username = username; this.description = description; this.actionType = actionType; this.logTime = logTime; Users users = new Users(); users.setId(userId); this.users = users; this.ipAddress = ipAddress; } @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="cloud_users_audit_seq") @SequenceGenerator(name="cloud_users_audit_seq", sequenceName="cloud_users_audit_seq") @Column(name = "id", unique = true, nullable = false) public Long getId() { return id; } public void setId(Long id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "users_id") public Users getUser() { return users; } public void setUser(Users users) { this.users = users; } @Column(name = "username", nullable = false) public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } @Column(name = "description") public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Column(name = "action_type", nullable = false) public String getActionType() { return actionType; } public void setActionType(String actionType) { this.actionType = actionType; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "log_time", length = 30, nullable = false) public Date getLogTime() { return logTime; } public void setLogTime(Date logTime) { this.logTime = logTime; } @Column(name = "ip_address", nullable = false) public String getIpAddress() { return ipAddress; } public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } }
[ "rolando.gabriana@gmail.com" ]
rolando.gabriana@gmail.com
fe3f6211dca1985b3509263b83a0d6b589e8f0b9
8639034af1b7e3f28deda2233739c247e57c0a91
/paging/example1/app/src/main/java/com/codestack/example1/ItemDataSource.java
c842563e76b47f47314930ddf807fd27d0aaf0ad
[]
no_license
vijithbk/android-tutorials
d2a0d7e27660a8c711f8405ea30116af91ce7198
ccdccedd2b1d713afd53a7ecc32666db1bf309f0
refs/heads/master
2023-07-18T22:08:37.976738
2023-07-17T09:13:27
2023-07-17T09:13:27
145,300,092
0
0
null
null
null
null
UTF-8
Java
false
false
3,047
java
package com.codestack.example1; import android.arch.paging.PageKeyedDataSource; import android.support.annotation.NonNull; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class ItemDataSource extends PageKeyedDataSource<Integer, Item> { public static final int PAGE_SIZE = 50; public static final int FIRST_PAGE = 1; private static final String SITE_NAME = "stackoverflow"; @Override public void loadInitial(@NonNull LoadInitialParams<Integer> params, @NonNull final LoadInitialCallback<Integer, Item> callback) { RetrofitClient.getInstance() .getApi() .getAnswers(FIRST_PAGE, PAGE_SIZE, SITE_NAME) .enqueue(new Callback<StackApiResponse>() { @Override public void onResponse(Call<StackApiResponse> call, Response<StackApiResponse> response) { if(response.body() != null) { callback.onResult(response.body().items, null, FIRST_PAGE + 1); } } @Override public void onFailure(Call<StackApiResponse> call, Throwable t) { } }); } @Override public void loadBefore(@NonNull final LoadParams<Integer> params, @NonNull final LoadCallback<Integer, Item> callback) { RetrofitClient.getInstance() .getApi() .getAnswers(params.key, PAGE_SIZE, SITE_NAME) .enqueue(new Callback<StackApiResponse>() { @Override public void onResponse(Call<StackApiResponse> call, Response<StackApiResponse> response) { Integer key = (params.key > 1) ? params.key - 1 : null; if(response.body() != null) { callback.onResult(response.body().items, key); } } @Override public void onFailure(Call<StackApiResponse> call, Throwable t) { } }); } @Override public void loadAfter(@NonNull final LoadParams<Integer> params, @NonNull final LoadCallback<Integer, Item> callback) { RetrofitClient.getInstance() .getApi() .getAnswers(params.key, PAGE_SIZE, SITE_NAME) .enqueue(new Callback<StackApiResponse>() { @Override public void onResponse(Call<StackApiResponse> call, Response<StackApiResponse> response) { Integer key = response.body().has_more ? params.key + 1 : null; if(response.body() != null) { callback.onResult(response.body().items, key); } } @Override public void onFailure(Call<StackApiResponse> call, Throwable t) { } }); } }
[ "vijubalak@gmail.com" ]
vijubalak@gmail.com
928bedaee17a00dd0968a8a812dc99e66f9c6964
467ddec9b6a4028d0fc79cc37ddd747e7ecd749b
/app/src/androidTest/java/com/example/androidlifecycletest/ExampleInstrumentedTest.java
af6e14f90b5ed96e13ea301b0d6f3c30a57302f9
[]
no_license
DannyAnn/AndroidLifeCycleTest
99069a5738e0f071a93a648fa8ed13541bc13725
0cbbaa5bf05883cfbb2d65b27c162f2db945278b
refs/heads/master
2021-01-19T23:19:22.095875
2017-04-21T07:48:27
2017-04-21T07:48:27
88,957,084
0
0
null
null
null
null
UTF-8
Java
false
false
768
java
package com.example.androidlifecycletest; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.androidlifecycletest", appContext.getPackageName()); } }
[ "dannyann95@foxmail.com" ]
dannyann95@foxmail.com
295f3de6269001ecfe35c5ff948d17523999f9ee
c9323f609009776a65166b618ca988fc84bf7e42
/service/fast/fast-server/src/main/java/com/jxph/cloud/service/fast/server/task/job/TestJob.java
23e72cd6a15c71bf6bbf80b710ae685eab9c7a70
[]
no_license
tyler2350/cloud
c13387f23117d7aa42a4699413f3683af2867b69
65cf634f05199bacdddf89907203140d960c7335
refs/heads/master
2020-03-31T21:18:21.684320
2018-09-29T16:28:27
2018-09-29T16:28:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
302
java
package com.jxph.cloud.service.fast.server.task.job; import org.springframework.stereotype.Component; /** * @author 谢秋豪 * @date 2018/9/8 15:18 */ @Component public class TestJob implements TaskJob { @Override public void processImpl() { System.out.println("错误"); } }
[ "794147572@qq.com" ]
794147572@qq.com
714544355c5350f52dc0f85f66c26c5eaa20e2d2
924dedecbb859c922a62c13ac2e4740c8c496709
/platforms/android/src/com/ionicframework/mapamenues197729/MainActivity.java
fccc0cc12c7f6967e79e9745452ac93e0cda9207
[]
no_license
BariGuia/BariGuia
1d5ca5916f4ff589c93971297bfd73ea14f73996
f7363cfd39cf22fe3a5ae423d8c4a864c0b51008
refs/heads/master
2021-08-23T17:42:41.302920
2017-12-05T23:06:48
2017-12-05T23:06:48
110,351,262
0
0
null
null
null
null
UTF-8
Java
false
false
1,468
java
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.ionicframework.mapamenues197729; import android.os.Bundle; import org.apache.cordova.*; public class MainActivity extends CordovaActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // enable Cordova apps to be started in the background Bundle extras = getIntent().getExtras(); if (extras != null && extras.getBoolean("cdvStartInBackground", false)) { moveTaskToBack(true); } // Set by <content src="index.html" /> in config.xml loadUrl(launchUrl); } }
[ "matiaslavanchi@gmail.com" ]
matiaslavanchi@gmail.com
3df5c058f34c01c7f59c0f25bafc88cf7ea9340f
6ac6448e059d12574c0c778907e6f043f59c67f4
/app/entitys/response/AbicsDataRelatorioAbicsResponse.java
292e4126cab00b281ed740ffd3b1594796d3a826
[ "Apache-2.0" ]
permissive
joaoveronezi/abicslogprojeto
4616189d96f1535872b3a1507a1b89e97f230630
f5aefd971304de834f6856a92187d1534b8fef05
refs/heads/master
2020-05-25T16:50:54.958809
2019-05-21T19:00:36
2019-05-21T19:00:36
187,894,939
0
0
null
null
null
null
UTF-8
Java
false
false
1,078
java
package entitys.response; public class AbicsDataRelatorioAbicsResponse { private String tipo; private String tipoCafe; private String pais; private String mes; private String ano; private String peso; private String receita; private String saca60kg; public AbicsDataRelatorioAbicsResponse(String tipo, String tipoCafe, String pais, String mes, String ano, String peso, String receita, String saca60kg) { this.tipo = tipo; this.tipoCafe = tipoCafe; this.mes = mes; this.pais = pais; this.ano = ano; this.peso = peso; this.receita = receita; this.saca60kg = saca60kg; } public String getTipoCafe() { return tipoCafe; } public String getPais() { return pais; } public String getMes() { return mes; } public String getAno() { return ano; } public String getTipo() { return tipo; } public String getPeso() { return peso; } public String getReceita() { return receita; } public String getSaca60kg() { return saca60kg; } }
[ "noreply@github.com" ]
joaoveronezi.noreply@github.com
82f6c4a03fc88c7ffcaeefedb9e60155a08fceda
2bf4f53cccf1b1ac519ba273660f8833902f5c58
/src/main/java/cn/com/connext/oms/commons/dto/exchange/ReturnDetails.java
c088344ba78c4d1b66f19104b79d9c10114d96e8
[]
no_license
oms-wms/OMS4Intern
93b002319f6fb0bdaa811de21fb5e77a5374ee11
8707064e6662b23c72a9dc12137538455826a893
refs/heads/master
2020-04-20T14:45:37.196331
2019-02-03T04:35:30
2019-02-03T04:35:42
168,908,995
1
0
null
null
null
null
UTF-8
Java
false
false
3,085
java
package cn.com.connext.oms.commons.dto.exchange; import cn.com.connext.oms.entity.TbReturnGoods; import java.util.Date; import java.util.List; /** * @created with IDEA * @author: yonyong * @version: 1.0.0 * @date: 2019/1/8 * @time: 23:52 **/ public class ReturnDetails { private Integer returnId; /** * 退货单号 */ private String returnCode; /** * 退货的状态 */ private String returnState; /** * 订单id */ private Integer orderId; /** * 退货金额 */ private Double returnPrice; /** * 创建时间 */ private Date created; /** * 修改人 */ private String modifiedUser; /** * 修改时间 */ private Date updated; /** * 单号类型(退货单/换货单) */ private String returnType; /** * 订单号 */ private String orderCode; /** * 渠道订单号 */ private String channelCode; /** * 退货商品列表 */ private List<TbReturnGoods> tbReturnGoods; public Integer getReturnId() { return returnId; } public void setReturnId(Integer returnId) { this.returnId = returnId; } public String getReturnCode() { return returnCode; } public void setReturnCode(String returnCode) { this.returnCode = returnCode; } public String getReturnState() { return returnState; } public void setReturnState(String returnState) { this.returnState = returnState; } public Integer getOrderId() { return orderId; } public void setOrderId(Integer orderId) { this.orderId = orderId; } public Double getReturnPrice() { return returnPrice; } public void setReturnPrice(Double returnPrice) { this.returnPrice = returnPrice; } public Date getCreated() { return created; } public void setCreated(Date created) { this.created = created; } public String getModifiedUser() { return modifiedUser; } public void setModifiedUser(String modifiedUser) { this.modifiedUser = modifiedUser; } public Date getUpdated() { return updated; } public void setUpdated(Date updated) { this.updated = updated; } public String getReturnType() { return returnType; } public void setReturnType(String returnType) { this.returnType = returnType; } public String getOrderCode() { return orderCode; } public void setOrderCode(String orderCode) { this.orderCode = orderCode; } public String getChannelCode() { return channelCode; } public void setChannelCode(String channelCode) { this.channelCode = channelCode; } public List<TbReturnGoods> getTbReturnGoods() { return tbReturnGoods; } public void setTbReturnGoods(List<TbReturnGoods> tbReturnGoods) { this.tbReturnGoods = tbReturnGoods; } }
[ "279205343@qq.com" ]
279205343@qq.com
f83e4d8dfaa999cf7d906eaa8128b61e620edc96
f6b54cec9d36b806a893e353c66e2dd18836ce5a
/BookCatalogService/src/main/java/com/sber/bookcatalog/repository/AuthorRepositoryJpa.java
7c51407a38bfa41f15c3f6cdb4ebba448621694f
[]
no_license
MarinaP85/KafkaAdapter
49663f8b13e6e7e5bd582ab3af38a52f1fe37113
4b935f76ce2e8121768627ad6a16e242fb807125
refs/heads/master
2023-06-16T09:20:17.309572
2021-07-13T10:17:01
2021-07-13T10:17:01
383,418,324
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
package com.sber.bookcatalog.repository; import com.sber.bookcatalog.model.Author; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface AuthorRepositoryJpa extends JpaRepository<Author, Long> { @Query("select a.name from Author a order by a.name") List<String> readListAuthors(); }
[ "marisha_home@mail.ru" ]
marisha_home@mail.ru
200026f13a1e6bdda6bb2f115afcc6a8386473f1
0d51b1365bb50503c3d3fda4b8357dd4f1bcb1e1
/src/net/eoutech/utils/EuUdpClient.java
d96ccdbd4cecaef8028a2fac885b2a94ea8d467a
[]
no_license
hezhengwei92/vifiws
3303fba045b736190a423dd7f5679bdc661facac
a093fffefc5165a4cbe4cac062302f4aa80f59b2
refs/heads/master
2021-08-23T08:44:13.951601
2017-12-04T10:38:13
2017-12-04T10:38:13
113,009,083
0
0
null
null
null
null
UTF-8
Java
false
false
975
java
package net.eoutech.utils; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; //05x public class EuUdpClient { private DatagramSocket m_socket; private String m_serverIP; private int m_serverPort; public EuUdpClient(String servIp, int servPort) { m_serverIP = servIp; m_serverPort = servPort; } public int sendMsg(String msg) { try { m_socket = new DatagramSocket(); m_socket.setSoTimeout(3000); byte[] buffer = msg.getBytes(); DatagramPacket packet = new DatagramPacket(buffer, buffer.length, InetAddress.getByName(m_serverIP), m_serverPort); m_socket.send(packet); byte[] b = new byte[4096]; DatagramPacket in = new DatagramPacket(b, 0, b.length); m_socket.receive(in); System.out.println("服务器返回字节长度。。。" + in.getLength()); } catch (Exception e) { return -1; } finally { if (m_socket != null) { m_socket.close(); } } return 0; } }
[ "419084526@qq.com" ]
419084526@qq.com
1966706c2a387792896bf3045a9043613286ab9d
44e7adc9a1c5c0a1116097ac99c2a51692d4c986
/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/replication/ReplicationNAryOperator.java
fca4b43e02d77ade601f2faf401d72bf0ce360cd
[ "Apache-2.0" ]
permissive
QiAnXinCodeSafe/aws-sdk-java
f93bc97c289984e41527ae5bba97bebd6554ddbe
8251e0a3d910da4f63f1b102b171a3abf212099e
refs/heads/master
2023-01-28T14:28:05.239019
2020-12-03T22:09:01
2020-12-03T22:09:01
318,460,751
1
0
Apache-2.0
2020-12-04T10:06:51
2020-12-04T09:05:03
null
UTF-8
Java
false
false
1,063
java
/* * Copyright 2011-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * 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://aws.amazon.com/apache2.0 * * This file 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.amazonaws.services.s3.model.replication; import java.util.List; /** * Abstract class representing an operator that acts on N number of predicates. */ abstract class ReplicationNAryOperator extends ReplicationFilterPredicate { private final List<ReplicationFilterPredicate> operands; public ReplicationNAryOperator(List<ReplicationFilterPredicate> operands) { this.operands = operands; } public List<ReplicationFilterPredicate> getOperands() { return operands; } }
[ "" ]
fc232607b303a0dea51fb6e4cc118b384cc5b79d
7d45441da2999f92782bcfc4ed99c92e4a36bc8c
/src/com/test/databasetest/holders/Course.java
295ce7dc067fcbdd2320db9832f2caff59be1078
[]
no_license
kevinvanmierlo/AndroidDatabase
a0b9faab9b45665f16f94871b9f960fb10305768
0d4089d96a6688c098d97cd554bb73c571a09c7d
refs/heads/master
2016-09-06T14:37:33.071121
2014-03-11T23:27:41
2014-03-11T23:27:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
428
java
package com.test.databasetest.holders; public class Course { private long id; private String course; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getCourse(){ return course; } public void setCourse(String course) { this.course = course; } // Will be used by the ArrayAdapter in the ListView @Override public String toString() { return course; } }
[ "mierlok001@hva.nl" ]
mierlok001@hva.nl
5fbc929467b493395f452b3fc81078efb31bd828
e3162d976b3a665717b9a75c503281e501ec1b1a
/src/main/java/com/alipay/api/domain/TemplateOpenCardConfDTO.java
5b12a33cedae1d2c2c5c280678f82a8d942020f7
[ "Apache-2.0" ]
permissive
sunandy3/alipay-sdk-java-all
16b14f3729864d74846585796a28d858c40decf8
30e6af80cffc0d2392133457925dc5e9ee44cbac
refs/heads/master
2020-07-30T14:07:34.040692
2019-09-20T09:35:20
2019-09-20T09:35:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,919
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 模板开卡配置 * * @author auto create * @since 1.0, 2018-04-17 17:57:49 */ public class TemplateOpenCardConfDTO extends AlipayObject { private static final long serialVersionUID = 4279761832973662935L; /** * 领卡权益信息 */ @ApiListField("card_rights") @ApiField("template_rights_content_d_t_o") private List<TemplateRightsContentDTO> cardRights; /** * 配置,预留字段,暂时不用 */ @ApiField("conf") private String conf; /** * ISV:外部系统 MER:直连商户 */ @ApiField("open_card_source_type") private String openCardSourceType; /** * 开卡连接,必须http、https开头 */ @ApiField("open_card_url") private String openCardUrl; /** * 渠道APPID,提供领卡页面的服务提供方 */ @ApiField("source_app_id") private String sourceAppId; public List<TemplateRightsContentDTO> getCardRights() { return this.cardRights; } public void setCardRights(List<TemplateRightsContentDTO> cardRights) { this.cardRights = cardRights; } public String getConf() { return this.conf; } public void setConf(String conf) { this.conf = conf; } public String getOpenCardSourceType() { return this.openCardSourceType; } public void setOpenCardSourceType(String openCardSourceType) { this.openCardSourceType = openCardSourceType; } public String getOpenCardUrl() { return this.openCardUrl; } public void setOpenCardUrl(String openCardUrl) { this.openCardUrl = openCardUrl; } public String getSourceAppId() { return this.sourceAppId; } public void setSourceAppId(String sourceAppId) { this.sourceAppId = sourceAppId; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
8cbc225b3c2fb15b362d91634819562f4f264614
401dd2cfc43a46b94d72db665810d902e54a8020
/src/main/java/org/edu/academic/service/AlunoService.java
8c1045df2073cc0517de77ae440d4ba9f82028ae
[]
no_license
pdror/spring-mini-projeto
07013404442e16533a4a67a7b9a9b7d8725d92ed
8e9b9b7d7ef588f748bf72acc1765151b358a322
refs/heads/master
2023-01-31T14:00:41.622824
2020-12-15T14:27:27
2020-12-15T14:27:27
316,604,441
0
1
null
null
null
null
UTF-8
Java
false
false
367
java
package org.edu.academic.service; import java.util.List; import org.edu.academic.model.Aluno; public interface AlunoService { public List<Aluno> getAlunos(); public Aluno getByMatricula(String matricula); public Aluno postAluno(Aluno aluno); public Aluno putAluno(String matricula, Aluno aluno); public void deleteAluno(String matricula); }
[ "pedrohframos@outlook.com" ]
pedrohframos@outlook.com
99cf9f03dabcffb9bdccc20b8b42aee6b55e2376
0378014de0a1bb6c6f3624d4bc40dba543474344
/src/ai/Heuristic.java
8f73a3b12ec4a52b455bf83b02d86ea7a24cd035
[ "MIT" ]
permissive
pitagoras3/stratego_game
5f007c01f12a659283eecefe3b269e54fd684ccf
da3ac2f5dc5b07841370da2af3af423251d11a6c
refs/heads/master
2020-03-11T18:32:34.089532
2018-05-14T04:46:07
2018-05-14T04:46:07
130,179,992
0
0
null
null
null
null
UTF-8
Java
false
false
802
java
package ai; import game.BoardSquare; import game.Game; import java.util.ArrayList; import java.util.Collections; public interface Heuristic { static ArrayList<Move> getInOrderPossibleMoves(BoardSquare[][] board){ ArrayList<Move> availableMoves = new ArrayList<>(); for(int y = 0; y < Game.BOARD_SIZE; y++){ for(int x = 0; x < Game.BOARD_SIZE; x++){ if(!board[y][x].isFilled()){ availableMoves.add(new Move(x, y)); } } } return availableMoves; } static ArrayList<Move> getRandomizedPossibleMoves(BoardSquare[][] board){ ArrayList<Move> availableMoves = getInOrderPossibleMoves(board); Collections.shuffle(availableMoves); return availableMoves; } }
[ "szymon.marcinkiewicz@gmail.com" ]
szymon.marcinkiewicz@gmail.com
624ac545bc442e85e697a728ffd6008cc1ebb245
4c6adf0ce6ef3f02dcef9c345e0e5e4ff139d886
/Common/MA/ma-manager/src/main/java/com/pay/poss/enterprisemanager/controller/AccountOfEnterpriseListController.java
c5df59062bf5c78f45e95ba9d3b00d4a4bb9bf28
[]
no_license
happyjianguo/pay-1
8631906be62707316f0ed3eb6b2337c90d213bc0
40ae79738cfe4e5d199ca66468f3a33e9d8f2007
refs/heads/master
2020-07-27T19:51:54.958859
2016-12-19T07:34:24
2016-12-19T07:34:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,589
java
package com.pay.poss.enterprisemanager.controller; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream; import java.text.SimpleDateFormat; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.beans.BeanUtils; import org.springframework.validation.BindException; import org.springframework.web.bind.ServletRequestUtils; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.SimpleFormController; import com.pay.acc.service.account.constantenum.AcctTypeEnum; import com.pay.inf.comm.PageUtils; import com.pay.inf.dao.Page; import com.pay.poss.enterprisemanager.common.Constants; import com.pay.poss.enterprisemanager.dto.EnterpriseSearchDto; import com.pay.poss.enterprisemanager.dto.EnterpriseSearchListDto; import com.pay.poss.enterprisemanager.enums.AccountStatusEnum; import com.pay.poss.enterprisemanager.formbean.EnterpriseSearchFormBean; import com.pay.poss.enterprisemanager.service.IEnterpriseService; import com.pay.poss.security.util.SessionUserHolderUtil; import com.pay.poss.userrelation.dto.NodesDto; import com.pay.poss.userrelation.service.IUserRelationService; /** * * @Description * @project poss-membermanager * @file AccountOfEnterpriseListController.java * @note <br> * @develop JDK1.6 + Eclipse 3.5 * @version 1.0 * Copyright © 2004-2013 pay.com . All rights reserved. 版权所有 * Date Author Changes * 2010-10-22 ddr Create */ public class AccountOfEnterpriseListController extends SimpleFormController { private Log log = LogFactory.getLog(AccountOfEnterpriseListController.class); private IEnterpriseService enterpriseService; private IUserRelationService userRelationService; public void setUserRelationService(IUserRelationService userRelationService) { this.userRelationService = userRelationService; } @Override protected Map<String,Object> referenceData(HttpServletRequest request) throws Exception { log.debug("AccountOfEnterpriseListController.referenceData is running..."); Map<String,Object> dataMap = this.initData(request); return dataMap; } @Override protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { log.debug("AccountOfEnterpriseListController.onSubmit is running..."); EnterpriseSearchFormBean enterpriseSearchFormBean = (EnterpriseSearchFormBean) command; EnterpriseSearchDto enterpriseSearchDto = new EnterpriseSearchDto(); BeanUtils.copyProperties(enterpriseSearchFormBean, enterpriseSearchDto); //数据库排序字段 String orderParam = ServletRequestUtils.getStringParameter(request, "orderParam",null); String ascOrDesc = ServletRequestUtils.getStringParameter(request, "ascOrDesc",null); enterpriseSearchDto.setOrderParam(orderParam); enterpriseSearchDto.setAscOrDesc(ascOrDesc); //// if(StringUtils.isNotEmpty(enterpriseSearchFormBean.getMerchantName())){ if(Pattern.compile(Constants.SEARCHKEY).matcher(enterpriseSearchFormBean.getMerchantName()).matches()){ enterpriseSearchDto.setEnterpriseSearchKey(enterpriseSearchFormBean.getMerchantName()); enterpriseSearchDto.setMerchantName(null); } } Page<EnterpriseSearchListDto> page = PageUtils.getPage(request); enterpriseSearchDto.setPageEndRow((page.getPageNo()*page.getPageSize())+""); if((page.getPageNo()-1)==0){ enterpriseSearchDto.setPageStartRow("0"); }else{ enterpriseSearchDto.setPageStartRow((page.getPageNo()-1)*page.getPageSize()+""); } //处理所属销售条件 2014/5/12 if(StringUtils.isEmpty(enterpriseSearchDto.getSignLoginId())){ //List<NodesDto> loginSubNodes = getLoginIdSubNodes(); //enterpriseSearchDto.setSignLoginIds((this.convertNodesToString(loginSubNodes))); }else{ enterpriseSearchDto.setSignLoginIds(new String[]{enterpriseSearchDto.getSignLoginId()}); } List<EnterpriseSearchListDto> enterpriseList = enterpriseService.queryAccountOfEnterprise(enterpriseSearchDto); Integer enterpriseListCount = enterpriseService.queryAccountOfEnterpriseCount(enterpriseSearchDto); page.setResult(enterpriseList); page.setTotalCount(enterpriseListCount); /////////////// //如果是导出 String export = ServletRequestUtils.getStringParameter(request, "export","0"); Map<String,Object> dataMap = this.initData(request); if(export.equals("1")){ List<EnterpriseSearchListDto> enterpriseListAll=enterpriseService.queryAccountOfEnterpriseAll(enterpriseSearchDto); return exportAccountList(enterpriseListAll,request, response,dataMap); } dataMap.put("page",page); dataMap.put("enterpriseSearchDto", enterpriseSearchDto); return new ModelAndView(this.getSuccessView()).addAllObjects(dataMap); } public ModelAndView exportAccountList(List<EnterpriseSearchListDto> list,HttpServletRequest request,HttpServletResponse response,Map dataMap) throws FileNotFoundException, IOException{ String fullPath = request.getSession().getServletContext().getRealPath("/WEB-INF/jsp/enterprisemanager/accountOfEnterpriseListExport.xls"); HSSFWorkbook book ; OutputStream os = null ; //创建workbook book = new HSSFWorkbook(new FileInputStream(fullPath)); HSSFFont fontHei = book.createFont(); fontHei.setFontHeightInPoints( (short)11); fontHei.setFontName("黑体"); HSSFSheet sheet = book.getSheetAt(0); // 取得第一张表 try { //创建workbook int ROWNUM_DATA = 2; // 数据的起始行位置 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); int i=0 ; for(; i<list.size();i++){ EnterpriseSearchListDto record = (EnterpriseSearchListDto)list.get(i); HSSFRow row = sheet.createRow(ROWNUM_DATA+i); int j = 0; row.createCell(j++).setCellValue(record.getMemberCode()); row.createCell(j++).setCellValue(record.getMerchantCode()); row.createCell(j++).setCellValue(record.getMerchantName()); row.createCell(j++).setCellValue((record.getLoginName())); row.createCell(j++).setCellValue((record.getAccountCode())); AcctTypeEnum[] accountTypeList=(AcctTypeEnum[]) dataMap.get("accountTypeList"); Boolean flag=false; for (AcctTypeEnum acctTypeEnum : accountTypeList) { if(acctTypeEnum.getCode()==Integer.parseInt(record.getAccountType())){ row.createCell(j++).setCellValue(acctTypeEnum.getDisplayName()); flag=true; } } if(!flag){ row.createCell(j++).setCellValue(""); } row.createCell(j++).setCellValue(record.getCreditBalance()); row.createCell(j++).setCellValue(record.getDebitBalance()); row.createCell(j++).setCellValue(record.getBalance()); row.createCell(j++).setCellValue((record.getFrozenBalance())); AccountStatusEnum[] accountStatusEnum=(AccountStatusEnum[])dataMap.get("accountStatusEnum"); for (AccountStatusEnum accountStatusEnum2 : accountStatusEnum) { if(accountStatusEnum2.getCode()==Integer.parseInt(record.getAccountStatus())){ row.createCell(j++).setCellValue(accountStatusEnum2.getDescription()); } } row.createCell(j++).setCellValue(record.getSignName()); }; // 设置格式 // 输出 response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.addHeader("Content-Disposition", (new StringBuilder("attachment; filename=\"")) .append(new String("账户信息当前页.xls".getBytes("gbk"), "ISO-8859-1")).append("\"").toString()); os = response.getOutputStream(); book.write(os); os.flush(); } catch (Exception e) { e.printStackTrace(); logger.error("写excel报错IO", e); } finally{ try{ if(os!=null) os.close(); }catch (Exception e) { e.printStackTrace(); logger.error("关闭流出错", e); } } return null; } private Map<String,Object> initData(HttpServletRequest request){ AcctTypeEnum[] accountTypeList = AcctTypeEnum.values(); AccountStatusEnum[] accountStatusEnum = AccountStatusEnum.values(); Map<String,Object> dataMap = new Hashtable<String,Object>(); dataMap.put("accountTypeList",accountTypeList ); dataMap.put("accountStatusEnum",accountStatusEnum ); /*List<NodesDto> loginSubNodes = getLoginIdSubNodes(); dataMap.put("loginSubNodes", loginSubNodes == null ? new ArrayList<NodesDto>() :loginSubNodes);*/ List<NodesDto> loginSubNodes=userRelationService.findAll(); dataMap.put("loginSubNodes",loginSubNodes); return dataMap; } private List<NodesDto> getLoginIdSubNodes() { //登录人的子节点 String loginId = SessionUserHolderUtil.getLoginId(); List<NodesDto> loginSubNodes = userRelationService.findAllSubLoginId(loginId); return loginSubNodes; } private String [] convertNodesToString(List<NodesDto> loginSubNodes){ if(null == loginSubNodes) return null; //String strs = ""; String[] signIds = new String [loginSubNodes.size()]; NodesDto nodesDto = null; for (int i = 0; i < loginSubNodes.size(); i++) { nodesDto = loginSubNodes.get(i); signIds[i] = nodesDto.getLoginId(); } // for (NodesDto nodesDto : loginSubNodes) { // strs += "'"+ nodesDto.getLoginId() +"',"; // } // if(strs.length() > 0) // return strs.substring(0,strs.length()-1); return signIds; } public void setEnterpriseService(IEnterpriseService enterpriseService) { this.enterpriseService = enterpriseService; } }
[ "stanley.zou@hrocloud.com" ]
stanley.zou@hrocloud.com
32a50d629dbb247655ef6334f097858d8bfcffd0
235b4ad13202d2c51d1ac824bd819ebb31f084f8
/Pizzi-Del Brio/src/it/PrjPizziDelBrio/model/Persona.java
23c1a33727b5ccb40aa8920f2a4921fcbc16e1e4
[]
no_license
manu111197/Pizzi-Del-Brio
2ff940eac331ffa8ef1c1e00964e3910b072f8fe
c23bbb555b5639da49f8bafc87751db483acdcd9
refs/heads/master
2021-05-06T10:28:17.409319
2018-02-16T12:06:22
2018-02-16T12:06:22
114,136,355
0
0
null
null
null
null
UTF-8
Java
false
false
926
java
package it.PrjPizziDelBrio.model; public class Persona { private String email; private byte[] password; private String nome; private String cognome; private String cellulare; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public byte[] getPassword() { return password; } public void setPassword(byte[] password) { this.password = password; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getCognome() { return cognome; } public void setCognome(String cognome) { this.cognome = cognome; } public String getCellulare() { return cellulare; } public void setCellulare(String cellulare) { this.cellulare = cellulare; } }
[ "manuleopizzi2010@live.it" ]
manuleopizzi2010@live.it
ca8ec3cc0b83902cf8b063beaa0bfeb51ded5ec0
447520f40e82a060368a0802a391697bc00be96f
/apks/playstore_apps/de_number26_android/source/com/salesforce/android/chat/core/internal/e/c/e.java
4ee47d63736b292e0f7b8d2c30222edfa45808c2
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
1,231
java
package com.salesforce.android.chat.core.internal.e.c; import com.google.gson.Gson; import com.salesforce.android.service.common.b.d; import com.salesforce.android.service.common.b.h; import com.salesforce.android.service.common.b.j; import com.salesforce.android.service.common.c.e.f; import com.salesforce.android.service.common.utilities.h.a; import okhttp3.RequestBody; public class e implements f { private final transient String b; private final transient String c; e(String paramString1, String paramString2) { this.c = paramString2; this.b = paramString1; } public h a(String paramString, Gson paramGson, int paramInt) { return d.b().a(a(paramString)).a("Accept", "application/json; charset=utf-8").a("x-liveagent-api-version", "42").a("x-liveagent-session-key", this.b).a("x-liveagent-affinity", this.c).a("x-liveagent-sequence", Integer.toString(paramInt)).a(RequestBody.create(a, a(paramGson))).c(); } public String a(Gson paramGson) { return paramGson.toJson(this); } public String a(String paramString) { return String.format("https://%s/chat/rest/%s", new Object[] { a.a(paramString, "LiveAgent Pod must not be null"), "Chasitor/ChasitorTyping" }); } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
b43a452a961d7377dfb04799d309c36bc7de971f
318e0817bb3697ed28a6cab159ca60809df45b7b
/src/kr/ac/kirc/ekp/core/search/integra_translator_ver1.java
28460a3acf5d224daf32efec366fba58c84c1aa4
[]
no_license
brianhan87/knowledge_discovery
023472f20a9726079eb93f9b858af8c31bbbf9ba
87b8141de40170054eacde072e2accda3d517613
refs/heads/master
2020-06-21T21:16:19.307953
2019-07-18T23:50:41
2019-07-18T23:50:41
197,554,292
0
0
null
null
null
null
UHC
Java
false
false
16,577
java
package kr.ac.kirc.ekp.core.search; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; public class integra_translator_ver1 { // 메소드화를 위한 main class 생성// 테스트용 메인함수 : 아래와 같은 형태로 호출하여 사용하면 리스트 값을 리턴함 public static void main(String[] args) { String diagnosis="아밀라아제(Amylase)가 높고 리파아제(Lipase)가 높지 않습니다. 침샘, 소장, 간, 마크로아밀라제 혹은 드물게 췌장의 질환과 관련이 있습니다."; ArrayList<String> expendedlist = new ArrayList<String>(); expendedlist = getData(diagnosis); for (int r=0; r<expendedlist.size(); r++) { System.out.print(expendedlist.get(r)+", "); } } //sql 연결을 위한 함수 public static Connection getConnection() throws ClassNotFoundException, SQLException{ String url= "jdbc:mysql://ekp.kaist.ac.kr:3306/ekp_db_v2"; String user = "admin"; String pass= "rudgjawltlr1!"; Connection conn=null; Class.forName("org.gjt.mm.mysql.Driver"); conn=DriverManager.getConnection(url,user,pass); //System.out.println("*******접속완료***********"); return conn; } // 문장 입력 부 public static String navertranslator(String query) { String clientId = "9OCPynC2P3XqfptdPqhl";//애플리케이션 클라이언트 아이디값"; String clientSecret = "YCwSQsHmlC";//애플리케이션 클라이언트 시크릿값"; try { String text = URLEncoder.encode(query, "UTF-8"); String apiURL = "https://openapi.naver.com/v1/language/translate"; URL url = new URL(apiURL); HttpURLConnection con = (HttpURLConnection)url.openConnection(); con.setRequestMethod("POST"); con.setRequestProperty("X-Naver-Client-Id", clientId); con.setRequestProperty("X-Naver-Client-Secret", clientSecret); // post request String postParams = "source=ko&target=en&text=" + text; con.setDoOutput(true); DataOutputStream wr = new DataOutputStream(con.getOutputStream()); wr.writeBytes(postParams); wr.flush(); wr.close(); int responseCode = con.getResponseCode(); BufferedReader br; if(responseCode==200) { // 정상 호출 br = new BufferedReader(new InputStreamReader(con.getInputStream())); } else { // 에러 발생 br = new BufferedReader(new InputStreamReader(con.getErrorStream())); } String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = br.readLine()) != null) { response.append(inputLine); } br.close(); //System.out.println(response.toString()); //문장 나누기 String resultstr = response.toString(); String[] words = resultstr.split("translatedText"); //System.out.println(words[1]); String stringresult = words[1].toString(); stringresult =stringresult.replace("\"", ""); //System.out.println(stringresult); String[] words2 = stringresult.split(":"); String realresult = words2[1].toString(); //System.out.println(realresult); realresult =realresult.replace("srcLangType", ""); realresult =realresult.replace(",", ""); realresult =realresult.replace(".", ""); //System.out.println("웹번역대상 : "+ query); return realresult; } catch (Exception e) { System.out.println(e); } return null; } //네이버 기반 번역 파트 public static ArrayList<String> getData(String targettext) { try { //String targettext = "전립선특이항원(PSA)가 정상아지만, 전립선에 문제가 있습니다."; //String targettext = "아밀라아제(Amylase)가 높고 리파아제(Lipase)가 높지 않습니다. 침샘, 소장, 간, 마크로아밀라제 혹은 드물게 췌장의 질환과 관련이 있습니다."; //System.out.println("*************온톨로지에 접속중*************"); Connection conn = getConnection(); StringBuilder sb = new StringBuilder(); sb=new StringBuilder(""); String sql0 = sb.append("SELECT * FROM ekp_db_v2.conclusions_en where conclusion_kr='"+targettext +"';").toString(); ResultSet res0=null; Statement stmt0=null; stmt0 = conn.createStatement(); res0 = stmt0.executeQuery(sql0); String response =""; if(res0.next()){ //검색결과가 널이 아니라면 //System.out.println("검색어 : "+ targettext); //System.out.println("온톨로지 번역:"+ res0.getString(4)); response = res0.getString(4); ResultSet qres0=null; Statement qstmt0=null; //System.out.println("--------------------------------- "); //System.out.println(""); if(res0 != null) res0.close(); if(stmt0 != null) stmt0.close(); if(qres0 != null) qres0.close(); if(qstmt0 != null) qstmt0.close(); //if(conn != null) conn.close(); }else { //System.out.println("결과가 없습니다. 웹번역을 실행합니다."); //네이버 번역 실행 response = navertranslator(targettext).toString(); //System.out.println("번역결과 : "+response); //번역결과 DB에 저장 try { //Pkey값 가져오기 sb=new StringBuilder(""); String sql98 =sb.append("select count(*) from `ekp_db_v2`.`conclusions_en`").toString(); ResultSet res98=null; Statement stmt98=null; stmt98 = conn.createStatement(); res98 = stmt98.executeQuery(sql98); int rowcount = 0; if(res98.next()) { rowcount=res98.getInt(1); } //System.out.println(rowcount); if(res98 != null) res98.close(); if(stmt98 != null) stmt98.close(); int pKey= rowcount+1; sb=new StringBuilder(""); String sql99=sb.append("INSERT INTO `ekp_db_v2`.`conclusions_en` (`con_pid`, `conclusion_kr`, `tran_conclu`) VALUES ('"+pKey+"','"+targettext+"','"+response+"');").toString(); //String sql99 =sb.append("INSERT INTO `ekp_db_v2`.`conclusions_en` (`conclusion_kr`, `tran_conclu`) VALUES ("+targettext+","+response+");").toString(); ResultSet res99=null; Statement stmt99=null; //System.out.println(sql99.toString()); stmt99 = conn.createStatement(); stmt99.executeUpdate(sql99); if(res99 != null) res99.close(); if(stmt99 != null) stmt99.close(); //System.out.println("------DB에 번역을 입력하였습니다.-----"); }catch(Exception e) { e.printStackTrace(); System.out.println("member 테이블에 새로운 레코드 추가에 실패했습니다."); } // 번역결과 DB에 저장 } //번역문 DB에서 검색후 없으면-> 웹 번역으로 //번역결과 확인 //System.out.println(response.toString()); //번역 결과 정리 String realresult= response; realresult =realresult.replace("(", ""); realresult =realresult.replace(")", ""); realresult =realresult.replace(".", ""); //단어 형태의 검색 실시 String[] inputlist1 = realresult.split(" "); String[] inputlist2 = new String[inputlist1.length-1]; //System.out.print(inputlist1.length-1); //System.out.println("개의 문자열에 대해 검색을 실시합니다."); //2단어로 구성된 리스트 생성 for(int i=0; i<inputlist1.length-1;i++ ) { inputlist2[i]=inputlist1[i].toString() +" "+inputlist1[i+1].toString(); //System.out.println(inputlist2[i]); } ///2단어 리스트중 'in the'라는 문자열은 제거 해주는 걸로 for(int p=0; p<inputlist2.length;p++) { String check= inputlist2[p].toString(); if(check.equalsIgnoreCase("in the")){ inputlist2[p]= inputlist2[p].replace(inputlist2[p], "---@노#!이@$즈#---"); } } //최종 결과 아웃푹을 위한 ArrayList 생성 ArrayList<String> expendedlist = new ArrayList<String>(); //2단어에 대한 검색 부분 for(int i=0;i<inputlist2.length;i++) {//나중에 반복문으로 변경 필요 String query = inputlist2[i]; sb=new StringBuilder(""); String sql = sb.append("SELECT * FROM ekp_db_v2.word_dictionary_v2 where Word like '%"+query +"%';").toString(); //System.out.println(sql);//검색식 확인용 ResultSet res=null; Statement stmt=null; stmt = conn.createStatement(); res = stmt.executeQuery(sql); if(res.next()){ //검색결과가 널이 아니라면 //System.out.println("검색어 : "+ query); //검색어 확인용 //System.out.println("검색된 code:"+ res.getString(2)); //검색된 코드 확인용 String qcode = res.getString(2); StringBuilder qsb = new StringBuilder(); String qsql = qsb.append("select Word from ekp_db_v2.word_dictionary_v2 where Code='"+qcode+"' and lang = 'EN';").toString(); ResultSet qres=null; Statement qstmt=null; qstmt = conn.createStatement(); qres = qstmt.executeQuery(qsql); //결과 프린팅 while(qres.next()) { String code = qres.getString(1); //System.out.print(code+", "); expendedlist.add(code); } //System.out.println(""); //System.out.println("--------------------------------- "); //삭제 대상 문자열 체크용 //System.out.println("스플릿 대상"); //System.out.println(query); String[] delwords = query.split(" "); ///for(int i=0;i<delwords.length;i++) { ///System.out.println(delwords[i]); ///} //2단어 구성된 문자열을 구성하는 단어 제거 for(int k=0;k<2;k++) { String deltar = delwords[k].toString(); ///System.out.println("정상작동"); for(int j=0; j<inputlist1.length ;j++) { //System.out.println("비교대상"); //System.out.print(deltar); //System.out.print(" VS "); //System.out.println(inputlist1[j]); if(inputlist1[j].equalsIgnoreCase(deltar)) { ///System.out.println("비교시작"); inputlist1[j]= inputlist1[j].replace(inputlist1[j], ""); //System.out.print(deltar); //System.out.println("이(가) 제거됨"); } } } // 리스트 제거 확인용 ///System.out.println("단일 단어 리스트 체크"); ///for(int i=0;i<inputlist1.length;i++) { /// System.out.println(inputlist1[i]); ///} if(res != null) res.close(); if(stmt != null) stmt.close(); if(qres != null) qres.close(); if(qstmt != null) qstmt.close(); //if(conn != null) conn.close();/// 나중에 위치 변경 필요 할것 접속을 끊을 필요 없음 }else { //System.out.print("검색결과가 없습니다"); } } //단일 단어에 대한 검색 확장(exact 메칭 사용) for(int z=0;z<inputlist1.length;z++) { String query2 = inputlist1[z]; //System.out.println("검색어 : "+ query2);// 검색어 확인용 sb=new StringBuilder(""); String sql2 = sb.append("SELECT * FROM ekp_db_v2.word_dictionary_v2 where Word ='"+query2 +"';").toString(); //System.out.println(sql2);//검색식 확인용 ResultSet res2=null; Statement stmt2=null; stmt2 = conn.createStatement(); res2 = stmt2.executeQuery(sql2); if(res2.next()){ //검색결과가 널이 아니라면 //System.out.println("검색어 : "+ query2); //System.out.println("검색된 code:"+ res2.getString(2)); String qcode2 = res2.getString(2); StringBuilder qsb2= new StringBuilder(); String qsql2 = qsb2.append("select Word from ekp_db_v2.word_dictionary_v2 where Code='"+qcode2+"' and lang = 'EN';").toString(); ResultSet qres2=null; Statement qstmt2=null; qstmt2 = conn.createStatement(); qres2 = qstmt2.executeQuery(qsql2); while(qres2.next()) { String code = qres2.getString(1); //System.out.print(code+", "); expendedlist.add(code); } //System.out.println(""); //System.out.println("--------------------------------- "); if(res2 != null) res2.close(); if(stmt2 != null) stmt2.close(); if(qres2 != null) qres2.close(); if(qstmt2 != null) qstmt2.close(); //if(conn != null) conn.close(); }else { //System.out.print(query2+"에 대한"); //System.out.println("검색결과가 없습니다"); } } //생성된 배열 리턴 //추후 다른 파트 부분과 연계하여 리턴의 형태 정리 /* System.out.println(""); System.out.println("============================================================================="); System.out.print("확장된 검색어 리스트: "); for (int r=0; r<expendedlist.size(); r++) { System.out.print(expendedlist.get(r)+", "); } System.out.println(""); System.out.println("============================================================================="); */ return expendedlist; } catch (Exception e) { System.out.println(e); } return null; } }
[ "brianhan87@gmail.com" ]
brianhan87@gmail.com
5e97635952dc32368f0a7db19bb0e878e72e9c41
93a8954e4178dd633a9f4631b99d3b3d7cceca22
/app/src/main/java/com/informatics/b254safaris/Home.java
d28a6c7147495d1e0bd6b69a854f4056301ac6e0
[]
no_license
BayoKwendo/TouristTrack
dcd743e702639972ed76c89f1cf570ef8ba77c72
de4aaeb20bc74fe00c3b320ac274b37c041f09f6
refs/heads/master
2022-01-22T12:35:25.924993
2019-07-20T11:04:29
2019-07-20T11:04:29
197,918,821
0
0
null
null
null
null
UTF-8
Java
false
false
3,686
java
package com.informatics.b254safaris; import android.content.Context; import android.net.Uri; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * {@link Home.OnFragmentInteractionListener} interface * to handle interaction events. * Use the {@link Home#newInstance} factory method to * create an instance of this fragment. */ public class Home extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnFragmentInteractionListener mListener; public Home() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment Home. */ // TODO: Rename and change types and number of parameters public static Home newInstance(String param1, String param2) { Home fragment = new Home(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_home, container, false); } // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } } // @Override // public void onAttach(Context context) { // super.onAttach(context); // if (context instanceof OnFragmentInteractionListener) { // mListener = (OnFragmentInteractionListener) context; // } else { // throw new RuntimeException(context.toString() // + " must implement OnFragmentInteractionListener"); // } // } @Override public void onDetach() { super.onDetach(); mListener = null; } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } }
[ "kwendobrian96@gmail.com" ]
kwendobrian96@gmail.com
028b178fbdfb572c7094993c136cddeb433b70da
4a34c38cc5d9090d29b9a40339028e8ea5ec5bbc
/backend/src/rpc/Login.java
4b8e74af292265dc53d187ddb46d124a1d7ccce3
[]
no_license
Debbieliang9/TravelPin
b183e0c1c5d0d28654530ba397a5883b4f04195b
909ffcec920b835adefc21631f26d9dd12e61c8b
refs/heads/master
2020-04-22T14:51:45.744189
2019-02-13T07:18:02
2019-02-13T07:18:02
170,458,915
0
0
null
2019-02-13T07:09:45
2019-02-13T07:09:42
null
UTF-8
Java
false
false
469
java
package rpc; import java.io.IOException; public class Login extends javax.servlet.http.HttpServlet { protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException { } protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException { } }
[ "sonedigo@gmail.com" ]
sonedigo@gmail.com
3aa3c9d578d33cabe5df8ffcefa20c7e3fdd11ad
a846c5eadf14dacdd341ca3d01f421d9ce3ae5e8
/src/id/co/ahm/jx/uam/app000/model/AhmipuamMstrlsvcs.java
b9c69fa181de487006a8496cdca5583fc4f5454f
[]
no_license
wonx46/ahmtes
1e22404cd527282f28e207c2e3cf5220eaa60ea5
37ab78068b3d90ee03ce5ff69f8aaa3a964e988e
refs/heads/master
2023-03-02T15:56:59.655309
2021-02-03T07:23:11
2021-02-03T07:23:11
335,537,563
0
0
null
null
null
null
UTF-8
Java
false
false
3,135
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 id.co.ahm.jx.uam.app000.model; import id.co.ahm.jxf.model.vid.BaseAuditVidVersioning; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.UniqueConstraint; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; /** * * @author achmad.ha */ @DynamicInsert @DynamicUpdate @Entity @Table(name = "AHMIPUAM_MSTRLSVCS", uniqueConstraints = @UniqueConstraint(columnNames = {"MROLE_IIDROLE", "MSRVC_VIDSERVICE"})) public class AhmipuamMstrlsvcs extends BaseAuditVidVersioning implements Serializable { @Column(name="MROLE_IIDROLE") private Long mroleIidrole; @Column(name="MSRVC_VIDSERVICE",length = 64,nullable = false) private String vidAhmjxuamMstservices; @Column(name = "DBEGINEFF", nullable = false) @Temporal(TemporalType.DATE) private Date dbegineff; @Column(name = "DENDEFF", nullable = false) @Temporal(TemporalType.DATE) private Date dendeff; @ManyToOne(targetEntity=AhmipuamMstroles.class, fetch = FetchType.LAZY) @JoinColumn(name = "MROLE_IIDROLE",referencedColumnName = "IINTERNALID",insertable = false,updatable = false) private AhmipuamMstroles ahmipuamMstroles; @ManyToOne(targetEntity=AhmipuamMstservices.class, fetch = FetchType.LAZY) @JoinColumn(name = "MSRVC_VIDSERVICE",referencedColumnName = "VID",insertable = false,updatable = false) private AhmipuamMstservices ahmipuamMstservices; public Long getMroleIidrole() { return mroleIidrole; } public void setMroleIidrole(Long mroleIidrole) { this.mroleIidrole = mroleIidrole; } public String getVidAhmjxuamMstservices() { return vidAhmjxuamMstservices; } public void setVidAhmjxuamMstservices(String vidAhmjxuamMstservices) { this.vidAhmjxuamMstservices = vidAhmjxuamMstservices; } public Date getDbegineff() { return dbegineff; } public void setDbegineff(Date dbegineff) { this.dbegineff = dbegineff; } public Date getDendeff() { return dendeff; } public void setDendeff(Date dendeff) { this.dendeff = dendeff; } public AhmipuamMstroles getAhmipuamMstroles() { return ahmipuamMstroles; } public void setAhmipuamMstroles(AhmipuamMstroles ahmipuamMstroles) { this.ahmipuamMstroles = ahmipuamMstroles; } public AhmipuamMstservices getAhmipuamMstservices() { return ahmipuamMstservices; } public void setAhmipuamMstservices(AhmipuamMstservices ahmipuamMstservices) { this.ahmipuamMstservices = ahmipuamMstservices; } }
[ "wonx.project@gmail.com" ]
wonx.project@gmail.com
85e8e080c15378562a58081ae53b3eaeb10c5e73
eac576976210a42aaeb484d45e2316033d1dae9e
/jOOQ/src/main/java/org/jooq/impl/TableImpl.java
8130159f5be97a95567478692dd95366cf74a621
[ "Apache-2.0" ]
permissive
prashanth02/jOOQ
75fa46912cdeb72ef472b9020635c2a792dcf1af
2a4955abf1752a4e6e2b8127f429d13b8fe68be6
refs/heads/master
2022-10-03T15:32:45.960679
2016-05-30T10:14:52
2016-05-30T10:14:52
60,037,493
0
0
NOASSERTION
2022-09-22T19:34:19
2016-05-30T20:34:12
Java
UTF-8
Java
false
false
6,706
java
/** * Copyright (c) 2009-2016, Data Geekery GmbH (http://www.datageekery.com) * All rights reserved. * * 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. * * Other licenses: * ----------------------------------------------------------------------------- * Commercial licenses for this work are available. These replace the above * ASL 2.0 and offer limited warranties, support, maintenance, and commercial * database integrations. * * For more information, please visit: http://www.jooq.org/licenses * * * * * * * * * * * * * * * * */ package org.jooq.impl; import static java.util.Arrays.asList; import static org.jooq.Clause.TABLE; import static org.jooq.Clause.TABLE_ALIAS; import static org.jooq.Clause.TABLE_REFERENCE; import static org.jooq.SQLDialect.FIREBIRD; // ... import static org.jooq.SQLDialect.POSTGRES; import java.util.Arrays; import org.jooq.Clause; import org.jooq.Context; import org.jooq.Field; import org.jooq.Record; import org.jooq.Schema; import org.jooq.Table; import org.jooq.tools.StringUtils; /** * A common base type for tables * <p> * This type is for JOOQ INTERNAL USE only. Do not reference directly * * @author Lukas Eder */ public class TableImpl<R extends Record> extends AbstractTable<R> { private static final long serialVersionUID = 261033315221985068L; private static final Clause[] CLAUSES_TABLE_REFERENCE = { TABLE, TABLE_REFERENCE }; private static final Clause[] CLAUSES_TABLE_ALIAS = { TABLE, TABLE_ALIAS }; final Fields<R> fields; final Alias<Table<R>> alias; protected final Field<?>[] parameters; public TableImpl(String name) { this(name, null, null, null, null); } public TableImpl(String name, Schema schema) { this(name, schema, null, null, null); } public TableImpl(String name, Schema schema, Table<R> aliased) { this(name, schema, aliased, null, null); } public TableImpl(String name, Schema schema, Table<R> aliased, Field<?>[] parameters) { this(name, schema, aliased, parameters, null); } public TableImpl(String name, Schema schema, Table<R> aliased, Field<?>[] parameters, String comment) { super(name, schema, comment); this.fields = new Fields<R>(); if (aliased != null) { alias = new Alias<Table<R>>(aliased, name); } else { alias = null; } this.parameters = parameters; } /** * Get the aliased table wrapped by this table */ Table<R> getAliasedTable() { if (alias != null) { return alias.wrapped(); } return null; } @Override final Fields<R> fields0() { return fields; } @Override public final Clause[] clauses(Context<?> ctx) { return alias != null ? CLAUSES_TABLE_ALIAS : CLAUSES_TABLE_REFERENCE; } @Override public final void accept(Context<?> ctx) { if (alias != null) { ctx.visit(alias); } else { accept0(ctx); } } private void accept0(Context<?> ctx) { if (ctx.qualify() && (!asList(POSTGRES).contains(ctx.family()) || parameters == null || ctx.declareTables())) { Schema mappedSchema = Tools.getMappedSchema(ctx.configuration(), getSchema()); if (mappedSchema != null) { ctx.visit(mappedSchema); ctx.sql('.'); } } ctx.literal(Tools.getMappedTable(ctx.configuration(), this).getName()); if (parameters != null && ctx.declareTables()) { // [#2925] Some dialects don't like empty parameter lists if (ctx.family() == FIREBIRD && parameters.length == 0) ctx.visit(new QueryPartList<Field<?>>(parameters)); else ctx.sql('(') .visit(new QueryPartList<Field<?>>(parameters)) .sql(')'); } } /** * Subclasses may override this method to provide custom aliasing * implementations * <p> * {@inheritDoc} */ @Override public Table<R> as(String as) { if (alias != null) { return alias.wrapped().as(as); } else { return new TableAlias<R>(this, as); } } /** * Subclasses may override this method to provide custom aliasing * implementations * <p> * {@inheritDoc} */ @Override public Table<R> as(String as, String... fieldAliases) { if (alias != null) { return alias.wrapped().as(as, fieldAliases); } else { return new TableAlias<R>(this, as, fieldAliases); } } public Table<R> rename(String rename) { return new TableImpl<R>(rename, getSchema()); } /** * Subclasses must override this method if they use the generic type * parameter <R> for other types than {@link Record} * <p> * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public Class<? extends R> getRecordType() { return (Class<? extends R>) RecordImpl.class; } @Override public boolean declaresTables() { return (alias != null) || (parameters != null) || super.declaresTables(); } // ------------------------------------------------------------------------ // XXX: Object API // ------------------------------------------------------------------------ @Override public boolean equals(Object that) { if (this == that) { return true; } // [#2144] TableImpl equality can be decided without executing the // rather expensive implementation of AbstractQueryPart.equals() if (that instanceof TableImpl) { TableImpl<?> other = (TableImpl<?>) that; return StringUtils.equals(getSchema(), other.getSchema()) && StringUtils.equals(getName(), other.getName()) && Arrays.equals(parameters, other.parameters); } return super.equals(that); } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
0a2fa626120ff96799ecbd558a4dee48275535e3
ec76163cd6b4d397db0960f6247120218d181655
/Launcher3/src/com/android/launcher3/CellLayout.java
eb1dfa7cffc6bad03379155674ded4ed33d3381e
[ "Apache-2.0" ]
permissive
linlin01/Launcher3_4.4
3dd8156f986223010c502e8388996f2212d0a59c
c784d67932d11ef9fe4c54c2a043d7058292ec0c
refs/heads/master
2020-04-18T21:11:44.562562
2016-09-08T23:48:33
2016-09-08T23:48:33
67,748,564
0
0
null
null
null
null
UTF-8
Java
false
false
131,936
java
/* * Copyright (C) 2008 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.android.launcher3; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Point; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.NinePatchDrawable; import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; import android.view.MotionEvent; import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.DecelerateInterpolator; import android.view.animation.LayoutAnimationController; import com.android.launcher3.R; import com.android.launcher3.FolderIcon.FolderRingAnimator; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Stack; public class CellLayout extends ViewGroup { static final String TAG = "CellLayout"; private Launcher mLauncher; private int mCellWidth; private int mCellHeight; private int mFixedCellWidth; private int mFixedCellHeight; private int mCountX; private int mCountY; private int mOriginalWidthGap; private int mOriginalHeightGap; private int mWidthGap; private int mHeightGap; private int mMaxGap; private boolean mScrollingTransformsDirty = false; private final Rect mRect = new Rect(); private final CellInfo mCellInfo = new CellInfo(); // These are temporary variables to prevent having to allocate a new object just to // return an (x, y) value from helper functions. Do NOT use them to maintain other state. private final int[] mTmpXY = new int[2]; private final int[] mTmpPoint = new int[2]; int[] mTempLocation = new int[2]; boolean[][] mOccupied; boolean[][] mTmpOccupied; private boolean mLastDownOnOccupiedCell = false; private OnTouchListener mInterceptTouchListener; private ArrayList<FolderRingAnimator> mFolderOuterRings = new ArrayList<FolderRingAnimator>(); private int[] mFolderLeaveBehindCell = {-1, -1}; private float FOREGROUND_ALPHA_DAMPER = 0.65f; private int mForegroundAlpha = 0; private float mBackgroundAlpha; private float mBackgroundAlphaMultiplier = 1.0f; private Drawable mNormalBackground; private Drawable mActiveGlowBackground; private Drawable mOverScrollForegroundDrawable; private Drawable mOverScrollLeft; private Drawable mOverScrollRight; private Rect mBackgroundRect; private Rect mForegroundRect; private int mForegroundPadding; // These values allow a fixed measurement to be set on the CellLayout. private int mFixedWidth = -1; private int mFixedHeight = -1; // If we're actively dragging something over this screen, mIsDragOverlapping is true private boolean mIsDragOverlapping = false; boolean mUseActiveGlowBackground = false; // These arrays are used to implement the drag visualization on x-large screens. // They are used as circular arrays, indexed by mDragOutlineCurrent. private Rect[] mDragOutlines = new Rect[4]; private float[] mDragOutlineAlphas = new float[mDragOutlines.length]; private InterruptibleInOutAnimator[] mDragOutlineAnims = new InterruptibleInOutAnimator[mDragOutlines.length]; // Used as an index into the above 3 arrays; indicates which is the most current value. private int mDragOutlineCurrent = 0; private final Paint mDragOutlinePaint = new Paint(); private BubbleTextView mPressedOrFocusedIcon; private HashMap<CellLayout.LayoutParams, Animator> mReorderAnimators = new HashMap<CellLayout.LayoutParams, Animator>(); private HashMap<View, ReorderHintAnimation> mShakeAnimators = new HashMap<View, ReorderHintAnimation>(); private boolean mItemPlacementDirty = false; // When a drag operation is in progress, holds the nearest cell to the touch point private final int[] mDragCell = new int[2]; private boolean mDragging = false; private TimeInterpolator mEaseOutInterpolator; private ShortcutAndWidgetContainer mShortcutsAndWidgets; private boolean mIsHotseat = false; private float mHotseatScale = 1f; public static final int MODE_DRAG_OVER = 0; public static final int MODE_ON_DROP = 1; public static final int MODE_ON_DROP_EXTERNAL = 2; public static final int MODE_ACCEPT_DROP = 3; private static final boolean DESTRUCTIVE_REORDER = false; private static final boolean DEBUG_VISUALIZE_OCCUPIED = false; static final int LANDSCAPE = 0; static final int PORTRAIT = 1; private static final float REORDER_HINT_MAGNITUDE = 0.12f; private static final int REORDER_ANIMATION_DURATION = 150; private float mReorderHintAnimationMagnitude; private ArrayList<View> mIntersectingViews = new ArrayList<View>(); private Rect mOccupiedRect = new Rect(); private int[] mDirectionVector = new int[2]; int[] mPreviousReorderDirection = new int[2]; private static final int INVALID_DIRECTION = -100; private DropTarget.DragEnforcer mDragEnforcer; private Rect mTempRect = new Rect(); private final static PorterDuffXfermode sAddBlendMode = new PorterDuffXfermode(PorterDuff.Mode.ADD); private final static Paint sPaint = new Paint(); public CellLayout(Context context) { this(context, null); } public CellLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } public CellLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mDragEnforcer = new DropTarget.DragEnforcer(context); // A ViewGroup usually does not draw, but CellLayout needs to draw a rectangle to show // the user where a dragged item will land when dropped. setWillNotDraw(false); setClipToPadding(false); mLauncher = (Launcher) context; LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0); mCellWidth = mCellHeight = -1; mFixedCellHeight = mFixedCellHeight = -1; mWidthGap = mOriginalWidthGap = 0; mHeightGap = mOriginalHeightGap = 0; mMaxGap = Integer.MAX_VALUE; mCountX = (int) grid.numColumns; mCountY = (int) grid.numRows; mOccupied = new boolean[mCountX][mCountY]; mTmpOccupied = new boolean[mCountX][mCountY]; mPreviousReorderDirection[0] = INVALID_DIRECTION; mPreviousReorderDirection[1] = INVALID_DIRECTION; a.recycle(); setAlwaysDrawnWithCacheEnabled(false); final Resources res = getResources(); mHotseatScale = (float) grid.hotseatIconSize / grid.iconSize; mNormalBackground = res.getDrawable(R.drawable.screenpanel); mActiveGlowBackground = res.getDrawable(R.drawable.screenpanel_hover); mOverScrollLeft = res.getDrawable(R.drawable.overscroll_glow_left); mOverScrollRight = res.getDrawable(R.drawable.overscroll_glow_right); mForegroundPadding = res.getDimensionPixelSize(R.dimen.workspace_overscroll_drawable_padding); mReorderHintAnimationMagnitude = (REORDER_HINT_MAGNITUDE * grid.iconSizePx); mNormalBackground.setFilterBitmap(true); mActiveGlowBackground.setFilterBitmap(true); // Initialize the data structures used for the drag visualization. mEaseOutInterpolator = new DecelerateInterpolator(2.5f); // Quint ease out mDragCell[0] = mDragCell[1] = -1; for (int i = 0; i < mDragOutlines.length; i++) { mDragOutlines[i] = new Rect(-1, -1, -1, -1); } // When dragging things around the home screens, we show a green outline of // where the item will land. The outlines gradually fade out, leaving a trail // behind the drag path. // Set up all the animations that are used to implement this fading. final int duration = res.getInteger(R.integer.config_dragOutlineFadeTime); final float fromAlphaValue = 0; final float toAlphaValue = (float)res.getInteger(R.integer.config_dragOutlineMaxAlpha); Arrays.fill(mDragOutlineAlphas, fromAlphaValue); for (int i = 0; i < mDragOutlineAnims.length; i++) { final InterruptibleInOutAnimator anim = new InterruptibleInOutAnimator(this, duration, fromAlphaValue, toAlphaValue); anim.getAnimator().setInterpolator(mEaseOutInterpolator); final int thisIndex = i; anim.getAnimator().addUpdateListener(new AnimatorUpdateListener() { public void onAnimationUpdate(ValueAnimator animation) { final Bitmap outline = (Bitmap)anim.getTag(); // If an animation is started and then stopped very quickly, we can still // get spurious updates we've cleared the tag. Guard against this. if (outline == null) { @SuppressWarnings("all") // suppress dead code warning final boolean debug = false; if (debug) { Object val = animation.getAnimatedValue(); Log.d(TAG, "anim " + thisIndex + " update: " + val + ", isStopped " + anim.isStopped()); } // Try to prevent it from continuing to run animation.cancel(); } else { mDragOutlineAlphas[thisIndex] = (Float) animation.getAnimatedValue(); CellLayout.this.invalidate(mDragOutlines[thisIndex]); } } }); // The animation holds a reference to the drag outline bitmap as long is it's // running. This way the bitmap can be GCed when the animations are complete. anim.getAnimator().addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if ((Float) ((ValueAnimator) animation).getAnimatedValue() == 0f) { anim.setTag(null); } } }); mDragOutlineAnims[i] = anim; } mBackgroundRect = new Rect(); mForegroundRect = new Rect(); mShortcutsAndWidgets = new ShortcutAndWidgetContainer(context); mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap, mCountX, mCountY); addView(mShortcutsAndWidgets); } public void enableHardwareLayer(boolean hasLayer) { mShortcutsAndWidgets.setLayerType(hasLayer ? LAYER_TYPE_HARDWARE : LAYER_TYPE_NONE, sPaint); } public void buildHardwareLayer() { mShortcutsAndWidgets.buildLayer(); } public float getChildrenScale() { return mIsHotseat ? mHotseatScale : 1.0f; } public void setCellDimensions(int width, int height) { mFixedCellWidth = mCellWidth = width; mFixedCellHeight = mCellHeight = height; mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap, mCountX, mCountY); } public void setGridSize(int x, int y) { mCountX = x; mCountY = y; mOccupied = new boolean[mCountX][mCountY]; mTmpOccupied = new boolean[mCountX][mCountY]; mTempRectStack.clear(); mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap, mCountX, mCountY); requestLayout(); } // Set whether or not to invert the layout horizontally if the layout is in RTL mode. public void setInvertIfRtl(boolean invert) { mShortcutsAndWidgets.setInvertIfRtl(invert); } private void invalidateBubbleTextView(BubbleTextView icon) { final int padding = icon.getPressedOrFocusedBackgroundPadding(); invalidate(icon.getLeft() + getPaddingLeft() - padding, icon.getTop() + getPaddingTop() - padding, icon.getRight() + getPaddingLeft() + padding, icon.getBottom() + getPaddingTop() + padding); } void setOverScrollAmount(float r, boolean left) { if (left && mOverScrollForegroundDrawable != mOverScrollLeft) { mOverScrollForegroundDrawable = mOverScrollLeft; } else if (!left && mOverScrollForegroundDrawable != mOverScrollRight) { mOverScrollForegroundDrawable = mOverScrollRight; } r *= FOREGROUND_ALPHA_DAMPER; mForegroundAlpha = (int) Math.round((r * 255)); mOverScrollForegroundDrawable.setAlpha(mForegroundAlpha); invalidate(); } void setPressedOrFocusedIcon(BubbleTextView icon) { // We draw the pressed or focused BubbleTextView's background in CellLayout because it // requires an expanded clip rect (due to the glow's blur radius) BubbleTextView oldIcon = mPressedOrFocusedIcon; mPressedOrFocusedIcon = icon; if (oldIcon != null) { invalidateBubbleTextView(oldIcon); } if (mPressedOrFocusedIcon != null) { invalidateBubbleTextView(mPressedOrFocusedIcon); } } void setIsDragOverlapping(boolean isDragOverlapping) { if (mIsDragOverlapping != isDragOverlapping) { mIsDragOverlapping = isDragOverlapping; setUseActiveGlowBackground(mIsDragOverlapping); invalidate(); } } void setUseActiveGlowBackground(boolean use) { mUseActiveGlowBackground = use; } boolean getIsDragOverlapping() { return mIsDragOverlapping; } protected void setOverscrollTransformsDirty(boolean dirty) { mScrollingTransformsDirty = dirty; } protected void resetOverscrollTransforms() { if (mScrollingTransformsDirty) { setOverscrollTransformsDirty(false); setTranslationX(0); setRotationY(0); // It doesn't matter if we pass true or false here, the important thing is that we // pass 0, which results in the overscroll drawable not being drawn any more. setOverScrollAmount(0, false); setPivotX(getMeasuredWidth() / 2); setPivotY(getMeasuredHeight() / 2); } } @Override protected void onDraw(Canvas canvas) { // When we're large, we are either drawn in a "hover" state (ie when dragging an item to // a neighboring page) or with just a normal background (if backgroundAlpha > 0.0f) // When we're small, we are either drawn normally or in the "accepts drops" state (during // a drag). However, we also drag the mini hover background *over* one of those two // backgrounds if (mBackgroundAlpha > 0.0f) { Drawable bg; if (mUseActiveGlowBackground) { // In the mini case, we draw the active_glow bg *over* the active background bg = mActiveGlowBackground; } else { bg = mNormalBackground; } bg.setAlpha((int) (mBackgroundAlpha * mBackgroundAlphaMultiplier * 255)); bg.setBounds(mBackgroundRect); bg.draw(canvas); } final Paint paint = mDragOutlinePaint; for (int i = 0; i < mDragOutlines.length; i++) { final float alpha = mDragOutlineAlphas[i]; if (alpha > 0) { final Rect r = mDragOutlines[i]; mTempRect.set(r); Utilities.scaleRectAboutCenter(mTempRect, getChildrenScale()); final Bitmap b = (Bitmap) mDragOutlineAnims[i].getTag(); paint.setAlpha((int)(alpha + .5f)); canvas.drawBitmap(b, null, mTempRect, paint); } } // We draw the pressed or focused BubbleTextView's background in CellLayout because it // requires an expanded clip rect (due to the glow's blur radius) if (mPressedOrFocusedIcon != null) { final int padding = mPressedOrFocusedIcon.getPressedOrFocusedBackgroundPadding(); final Bitmap b = mPressedOrFocusedIcon.getPressedOrFocusedBackground(); if (b != null) { int offset = getMeasuredWidth() - getPaddingLeft() - getPaddingRight() - (mCountX * mCellWidth); int left = getPaddingLeft() + (int) Math.ceil(offset / 2f); int top = getPaddingTop(); canvas.drawBitmap(b, mPressedOrFocusedIcon.getLeft() + left - padding, mPressedOrFocusedIcon.getTop() + top - padding, null); } } if (DEBUG_VISUALIZE_OCCUPIED) { int[] pt = new int[2]; ColorDrawable cd = new ColorDrawable(Color.RED); cd.setBounds(0, 0, mCellWidth, mCellHeight); for (int i = 0; i < mCountX; i++) { for (int j = 0; j < mCountY; j++) { if (mOccupied[i][j]) { cellToPoint(i, j, pt); canvas.save(); canvas.translate(pt[0], pt[1]); cd.draw(canvas); canvas.restore(); } } } } int previewOffset = FolderRingAnimator.sPreviewSize; // The folder outer / inner ring image(s) LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); for (int i = 0; i < mFolderOuterRings.size(); i++) { FolderRingAnimator fra = mFolderOuterRings.get(i); Drawable d; int width, height; cellToPoint(fra.mCellX, fra.mCellY, mTempLocation); View child = getChildAt(fra.mCellX, fra.mCellY); if (child != null) { int centerX = mTempLocation[0] + mCellWidth / 2; int centerY = mTempLocation[1] + previewOffset / 2 + child.getPaddingTop() + grid.folderBackgroundOffset; // Draw outer ring, if it exists if (FolderIcon.HAS_OUTER_RING) { d = FolderRingAnimator.sSharedOuterRingDrawable; width = (int) (fra.getOuterRingSize() * getChildrenScale()); height = width; canvas.save(); canvas.translate(centerX - width / 2, centerY - height / 2); d.setBounds(0, 0, width, height); d.draw(canvas); canvas.restore(); } // Draw inner ring d = FolderRingAnimator.sSharedInnerRingDrawable; width = (int) (fra.getInnerRingSize() * getChildrenScale()); height = width; canvas.save(); canvas.translate(centerX - width / 2, centerY - width / 2); d.setBounds(0, 0, width, height); d.draw(canvas); canvas.restore(); } } if (mFolderLeaveBehindCell[0] >= 0 && mFolderLeaveBehindCell[1] >= 0) { Drawable d = FolderIcon.sSharedFolderLeaveBehind; int width = d.getIntrinsicWidth(); int height = d.getIntrinsicHeight(); cellToPoint(mFolderLeaveBehindCell[0], mFolderLeaveBehindCell[1], mTempLocation); View child = getChildAt(mFolderLeaveBehindCell[0], mFolderLeaveBehindCell[1]); if (child != null) { int centerX = mTempLocation[0] + mCellWidth / 2; int centerY = mTempLocation[1] + previewOffset / 2 + child.getPaddingTop() + grid.folderBackgroundOffset; canvas.save(); canvas.translate(centerX - width / 2, centerY - width / 2); d.setBounds(0, 0, width, height); d.draw(canvas); canvas.restore(); } } } @Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); if (mForegroundAlpha > 0) { mOverScrollForegroundDrawable.setBounds(mForegroundRect); mOverScrollForegroundDrawable.draw(canvas); } } public void showFolderAccept(FolderRingAnimator fra) { mFolderOuterRings.add(fra); } public void hideFolderAccept(FolderRingAnimator fra) { if (mFolderOuterRings.contains(fra)) { mFolderOuterRings.remove(fra); } invalidate(); } public void setFolderLeaveBehindCell(int x, int y) { mFolderLeaveBehindCell[0] = x; mFolderLeaveBehindCell[1] = y; invalidate(); } public void clearFolderLeaveBehind() { mFolderLeaveBehindCell[0] = -1; mFolderLeaveBehindCell[1] = -1; invalidate(); } @Override public boolean shouldDelayChildPressedState() { return false; } public void restoreInstanceState(SparseArray<Parcelable> states) { dispatchRestoreInstanceState(states); } @Override public void cancelLongPress() { super.cancelLongPress(); // Cancel long press for all children final int count = getChildCount(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); child.cancelLongPress(); } } public void setOnInterceptTouchListener(View.OnTouchListener listener) { mInterceptTouchListener = listener; } int getCountX() { return mCountX; } int getCountY() { return mCountY; } public void setIsHotseat(boolean isHotseat) { mIsHotseat = isHotseat; mShortcutsAndWidgets.setIsHotseat(isHotseat); } public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params, boolean markCells) { final LayoutParams lp = params; // Hotseat icons - remove text if (child instanceof BubbleTextView) { BubbleTextView bubbleChild = (BubbleTextView) child; bubbleChild.setTextVisibility(!mIsHotseat); } child.setScaleX(getChildrenScale()); child.setScaleY(getChildrenScale()); // Generate an id for each view, this assumes we have at most 256x256 cells // per workspace screen if (lp.cellX >= 0 && lp.cellX <= mCountX - 1 && lp.cellY >= 0 && lp.cellY <= mCountY - 1) { // If the horizontal or vertical span is set to -1, it is taken to // mean that it spans the extent of the CellLayout if (lp.cellHSpan < 0) lp.cellHSpan = mCountX; if (lp.cellVSpan < 0) lp.cellVSpan = mCountY; child.setId(childId); mShortcutsAndWidgets.addView(child, index, lp); if (markCells) markCellsAsOccupiedForView(child); return true; } return false; } @Override public void removeAllViews() { clearOccupiedCells(); mShortcutsAndWidgets.removeAllViews(); } @Override public void removeAllViewsInLayout() { if (mShortcutsAndWidgets.getChildCount() > 0) { clearOccupiedCells(); mShortcutsAndWidgets.removeAllViewsInLayout(); } } public void removeViewWithoutMarkingCells(View view) { mShortcutsAndWidgets.removeView(view); } @Override public void removeView(View view) { markCellsAsUnoccupiedForView(view); mShortcutsAndWidgets.removeView(view); } @Override public void removeViewAt(int index) { markCellsAsUnoccupiedForView(mShortcutsAndWidgets.getChildAt(index)); mShortcutsAndWidgets.removeViewAt(index); } @Override public void removeViewInLayout(View view) { markCellsAsUnoccupiedForView(view); mShortcutsAndWidgets.removeViewInLayout(view); } @Override public void removeViews(int start, int count) { for (int i = start; i < start + count; i++) { markCellsAsUnoccupiedForView(mShortcutsAndWidgets.getChildAt(i)); } mShortcutsAndWidgets.removeViews(start, count); } @Override public void removeViewsInLayout(int start, int count) { for (int i = start; i < start + count; i++) { markCellsAsUnoccupiedForView(mShortcutsAndWidgets.getChildAt(i)); } mShortcutsAndWidgets.removeViewsInLayout(start, count); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (getParent() instanceof Workspace) { Workspace workspace = (Workspace) getParent(); mCellInfo.screenId = workspace.getIdForScreen(this); } } public void setTagToCellInfoForPoint(int touchX, int touchY) { final CellInfo cellInfo = mCellInfo; Rect frame = mRect; final int x = touchX + getScrollX(); final int y = touchY + getScrollY(); final int count = mShortcutsAndWidgets.getChildCount(); boolean found = false; for (int i = count - 1; i >= 0; i--) { final View child = mShortcutsAndWidgets.getChildAt(i); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); if ((child.getVisibility() == VISIBLE || child.getAnimation() != null) && lp.isLockedToGrid) { child.getHitRect(frame); float scale = child.getScaleX(); frame = new Rect(child.getLeft(), child.getTop(), child.getRight(), child.getBottom()); // The child hit rect is relative to the CellLayoutChildren parent, so we need to // offset that by this CellLayout's padding to test an (x,y) point that is relative // to this view. frame.offset(getPaddingLeft(), getPaddingTop()); frame.inset((int) (frame.width() * (1f - scale) / 2), (int) (frame.height() * (1f - scale) / 2)); if (frame.contains(x, y)) { cellInfo.cell = child; cellInfo.cellX = lp.cellX; cellInfo.cellY = lp.cellY; cellInfo.spanX = lp.cellHSpan; cellInfo.spanY = lp.cellVSpan; found = true; break; } } } mLastDownOnOccupiedCell = found; if (!found) { final int cellXY[] = mTmpXY; pointToCellExact(x, y, cellXY); cellInfo.cell = null; cellInfo.cellX = cellXY[0]; cellInfo.cellY = cellXY[1]; cellInfo.spanX = 1; cellInfo.spanY = 1; } setTag(cellInfo); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { // First we clear the tag to ensure that on every touch down we start with a fresh slate, // even in the case where we return early. Not clearing here was causing bugs whereby on // long-press we'd end up picking up an item from a previous drag operation. final int action = ev.getAction(); if (action == MotionEvent.ACTION_DOWN) { clearTagCellInfo(); } if (mInterceptTouchListener != null && mInterceptTouchListener.onTouch(this, ev)) { return true; } if (action == MotionEvent.ACTION_DOWN) { setTagToCellInfoForPoint((int) ev.getX(), (int) ev.getY()); } return false; } private void clearTagCellInfo() { final CellInfo cellInfo = mCellInfo; cellInfo.cell = null; cellInfo.cellX = -1; cellInfo.cellY = -1; cellInfo.spanX = 0; cellInfo.spanY = 0; setTag(cellInfo); } public CellInfo getTag() { return (CellInfo) super.getTag(); } /** * Given a point, return the cell that strictly encloses that point * @param x X coordinate of the point * @param y Y coordinate of the point * @param result Array of 2 ints to hold the x and y coordinate of the cell */ void pointToCellExact(int x, int y, int[] result) { final int hStartPadding = getPaddingLeft(); final int vStartPadding = getPaddingTop(); result[0] = (x - hStartPadding) / (mCellWidth + mWidthGap); result[1] = (y - vStartPadding) / (mCellHeight + mHeightGap); final int xAxis = mCountX; final int yAxis = mCountY; if (result[0] < 0) result[0] = 0; if (result[0] >= xAxis) result[0] = xAxis - 1; if (result[1] < 0) result[1] = 0; if (result[1] >= yAxis) result[1] = yAxis - 1; } /** * Given a point, return the cell that most closely encloses that point * @param x X coordinate of the point * @param y Y coordinate of the point * @param result Array of 2 ints to hold the x and y coordinate of the cell */ void pointToCellRounded(int x, int y, int[] result) { pointToCellExact(x + (mCellWidth / 2), y + (mCellHeight / 2), result); } /** * Given a cell coordinate, return the point that represents the upper left corner of that cell * * @param cellX X coordinate of the cell * @param cellY Y coordinate of the cell * * @param result Array of 2 ints to hold the x and y coordinate of the point */ void cellToPoint(int cellX, int cellY, int[] result) { final int hStartPadding = getPaddingLeft(); final int vStartPadding = getPaddingTop(); result[0] = hStartPadding + cellX * (mCellWidth + mWidthGap); result[1] = vStartPadding + cellY * (mCellHeight + mHeightGap); } /** * Given a cell coordinate, return the point that represents the center of the cell * * @param cellX X coordinate of the cell * @param cellY Y coordinate of the cell * * @param result Array of 2 ints to hold the x and y coordinate of the point */ void cellToCenterPoint(int cellX, int cellY, int[] result) { regionToCenterPoint(cellX, cellY, 1, 1, result); } /** * Given a cell coordinate and span return the point that represents the center of the regio * * @param cellX X coordinate of the cell * @param cellY Y coordinate of the cell * * @param result Array of 2 ints to hold the x and y coordinate of the point */ void regionToCenterPoint(int cellX, int cellY, int spanX, int spanY, int[] result) { final int hStartPadding = getPaddingLeft(); final int vStartPadding = getPaddingTop(); result[0] = hStartPadding + cellX * (mCellWidth + mWidthGap) + (spanX * mCellWidth + (spanX - 1) * mWidthGap) / 2; result[1] = vStartPadding + cellY * (mCellHeight + mHeightGap) + (spanY * mCellHeight + (spanY - 1) * mHeightGap) / 2; } /** * Given a cell coordinate and span fills out a corresponding pixel rect * * @param cellX X coordinate of the cell * @param cellY Y coordinate of the cell * @param result Rect in which to write the result */ void regionToRect(int cellX, int cellY, int spanX, int spanY, Rect result) { final int hStartPadding = getPaddingLeft(); final int vStartPadding = getPaddingTop(); final int left = hStartPadding + cellX * (mCellWidth + mWidthGap); final int top = vStartPadding + cellY * (mCellHeight + mHeightGap); result.set(left, top, left + (spanX * mCellWidth + (spanX - 1) * mWidthGap), top + (spanY * mCellHeight + (spanY - 1) * mHeightGap)); } public float getDistanceFromCell(float x, float y, int[] cell) { cellToCenterPoint(cell[0], cell[1], mTmpPoint); float distance = (float) Math.sqrt( Math.pow(x - mTmpPoint[0], 2) + Math.pow(y - mTmpPoint[1], 2)); return distance; } int getCellWidth() { return mCellWidth; } int getCellHeight() { return mCellHeight; } int getWidthGap() { return mWidthGap; } int getHeightGap() { return mHeightGap; } Rect getContentRect(Rect r) { if (r == null) { r = new Rect(); } int left = getPaddingLeft(); int top = getPaddingTop(); int right = left + getWidth() - getPaddingLeft() - getPaddingRight(); int bottom = top + getHeight() - getPaddingTop() - getPaddingBottom(); r.set(left, top, right, bottom); return r; } /** Return a rect that has the cellWidth/cellHeight (left, top), and * widthGap/heightGap (right, bottom) */ static void getMetrics(Rect metrics, int paddedMeasureWidth, int paddedMeasureHeight, int countX, int countY) { LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); metrics.set(grid.calculateCellWidth(paddedMeasureWidth, countX), grid.calculateCellHeight(paddedMeasureHeight, countY), 0, 0); } public void setFixedSize(int width, int height) { mFixedWidth = width; mFixedHeight = height; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec); int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); int childWidthSize = widthSize - (getPaddingLeft() + getPaddingRight()); int childHeightSize = heightSize - (getPaddingTop() + getPaddingBottom()); if (mFixedCellWidth < 0 || mFixedCellHeight < 0) { int cw = grid.calculateCellWidth(childWidthSize, mCountX); int ch = grid.calculateCellHeight(childHeightSize, mCountY); if (cw != mCellWidth || ch != mCellHeight) { mCellWidth = cw; mCellHeight = ch; mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap, mCountX, mCountY); } } int newWidth = childWidthSize; int newHeight = childHeightSize; if (mFixedWidth > 0 && mFixedHeight > 0) { newWidth = mFixedWidth; newHeight = mFixedHeight; } else if (widthSpecMode == MeasureSpec.UNSPECIFIED || heightSpecMode == MeasureSpec.UNSPECIFIED) { throw new RuntimeException("CellLayout cannot have UNSPECIFIED dimensions"); } int numWidthGaps = mCountX - 1; int numHeightGaps = mCountY - 1; if (mOriginalWidthGap < 0 || mOriginalHeightGap < 0) { int hSpace = childWidthSize; int vSpace = childHeightSize; int hFreeSpace = hSpace - (mCountX * mCellWidth); int vFreeSpace = vSpace - (mCountY * mCellHeight); mWidthGap = Math.min(mMaxGap, numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0); mHeightGap = Math.min(mMaxGap,numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0); mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap, mCountX, mCountY); } else { mWidthGap = mOriginalWidthGap; mHeightGap = mOriginalHeightGap; } int count = getChildCount(); int maxWidth = 0; int maxHeight = 0; for (int i = 0; i < count; i++) { View child = getChildAt(i); int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(newWidth, MeasureSpec.EXACTLY); int childheightMeasureSpec = MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.EXACTLY); child.measure(childWidthMeasureSpec, childheightMeasureSpec); maxWidth = Math.max(maxWidth, child.getMeasuredWidth()); maxHeight = Math.max(maxHeight, child.getMeasuredHeight()); } if (mFixedWidth > 0 && mFixedHeight > 0) { setMeasuredDimension(maxWidth, maxHeight); } else { setMeasuredDimension(widthSize, heightSize); } } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int offset = getMeasuredWidth() - getPaddingLeft() - getPaddingRight() - (mCountX * mCellWidth); int left = getPaddingLeft() + (int) Math.ceil(offset / 2f); int top = getPaddingTop(); int count = getChildCount(); Log.i("zhao111","count:"+count+",l:"+l+",t:"+t+",r:"+r+",b:"+b); for (int i = 0; i < count; i++) { View child = getChildAt(i); child.layout(left, top,left + r - l,top + b - t); Log.i("zhao111","left:"+left+",top:"+top+",left + r - l:"+(left + r - l)+",top + b - t::"+(top + b - t)); } } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); // Expand the background drawing bounds by the padding baked into the background drawable Rect padding = new Rect(); mNormalBackground.getPadding(padding); mBackgroundRect.set(-padding.left, -padding.top, w + padding.right, h + padding.bottom); mForegroundRect.set(mForegroundPadding, mForegroundPadding, w - mForegroundPadding, h - mForegroundPadding); } @Override protected void setChildrenDrawingCacheEnabled(boolean enabled) { mShortcutsAndWidgets.setChildrenDrawingCacheEnabled(enabled); } @Override protected void setChildrenDrawnWithCacheEnabled(boolean enabled) { mShortcutsAndWidgets.setChildrenDrawnWithCacheEnabled(enabled); } public float getBackgroundAlpha() { return mBackgroundAlpha; } public void setBackgroundAlphaMultiplier(float multiplier) { if (mBackgroundAlphaMultiplier != multiplier) { mBackgroundAlphaMultiplier = multiplier; invalidate(); } } public float getBackgroundAlphaMultiplier() { return mBackgroundAlphaMultiplier; } public void setBackgroundAlpha(float alpha) { if (mBackgroundAlpha != alpha) { mBackgroundAlpha = alpha; invalidate(); } } public void setShortcutAndWidgetAlpha(float alpha) { final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { getChildAt(i).setAlpha(alpha); } } public ShortcutAndWidgetContainer getShortcutsAndWidgets() { if (getChildCount() > 0) { return (ShortcutAndWidgetContainer) getChildAt(0); } return null; } public View getChildAt(int x, int y) { return mShortcutsAndWidgets.getChildAt(x, y); } public boolean animateChildToPosition(final View child, int cellX, int cellY, int duration, int delay, boolean permanent, boolean adjustOccupied) { ShortcutAndWidgetContainer clc = getShortcutsAndWidgets(); boolean[][] occupied = mOccupied; if (!permanent) { occupied = mTmpOccupied; } if (clc.indexOfChild(child) != -1) { final LayoutParams lp = (LayoutParams) child.getLayoutParams(); final ItemInfo info = (ItemInfo) child.getTag(); // We cancel any existing animations if (mReorderAnimators.containsKey(lp)) { mReorderAnimators.get(lp).cancel(); mReorderAnimators.remove(lp); } final int oldX = lp.x; final int oldY = lp.y; if (adjustOccupied) { occupied[lp.cellX][lp.cellY] = false; occupied[cellX][cellY] = true; } lp.isLockedToGrid = true; if (permanent) { lp.cellX = info.cellX = cellX; lp.cellY = info.cellY = cellY; } else { lp.tmpCellX = cellX; lp.tmpCellY = cellY; } clc.setupLp(lp); lp.isLockedToGrid = false; final int newX = lp.x; final int newY = lp.y; lp.x = oldX; lp.y = oldY; // Exit early if we're not actually moving the view if (oldX == newX && oldY == newY) { lp.isLockedToGrid = true; return true; } ValueAnimator va = LauncherAnimUtils.ofFloat(child, 0f, 1f); va.setDuration(duration); mReorderAnimators.put(lp, va); va.addUpdateListener(new AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { float r = ((Float) animation.getAnimatedValue()).floatValue(); lp.x = (int) ((1 - r) * oldX + r * newX); lp.y = (int) ((1 - r) * oldY + r * newY); child.requestLayout(); } }); va.addListener(new AnimatorListenerAdapter() { boolean cancelled = false; public void onAnimationEnd(Animator animation) { // If the animation was cancelled, it means that another animation // has interrupted this one, and we don't want to lock the item into // place just yet. if (!cancelled) { lp.isLockedToGrid = true; child.requestLayout(); } if (mReorderAnimators.containsKey(lp)) { mReorderAnimators.remove(lp); } } public void onAnimationCancel(Animator animation) { cancelled = true; } }); va.setStartDelay(delay); va.start(); return true; } return false; } /** * Estimate where the top left cell of the dragged item will land if it is dropped. * * @param originX The X value of the top left corner of the item * @param originY The Y value of the top left corner of the item * @param spanX The number of horizontal cells that the item spans * @param spanY The number of vertical cells that the item spans * @param result The estimated drop cell X and Y. */ void estimateDropCell(int originX, int originY, int spanX, int spanY, int[] result) { final int countX = mCountX; final int countY = mCountY; // pointToCellRounded takes the top left of a cell but will pad that with // cellWidth/2 and cellHeight/2 when finding the matching cell pointToCellRounded(originX, originY, result); // If the item isn't fully on this screen, snap to the edges int rightOverhang = result[0] + spanX - countX; if (rightOverhang > 0) { result[0] -= rightOverhang; // Snap to right } result[0] = Math.max(0, result[0]); // Snap to left int bottomOverhang = result[1] + spanY - countY; if (bottomOverhang > 0) { result[1] -= bottomOverhang; // Snap to bottom } result[1] = Math.max(0, result[1]); // Snap to top } void visualizeDropLocation(View v, Bitmap dragOutline, int originX, int originY, int cellX, int cellY, int spanX, int spanY, boolean resize, Point dragOffset, Rect dragRegion) { final int oldDragCellX = mDragCell[0]; final int oldDragCellY = mDragCell[1]; if (dragOutline == null && v == null) { return; } if (cellX != oldDragCellX || cellY != oldDragCellY) { mDragCell[0] = cellX; mDragCell[1] = cellY; // Find the top left corner of the rect the object will occupy final int[] topLeft = mTmpPoint; cellToPoint(cellX, cellY, topLeft); int left = topLeft[0]; int top = topLeft[1]; if (v != null && dragOffset == null) { // When drawing the drag outline, it did not account for margin offsets // added by the view's parent. MarginLayoutParams lp = (MarginLayoutParams) v.getLayoutParams(); left += lp.leftMargin; top += lp.topMargin; // Offsets due to the size difference between the View and the dragOutline. // There is a size difference to account for the outer blur, which may lie // outside the bounds of the view. top += (v.getHeight() - dragOutline.getHeight()) / 2; // We center about the x axis left += ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap) - dragOutline.getWidth()) / 2; } else { if (dragOffset != null && dragRegion != null) { // Center the drag region *horizontally* in the cell and apply a drag // outline offset left += dragOffset.x + ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap) - dragRegion.width()) / 2; int cHeight = getShortcutsAndWidgets().getCellContentHeight(); int cellPaddingY = (int) Math.max(0, ((mCellHeight - cHeight) / 2f)); top += dragOffset.y + cellPaddingY; } else { // Center the drag outline in the cell left += ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap) - dragOutline.getWidth()) / 2; top += ((mCellHeight * spanY) + ((spanY - 1) * mHeightGap) - dragOutline.getHeight()) / 2; } } final int oldIndex = mDragOutlineCurrent; mDragOutlineAnims[oldIndex].animateOut(); mDragOutlineCurrent = (oldIndex + 1) % mDragOutlines.length; Rect r = mDragOutlines[mDragOutlineCurrent]; r.set(left, top, left + dragOutline.getWidth(), top + dragOutline.getHeight()); if (resize) { cellToRect(cellX, cellY, spanX, spanY, r); } mDragOutlineAnims[mDragOutlineCurrent].setTag(dragOutline); mDragOutlineAnims[mDragOutlineCurrent].animateIn(); } } public void clearDragOutlines() { final int oldIndex = mDragOutlineCurrent; mDragOutlineAnims[oldIndex].animateOut(); mDragCell[0] = mDragCell[1] = -1; } /** * Find a vacant area that will fit the given bounds nearest the requested * cell location. Uses Euclidean distance to score multiple vacant areas. * * @param pixelX The X location at which you want to search for a vacant area. * @param pixelY The Y location at which you want to search for a vacant area. * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param result Array in which to place the result, or null (in which case a new array will * be allocated) * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ int[] findNearestVacantArea(int pixelX, int pixelY, int spanX, int spanY, int[] result) { return findNearestVacantArea(pixelX, pixelY, spanX, spanY, null, result); } /** * Find a vacant area that will fit the given bounds nearest the requested * cell location. Uses Euclidean distance to score multiple vacant areas. * * @param pixelX The X location at which you want to search for a vacant area. * @param pixelY The Y location at which you want to search for a vacant area. * @param minSpanX The minimum horizontal span required * @param minSpanY The minimum vertical span required * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param result Array in which to place the result, or null (in which case a new array will * be allocated) * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ int[] findNearestVacantArea(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX, int spanY, int[] result, int[] resultSpan) { return findNearestVacantArea(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, null, result, resultSpan); } /** * Find a vacant area that will fit the given bounds nearest the requested * cell location. Uses Euclidean distance to score multiple vacant areas. * * @param pixelX The X location at which you want to search for a vacant area. * @param pixelY The Y location at which you want to search for a vacant area. * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param ignoreOccupied If true, the result can be an occupied cell * @param result Array in which to place the result, or null (in which case a new array will * be allocated) * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ int[] findNearestArea(int pixelX, int pixelY, int spanX, int spanY, View ignoreView, boolean ignoreOccupied, int[] result) { return findNearestArea(pixelX, pixelY, spanX, spanY, spanX, spanY, ignoreView, ignoreOccupied, result, null, mOccupied); } private final Stack<Rect> mTempRectStack = new Stack<Rect>(); private void lazyInitTempRectStack() { if (mTempRectStack.isEmpty()) { for (int i = 0; i < mCountX * mCountY; i++) { mTempRectStack.push(new Rect()); } } } private void recycleTempRects(Stack<Rect> used) { while (!used.isEmpty()) { mTempRectStack.push(used.pop()); } } /** * Find a vacant area that will fit the given bounds nearest the requested * cell location. Uses Euclidean distance to score multiple vacant areas. * * @param pixelX The X location at which you want to search for a vacant area. * @param pixelY The Y location at which you want to search for a vacant area. * @param minSpanX The minimum horizontal span required * @param minSpanY The minimum vertical span required * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param ignoreOccupied If true, the result can be an occupied cell * @param result Array in which to place the result, or null (in which case a new array will * be allocated) * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ int[] findNearestArea(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX, int spanY, View ignoreView, boolean ignoreOccupied, int[] result, int[] resultSpan, boolean[][] occupied) { lazyInitTempRectStack(); // mark space take by ignoreView as available (method checks if ignoreView is null) markCellsAsUnoccupiedForView(ignoreView, occupied); // For items with a spanX / spanY > 1, the passed in point (pixelX, pixelY) corresponds // to the center of the item, but we are searching based on the top-left cell, so // we translate the point over to correspond to the top-left. pixelX -= (mCellWidth + mWidthGap) * (spanX - 1) / 2f; pixelY -= (mCellHeight + mHeightGap) * (spanY - 1) / 2f; // Keep track of best-scoring drop area final int[] bestXY = result != null ? result : new int[2]; double bestDistance = Double.MAX_VALUE; final Rect bestRect = new Rect(-1, -1, -1, -1); final Stack<Rect> validRegions = new Stack<Rect>(); final int countX = mCountX; final int countY = mCountY; if (minSpanX <= 0 || minSpanY <= 0 || spanX <= 0 || spanY <= 0 || spanX < minSpanX || spanY < minSpanY) { return bestXY; } for (int y = 0; y < countY - (minSpanY - 1); y++) { inner: for (int x = 0; x < countX - (minSpanX - 1); x++) { int ySize = -1; int xSize = -1; if (ignoreOccupied) { // First, let's see if this thing fits anywhere for (int i = 0; i < minSpanX; i++) { for (int j = 0; j < minSpanY; j++) { if (occupied[x + i][y + j]) { continue inner; } } } xSize = minSpanX; ySize = minSpanY; // We know that the item will fit at _some_ acceptable size, now let's see // how big we can make it. We'll alternate between incrementing x and y spans // until we hit a limit. boolean incX = true; boolean hitMaxX = xSize >= spanX; boolean hitMaxY = ySize >= spanY; while (!(hitMaxX && hitMaxY)) { if (incX && !hitMaxX) { for (int j = 0; j < ySize; j++) { if (x + xSize > countX -1 || occupied[x + xSize][y + j]) { // We can't move out horizontally hitMaxX = true; } } if (!hitMaxX) { xSize++; } } else if (!hitMaxY) { for (int i = 0; i < xSize; i++) { if (y + ySize > countY - 1 || occupied[x + i][y + ySize]) { // We can't move out vertically hitMaxY = true; } } if (!hitMaxY) { ySize++; } } hitMaxX |= xSize >= spanX; hitMaxY |= ySize >= spanY; incX = !incX; } incX = true; hitMaxX = xSize >= spanX; hitMaxY = ySize >= spanY; } final int[] cellXY = mTmpXY; cellToCenterPoint(x, y, cellXY); // We verify that the current rect is not a sub-rect of any of our previous // candidates. In this case, the current rect is disqualified in favour of the // containing rect. Rect currentRect = mTempRectStack.pop(); currentRect.set(x, y, x + xSize, y + ySize); boolean contained = false; for (Rect r : validRegions) { if (r.contains(currentRect)) { contained = true; break; } } validRegions.push(currentRect); double distance = Math.sqrt(Math.pow(cellXY[0] - pixelX, 2) + Math.pow(cellXY[1] - pixelY, 2)); if ((distance <= bestDistance && !contained) || currentRect.contains(bestRect)) { bestDistance = distance; bestXY[0] = x; bestXY[1] = y; if (resultSpan != null) { resultSpan[0] = xSize; resultSpan[1] = ySize; } bestRect.set(currentRect); } } } // re-mark space taken by ignoreView as occupied markCellsAsOccupiedForView(ignoreView, occupied); // Return -1, -1 if no suitable location found if (bestDistance == Double.MAX_VALUE) { bestXY[0] = -1; bestXY[1] = -1; } recycleTempRects(validRegions); return bestXY; } /** * Find a vacant area that will fit the given bounds nearest the requested * cell location, and will also weigh in a suggested direction vector of the * desired location. This method computers distance based on unit grid distances, * not pixel distances. * * @param cellX The X cell nearest to which you want to search for a vacant area. * @param cellY The Y cell nearest which you want to search for a vacant area. * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param direction The favored direction in which the views should move from x, y * @param exactDirectionOnly If this parameter is true, then only solutions where the direction * matches exactly. Otherwise we find the best matching direction. * @param occoupied The array which represents which cells in the CellLayout are occupied * @param blockOccupied The array which represents which cells in the specified block (cellX, * cellY, spanX, spanY) are occupied. This is used when try to move a group of views. * @param result Array in which to place the result, or null (in which case a new array will * be allocated) * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ private int[] findNearestArea(int cellX, int cellY, int spanX, int spanY, int[] direction, boolean[][] occupied, boolean blockOccupied[][], int[] result) { // Keep track of best-scoring drop area final int[] bestXY = result != null ? result : new int[2]; float bestDistance = Float.MAX_VALUE; int bestDirectionScore = Integer.MIN_VALUE; final int countX = mCountX; final int countY = mCountY; for (int y = 0; y < countY - (spanY - 1); y++) { inner: for (int x = 0; x < countX - (spanX - 1); x++) { // First, let's see if this thing fits anywhere for (int i = 0; i < spanX; i++) { for (int j = 0; j < spanY; j++) { if (occupied[x + i][y + j] && (blockOccupied == null || blockOccupied[i][j])) { continue inner; } } } float distance = (float) Math.sqrt((x - cellX) * (x - cellX) + (y - cellY) * (y - cellY)); int[] curDirection = mTmpPoint; computeDirectionVector(x - cellX, y - cellY, curDirection); // The direction score is just the dot product of the two candidate direction // and that passed in. int curDirectionScore = direction[0] * curDirection[0] + direction[1] * curDirection[1]; boolean exactDirectionOnly = false; boolean directionMatches = direction[0] == curDirection[0] && direction[0] == curDirection[0]; if ((directionMatches || !exactDirectionOnly) && Float.compare(distance, bestDistance) < 0 || (Float.compare(distance, bestDistance) == 0 && curDirectionScore > bestDirectionScore)) { bestDistance = distance; bestDirectionScore = curDirectionScore; bestXY[0] = x; bestXY[1] = y; } } } // Return -1, -1 if no suitable location found if (bestDistance == Float.MAX_VALUE) { bestXY[0] = -1; bestXY[1] = -1; } return bestXY; } private boolean addViewToTempLocation(View v, Rect rectOccupiedByPotentialDrop, int[] direction, ItemConfiguration currentState) { CellAndSpan c = currentState.map.get(v); boolean success = false; markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false); markCellsForRect(rectOccupiedByPotentialDrop, mTmpOccupied, true); findNearestArea(c.x, c.y, c.spanX, c.spanY, direction, mTmpOccupied, null, mTempLocation); if (mTempLocation[0] >= 0 && mTempLocation[1] >= 0) { c.x = mTempLocation[0]; c.y = mTempLocation[1]; success = true; } markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true); return success; } /** * This helper class defines a cluster of views. It helps with defining complex edges * of the cluster and determining how those edges interact with other views. The edges * essentially define a fine-grained boundary around the cluster of views -- like a more * precise version of a bounding box. */ private class ViewCluster { final static int LEFT = 0; final static int TOP = 1; final static int RIGHT = 2; final static int BOTTOM = 3; ArrayList<View> views; ItemConfiguration config; Rect boundingRect = new Rect(); int[] leftEdge = new int[mCountY]; int[] rightEdge = new int[mCountY]; int[] topEdge = new int[mCountX]; int[] bottomEdge = new int[mCountX]; boolean leftEdgeDirty, rightEdgeDirty, topEdgeDirty, bottomEdgeDirty, boundingRectDirty; @SuppressWarnings("unchecked") public ViewCluster(ArrayList<View> views, ItemConfiguration config) { this.views = (ArrayList<View>) views.clone(); this.config = config; resetEdges(); } void resetEdges() { for (int i = 0; i < mCountX; i++) { topEdge[i] = -1; bottomEdge[i] = -1; } for (int i = 0; i < mCountY; i++) { leftEdge[i] = -1; rightEdge[i] = -1; } leftEdgeDirty = true; rightEdgeDirty = true; bottomEdgeDirty = true; topEdgeDirty = true; boundingRectDirty = true; } void computeEdge(int which, int[] edge) { int count = views.size(); for (int i = 0; i < count; i++) { CellAndSpan cs = config.map.get(views.get(i)); switch (which) { case LEFT: int left = cs.x; for (int j = cs.y; j < cs.y + cs.spanY; j++) { if (left < edge[j] || edge[j] < 0) { edge[j] = left; } } break; case RIGHT: int right = cs.x + cs.spanX; for (int j = cs.y; j < cs.y + cs.spanY; j++) { if (right > edge[j]) { edge[j] = right; } } break; case TOP: int top = cs.y; for (int j = cs.x; j < cs.x + cs.spanX; j++) { if (top < edge[j] || edge[j] < 0) { edge[j] = top; } } break; case BOTTOM: int bottom = cs.y + cs.spanY; for (int j = cs.x; j < cs.x + cs.spanX; j++) { if (bottom > edge[j]) { edge[j] = bottom; } } break; } } } boolean isViewTouchingEdge(View v, int whichEdge) { CellAndSpan cs = config.map.get(v); int[] edge = getEdge(whichEdge); switch (whichEdge) { case LEFT: for (int i = cs.y; i < cs.y + cs.spanY; i++) { if (edge[i] == cs.x + cs.spanX) { return true; } } break; case RIGHT: for (int i = cs.y; i < cs.y + cs.spanY; i++) { if (edge[i] == cs.x) { return true; } } break; case TOP: for (int i = cs.x; i < cs.x + cs.spanX; i++) { if (edge[i] == cs.y + cs.spanY) { return true; } } break; case BOTTOM: for (int i = cs.x; i < cs.x + cs.spanX; i++) { if (edge[i] == cs.y) { return true; } } break; } return false; } void shift(int whichEdge, int delta) { for (View v: views) { CellAndSpan c = config.map.get(v); switch (whichEdge) { case LEFT: c.x -= delta; break; case RIGHT: c.x += delta; break; case TOP: c.y -= delta; break; case BOTTOM: default: c.y += delta; break; } } resetEdges(); } public void addView(View v) { views.add(v); resetEdges(); } public Rect getBoundingRect() { if (boundingRectDirty) { boolean first = true; for (View v: views) { CellAndSpan c = config.map.get(v); if (first) { boundingRect.set(c.x, c.y, c.x + c.spanX, c.y + c.spanY); first = false; } else { boundingRect.union(c.x, c.y, c.x + c.spanX, c.y + c.spanY); } } } return boundingRect; } public int[] getEdge(int which) { switch (which) { case LEFT: return getLeftEdge(); case RIGHT: return getRightEdge(); case TOP: return getTopEdge(); case BOTTOM: default: return getBottomEdge(); } } public int[] getLeftEdge() { if (leftEdgeDirty) { computeEdge(LEFT, leftEdge); } return leftEdge; } public int[] getRightEdge() { if (rightEdgeDirty) { computeEdge(RIGHT, rightEdge); } return rightEdge; } public int[] getTopEdge() { if (topEdgeDirty) { computeEdge(TOP, topEdge); } return topEdge; } public int[] getBottomEdge() { if (bottomEdgeDirty) { computeEdge(BOTTOM, bottomEdge); } return bottomEdge; } PositionComparator comparator = new PositionComparator(); class PositionComparator implements Comparator<View> { int whichEdge = 0; public int compare(View left, View right) { CellAndSpan l = config.map.get(left); CellAndSpan r = config.map.get(right); switch (whichEdge) { case LEFT: return (r.x + r.spanX) - (l.x + l.spanX); case RIGHT: return l.x - r.x; case TOP: return (r.y + r.spanY) - (l.y + l.spanY); case BOTTOM: default: return l.y - r.y; } } } public void sortConfigurationForEdgePush(int edge) { comparator.whichEdge = edge; Collections.sort(config.sortedViews, comparator); } } private boolean pushViewsToTempLocation(ArrayList<View> views, Rect rectOccupiedByPotentialDrop, int[] direction, View dragView, ItemConfiguration currentState) { ViewCluster cluster = new ViewCluster(views, currentState); Rect clusterRect = cluster.getBoundingRect(); int whichEdge; int pushDistance; boolean fail = false; // Determine the edge of the cluster that will be leading the push and how far // the cluster must be shifted. if (direction[0] < 0) { whichEdge = ViewCluster.LEFT; pushDistance = clusterRect.right - rectOccupiedByPotentialDrop.left; } else if (direction[0] > 0) { whichEdge = ViewCluster.RIGHT; pushDistance = rectOccupiedByPotentialDrop.right - clusterRect.left; } else if (direction[1] < 0) { whichEdge = ViewCluster.TOP; pushDistance = clusterRect.bottom - rectOccupiedByPotentialDrop.top; } else { whichEdge = ViewCluster.BOTTOM; pushDistance = rectOccupiedByPotentialDrop.bottom - clusterRect.top; } // Break early for invalid push distance. if (pushDistance <= 0) { return false; } // Mark the occupied state as false for the group of views we want to move. for (View v: views) { CellAndSpan c = currentState.map.get(v); markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false); } // We save the current configuration -- if we fail to find a solution we will revert // to the initial state. The process of finding a solution modifies the configuration // in place, hence the need for revert in the failure case. currentState.save(); // The pushing algorithm is simplified by considering the views in the order in which // they would be pushed by the cluster. For example, if the cluster is leading with its // left edge, we consider sort the views by their right edge, from right to left. cluster.sortConfigurationForEdgePush(whichEdge); while (pushDistance > 0 && !fail) { for (View v: currentState.sortedViews) { // For each view that isn't in the cluster, we see if the leading edge of the // cluster is contacting the edge of that view. If so, we add that view to the // cluster. if (!cluster.views.contains(v) && v != dragView) { if (cluster.isViewTouchingEdge(v, whichEdge)) { LayoutParams lp = (LayoutParams) v.getLayoutParams(); if (!lp.canReorder) { // The push solution includes the all apps button, this is not viable. fail = true; break; } cluster.addView(v); CellAndSpan c = currentState.map.get(v); // Adding view to cluster, mark it as not occupied. markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false); } } } pushDistance--; // The cluster has been completed, now we move the whole thing over in the appropriate // direction. cluster.shift(whichEdge, 1); } boolean foundSolution = false; clusterRect = cluster.getBoundingRect(); // Due to the nature of the algorithm, the only check required to verify a valid solution // is to ensure that completed shifted cluster lies completely within the cell layout. if (!fail && clusterRect.left >= 0 && clusterRect.right <= mCountX && clusterRect.top >= 0 && clusterRect.bottom <= mCountY) { foundSolution = true; } else { currentState.restore(); } // In either case, we set the occupied array as marked for the location of the views for (View v: cluster.views) { CellAndSpan c = currentState.map.get(v); markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true); } return foundSolution; } private boolean addViewsToTempLocation(ArrayList<View> views, Rect rectOccupiedByPotentialDrop, int[] direction, View dragView, ItemConfiguration currentState) { if (views.size() == 0) return true; boolean success = false; Rect boundingRect = null; // We construct a rect which represents the entire group of views passed in for (View v: views) { CellAndSpan c = currentState.map.get(v); if (boundingRect == null) { boundingRect = new Rect(c.x, c.y, c.x + c.spanX, c.y + c.spanY); } else { boundingRect.union(c.x, c.y, c.x + c.spanX, c.y + c.spanY); } } // Mark the occupied state as false for the group of views we want to move. for (View v: views) { CellAndSpan c = currentState.map.get(v); markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false); } boolean[][] blockOccupied = new boolean[boundingRect.width()][boundingRect.height()]; int top = boundingRect.top; int left = boundingRect.left; // We mark more precisely which parts of the bounding rect are truly occupied, allowing // for interlocking. for (View v: views) { CellAndSpan c = currentState.map.get(v); markCellsForView(c.x - left, c.y - top, c.spanX, c.spanY, blockOccupied, true); } markCellsForRect(rectOccupiedByPotentialDrop, mTmpOccupied, true); findNearestArea(boundingRect.left, boundingRect.top, boundingRect.width(), boundingRect.height(), direction, mTmpOccupied, blockOccupied, mTempLocation); // If we successfuly found a location by pushing the block of views, we commit it if (mTempLocation[0] >= 0 && mTempLocation[1] >= 0) { int deltaX = mTempLocation[0] - boundingRect.left; int deltaY = mTempLocation[1] - boundingRect.top; for (View v: views) { CellAndSpan c = currentState.map.get(v); c.x += deltaX; c.y += deltaY; } success = true; } // In either case, we set the occupied array as marked for the location of the views for (View v: views) { CellAndSpan c = currentState.map.get(v); markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true); } return success; } private void markCellsForRect(Rect r, boolean[][] occupied, boolean value) { markCellsForView(r.left, r.top, r.width(), r.height(), occupied, value); } // This method tries to find a reordering solution which satisfies the push mechanic by trying // to push items in each of the cardinal directions, in an order based on the direction vector // passed. private boolean attemptPushInDirection(ArrayList<View> intersectingViews, Rect occupied, int[] direction, View ignoreView, ItemConfiguration solution) { if ((Math.abs(direction[0]) + Math.abs(direction[1])) > 1) { // If the direction vector has two non-zero components, we try pushing // separately in each of the components. int temp = direction[1]; direction[1] = 0; if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } direction[1] = temp; temp = direction[0]; direction[0] = 0; if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } // Revert the direction direction[0] = temp; // Now we try pushing in each component of the opposite direction direction[0] *= -1; direction[1] *= -1; temp = direction[1]; direction[1] = 0; if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } direction[1] = temp; temp = direction[0]; direction[0] = 0; if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } // revert the direction direction[0] = temp; direction[0] *= -1; direction[1] *= -1; } else { // If the direction vector has a single non-zero component, we push first in the // direction of the vector if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } // Then we try the opposite direction direction[0] *= -1; direction[1] *= -1; if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } // Switch the direction back direction[0] *= -1; direction[1] *= -1; // If we have failed to find a push solution with the above, then we try // to find a solution by pushing along the perpendicular axis. // Swap the components int temp = direction[1]; direction[1] = direction[0]; direction[0] = temp; if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } // Then we try the opposite direction direction[0] *= -1; direction[1] *= -1; if (pushViewsToTempLocation(intersectingViews, occupied, direction, ignoreView, solution)) { return true; } // Switch the direction back direction[0] *= -1; direction[1] *= -1; // Swap the components back temp = direction[1]; direction[1] = direction[0]; direction[0] = temp; } return false; } private boolean rearrangementExists(int cellX, int cellY, int spanX, int spanY, int[] direction, View ignoreView, ItemConfiguration solution) { // Return early if get invalid cell positions if (cellX < 0 || cellY < 0) return false; mIntersectingViews.clear(); mOccupiedRect.set(cellX, cellY, cellX + spanX, cellY + spanY); // Mark the desired location of the view currently being dragged. if (ignoreView != null) { CellAndSpan c = solution.map.get(ignoreView); if (c != null) { c.x = cellX; c.y = cellY; } } Rect r0 = new Rect(cellX, cellY, cellX + spanX, cellY + spanY); Rect r1 = new Rect(); for (View child: solution.map.keySet()) { if (child == ignoreView) continue; CellAndSpan c = solution.map.get(child); LayoutParams lp = (LayoutParams) child.getLayoutParams(); r1.set(c.x, c.y, c.x + c.spanX, c.y + c.spanY); if (Rect.intersects(r0, r1)) { if (!lp.canReorder) { return false; } mIntersectingViews.add(child); } } // First we try to find a solution which respects the push mechanic. That is, // we try to find a solution such that no displaced item travels through another item // without also displacing that item. if (attemptPushInDirection(mIntersectingViews, mOccupiedRect, direction, ignoreView, solution)) { return true; } // Next we try moving the views as a block, but without requiring the push mechanic. if (addViewsToTempLocation(mIntersectingViews, mOccupiedRect, direction, ignoreView, solution)) { return true; } // Ok, they couldn't move as a block, let's move them individually for (View v : mIntersectingViews) { if (!addViewToTempLocation(v, mOccupiedRect, direction, solution)) { return false; } } return true; } /* * Returns a pair (x, y), where x,y are in {-1, 0, 1} corresponding to vector between * the provided point and the provided cell */ private void computeDirectionVector(float deltaX, float deltaY, int[] result) { double angle = Math.atan(((float) deltaY) / deltaX); result[0] = 0; result[1] = 0; if (Math.abs(Math.cos(angle)) > 0.5f) { result[0] = (int) Math.signum(deltaX); } if (Math.abs(Math.sin(angle)) > 0.5f) { result[1] = (int) Math.signum(deltaY); } } private void copyOccupiedArray(boolean[][] occupied) { for (int i = 0; i < mCountX; i++) { for (int j = 0; j < mCountY; j++) { occupied[i][j] = mOccupied[i][j]; } } } ItemConfiguration simpleSwap(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX, int spanY, int[] direction, View dragView, boolean decX, ItemConfiguration solution) { // Copy the current state into the solution. This solution will be manipulated as necessary. copyCurrentStateToSolution(solution, false); // Copy the current occupied array into the temporary occupied array. This array will be // manipulated as necessary to find a solution. copyOccupiedArray(mTmpOccupied); // We find the nearest cell into which we would place the dragged item, assuming there's // nothing in its way. int result[] = new int[2]; result = findNearestArea(pixelX, pixelY, spanX, spanY, result); boolean success = false; // First we try the exact nearest position of the item being dragged, // we will then want to try to move this around to other neighbouring positions success = rearrangementExists(result[0], result[1], spanX, spanY, direction, dragView, solution); if (!success) { // We try shrinking the widget down to size in an alternating pattern, shrink 1 in // x, then 1 in y etc. if (spanX > minSpanX && (minSpanY == spanY || decX)) { return simpleSwap(pixelX, pixelY, minSpanX, minSpanY, spanX - 1, spanY, direction, dragView, false, solution); } else if (spanY > minSpanY) { return simpleSwap(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY - 1, direction, dragView, true, solution); } solution.isSolution = false; } else { solution.isSolution = true; solution.dragViewX = result[0]; solution.dragViewY = result[1]; solution.dragViewSpanX = spanX; solution.dragViewSpanY = spanY; } return solution; } private void copyCurrentStateToSolution(ItemConfiguration solution, boolean temp) { int childCount = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mShortcutsAndWidgets.getChildAt(i); LayoutParams lp = (LayoutParams) child.getLayoutParams(); CellAndSpan c; if (temp) { c = new CellAndSpan(lp.tmpCellX, lp.tmpCellY, lp.cellHSpan, lp.cellVSpan); } else { c = new CellAndSpan(lp.cellX, lp.cellY, lp.cellHSpan, lp.cellVSpan); } solution.add(child, c); } } private void copySolutionToTempState(ItemConfiguration solution, View dragView) { for (int i = 0; i < mCountX; i++) { for (int j = 0; j < mCountY; j++) { mTmpOccupied[i][j] = false; } } int childCount = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mShortcutsAndWidgets.getChildAt(i); if (child == dragView) continue; LayoutParams lp = (LayoutParams) child.getLayoutParams(); CellAndSpan c = solution.map.get(child); if (c != null) { lp.tmpCellX = c.x; lp.tmpCellY = c.y; lp.cellHSpan = c.spanX; lp.cellVSpan = c.spanY; markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true); } } markCellsForView(solution.dragViewX, solution.dragViewY, solution.dragViewSpanX, solution.dragViewSpanY, mTmpOccupied, true); } private void animateItemsToSolution(ItemConfiguration solution, View dragView, boolean commitDragView) { boolean[][] occupied = DESTRUCTIVE_REORDER ? mOccupied : mTmpOccupied; for (int i = 0; i < mCountX; i++) { for (int j = 0; j < mCountY; j++) { occupied[i][j] = false; } } int childCount = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mShortcutsAndWidgets.getChildAt(i); if (child == dragView) continue; CellAndSpan c = solution.map.get(child); if (c != null) { animateChildToPosition(child, c.x, c.y, REORDER_ANIMATION_DURATION, 0, DESTRUCTIVE_REORDER, false); markCellsForView(c.x, c.y, c.spanX, c.spanY, occupied, true); } } if (commitDragView) { markCellsForView(solution.dragViewX, solution.dragViewY, solution.dragViewSpanX, solution.dragViewSpanY, occupied, true); } } // This method starts or changes the reorder hint animations private void beginOrAdjustHintAnimations(ItemConfiguration solution, View dragView, int delay) { int childCount = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mShortcutsAndWidgets.getChildAt(i); if (child == dragView) continue; CellAndSpan c = solution.map.get(child); LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (c != null) { ReorderHintAnimation rha = new ReorderHintAnimation(child, lp.cellX, lp.cellY, c.x, c.y, c.spanX, c.spanY); rha.animate(); } } } // Class which represents the reorder hint animations. These animations show that an item is // in a temporary state, and hint at where the item will return to. class ReorderHintAnimation { View child; float finalDeltaX; float finalDeltaY; float initDeltaX; float initDeltaY; float finalScale; float initScale; private static final int DURATION = 300; Animator a; public ReorderHintAnimation(View child, int cellX0, int cellY0, int cellX1, int cellY1, int spanX, int spanY) { regionToCenterPoint(cellX0, cellY0, spanX, spanY, mTmpPoint); final int x0 = mTmpPoint[0]; final int y0 = mTmpPoint[1]; regionToCenterPoint(cellX1, cellY1, spanX, spanY, mTmpPoint); final int x1 = mTmpPoint[0]; final int y1 = mTmpPoint[1]; final int dX = x1 - x0; final int dY = y1 - y0; finalDeltaX = 0; finalDeltaY = 0; if (dX == dY && dX == 0) { } else { if (dY == 0) { finalDeltaX = - Math.signum(dX) * mReorderHintAnimationMagnitude; } else if (dX == 0) { finalDeltaY = - Math.signum(dY) * mReorderHintAnimationMagnitude; } else { double angle = Math.atan( (float) (dY) / dX); finalDeltaX = (int) (- Math.signum(dX) * Math.abs(Math.cos(angle) * mReorderHintAnimationMagnitude)); finalDeltaY = (int) (- Math.signum(dY) * Math.abs(Math.sin(angle) * mReorderHintAnimationMagnitude)); } } initDeltaX = child.getTranslationX(); initDeltaY = child.getTranslationY(); finalScale = getChildrenScale() - 4.0f / child.getWidth(); initScale = child.getScaleX(); this.child = child; } void animate() { if (mShakeAnimators.containsKey(child)) { ReorderHintAnimation oldAnimation = mShakeAnimators.get(child); oldAnimation.cancel(); mShakeAnimators.remove(child); if (finalDeltaX == 0 && finalDeltaY == 0) { completeAnimationImmediately(); return; } } if (finalDeltaX == 0 && finalDeltaY == 0) { return; } ValueAnimator va = LauncherAnimUtils.ofFloat(child, 0f, 1f); a = va; va.setRepeatMode(ValueAnimator.REVERSE); va.setRepeatCount(ValueAnimator.INFINITE); va.setDuration(DURATION); va.setStartDelay((int) (Math.random() * 60)); va.addUpdateListener(new AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { float r = ((Float) animation.getAnimatedValue()).floatValue(); float x = r * finalDeltaX + (1 - r) * initDeltaX; float y = r * finalDeltaY + (1 - r) * initDeltaY; child.setTranslationX(x); child.setTranslationY(y); float s = r * finalScale + (1 - r) * initScale; child.setScaleX(s); child.setScaleY(s); } }); va.addListener(new AnimatorListenerAdapter() { public void onAnimationRepeat(Animator animation) { // We make sure to end only after a full period initDeltaX = 0; initDeltaY = 0; initScale = getChildrenScale(); } }); mShakeAnimators.put(child, this); va.start(); } private void cancel() { if (a != null) { a.cancel(); } } private void completeAnimationImmediately() { if (a != null) { a.cancel(); } AnimatorSet s = LauncherAnimUtils.createAnimatorSet(); a = s; s.playTogether( LauncherAnimUtils.ofFloat(child, "scaleX", getChildrenScale()), LauncherAnimUtils.ofFloat(child, "scaleY", getChildrenScale()), LauncherAnimUtils.ofFloat(child, "translationX", 0f), LauncherAnimUtils.ofFloat(child, "translationY", 0f) ); s.setDuration(REORDER_ANIMATION_DURATION); s.setInterpolator(new android.view.animation.DecelerateInterpolator(1.5f)); s.start(); } } private void completeAndClearReorderHintAnimations() { for (ReorderHintAnimation a: mShakeAnimators.values()) { a.completeAnimationImmediately(); } mShakeAnimators.clear(); } private void commitTempPlacement() { for (int i = 0; i < mCountX; i++) { for (int j = 0; j < mCountY; j++) { mOccupied[i][j] = mTmpOccupied[i][j]; } } int childCount = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mShortcutsAndWidgets.getChildAt(i); LayoutParams lp = (LayoutParams) child.getLayoutParams(); ItemInfo info = (ItemInfo) child.getTag(); // We do a null check here because the item info can be null in the case of the // AllApps button in the hotseat. if (info != null) { if (info.cellX != lp.tmpCellX || info.cellY != lp.tmpCellY || info.spanX != lp.cellHSpan || info.spanY != lp.cellVSpan) { info.requiresDbUpdate = true; } info.cellX = lp.cellX = lp.tmpCellX; info.cellY = lp.cellY = lp.tmpCellY; info.spanX = lp.cellHSpan; info.spanY = lp.cellVSpan; } } mLauncher.getWorkspace().updateItemLocationsInDatabase(this); } public void setUseTempCoords(boolean useTempCoords) { int childCount = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < childCount; i++) { LayoutParams lp = (LayoutParams) mShortcutsAndWidgets.getChildAt(i).getLayoutParams(); lp.useTmpCoords = useTempCoords; } } ItemConfiguration findConfigurationNoShuffle(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX, int spanY, View dragView, ItemConfiguration solution) { int[] result = new int[2]; int[] resultSpan = new int[2]; findNearestVacantArea(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, null, result, resultSpan); if (result[0] >= 0 && result[1] >= 0) { copyCurrentStateToSolution(solution, false); solution.dragViewX = result[0]; solution.dragViewY = result[1]; solution.dragViewSpanX = resultSpan[0]; solution.dragViewSpanY = resultSpan[1]; solution.isSolution = true; } else { solution.isSolution = false; } return solution; } public void prepareChildForDrag(View child) { markCellsAsUnoccupiedForView(child); } /* This seems like it should be obvious and straight-forward, but when the direction vector needs to match with the notion of the dragView pushing other views, we have to employ a slightly more subtle notion of the direction vector. The question is what two points is the vector between? The center of the dragView and its desired destination? Not quite, as this doesn't necessarily coincide with the interaction of the dragView and items occupying those cells. Instead we use some heuristics to often lock the vector to up, down, left or right, which helps make pushing feel right. */ private void getDirectionVectorForDrop(int dragViewCenterX, int dragViewCenterY, int spanX, int spanY, View dragView, int[] resultDirection) { int[] targetDestination = new int[2]; findNearestArea(dragViewCenterX, dragViewCenterY, spanX, spanY, targetDestination); Rect dragRect = new Rect(); regionToRect(targetDestination[0], targetDestination[1], spanX, spanY, dragRect); dragRect.offset(dragViewCenterX - dragRect.centerX(), dragViewCenterY - dragRect.centerY()); Rect dropRegionRect = new Rect(); getViewsIntersectingRegion(targetDestination[0], targetDestination[1], spanX, spanY, dragView, dropRegionRect, mIntersectingViews); int dropRegionSpanX = dropRegionRect.width(); int dropRegionSpanY = dropRegionRect.height(); regionToRect(dropRegionRect.left, dropRegionRect.top, dropRegionRect.width(), dropRegionRect.height(), dropRegionRect); int deltaX = (dropRegionRect.centerX() - dragViewCenterX) / spanX; int deltaY = (dropRegionRect.centerY() - dragViewCenterY) / spanY; if (dropRegionSpanX == mCountX || spanX == mCountX) { deltaX = 0; } if (dropRegionSpanY == mCountY || spanY == mCountY) { deltaY = 0; } if (deltaX == 0 && deltaY == 0) { // No idea what to do, give a random direction. resultDirection[0] = 1; resultDirection[1] = 0; } else { computeDirectionVector(deltaX, deltaY, resultDirection); } } // For a given cell and span, fetch the set of views intersecting the region. private void getViewsIntersectingRegion(int cellX, int cellY, int spanX, int spanY, View dragView, Rect boundingRect, ArrayList<View> intersectingViews) { if (boundingRect != null) { boundingRect.set(cellX, cellY, cellX + spanX, cellY + spanY); } intersectingViews.clear(); Rect r0 = new Rect(cellX, cellY, cellX + spanX, cellY + spanY); Rect r1 = new Rect(); final int count = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < count; i++) { View child = mShortcutsAndWidgets.getChildAt(i); if (child == dragView) continue; LayoutParams lp = (LayoutParams) child.getLayoutParams(); r1.set(lp.cellX, lp.cellY, lp.cellX + lp.cellHSpan, lp.cellY + lp.cellVSpan); if (Rect.intersects(r0, r1)) { mIntersectingViews.add(child); if (boundingRect != null) { boundingRect.union(r1); } } } } boolean isNearestDropLocationOccupied(int pixelX, int pixelY, int spanX, int spanY, View dragView, int[] result) { result = findNearestArea(pixelX, pixelY, spanX, spanY, result); getViewsIntersectingRegion(result[0], result[1], spanX, spanY, dragView, null, mIntersectingViews); return !mIntersectingViews.isEmpty(); } void revertTempState() { if (!isItemPlacementDirty() || DESTRUCTIVE_REORDER) return; final int count = mShortcutsAndWidgets.getChildCount(); for (int i = 0; i < count; i++) { View child = mShortcutsAndWidgets.getChildAt(i); LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (lp.tmpCellX != lp.cellX || lp.tmpCellY != lp.cellY) { lp.tmpCellX = lp.cellX; lp.tmpCellY = lp.cellY; animateChildToPosition(child, lp.cellX, lp.cellY, REORDER_ANIMATION_DURATION, 0, false, false); } } completeAndClearReorderHintAnimations(); setItemPlacementDirty(false); } boolean createAreaForResize(int cellX, int cellY, int spanX, int spanY, View dragView, int[] direction, boolean commit) { int[] pixelXY = new int[2]; regionToCenterPoint(cellX, cellY, spanX, spanY, pixelXY); // First we determine if things have moved enough to cause a different layout ItemConfiguration swapSolution = simpleSwap(pixelXY[0], pixelXY[1], spanX, spanY, spanX, spanY, direction, dragView, true, new ItemConfiguration()); setUseTempCoords(true); if (swapSolution != null && swapSolution.isSolution) { // If we're just testing for a possible location (MODE_ACCEPT_DROP), we don't bother // committing anything or animating anything as we just want to determine if a solution // exists copySolutionToTempState(swapSolution, dragView); setItemPlacementDirty(true); animateItemsToSolution(swapSolution, dragView, commit); if (commit) { commitTempPlacement(); completeAndClearReorderHintAnimations(); setItemPlacementDirty(false); } else { beginOrAdjustHintAnimations(swapSolution, dragView, REORDER_ANIMATION_DURATION); } mShortcutsAndWidgets.requestLayout(); } return swapSolution.isSolution; } int[] createArea(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX, int spanY, View dragView, int[] result, int resultSpan[], int mode) { // First we determine if things have moved enough to cause a different layout result = findNearestArea(pixelX, pixelY, spanX, spanY, result); if (resultSpan == null) { resultSpan = new int[2]; } // When we are checking drop validity or actually dropping, we don't recompute the // direction vector, since we want the solution to match the preview, and it's possible // that the exact position of the item has changed to result in a new reordering outcome. if ((mode == MODE_ON_DROP || mode == MODE_ON_DROP_EXTERNAL || mode == MODE_ACCEPT_DROP) && mPreviousReorderDirection[0] != INVALID_DIRECTION) { mDirectionVector[0] = mPreviousReorderDirection[0]; mDirectionVector[1] = mPreviousReorderDirection[1]; // We reset this vector after drop if (mode == MODE_ON_DROP || mode == MODE_ON_DROP_EXTERNAL) { mPreviousReorderDirection[0] = INVALID_DIRECTION; mPreviousReorderDirection[1] = INVALID_DIRECTION; } } else { getDirectionVectorForDrop(pixelX, pixelY, spanX, spanY, dragView, mDirectionVector); mPreviousReorderDirection[0] = mDirectionVector[0]; mPreviousReorderDirection[1] = mDirectionVector[1]; } ItemConfiguration swapSolution = simpleSwap(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, mDirectionVector, dragView, true, new ItemConfiguration()); // We attempt the approach which doesn't shuffle views at all ItemConfiguration noShuffleSolution = findConfigurationNoShuffle(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, dragView, new ItemConfiguration()); ItemConfiguration finalSolution = null; if (swapSolution.isSolution && swapSolution.area() >= noShuffleSolution.area()) { finalSolution = swapSolution; } else if (noShuffleSolution.isSolution) { finalSolution = noShuffleSolution; } boolean foundSolution = true; if (!DESTRUCTIVE_REORDER) { setUseTempCoords(true); } if (finalSolution != null) { result[0] = finalSolution.dragViewX; result[1] = finalSolution.dragViewY; resultSpan[0] = finalSolution.dragViewSpanX; resultSpan[1] = finalSolution.dragViewSpanY; // If we're just testing for a possible location (MODE_ACCEPT_DROP), we don't bother // committing anything or animating anything as we just want to determine if a solution // exists if (mode == MODE_DRAG_OVER || mode == MODE_ON_DROP || mode == MODE_ON_DROP_EXTERNAL) { if (!DESTRUCTIVE_REORDER) { copySolutionToTempState(finalSolution, dragView); } setItemPlacementDirty(true); animateItemsToSolution(finalSolution, dragView, mode == MODE_ON_DROP); if (!DESTRUCTIVE_REORDER && (mode == MODE_ON_DROP || mode == MODE_ON_DROP_EXTERNAL)) { commitTempPlacement(); completeAndClearReorderHintAnimations(); setItemPlacementDirty(false); } else { beginOrAdjustHintAnimations(finalSolution, dragView, REORDER_ANIMATION_DURATION); } } } else { foundSolution = false; result[0] = result[1] = resultSpan[0] = resultSpan[1] = -1; } if ((mode == MODE_ON_DROP || !foundSolution) && !DESTRUCTIVE_REORDER) { setUseTempCoords(false); } mShortcutsAndWidgets.requestLayout(); return result; } void setItemPlacementDirty(boolean dirty) { mItemPlacementDirty = dirty; } boolean isItemPlacementDirty() { return mItemPlacementDirty; } private class ItemConfiguration { HashMap<View, CellAndSpan> map = new HashMap<View, CellAndSpan>(); private HashMap<View, CellAndSpan> savedMap = new HashMap<View, CellAndSpan>(); ArrayList<View> sortedViews = new ArrayList<View>(); boolean isSolution = false; int dragViewX, dragViewY, dragViewSpanX, dragViewSpanY; void save() { // Copy current state into savedMap for (View v: map.keySet()) { map.get(v).copy(savedMap.get(v)); } } void restore() { // Restore current state from savedMap for (View v: savedMap.keySet()) { savedMap.get(v).copy(map.get(v)); } } void add(View v, CellAndSpan cs) { map.put(v, cs); savedMap.put(v, new CellAndSpan()); sortedViews.add(v); } int area() { return dragViewSpanX * dragViewSpanY; } } private class CellAndSpan { int x, y; int spanX, spanY; public CellAndSpan() { } public void copy(CellAndSpan copy) { copy.x = x; copy.y = y; copy.spanX = spanX; copy.spanY = spanY; } public CellAndSpan(int x, int y, int spanX, int spanY) { this.x = x; this.y = y; this.spanX = spanX; this.spanY = spanY; } public String toString() { return "(" + x + ", " + y + ": " + spanX + ", " + spanY + ")"; } } /** * Find a vacant area that will fit the given bounds nearest the requested * cell location. Uses Euclidean distance to score multiple vacant areas. * * @param pixelX The X location at which you want to search for a vacant area. * @param pixelY The Y location at which you want to search for a vacant area. * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param ignoreView Considers space occupied by this view as unoccupied * @param result Previously returned value to possibly recycle. * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ int[] findNearestVacantArea( int pixelX, int pixelY, int spanX, int spanY, View ignoreView, int[] result) { return findNearestArea(pixelX, pixelY, spanX, spanY, ignoreView, true, result); } /** * Find a vacant area that will fit the given bounds nearest the requested * cell location. Uses Euclidean distance to score multiple vacant areas. * * @param pixelX The X location at which you want to search for a vacant area. * @param pixelY The Y location at which you want to search for a vacant area. * @param minSpanX The minimum horizontal span required * @param minSpanY The minimum vertical span required * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param ignoreView Considers space occupied by this view as unoccupied * @param result Previously returned value to possibly recycle. * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ int[] findNearestVacantArea(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX, int spanY, View ignoreView, int[] result, int[] resultSpan) { return findNearestArea(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, ignoreView, true, result, resultSpan, mOccupied); } /** * Find a starting cell position that will fit the given bounds nearest the requested * cell location. Uses Euclidean distance to score multiple vacant areas. * * @param pixelX The X location at which you want to search for a vacant area. * @param pixelY The Y location at which you want to search for a vacant area. * @param spanX Horizontal span of the object. * @param spanY Vertical span of the object. * @param ignoreView Considers space occupied by this view as unoccupied * @param result Previously returned value to possibly recycle. * @return The X, Y cell of a vacant area that can contain this object, * nearest the requested location. */ int[] findNearestArea( int pixelX, int pixelY, int spanX, int spanY, int[] result) { return findNearestArea(pixelX, pixelY, spanX, spanY, null, false, result); } boolean existsEmptyCell() { return findCellForSpan(null, 1, 1); } /** * Finds the upper-left coordinate of the first rectangle in the grid that can * hold a cell of the specified dimensions. If intersectX and intersectY are not -1, * then this method will only return coordinates for rectangles that contain the cell * (intersectX, intersectY) * * @param cellXY The array that will contain the position of a vacant cell if such a cell * can be found. * @param spanX The horizontal span of the cell we want to find. * @param spanY The vertical span of the cell we want to find. * * @return True if a vacant cell of the specified dimension was found, false otherwise. */ boolean findCellForSpan(int[] cellXY, int spanX, int spanY) { return findCellForSpanThatIntersectsIgnoring(cellXY, spanX, spanY, -1, -1, null, mOccupied); } /** * Like above, but ignores any cells occupied by the item "ignoreView" * * @param cellXY The array that will contain the position of a vacant cell if such a cell * can be found. * @param spanX The horizontal span of the cell we want to find. * @param spanY The vertical span of the cell we want to find. * @param ignoreView The home screen item we should treat as not occupying any space * @return */ boolean findCellForSpanIgnoring(int[] cellXY, int spanX, int spanY, View ignoreView) { return findCellForSpanThatIntersectsIgnoring(cellXY, spanX, spanY, -1, -1, ignoreView, mOccupied); } /** * Like above, but if intersectX and intersectY are not -1, then this method will try to * return coordinates for rectangles that contain the cell [intersectX, intersectY] * * @param spanX The horizontal span of the cell we want to find. * @param spanY The vertical span of the cell we want to find. * @param ignoreView The home screen item we should treat as not occupying any space * @param intersectX The X coordinate of the cell that we should try to overlap * @param intersectX The Y coordinate of the cell that we should try to overlap * * @return True if a vacant cell of the specified dimension was found, false otherwise. */ boolean findCellForSpanThatIntersects(int[] cellXY, int spanX, int spanY, int intersectX, int intersectY) { return findCellForSpanThatIntersectsIgnoring( cellXY, spanX, spanY, intersectX, intersectY, null, mOccupied); } /** * The superset of the above two methods */ boolean findCellForSpanThatIntersectsIgnoring(int[] cellXY, int spanX, int spanY, int intersectX, int intersectY, View ignoreView, boolean occupied[][]) { // mark space take by ignoreView as available (method checks if ignoreView is null) markCellsAsUnoccupiedForView(ignoreView, occupied); boolean foundCell = false; while (true) { int startX = 0; if (intersectX >= 0) { startX = Math.max(startX, intersectX - (spanX - 1)); } int endX = mCountX - (spanX - 1); if (intersectX >= 0) { endX = Math.min(endX, intersectX + (spanX - 1) + (spanX == 1 ? 1 : 0)); } int startY = 0; if (intersectY >= 0) { startY = Math.max(startY, intersectY - (spanY - 1)); } int endY = mCountY - (spanY - 1); if (intersectY >= 0) { endY = Math.min(endY, intersectY + (spanY - 1) + (spanY == 1 ? 1 : 0)); } for (int y = startY; y < endY && !foundCell; y++) { inner: for (int x = startX; x < endX; x++) { for (int i = 0; i < spanX; i++) { for (int j = 0; j < spanY; j++) { if (occupied[x + i][y + j]) { // small optimization: we can skip to after the column we just found // an occupied cell x += i; continue inner; } } } if (cellXY != null) { cellXY[0] = x; cellXY[1] = y; } foundCell = true; break; } } if (intersectX == -1 && intersectY == -1) { break; } else { // if we failed to find anything, try again but without any requirements of // intersecting intersectX = -1; intersectY = -1; continue; } } // re-mark space taken by ignoreView as occupied markCellsAsOccupiedForView(ignoreView, occupied); return foundCell; } /** * A drag event has begun over this layout. * It may have begun over this layout (in which case onDragChild is called first), * or it may have begun on another layout. */ void onDragEnter() { mDragEnforcer.onDragEnter(); mDragging = true; } /** * Called when drag has left this CellLayout or has been completed (successfully or not) */ void onDragExit() { mDragEnforcer.onDragExit(); // This can actually be called when we aren't in a drag, e.g. when adding a new // item to this layout via the customize drawer. // Guard against that case. if (mDragging) { mDragging = false; } // Invalidate the drag data mDragCell[0] = mDragCell[1] = -1; mDragOutlineAnims[mDragOutlineCurrent].animateOut(); mDragOutlineCurrent = (mDragOutlineCurrent + 1) % mDragOutlineAnims.length; revertTempState(); setIsDragOverlapping(false); } /** * Mark a child as having been dropped. * At the beginning of the drag operation, the child may have been on another * screen, but it is re-parented before this method is called. * * @param child The child that is being dropped */ void onDropChild(View child) { if (child != null) { LayoutParams lp = (LayoutParams) child.getLayoutParams(); lp.dropped = true; child.requestLayout(); } } /** * Computes a bounding rectangle for a range of cells * * @param cellX X coordinate of upper left corner expressed as a cell position * @param cellY Y coordinate of upper left corner expressed as a cell position * @param cellHSpan Width in cells * @param cellVSpan Height in cells * @param resultRect Rect into which to put the results */ public void cellToRect(int cellX, int cellY, int cellHSpan, int cellVSpan, Rect resultRect) { final int cellWidth = mCellWidth; final int cellHeight = mCellHeight; final int widthGap = mWidthGap; final int heightGap = mHeightGap; final int hStartPadding = getPaddingLeft(); final int vStartPadding = getPaddingTop(); int width = cellHSpan * cellWidth + ((cellHSpan - 1) * widthGap); int height = cellVSpan * cellHeight + ((cellVSpan - 1) * heightGap); int x = hStartPadding + cellX * (cellWidth + widthGap); int y = vStartPadding + cellY * (cellHeight + heightGap); resultRect.set(x, y, x + width, y + height); } /** * Computes the required horizontal and vertical cell spans to always * fit the given rectangle. * * @param width Width in pixels * @param height Height in pixels * @param result An array of length 2 in which to store the result (may be null). */ public static int[] rectToCell(int width, int height, int[] result) { LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); Rect padding = grid.getWorkspacePadding(grid.isLandscape ? CellLayout.LANDSCAPE : CellLayout.PORTRAIT); // Always assume we're working with the smallest span to make sure we // reserve enough space in both orientations. int parentWidth = grid.calculateCellWidth(grid.widthPx - padding.left - padding.right, (int) grid.numColumns); int parentHeight = grid.calculateCellHeight(grid.heightPx - padding.top - padding.bottom, (int) grid.numRows); int smallerSize = Math.min(parentWidth, parentHeight); // Always round up to next largest cell int spanX = (int) Math.ceil(width / (float) smallerSize); int spanY = (int) Math.ceil(height / (float) smallerSize); if (result == null) { return new int[] { spanX, spanY }; } result[0] = spanX; result[1] = spanY; return result; } public int[] cellSpansToSize(int hSpans, int vSpans) { int[] size = new int[2]; size[0] = hSpans * mCellWidth + (hSpans - 1) * mWidthGap; size[1] = vSpans * mCellHeight + (vSpans - 1) * mHeightGap; return size; } /** * Calculate the grid spans needed to fit given item */ public void calculateSpans(ItemInfo info) { final int minWidth; final int minHeight; if (info instanceof LauncherAppWidgetInfo) { minWidth = ((LauncherAppWidgetInfo) info).minWidth; minHeight = ((LauncherAppWidgetInfo) info).minHeight; } else if (info instanceof PendingAddWidgetInfo) { minWidth = ((PendingAddWidgetInfo) info).minWidth; minHeight = ((PendingAddWidgetInfo) info).minHeight; } else { // It's not a widget, so it must be 1x1 info.spanX = info.spanY = 1; return; } int[] spans = rectToCell(minWidth, minHeight, null); info.spanX = spans[0]; info.spanY = spans[1]; } /** * Find the first vacant cell, if there is one. * * @param vacant Holds the x and y coordinate of the vacant cell * @param spanX Horizontal cell span. * @param spanY Vertical cell span. * * @return True if a vacant cell was found */ public boolean getVacantCell(int[] vacant, int spanX, int spanY) { return findVacantCell(vacant, spanX, spanY, mCountX, mCountY, mOccupied); } static boolean findVacantCell(int[] vacant, int spanX, int spanY, int xCount, int yCount, boolean[][] occupied) { for (int y = 0; y < yCount; y++) { for (int x = 0; x < xCount; x++) { boolean available = !occupied[x][y]; out: for (int i = x; i < x + spanX - 1 && x < xCount; i++) { for (int j = y; j < y + spanY - 1 && y < yCount; j++) { available = available && !occupied[i][j]; if (!available) break out; } } if (available) { vacant[0] = x; vacant[1] = y; return true; } } } return false; } private void clearOccupiedCells() { for (int x = 0; x < mCountX; x++) { for (int y = 0; y < mCountY; y++) { mOccupied[x][y] = false; } } } public void onMove(View view, int newCellX, int newCellY, int newSpanX, int newSpanY) { markCellsAsUnoccupiedForView(view); markCellsForView(newCellX, newCellY, newSpanX, newSpanY, mOccupied, true); } public void markCellsAsOccupiedForView(View view) { markCellsAsOccupiedForView(view, mOccupied); } public void markCellsAsOccupiedForView(View view, boolean[][] occupied) { if (view == null || view.getParent() != mShortcutsAndWidgets) return; LayoutParams lp = (LayoutParams) view.getLayoutParams(); markCellsForView(lp.cellX, lp.cellY, lp.cellHSpan, lp.cellVSpan, occupied, true); } public void markCellsAsUnoccupiedForView(View view) { markCellsAsUnoccupiedForView(view, mOccupied); } public void markCellsAsUnoccupiedForView(View view, boolean occupied[][]) { if (view == null || view.getParent() != mShortcutsAndWidgets) return; LayoutParams lp = (LayoutParams) view.getLayoutParams(); markCellsForView(lp.cellX, lp.cellY, lp.cellHSpan, lp.cellVSpan, occupied, false); } private void markCellsForView(int cellX, int cellY, int spanX, int spanY, boolean[][] occupied, boolean value) { if (cellX < 0 || cellY < 0) return; for (int x = cellX; x < cellX + spanX && x < mCountX; x++) { for (int y = cellY; y < cellY + spanY && y < mCountY; y++) { occupied[x][y] = value; } } } public int getDesiredWidth() { return getPaddingLeft() + getPaddingRight() + (mCountX * mCellWidth) + (Math.max((mCountX - 1), 0) * mWidthGap); } public int getDesiredHeight() { return getPaddingTop() + getPaddingBottom() + (mCountY * mCellHeight) + (Math.max((mCountY - 1), 0) * mHeightGap); } public boolean isOccupied(int x, int y) { if (x < mCountX && y < mCountY) { return mOccupied[x][y]; } else { throw new RuntimeException("Position exceeds the bound of this CellLayout"); } } @Override public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) { return new CellLayout.LayoutParams(getContext(), attrs); } @Override protected boolean checkLayoutParams(ViewGroup.LayoutParams p) { return p instanceof CellLayout.LayoutParams; } @Override protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) { return new CellLayout.LayoutParams(p); } public static class CellLayoutAnimationController extends LayoutAnimationController { public CellLayoutAnimationController(Animation animation, float delay) { super(animation, delay); } @Override protected long getDelayForView(View view) { return (int) (Math.random() * 150); } } public static class LayoutParams extends ViewGroup.MarginLayoutParams { /** * Horizontal location of the item in the grid. */ @ViewDebug.ExportedProperty public int cellX; /** * Vertical location of the item in the grid. */ @ViewDebug.ExportedProperty public int cellY; /** * Temporary horizontal location of the item in the grid during reorder */ public int tmpCellX; /** * Temporary vertical location of the item in the grid during reorder */ public int tmpCellY; /** * Indicates that the temporary coordinates should be used to layout the items */ public boolean useTmpCoords; /** * Number of cells spanned horizontally by the item. */ @ViewDebug.ExportedProperty public int cellHSpan; /** * Number of cells spanned vertically by the item. */ @ViewDebug.ExportedProperty public int cellVSpan; /** * Indicates whether the item will set its x, y, width and height parameters freely, * or whether these will be computed based on cellX, cellY, cellHSpan and cellVSpan. */ public boolean isLockedToGrid = true; /** * Indicates that this item should use the full extents of its parent. */ public boolean isFullscreen = false; /** * Indicates whether this item can be reordered. Always true except in the case of the * the AllApps button. */ public boolean canReorder = true; // X coordinate of the view in the layout. @ViewDebug.ExportedProperty int x; // Y coordinate of the view in the layout. @ViewDebug.ExportedProperty int y; boolean dropped; public LayoutParams(Context c, AttributeSet attrs) { super(c, attrs); cellHSpan = 1; cellVSpan = 1; } public LayoutParams(ViewGroup.LayoutParams source) { super(source); cellHSpan = 1; cellVSpan = 1; } public LayoutParams(LayoutParams source) { super(source); this.cellX = source.cellX; this.cellY = source.cellY; this.cellHSpan = source.cellHSpan; this.cellVSpan = source.cellVSpan; } public LayoutParams(int cellX, int cellY, int cellHSpan, int cellVSpan) { super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); this.cellX = cellX; this.cellY = cellY; this.cellHSpan = cellHSpan; this.cellVSpan = cellVSpan; } public void setup(int cellWidth, int cellHeight, int widthGap, int heightGap, boolean invertHorizontally, int colCount) { if (isLockedToGrid) { final int myCellHSpan = cellHSpan; final int myCellVSpan = cellVSpan; int myCellX = useTmpCoords ? tmpCellX : cellX; int myCellY = useTmpCoords ? tmpCellY : cellY; if (invertHorizontally) { myCellX = colCount - myCellX - cellHSpan; } width = myCellHSpan * cellWidth + ((myCellHSpan - 1) * widthGap) - leftMargin - rightMargin; height = myCellVSpan * cellHeight + ((myCellVSpan - 1) * heightGap) - topMargin - bottomMargin; x = (int) (myCellX * (cellWidth + widthGap) + leftMargin); y = (int) (myCellY * (cellHeight + heightGap) + topMargin); } } public String toString() { return "(" + this.cellX + ", " + this.cellY + ")"; } public void setWidth(int width) { this.width = width; } public int getWidth() { return width; } public void setHeight(int height) { this.height = height; } public int getHeight() { return height; } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(int y) { this.y = y; } public int getY() { return y; } } // This class stores info for two purposes: // 1. When dragging items (mDragInfo in Workspace), we store the View, its cellX & cellY, // its spanX, spanY, and the screen it is on // 2. When long clicking on an empty cell in a CellLayout, we save information about the // cellX and cellY coordinates and which page was clicked. We then set this as a tag on // the CellLayout that was long clicked static final class CellInfo { View cell; int cellX = -1; int cellY = -1; int spanX; int spanY; long screenId; long container; @Override public String toString() { return "Cell[view=" + (cell == null ? "null" : cell.getClass()) + ", x=" + cellX + ", y=" + cellY + "]"; } } public boolean lastDownOnOccupiedCell() { return mLastDownOnOccupiedCell; } }
[ "penglin.zhao@RH-F0579-SH1SW.ragent.cn" ]
penglin.zhao@RH-F0579-SH1SW.ragent.cn
d616180890bdca1cfacaf0289eeb89f311744b1b
6f4c5c7eb3f6612b8eeea50897edc312a8b43679
/src/test/java/runners/TestRunner.java
6a154b653afad76ffc0ffba558da0f44f80084ec
[]
no_license
ishapaul/EggTimerTest
26197fa307118f357fdc5405358231dec982955d
976479110d9f30638a50c3516e78ad795b69a850
refs/heads/main
2023-07-04T13:48:49.627662
2021-08-02T13:22:04
2021-08-02T13:22:04
391,922,893
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package runners; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( features = "src/test/resources/functionalTests", glue= {"stepDefinitions"} ) public class TestRunner { }
[ "Isha.Paul@gds.ey.com" ]
Isha.Paul@gds.ey.com
cb48ccecf85de372ce0cd12f881e5f3c59cab986
685b53707038e9442d1cdb3f0e5b4e6c168bfaae
/MatchQueriesWithAOL.java
22cfd343220cb735935c84b6ace1cb0ad2cf5247
[]
no_license
rishabhmehrotra/ddcrp_subtasks
df7ddc0bf03680aeacd199736fd693f12a249f86
03e3816f497dffafb112f450f31a956ea28e9691
refs/heads/master
2021-01-10T05:09:45.532315
2016-01-07T04:45:30
2016-01-07T04:45:30
48,929,073
1
0
null
null
null
null
UTF-8
Java
false
false
9,859
java
import java.io.*; import java.util.*; public class MatchQueriesWithAOL { public static HashMap<String, Integer> isPresent; public static HashMap<String, Integer> taskNo; public static HashMap<String, Integer> dslr; public static HashMap<String, Integer> wedding; public static HashMap<String, Integer> games; public static HashMap<String, Integer> guitar; public static HashMap<String, Integer> download; public static HashMap<String, Integer> blog; public static HashMap<String, Integer> stream; public static void main(String[] args) throws Exception { isPresent = new HashMap<String, Integer>(); taskNo = new HashMap<String, Integer>(); dslr = new HashMap<String, Integer>(); wedding = new HashMap<String, Integer>(); games = new HashMap<String, Integer>(); guitar = new HashMap<String, Integer>(); download = new HashMap<String, Integer>(); blog = new HashMap<String, Integer>(); stream = new HashMap<String, Integer>(); getExtraAOLQueries(); System.exit(0); readQueries(); readAOL(); howManyCommon(); } public static void getExtraAOLQueries() throws IOException { String filename = "/Users/rishabhmehrotra/dev/workspace/TaskBasedUserModeling/src/data/AOL/AOL1.txt"; BufferedReader br; String line = ""; int start = 1; String prevUserID = ""; int c=0, count=10; while(count>0) { filename = "/Users/rishabhmehrotra/dev/workspace/TaskBasedUserModeling/src/data/AOL/AOL"+count+".txt"; br = new BufferedReader(new FileReader(filename)); line = br.readLine();line = br.readLine(); while(line!=null) { try{ c++; //if(c==100) break; String parts[] = line.split("\t"); String userID = ""; if(line.length()<1 || parts.length<1) {line = br.readLine();continue;} String qq = parts[1]; if(qq.contains("buy") && (qq.contains("dslr") || qq.contains("camera") || qq.contains("nikon") || qq.contains("canon"))) if(dslr.containsKey(qq)) {int tt = dslr.get(qq);tt++;dslr.put(qq,tt);}else dslr.put(qq, 0); if(qq.contains("wedding")) if(wedding.containsKey(qq)) {int tt = wedding.get(qq);tt++;wedding.put(qq,tt);}else wedding.put(qq, 0); if(qq.contains("play") && qq.contains("game")) if(games.containsKey(qq)) {int tt = games.get(qq);tt++;games.put(qq,tt);}else games.put(qq, 0); if(qq.contains("guitar") && qq.contains("learn")) if(guitar.containsKey(qq)) {int tt = guitar.get(qq);tt++;guitar.put(qq,tt);}else guitar.put(qq, 0); if(qq.contains("download") && (qq.contains("video") || qq.contains("movie") || qq.contains("song"))) if(download.containsKey(qq)) {int tt = download.get(qq);tt++;download.put(qq,tt);}else download.put(qq, 0); if((qq.contains("write") || qq.contains("start") || qq.contains("site")) && qq.contains("blog")) if(blog.containsKey(qq)) {int tt = blog.get(qq);tt++;blog.put(qq,tt);}else blog.put(qq, 0); if(qq.contains("stream") && (qq.contains("live") || qq.contains("match") || qq.contains("game"))) if(stream.containsKey(qq)) {int tt = stream.get(qq);tt++;stream.put(qq,tt);}else stream.put(qq, 0); } catch(Exception e){e.printStackTrace();} line = br.readLine(); } System.out.println("Done with "+count); count--; } FileWriter fstream0 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/extra/wedding.AOL.txt"); FileWriter fstream1 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/extra/dslr.AOL.txt"); FileWriter fstream2 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/extra/games.AOL.txt"); FileWriter fstream3 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/extra/guitar.AOL.txt"); FileWriter fstream4 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/extra/blog.AOL.txt"); FileWriter fstream5 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/extra/stream.AOL.txt"); FileWriter fstream6 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/extra/download.AOL.txt"); BufferedWriter out0 = new BufferedWriter(fstream0); BufferedWriter out1 = new BufferedWriter(fstream1); BufferedWriter out2 = new BufferedWriter(fstream2); BufferedWriter out3 = new BufferedWriter(fstream3); BufferedWriter out4 = new BufferedWriter(fstream4); BufferedWriter out5 = new BufferedWriter(fstream5); BufferedWriter out6 = new BufferedWriter(fstream6); Iterator<String> itr0 = wedding.keySet().iterator(); Iterator<String> itr1 = dslr.keySet().iterator(); Iterator<String> itr2 = games.keySet().iterator(); Iterator<String> itr3 = guitar.keySet().iterator(); Iterator<String> itr4 = blog.keySet().iterator(); Iterator<String> itr5 = stream.keySet().iterator(); Iterator<String> itr6 = download.keySet().iterator(); while(itr0.hasNext()) {String qq = itr0.next();int tt = wedding.get(qq);if(tt>10) out0.write(qq+"\t"+0+"\t0"+"\n");}out0.close(); while(itr1.hasNext()) {String qq = itr1.next();int tt = dslr.get(qq);if(tt>0) out1.write(qq+"\t"+0+"\t0"+"\n");}out1.close(); while(itr2.hasNext()) {String qq = itr2.next();int tt = games.get(qq);if(tt>10) out2.write(qq+"\t"+0+"\t0"+"\n");}out2.close(); while(itr3.hasNext()) {String qq = itr3.next();int tt = guitar.get(qq);if(tt>0) out3.write(qq+"\t"+0+"\t0"+"\n");}out3.close(); while(itr4.hasNext()) {String qq = itr4.next();int tt = blog.get(qq);if(tt>0) out4.write(qq+"\t"+0+"\t0"+"\n");}out4.close(); while(itr5.hasNext()) {String qq = itr5.next();int tt = stream.get(qq);if(tt>0) out5.write(qq+"\t"+0+"\t0"+"\n");}out5.close(); while(itr6.hasNext()) {String qq = itr6.next();int tt = download.get(qq);if(tt>10) out6.write(qq+"\t"+0+"\t0"+"\n");}out6.close(); } public static void howManyCommon() throws IOException { FileWriter fstream0 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/0.allQueries.freq.nUsers.AOL.txt"); FileWriter fstream1 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/1.allQueries.freq.nUsers.AOL.txt"); FileWriter fstream2 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/2.allQueries.freq.nUsers.AOL.txt"); FileWriter fstream3 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/3.allQueries.freq.nUsers.AOL.txt"); FileWriter fstream4 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/4.allQueries.freq.nUsers.AOL.txt"); FileWriter fstream5 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/5.allQueries.freq.nUsers.AOL.txt"); FileWriter fstream6 = new FileWriter("/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/6.allQueries.freq.nUsers.AOL.txt"); BufferedWriter out0 = new BufferedWriter(fstream0); BufferedWriter out1 = new BufferedWriter(fstream1); BufferedWriter out2 = new BufferedWriter(fstream2); BufferedWriter out3 = new BufferedWriter(fstream3); BufferedWriter out4 = new BufferedWriter(fstream4); BufferedWriter out5 = new BufferedWriter(fstream5); BufferedWriter out6 = new BufferedWriter(fstream6); Iterator<String> itr = isPresent.keySet().iterator(); int c1=0,c2=0; int t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0; while(itr.hasNext()) { c1++; String q = itr.next(); int r = isPresent.get(q); if(r==1) c2++; int t = taskNo.get(q); if(r==1) switch (t) { case 0: out0.write(q+"\t"+0+"\t"+0+"\n");t0++;break; case 1: out1.write(q+"\t"+0+"\t"+0+"\n");t1++;break; case 2: out2.write(q+"\t"+0+"\t"+0+"\n");t2++;break; case 3: out3.write(q+"\t"+0+"\t"+0+"\n");t3++;break; case 4: out4.write(q+"\t"+0+"\t"+0+"\n");t4++;break; case 5: out5.write(q+"\t"+0+"\t"+0+"\n");t5++;break; case 6: out6.write(q+"\t"+0+"\t"+0+"\n");t6++;break; } } System.out.println(c2+" "+c1); System.out.println(t0+" "+t1+" "+t2+" "+t3+" "+t4+" "+t5+" "+t6); out0.close();out1.close();out2.close();out3.close();out4.close();out5.close();out6.close(); } public static void readQueries() throws Exception { BufferedReader br; String line = ""; int c=0, count=6; while(count>=0) { String filename = "/Users/rishabhmehrotra/dev/UCL/projects/subtasks/data/"+count+".allQueries.freq.nUsers.txt"; br = new BufferedReader(new FileReader(filename)); line = br.readLine(); int tt=0; while(line!=null) { if(line.length()<5){line = br.readLine();continue;} String parts[] = line.split("\t"); String qq = parts[0]; if(!isPresent.containsKey(qq)) {isPresent.put(qq, new Integer(0));tt++;} if(!taskNo.containsKey(qq)) taskNo.put(qq, new Integer(count)); line = br.readLine(); } br.close(); count--; System.out.println("Done with "+count+"read: "+tt); System.out.println("Size of isPrssesent: "+isPresent.size()); } System.out.println("Done reading ALL QUERIES\nNo of queries read: "+isPresent.size()); //System.exit(0); } public static void readAOL() throws Exception { String filename = "/Users/rishabhmehrotra/dev/workspace/TaskBasedUserModeling/src/data/AOL/AOL1.txt"; BufferedReader br; String line = ""; int start = 1; String prevUserID = ""; int c=0, count=10; while(count>0) { filename = "/Users/rishabhmehrotra/dev/workspace/TaskBasedUserModeling/src/data/AOL/AOL"+count+".txt"; br = new BufferedReader(new FileReader(filename)); line = br.readLine();line = br.readLine(); while(line!=null) { try{ c++; //if(c==100) break; String parts[] = line.split("\t"); String userID = ""; if(line.length()<1 || parts.length<1) {line = br.readLine();continue;} String qq = parts[1]; if(isPresent.containsKey(qq)) { isPresent.put(qq, new Integer(1)); } } catch(Exception e){e.printStackTrace();} line = br.readLine(); } System.out.println("Done with "+count); count--; } } }
[ "erishabh@gmail.com" ]
erishabh@gmail.com
f1b04015f17225e35a8deb578bef9e675880153d
2d7a296960e2276c140ec487e704ca1806e156f6
/src/main/java/com/repository/mongo/TreeModelServicioRepository.java
4fed419ac9281e395ce8e00456ae89bda94368a5
[]
no_license
saymonset/surveybackend
4285d1a659352c728467c5f0e2dfdc6c15c67908
b9ec075ace815ed129cd79052726373c50d7f917
refs/heads/master
2020-05-22T17:03:10.868761
2019-06-13T18:40:53
2019-06-13T18:40:53
186,444,451
0
0
null
null
null
null
UTF-8
Java
false
false
556
java
package com.repository.mongo; import com.model.mongo.Company; import com.model.mongo.TreeModelServicio; import org.springframework.data.repository.CrudRepository; import java.util.List; /** * Created by simon on 5/22/2019. */ public interface TreeModelServicioRepository extends CrudRepository<TreeModelServicio, String> { List<TreeModelServicio> findByCompany(Company company); List<TreeModelServicio> findByParentNodeAndCompany(String parentNode, Company company); TreeModelServicio findByNodeAndCompany(String node, Company company); }
[ "saymon_set@hotmail.com" ]
saymon_set@hotmail.com
6e812851c21509720db31b97bb69a7ab6f2ee9df
f10baea697b3ff6ec29f651aac8aab6157195ae1
/src/main/java/com/yi/domain/Manager.java
c98fe829a95b023fe2b69ecd6381f9a8a56753cd
[]
no_license
jongho1227/cgv
8343c9d3b98551c9cdacaa27a2cbc9bc211218f9
7f69e0c5084bac0daae3074204c068fe7469fd62
refs/heads/master
2022-12-21T02:18:15.750213
2019-09-27T07:56:12
2019-09-27T07:56:12
210,098,545
0
0
null
2022-12-16T09:44:30
2019-09-22T06:01:32
Java
UTF-8
Java
false
false
612
java
package com.yi.domain; public class Manager { private String mgId; private String mgPass; public Manager() { } public Manager(String mgId, String mgPass) { super(); this.mgId = mgId; this.mgPass = mgPass; } public String getMgId() { return mgId; } public void setMgId(String mgId) { this.mgId = mgId; } public String getMgPass() { return mgPass; } public void setMgPass(String mgPass) { this.mgPass = mgPass; } @Override public String toString() { return "Manager [mgId=" + mgId + ", mgPass=" + mgPass + "]"; } }
[ "ejsvkvhdlsxm@naver.com" ]
ejsvkvhdlsxm@naver.com
302118d27ac3f02ff22afd21fa048c9933a83fbc
a1bd195bcd054083840675bf3edde1f6660717c2
/Logging/src/Debug.java
267b139920349e220906582cfa468645d0c9a3e4
[]
no_license
shawn93/Software-Development-Java-
67313e2aeb77a01d90c3b62c6a4f56c708b2f4fc
207a7f730a60dddc2c050eea48d5510b8e8282d7
refs/heads/master
2020-04-10T22:48:34.280972
2016-02-08T23:04:19
2016-02-08T23:04:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,299
java
/** * This class demonstrates a very debug class, used to motivate using a * logging package. */ public class Debug { /** Set this variable to {@code true} to turn on debug messages. */ public static boolean on = false; /** * If {@link #on} is {@code true}, this method will output debug messages * to the console. * * @param message to output when debugging */ public static void println(String message) { if (on) { System.out.println(message); } } /* * PROBLEMS: * Turning debugging on and off requires modification to source code, * and re-compilation of that code. Would be nicer if we could control * debug messages externally, via a flag or configuration file. * * This class is not configurable, so it is impossible to turn off debug * messages for just one class. If this class is widely used, turning on * debug messages could result in a lot of unnecessary output. We could * try to have a per-class debug flag, but then we run into other issues. * * We may also want some debug messages within a class to output, but not * all. For example, we may still want to see error messages. We could try * to add multiple levels of debug statements, but then our class starts * to get more and more complicated and computationally expensive. * * We may also want some debug messages to go to the console, and some to * go to a file to refer to later. For example, we may want most of the * debug messages to go to file, but want to know via the console when a * serious error occurs. Again, we can try to achieve this in this class, * but we have to worry about efficiency. * * Printing several messages to the console is not efficient, and will * noticeably slow down your code. Printing to a file, especially in a * multithreading context, can also be tricky! * * In some cases, more messages than the console can "remember" will be * added, causing the early debug messages to be lost. * * In multi-threading contexts, need the timestamp of when the message was * generated, not when it was output. It is possible that messages get * added to the console out-of-order! * * It just so happens there is something that addresses all of our * concerns, so we don't have to re-invent the wheel! */ }
[ "yixiao93217@gmail.com" ]
yixiao93217@gmail.com
c42c20e353fc3fb02dfbc465317bb9a5a3f4eba4
bd30f53508b0b9d5fa2d058ef178a54147446c93
/onlinebooking/src/main/java/projectmanager/model/Order.java
4665431db7e055a610e6562caf4f89d3e13fc8a3
[]
no_license
Muralitob/JSPWork
b5de81d7e0fc06bdf862a5e2369c47de8813004f
131064fe0a8c3d81e55f2b5c55cfb6068df48dfb
refs/heads/master
2021-05-05T21:18:19.520612
2017-12-31T14:26:29
2017-12-31T14:26:29
115,521,113
0
0
null
null
null
null
UTF-8
Java
false
false
2,392
java
package projectmanager.model; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * The persistent class for the orders database table. * */ @Entity @Table(name="orders") @NamedQuery(name="Order.findAll", query="SELECT o FROM Order o") public class Order extends projectmanager.model.BaseModel implements Serializable { private static final long serialVersionUID = 1L; @Temporal(TemporalType.TIMESTAMP) @Column(name="end_date") private Date endDate; private BigDecimal price; @Column(name="room_code") private String roomCode; @Column(name="room_guid") private String roomGuid; @Temporal(TemporalType.TIMESTAMP) @Column(name="start_date") private Date startDate; @Column(name="user_guid") private String userGuid; @Column(name="user_name") private String userName; public Order() { } public Date getEndDate() { return this.endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public BigDecimal getPrice() { return this.price; } public void setPrice(BigDecimal price) { this.price = price; } public String getRoomCode() { return this.roomCode; } public void setRoomCode(String roomCode) { this.roomCode = roomCode; } public String getRoomGuid() { return this.roomGuid; } public void setRoomGuid(String roomGuid) { this.roomGuid = roomGuid; } public Date getStartDate() { return this.startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public String getUserGuid() { return this.userGuid; } public void setUserGuid(String userGuid) { this.userGuid = userGuid; } public String getUserName() { return this.userName; } public void setUserName(String userName) { this.userName = userName; } public Order(Date endDate, BigDecimal price, String roomCode, String roomGuid, Date startDate, String userGuid, String userName) { super(); this.endDate = endDate; this.price = price; this.roomCode = roomCode; this.roomGuid = roomGuid; this.startDate = startDate; this.userGuid = userGuid; this.userName = userName; } }
[ "1768716821@qq.com" ]
1768716821@qq.com
1c1ea01ace7895c8cce19a211d751267c540a4a4
eee10dfbdc6cf16a11959bd2f21ca3c4e20ce205
/app/src/main/java/com/example/mathe/githubviewer/ListaAdapter.java
6dc65d5c5b1871e8a46c631eda1c749bac1a6fed
[]
no_license
gusmanmatheus/GitHubViewer
a9fe92bab4689e4fd0218c14289ece230f78aaa6
a1b8d2b7f3940b97704694c7834e6e45294a270e
refs/heads/master
2021-09-29T02:16:31.932690
2018-11-22T17:58:56
2018-11-22T17:58:56
158,733,389
1
0
null
null
null
null
UTF-8
Java
false
false
1,854
java
package com.example.mathe.githubviewer; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.example.mathe.githubviewer.model.RepositorioUsuario; import com.example.mathe.githubviewer.model.Repository; import java.util.List; public class ListaAdapter extends RecyclerView.Adapter <ListaAdapter.ViewHolderLista> { private List<Repository> dados; public ListaAdapter(List<Repository> dados){ this.dados=dados; } @NonNull @Override public ListaAdapter.ViewHolderLista onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { LayoutInflater layoutInflater =LayoutInflater.from(viewGroup.getContext()); View view =layoutInflater.inflate(R.layout.linha_lista,viewGroup,false); ViewHolderLista viewHolderLista = new ViewHolderLista(view); return viewHolderLista; } @Override public void onBindViewHolder(@NonNull ListaAdapter.ViewHolderLista viewHolder, int i) { if((dados!=null)&&(dados.size()>0)){ Repository repository = dados.get(i); viewHolder.nomeRepositorio.setText(repository.getName()); viewHolder.linguagemRepositorio.setText(repository.getLanguage()); } } @Override public int getItemCount() { return dados.size(); } public class ViewHolderLista extends RecyclerView.ViewHolder{ public TextView nomeRepositorio; public TextView linguagemRepositorio; public ViewHolderLista(View itemView){ super(itemView); nomeRepositorio= itemView.findViewById(R.id.txt_NomeProjeto_Id); linguagemRepositorio=itemView.findViewById(R.id.linguagemProjeto_Id); } } }
[ "matheusenrik@hotmai.com" ]
matheusenrik@hotmai.com
bc403e5f76945c3552f12e014e01bb1cf8e05ca5
7d4afef533670fd3a4e3d7c2f428624f8766baea
/src/pri/weiqiang/encryption/MediaCodecTest.java
c9fb459a3fdf7a1e0113940ca6b38a10623fbcd7
[]
no_license
weimingtom/MyJapanese
5a589aa54b15f286bbcab5e4dd77800d7cdc8bb3
578563cf77d8a54c0c1ca66da51888114f116607
refs/heads/master
2021-01-11T01:03:14.701833
2016-09-05T06:14:01
2016-09-05T06:14:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,388
java
package pri.weiqiang.encryption; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import android.media.MediaCodec; import android.media.MediaExtractor; import android.media.MediaFormat; import android.media.MediaCodec.BufferInfo; import android.util.Log; public class MediaCodecTest { byte[] decodeData = new byte[1024 * 1024 * 20];// 20m MediaCodec mMediaCodec; MediaExtractor mediaExtractor; MediaFormat mMediaFormat; final int TIMEOUT_US = 1000; BufferInfo info; boolean sawOutputEOS = false; boolean sawInputEOS = false; ByteBuffer[] codecInputBuffers; ByteBuffer[] codecOutputBuffers; /** * 解码音频文件,返回最后解码的数据 * * @param url * @return */ public byte[] decode(String url) { /*这个也太坑了,居然有url = ""*/ // url = ""; try {/*all requires API level 16 (current min is 11): android.media.MediaExtractor#setDataSource*/ Log.e("mediaExtractor", url); mediaExtractor.setDataSource(url); } catch (IOException e) { } mMediaFormat = mediaExtractor.getTrackFormat(0); String mime = mMediaFormat.getString(MediaFormat.KEY_MIME); try { mMediaCodec = MediaCodec.createDecoderByType(mime); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mMediaCodec.configure(mMediaFormat, null, null, 0); mMediaCodec.start(); codecInputBuffers = mMediaCodec.getInputBuffers(); codecOutputBuffers = mMediaCodec.getOutputBuffers(); info = new BufferInfo(); mediaExtractor.selectTrack(0); input(); output(); return decodeData; } private void output() { final int res = mMediaCodec.dequeueOutputBuffer(info, TIMEOUT_US); if (res >= 0) { int outputBufIndex = res; ByteBuffer buf = codecOutputBuffers[outputBufIndex]; final byte[] chunk = new byte[info.size]; buf.get(chunk); // Read the buffer all at once buf.clear(); // ** MUST DO!!! OTHERWISE THE NEXT TIME YOU GET THIS // SAME BUFFER BAD THINGS WILL HAPPEN if (chunk.length > 0) { System.arraycopy(chunk, 0, decodeData, 0, chunk.length); // mAudioTrack.write(chunk, 0, chunk.length); } mMediaCodec.releaseOutputBuffer(outputBufIndex, false /* render */); if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) { sawOutputEOS = true; } } else if (res == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) { codecOutputBuffers = mMediaCodec.getOutputBuffers(); } else if (res == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { final MediaFormat oformat = mMediaCodec.getOutputFormat(); // Log.d(LOG_TAG, "Output format has changed to " + oformat); // mAudioTrack.setPlaybackRate(oformat.getInteger(MediaFormat.KEY_SAMPLE_RATE)); } } private void input() { int inputBufIndex = mMediaCodec.dequeueInputBuffer(TIMEOUT_US); if (inputBufIndex >= 0) { ByteBuffer dstBuf = codecInputBuffers[inputBufIndex]; int sampleSize = mediaExtractor.readSampleData(dstBuf, 0); // Log.i(LOG_TAG, "sampleSize : "+sampleSize); long presentationTimeUs = 0; if (sampleSize < 0) { // .Log.i(LOG_TAG, "Saw input end of stream!"); sawInputEOS = true; sampleSize = 0; } else { presentationTimeUs = mediaExtractor.getSampleTime(); // Log.i(LOG_TAG, "presentationTimeUs "+presentationTimeUs); } mMediaCodec.queueInputBuffer(inputBufIndex, 0, // offset sampleSize, presentationTimeUs, sawInputEOS ? MediaCodec.BUFFER_FLAG_END_OF_STREAM : 0); if (!sawInputEOS) { // Log.i(LOG_TAG, "extractor.advance()"); mediaExtractor.advance(); } } } }
[ "weiqiang_1989@126.com" ]
weiqiang_1989@126.com
6c55df41258dee80fa3a04df81da526554724b79
66d9f0c75966ada87ede8d21cb1f1bad47b55c19
/src/main/java/org/datanucleus/ide/idea/integration/datanuculeus/EnhancerSupportDatanucleus.java
7029a32d63412bc2ecddeabc8a8270602b44fc92
[ "Apache-2.0" ]
permissive
rm3l/datanucleus-idea-plugin
c01e6930ba4a3cd07b45c18c5e149b91287c0277
58753e379b19371d894b328a0b30ea5927013b18
refs/heads/master
2021-01-17T22:11:13.278731
2016-04-11T18:17:59
2016-04-11T18:17:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,429
java
/******************************************************************************* * Copyright (c) 2010 Gerold Klinger and sourceheads Information Technology GmbH. * All rights reserved. * 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. * * Contributors: * ... ******************************************************************************/ package org.datanucleus.ide.idea.integration.datanuculeus; import org.datanucleus.ide.idea.PersistenceApi; import org.datanucleus.ide.idea.integration.AbstractEnhancerSupport; import org.datanucleus.ide.idea.integration.EnhancerSupportVersion; import org.jetbrains.annotations.NotNull; /** */ public class EnhancerSupportDatanucleus extends AbstractEnhancerSupport { private static final String ID = "DATANUCLEUS"; private static final String NAME = "DataNucleus"; @Override @NotNull public EnhancerSupportVersion getVersion() { return EnhancerSupportVersion.V1_1_X; } /** * The name to display in the configuration dialog enhancer support drop-down. * * @return Enhancer support name */ @NotNull public String getId() { return ID; } /** * The name to display in the configuration dialog enhancer support drop-down. * * @return Enhancer support name */ @NotNull public String getName() { return NAME; } @NotNull public String[] getEnhancerClassNames() { return new String[] {EnhancerProxyDataNucleus.NUCLEUS_ENHANCER_CLASS, EnhancerProxyDataNucleus.NUCLEUS_GENERIC_ENHANCER_CLASS}; } @NotNull public PersistenceApi[] getPersistenceApis() { return new PersistenceApi[] {PersistenceApi.JPA, PersistenceApi.JDO}; } @NotNull public Class<?> getEnhancerProxyClass() { return EnhancerProxyDataNucleus.class; } }
[ "andy@datanucleus.org" ]
andy@datanucleus.org
37a25acf83e419e78133fec6d8f2971eec91d3da
90aba55ba713dd7a09efea18abf323fac04767f0
/src/com/company/FootballPlayer.java
b3c1a713794013eca3c0bfa66b8931d9e1b67b16
[]
no_license
hudy98765/Football_Manager
0458f1ee49227785dbac3ec82dd83740f4e78062
368fa401e3abe9d640f3f70eb87d4d77f99e4ab0
refs/heads/master
2020-12-18T11:12:57.328221
2020-02-10T12:09:31
2020-02-10T12:09:31
235,358,023
0
0
null
null
null
null
UTF-8
Java
false
false
217
java
package com.company; public class FootballPlayer extends Player { public FootballPlayer(String name, int price) { super(name,price); } public FootballPlayer() { super(); } }
[ "noreply@github.com" ]
hudy98765.noreply@github.com
59a8a25c534e40b0cdf8f3e9c1b72330f2c31bc6
8e5104a35c0fcfb0e546fa6eebf092bc0d439858
/form/bmi/src/main/java/vn/techmaster/bmi/controller/BMIController3.java
5cbb5fc09a37d8cef5e6ecc167b5d19ac87c406e
[]
no_license
hoanghailethe/SpringBootBasic
9b20c73e9f7f0be6d688a3a130702419c0b7ba12
2922319c106ffb47ce31784ae222df9de5cf6e27
refs/heads/main
2023-05-02T01:48:08.725123
2021-05-20T06:08:26
2021-05-20T06:08:26
371,683,611
1
0
null
2021-05-28T11:49:08
2021-05-28T11:49:08
null
UTF-8
Java
false
false
1,411
java
package vn.techmaster.bmi.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import vn.techmaster.bmi.request.BMIRequest; import vn.techmaster.bmi.response.BMIResult; import vn.techmaster.bmi.service.HealthService; @Controller @RequestMapping("/bmi3") public class BMIController3 { @Autowired private HealthService healthService; @GetMapping public String getBMIForm(Model model) { model.addAttribute("bmiRequest", new BMIRequest()); return "bmi2"; } @PostMapping() public String handleBMIForm(@ModelAttribute BMIRequest request, BindingResult bindingResult, Model model) { if (! bindingResult.hasErrors()) { /* Chuyển cả logic tính BMI sang bean HealthService. Với cách này, chúng ta có thể phục vụ cả Web Form và cả REST API */ BMIResult bmiResult = healthService.calculateBMI(request); model.addAttribute("bmiRequest", request); model.addAttribute("bmiResult", bmiResult); } return "bmi2"; } }
[ "cuong@techmaster.vn" ]
cuong@techmaster.vn
a12465ae25e54a9e0fd295639d16043e7c1d9bcf
70bf3660a1b524fb941906d59b1a1a8261fc0f8c
/src/proyectograficaafd/ProyectoGraficaAFD.java
0e6a2175d967ae801e5589029c4355310a61f641
[]
no_license
lFerchol/ProyectoGraficaAFD
b230967b4d2eb87c69e47c778a449def316a19c1
75ba631266e126aeed5e4a02784f0a4b13408d84
refs/heads/master
2020-04-04T22:27:48.522665
2018-11-06T04:54:23
2018-11-06T04:54:23
156,324,702
0
0
null
null
null
null
UTF-8
Java
false
false
470
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 proyectograficaafd; /** * * @author Fercho */ public class ProyectoGraficaAFD { /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println("Hola"); //System.out.println("ok"); } }
[ "cadesluisxTo22@gmail.com" ]
cadesluisxTo22@gmail.com
f2fe298a35ee0f363bf230d4852e7e3dda2e8cd1
ca9d54a9205d8d954baf914f4bb2eb483a07d2d3
/app/src/main/java/com/android/kumaratul/myfirstproject/Benefits.java
0707f3f500483f7524d5337e8d52f38fc53e579d
[]
no_license
atul06112/HOPE
1cea598802df27871185042172a52daeb74406b5
1781f5b4f1776e2d03e387f62f2e5d5759fd1b30
refs/heads/master
2020-03-20T18:14:02.580836
2018-06-16T13:19:25
2018-06-16T13:19:25
137,568,199
0
0
null
null
null
null
UTF-8
Java
false
false
1,672
java
package com.android.kumaratul.myfirstproject; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class Benefits extends AppCompatActivity { TextView t1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_benefits); t1=(TextView)findViewById(R.id.textView6); String data="WHY HOPE:-"+"\n"+"1.It is online donation and receiver platform."+"\n" +"2.It fulfills the requirement of people who is cancer patient requires organ or blood."+"\n" +"3.It fulfills the requirement of people,who requires money for education,medical reliefs."+"\n" +"4.Donors feels happy and let the others to happy"+"\n"+"\n" +"WORKING WITH HOPE:-"+"\n" +"1.Different Self help groups,Social workers,Volunteers,NGO's can register themselves to help receivers."+"\n" +"2.This app allows the donors to go through various donation programs and help schemes where they Can contribute the Requirements of Receivers."+"\n" +"3.This App allows the receivers to fulfill their Requirements and utilities."+"\n" +"4.Donors are not those who have enough,But they are those who knows to give something out of something."+"\n" +"5.Receivers always thanks donors to contribute their essential credentials."+"\n" +"6.Any Illegal and Immoral things related to this app will be treated as dispute and Legal actions would be happen."; t1.setText(data); } }
[ "atul06112@gmail.com" ]
atul06112@gmail.com
f33e20081fb831571f00bd4680eba039e3438df0
4e12af05b124d85569dab15067e72215e4802f70
/guangdong/src/main/java/com/zpkj/exam/util/alipay/util/AlipayNotify.java
11e3cdc783cef882d8b57868e4330fd6a982e1bc
[]
no_license
wuqiwei2016/zly-test
5137a409722ea4b71a56a8d6ef5992bb95427558
b169641b52ab267e2fee6bb00727c45664e5ee75
refs/heads/master
2020-04-16T10:05:48.013776
2019-01-13T09:35:38
2019-01-13T09:35:38
165,490,344
0
0
null
null
null
null
UTF-8
Java
false
false
5,036
java
package com.zpkj.exam.util.alipay.util; import com.zpkj.exam.util.alipay.config.AlipayConfig; import com.zpkj.exam.util.alipay.sign.MD5; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.Map; /** * 类名:AlipayNotify 功能:支付宝通知处理类 详细:处理支付宝各接口通知返回 版本:3.3 日期:2012-08-17 说明: * 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。 * 该代码仅供学习和研究支付宝接口使用,只是提供一个参考 ************************* * 注意************************* 调试通知返回时,可查看或改写log日志的写入TXT里的数据,来检查通知返回是否正常 */ public class AlipayNotify { /** * 支付宝消息验证地址 */ private static final String HTTPS_VERIFY_URL = "https://mapi.alipay.com/gateway.do?service=notify_verify&"; /** * 验证消息是否是支付宝发出的合法消息 * * @param params * 通知返回来的参数数组 * @return 验证结果 */ public static boolean verify(Map<String, String> params) { // 判断responsetTxt是否为true,isSign是否为true // responsetTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关 // isSign不是true,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关 String responseTxt = "false"; if (params.get("notify_id") != null) { String notifyId = params.get("notify_id"); responseTxt = verifyResponse(notifyId); } String sign = ""; if (params.get("sign") != null) { sign = params.get("sign"); } boolean isSign = getSignVeryfy(params, sign); // 写日志记录(若要调试,请取消下面两行注释) // String sWord = "responseTxt=" + responseTxt + "\n isSign=" + isSign + // "\n 返回回来的参数:" + AlipayCore.createLinkString(params); // AlipayCore.logResult(sWord); if (isSign && responseTxt.equals("true")){ return true; } else { return false; } } /** * 根据反馈回来的信息,生成签名结果 * * @param params * 通知返回来的参数数组 * @param sign * 比对的签名结果 * @return 生成的签名结果 */ private static boolean getSignVeryfy(Map<String, String> params, String sign) { // 过滤空值、sign与sign_type参数 Map<String, String> sParaNew = AlipayCore.paraFilter(params); // 获取待签名字符串 String preSignStr = AlipayCore.createLinkString(sParaNew); // 获得签名验证结果 boolean isSign = false; if (AlipayConfig.signType.equals("MD5")) { isSign = MD5.verify(preSignStr, sign, AlipayConfig.key, AlipayConfig.inputCharset); } return isSign; } /** * 获取远程服务器ATN结果,验证返回URL * * @param notifyId * 通知校验ID * @return 服务器ATN结果 验证结果集: invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空 true * 返回正确信息 false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟 */ private static String verifyResponse(String notifyId) { // 获取远程服务器ATN结果,验证是否是支付宝服务器发来的请求 String partner = AlipayConfig.partner; String veryfyUrl = HTTPS_VERIFY_URL + "partner=" + partner + "&notify_id=" + notifyId; return checkUrl(veryfyUrl); } /** * 获取远程服务器ATN结果 * * @param urlvalue * 指定URL路径地址 * @return 服务器ATN结果 验证结果集: invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空 true * 返回正确信息 false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟 */ private static String checkUrl(String urlvalue) { String inputLine = ""; try { URL url = new URL(urlvalue); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); inputLine = in.readLine().toString(); } catch (Exception e) { e.printStackTrace(); inputLine = ""; } return inputLine; } }
[ "47045805@qq.com" ]
47045805@qq.com
4c621a63fe93ff41e46c52d5527a4ecebac47bcf
7d91c34d3f1e30a77afd3221d0ab595389fbe23e
/org/omg/PortableServer/RequestProcessingPolicyValue.java
3fd3170f85ef25702f87242b4f04b4ff30b37dc2
[]
no_license
JobTracker/java-source
a9a6b5c1030f8ee09831922fed8c8e808b75f2f5
15ffe2fc855c459f0397e7f633392177e91b4859
refs/heads/master
2016-09-05T08:59:02.510617
2014-08-25T05:51:05
2014-08-25T05:51:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,580
java
package org.omg.PortableServer; /** * org/omg/PortableServer/RequestProcessingPolicyValue.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/PortableServer/poa.idl * Thursday, May 14, 2009 3:38:54 AM PDT */ /** * The RequestProcessingPolicyValue can have the following * values. USE_ACTIVE_OBJECT_MAP_ONLY - If the Object Id * is not found in the Active Object Map, * an OBJECT_NOT_EXIST exception is returned to the * client. The RETAIN policy is also required. * USE_DEFAULT_SERVANT - If the Object Id is not found in * the Active Object Map or the NON_RETAIN policy is * present, and a default servant has been registered * with the POA using the set_servant operation, * the request is dispatched to the default servant. * USE_SERVANT_MANAGER - If the Object Id is not found * in the Active Object Map or the NON_RETAIN policy * is present, and a servant manager has been registered * with the POA using the set_servant_manager operation, * the servant manager is given the opportunity to * locate a servant or raise an exception. */ public class RequestProcessingPolicyValue implements org.omg.CORBA.portable.IDLEntity { private int __value; private static int __size = 3; private static org.omg.PortableServer.RequestProcessingPolicyValue[] __array = new org.omg.PortableServer.RequestProcessingPolicyValue [__size]; public static final int _USE_ACTIVE_OBJECT_MAP_ONLY = 0; public static final org.omg.PortableServer.RequestProcessingPolicyValue USE_ACTIVE_OBJECT_MAP_ONLY = new org.omg.PortableServer.RequestProcessingPolicyValue(_USE_ACTIVE_OBJECT_MAP_ONLY); public static final int _USE_DEFAULT_SERVANT = 1; public static final org.omg.PortableServer.RequestProcessingPolicyValue USE_DEFAULT_SERVANT = new org.omg.PortableServer.RequestProcessingPolicyValue(_USE_DEFAULT_SERVANT); public static final int _USE_SERVANT_MANAGER = 2; public static final org.omg.PortableServer.RequestProcessingPolicyValue USE_SERVANT_MANAGER = new org.omg.PortableServer.RequestProcessingPolicyValue(_USE_SERVANT_MANAGER); public int value () { return __value; } public static org.omg.PortableServer.RequestProcessingPolicyValue from_int (int value) { if (value >= 0 && value < __size) return __array[value]; else throw new org.omg.CORBA.BAD_PARAM (); } protected RequestProcessingPolicyValue (int value) { __value = value; __array[__value] = this; } } // class RequestProcessingPolicyValue
[ "1092862062@qq.com" ]
1092862062@qq.com
7080f5bf0a655ff705d80ea86f0b160eae77f513
ae21380f8dd799f01aaf2969e37106a85550e44c
/src/main/java/zhongfucheng/service/impl/BaseServiceImpl.java
c850dbec01edd45ee562b9bcf9714f2817bec2be
[]
no_license
sherryhhh/master
a8c1017137cff74e1a499acd2019f9dd2db4fe72
bb5f885e09970a0ee66430448b1f2ab97fff22dc
refs/heads/master
2022-12-21T00:17:28.928363
2019-09-26T09:08:28
2019-09-26T09:08:28
211,039,659
0
0
null
2022-12-16T01:52:20
2019-09-26T08:31:25
JavaScript
UTF-8
Java
false
false
2,475
java
package zhongfucheng.service.impl; import org.springframework.beans.factory.annotation.Autowired; import zhongfucheng.dao.BaseMapper; import zhongfucheng.dao.CommentMapper; import zhongfucheng.dao.MemoMapper; import zhongfucheng.dao.UserMapper; import zhongfucheng.service.BaseService; import javax.annotation.PostConstruct; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; /** * 使用initBaseMapper()将baseMapper实例化,service实现类是什么类型,baseMapper就是什么类型 * 将所有的Mapper都定义出来,那么子类service就可以直接使用了 * Created by ozc on 2017/12/8. * * @author ozc * @version 1.0 */ public class BaseServiceImpl<T> implements BaseService<T> { protected BaseMapper<T> baseMapper; @Autowired protected UserMapper userMapper; @Autowired protected CommentMapper commentMapper; @Autowired protected MemoMapper memoMapper; /** * 初始化baseMapper,哪种类型的service实现调用该方法,baseMapper就是那种类型 * * @throws Exception */ @PostConstruct private void initBaseMapper() throws Exception { //获取泛型的信息 ParameterizedType type = (ParameterizedType) this.getClass().getGenericSuperclass(); Class clazz = (Class) type.getActualTypeArguments()[0]; //拼接成“泛型”Mapper字符串 String localField = clazz.getSimpleName().substring(0, 1).toLowerCase() + clazz.getSimpleName().substring(1) + "Mapper"; //通过反射来获取成员变量的值 Field field = this.getClass().getSuperclass().getDeclaredField(localField); Field baseField = this.getClass().getSuperclass().getDeclaredField("baseMapper"); //将baseDao来进行实例化 baseField.set(this, field.get(this)); } public int insert(T entity) { return baseMapper.insert(entity); } public int insertSelective(T entity) { return baseMapper.insertSelective(entity); } public int deleteByPrimaryKey(String id) { return baseMapper.deleteByPrimaryKey(id); } public T selectByPrimaryKey(String id) { return baseMapper.selectByPrimaryKey(id); } public int updateByPrimaryKeySelective(T entity) { return baseMapper.updateByPrimaryKeySelective(entity); } public int updateByPrimaryKey(T entity) { return baseMapper.updateByPrimaryKey(entity); } }
[ "zj@zjdeMacBook-Air.lan" ]
zj@zjdeMacBook-Air.lan
faab15bb5b366f8b55ec60f3f14d475ce788436d
dd8f128775d4a0a8c655ee535d46779037f10e94
/East2WestToursAndTravels-ejb/src/java/com/cusc/sessionbean/FeedbacksFacadeLocal.java
6f9585f5ca109abbb35e5cb06121a2d89d24d773
[]
no_license
phtama18097/project_semester4
2b6605a936250285677817dab99913018cf59c1c
acb778a6b2831d2059e4d3587f9674a5c801d6fb
refs/heads/master
2023-06-24T13:53:30.945473
2021-08-02T14:37:52
2021-08-02T14:37:52
380,505,766
0
0
null
null
null
null
UTF-8
Java
false
false
624
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 com.cusc.sessionbean; import com.cusc.entities.Feedbacks; import java.util.List; import javax.ejb.Local; /** * * @author Admin */ @Local public interface FeedbacksFacadeLocal { void create(Feedbacks feedbacks); void edit(Feedbacks feedbacks); void remove(Feedbacks feedbacks); Feedbacks find(Object id); List<Feedbacks> findAll(); List<Feedbacks> findRange(int[] range); int count(); }
[ "Admin@DESKTOP-M21QKUC" ]
Admin@DESKTOP-M21QKUC
c930f8f918498883937842c45015a7070608e8da
feabbb0672c26a2268a3e51f6220ab871232014e
/src/main/java/org/matsim/networkEditor/App.java
89eed3da9309e941c2f468d5724e23389017bff4
[]
no_license
MJ0815/matsim-network-editor
23839dcbec3910c4e34e22b3a50caf6ca1263ce2
c95ae8142409e0594aa7ec42414644bf0522549d
refs/heads/master
2023-07-20T08:20:41.515486
2021-08-30T13:09:25
2021-08-30T13:09:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,019
java
package org.matsim.networkEditor; import com.sothawo.mapjfx.Projection; import org.matsim.networkEditor.controllers.MainController; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Demo application for the mapjfx component. * * @author P.J. Meisch (pj.meisch@sothawo.com). */ public class App extends Application { /** Logger for the class */ private static final Logger logger = LoggerFactory.getLogger(App.class); public static void main(String[] args) { logger.trace("begin main"); launch(args); logger.trace("end main"); } /** * Main function displaying the page of the application and linking the controllers to the visuals * @param primaryStage The main application window * @throws Exception */ @Override public void start(Stage primaryStage) throws Exception { logger.info("Starting Matsim Network Editor"); String fxmlFile = "/fxml/Main.fxml"; logger.debug("loading fxml file {}", fxmlFile); FXMLLoader fxmlLoader = new FXMLLoader(); Parent rootNode = fxmlLoader.load(getClass().getResourceAsStream(fxmlFile)); logger.trace("stage loaded"); final MainController controller = fxmlLoader.getController(); final Projection projection = getParameters().getUnnamed().contains("wgs84") ? Projection.WGS_84 : Projection.WEB_MERCATOR; controller.initMapAndControls(projection); Scene scene = new Scene(rootNode); logger.trace("scene created"); scene.getStylesheets().add("https://fonts.googleapis.com/css2?family=Open+Sans"); primaryStage.setTitle("MATSim Network Editor"); primaryStage.setScene(scene); logger.trace("showing scene"); primaryStage.show(); logger.debug("application start method finished."); } }
[ "intz.katerina@gmail.com" ]
intz.katerina@gmail.com
7282f6727bf7cb5dd17359126defcd341c585636
5b5405ca9b403adb9adc892e09d6a8e3af810e02
/Flowers/src/com/korabliova/study/home_tasks/Bouquet.java
e0dfbba23dddcfd079b777ec9701e9e0cb89e41b
[]
no_license
OlyaKorabliova/cs16korabliova-flowers-sweets
bc1a5b8f08efa5c121e0d36b06516805eda1086c
c262df77d6a66469a5ac166da4875ade23fe9fec
refs/heads/master
2021-01-10T22:15:37.043533
2017-01-08T20:12:50
2017-01-08T20:12:50
70,330,342
0
0
null
null
null
null
UTF-8
Java
false
false
2,055
java
package com.korabliova.study.home_tasks; import java.util.Arrays; /** * Created by Olia on 03.10.2016. */ public class Bouquet { // class of our bouquet private Flower[] flwrs = new Flower[0]; //an array of flowers private double sum = 0; public void addFlower(Flower... flower){ //adds a new flower to our bouquet Flower[] newFlwrs; newFlwrs = Arrays.copyOf(flwrs, flwrs.length + flower.length); int j = flwrs.length; for (int i = 0; i < flower.length; i++) { newFlwrs[j] = flower[i]; j++; } flwrs = newFlwrs; } public double countPrice(){ //counts price of our bouquet for (int i = 0; i < flwrs.length; i++){ sum += flwrs[i].getPrice(); } return sum; } public FlowerType findFlowerByStemSize(double range1, double range2){ //finds a flower by its freshness for (int i = 0; i < flwrs.length; i++){ if (range1 <= flwrs[i].getStemSize() && flwrs[i].getStemSize() <= range2){ return flwrs[i].getType(); } } return FlowerType.NO_TYPE; } public String search(FlowerSpec spec) { // search for specified flowers in our bouquet int count = 0; for (int i = 0; i < flwrs.length; i++) { if (flwrs[i].getSpec().matches(spec)) { count++; } } Flower[] result = new Flower[count]; int j = 0; for (int i = 0; i < flwrs.length; i++) { if (flwrs[i].getSpec().matches(spec)) { result[j] = flwrs[i]; j++; } } return Arrays.toString(result); } public String sortFlowers(){ //sorts flowers in bouquet by freshness Arrays.sort(flwrs, (a, b) -> Integer.compare(a.getFreshness(), b.getFreshness())); return Arrays.toString(flwrs); } public String toString(){ return Arrays.toString(flwrs); } }
[ "korablyova@ucu.edu.ua" ]
korablyova@ucu.edu.ua
0d52b43cdb861812d61e75491bcea6ee49dc9a1c
ffe050f122bc537fd6d24cf623c571f50fab8ee0
/hr-oauth/src/main/java/br/com/saves/hroauth/feingclients/UserFeingClient.java
ef8460537f82e9495d4891c37e52c37ba1de370a
[]
no_license
christian-costa/ms-course
5a736943ef68caeb5d53cd3eb2912700ff28378e
540e2579dfb6a9f5aae8bc04cbbaabe04debbade
refs/heads/main
2023-02-26T00:09:30.809878
2021-01-31T18:21:51
2021-01-31T18:21:51
334,227,351
0
0
null
null
null
null
UTF-8
Java
false
false
560
java
package br.com.saves.hroauth.feingclients; import br.com.saves.hroauth.entities.User; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @Component @FeignClient(name = "hr-user", path = "/users") public interface UserFeingClient { @GetMapping(value = "/search") ResponseEntity<User> findByEmail(@RequestParam String email); }
[ "christian_costa@terceiros.sicredi.com.br" ]
christian_costa@terceiros.sicredi.com.br
e5d63cc92c65af32a1c355bcb3246014b3a601f1
8b7da95bc9059853c82bf3af2568538289f045cf
/jdemo-jdk/src/main/java/com/tunyl/kafang/dergamma.java
13d8348a030ece6a242edcb156e918ad3d2909f6
[]
no_license
tonyonlian/jdemo
a5694c8a7391ec35d80d1429e01179150825aef6
f3d5ed1d18be2a49da93459991151c5bc91e353c
refs/heads/master
2022-12-27T05:02:28.565289
2020-03-17T00:36:35
2020-03-17T00:36:35
198,927,565
0
0
null
2022-12-16T04:35:36
2019-07-26T01:52:37
Java
UTF-8
Java
false
false
762
java
package com.tunyl.kafang; import org.apache.commons.math3.distribution.BinomialDistribution; /** * @author create by Tunyl on 2019/11/26 * @version 1.0 */ public class dergamma { //采样1000次 public static void main(String[] args) { // for (int i = 0; i < 1000; i++) { // System.out.println(binomialsampler(100,0.9)); // } BinomialDistribution binomial=new BinomialDistribution(100,0.1869); System.out.println(binomial.cumulativeProbability(11220)); } //二项分布采样 public static double binomialsampler(int trials, double p){ BinomialDistribution binomial=new BinomialDistribution(trials,p); binomial.getNumericalVariance(); return binomial.sample(); } }
[ "540340102@qq.com" ]
540340102@qq.com
eac50fc0bd4c7c2827ecbd85dfc9038983fcaed7
d5b8337dc43d2e407c1544b3cdccec3a37d5f0fe
/src/main/java/com/moodle/sevsu/webdb/entity/Developer.java
d8a788be246aea9288242f2d673244cf1ff053d1
[]
no_license
ObjectAli/WebDatabase
2cc0a919e8bce08ba470f07de52b56170eeae502
3e3b13151f15e8cfa7578aa95f2ff312c86bb335
refs/heads/master
2022-09-19T18:32:40.718016
2019-07-31T16:37:44
2019-07-31T16:37:44
172,958,147
0
0
null
null
null
null
UTF-8
Java
false
false
951
java
package com.moodle.sevsu.webdb.entity; import org.springframework.beans.factory.annotation.Autowired; import javax.persistence.*; @Entity @Table(name = "developer") public class Developer { @Id @GeneratedValue @Autowired @Column(name = "id", unique = true, updatable = false) private int id; @ManyToOne @JoinColumn private Course course; @ManyToOne @JoinColumn private User user; public int getId() { return id; } public void setId(int id) { this.id = id; } public Course getCourse() { return course; } public void setCourse(Course course) { this.course = course; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Developer(){} public Developer(Course course, User user) { this.course = course; this.user = user; } }
[ "alinorbobaev97@mail.ru" ]
alinorbobaev97@mail.ru
39f30d1285073f0115dbf7b807e24d009a3da9e8
c4bcb20a14330dbf59b54e8f7b714dba4fdd08b5
/run/helloworld/src/main/java/com/example/helloworld/HelloworldApplication.java
95902709e1c6328d42c4d3b6aac7b446c87e0602
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jskeet/java-docs-samples
e021d402ea2f66fc2284f2aff73dcbbe882aba61
2d1e2b0a94629e54b866a5dd05bc416383ebb6a1
refs/heads/master
2022-11-24T09:49:08.749021
2020-07-28T22:31:38
2020-07-28T22:31:38
283,470,279
1
0
Apache-2.0
2020-07-29T10:36:04
2020-07-29T10:36:03
null
UTF-8
Java
false
false
1,278
java
/* * Copyright 2020 Google 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.example.helloworld; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication public class HelloworldApplication { @Value("${NAME:World}") String name; @RestController class HelloworldController { @GetMapping("/") String hello() { return "Hello " + name + "!"; } } public static void main(String[] args) { SpringApplication.run(HelloworldApplication.class, args); } }
[ "noreply@github.com" ]
jskeet.noreply@github.com
38afc42e2cbb07384943f384878861a6edefa44c
e8af07583f747d59a61ecb152a3807dc492d2826
/app/src/test/java/pro/grino/tests/forDefa/ExampleUnitTest.java
63dfd554e208edfa2fc17f9dc7d6900ce57c2d59
[]
no_license
frommiass/For-Defa
a208f97ce51e4dc8adc8eb3e00ae9de97ada6a7d
c084041b2477ac86674e9eddf8aa3a400c142677
refs/heads/master
2020-12-23T21:55:40.402019
2016-07-30T09:21:21
2016-07-30T09:21:21
64,536,510
0
0
null
null
null
null
UTF-8
Java
false
false
316
java
package pro.grino.tests.forDefa; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "frommiass@yandex.ru" ]
frommiass@yandex.ru
aff9631186828e6f82b7b16be3cbc00f2681cb13
b4e306eaa86db3aa11132433ee6ad7fa6464db7b
/project-test/src/main/java/bitcamp/java106/pms/controller/teammember/TeamMemberAddController.java
5b6e5bc9b393e2d8298a5e0df1d2e66beefbbbb9
[]
no_license
donhee/test
b00279dde77ff5e7482e7a018efe91ff54d4f677
897f301a557325932afc0e4cd19e33f103d74dae
refs/heads/master
2021-07-01T00:13:06.085468
2020-09-10T13:26:18
2020-09-10T13:26:18
154,077,010
0
0
null
null
null
null
UTF-8
Java
false
false
2,585
java
// Controller 규칙에 따라 메서드 작성 package bitcamp.java106.pms.controller.teammember; import java.io.PrintWriter; import bitcamp.java106.pms.annotation.Component; import bitcamp.java106.pms.controller.Controller; import bitcamp.java106.pms.dao.MemberDao; import bitcamp.java106.pms.dao.TeamDao; import bitcamp.java106.pms.dao.TeamMemberDao; import bitcamp.java106.pms.domain.Member; import bitcamp.java106.pms.domain.Team; import bitcamp.java106.pms.server.ServerRequest; import bitcamp.java106.pms.server.ServerResponse; @Component("/team/member/add") public class TeamMemberAddController implements Controller { TeamDao teamDao; MemberDao memberDao; TeamMemberDao teamMemberDao; public TeamMemberAddController(TeamDao teamDao, MemberDao memberDao, TeamMemberDao teamMemberDao) { this.teamDao = teamDao; this.memberDao = memberDao; this.teamMemberDao = teamMemberDao; } @Override public void service(ServerRequest request, ServerResponse response) { PrintWriter out = response.getWriter(); String teamName = request.getParameter("teamName"); Team team = teamDao.get(teamName); if (team == null) { out.printf("%s 팀은 존재하지 않습니다.\n", teamName); return; } String memberId = request.getParameter("memberId"); Member member = memberDao.get(memberId); if (member == null) { out.printf("%s 회원은 없습니다.\n", memberId); return; } if (teamMemberDao.isExist(teamName, memberId)) { out.println("이미 등록된 회원입니다."); return; } teamMemberDao.addMember(teamName, memberId); out.println("팀에 회원을 추가하였습니다."); } } //ver 28 - 네트워크 버전으로 변경 //ver 26 - TeamMemberController에서 add() 메서드를 추출하여 클래스로 정의. //ver 23 - @Component 애노테이션을 붙인다. //ver 18 - ArrayList가 적용된 TeamMemberDao를 사용한다. //ver 17 - TeamMemberDao 클래스를 사용하여 팀 멤버의 아이디를 관리한다. //ver 16 - 인스턴스 변수를 직접 사용하는 대신 겟터, 셋터 사용. // ver 15 - 팀 멤버를 등록, 조회, 삭제할 수 있는 기능 추가. // ver 14 - TeamDao를 사용하여 팀 데이터를 관리한다. // ver 13 - 시작일, 종료일을 문자열로 입력 받아 Date 객체로 변환하여 저장.
[ "231313do@gmail.com" ]
231313do@gmail.com
deb965935a315c1e2fa39c51aa1b61fab5ab76a1
a984401b729648712b481ecaf872eca2b5539736
/app/src/main/java/com/ahmedbashir/capstonemanagementapp/NotificationsAdapter.java
2c5f7b51190c0d7934b5b69847c7aded814b6250
[]
no_license
ahmad-bashir/CapstoneManagementApp
7403ba59a65eb9f579eebfa23f36c7becba039fd
27218b65b7bb12435fba8af6133f50397f1b7998
refs/heads/master
2021-04-29T00:24:22.441473
2018-02-17T07:46:20
2018-02-17T07:46:20
121,827,917
0
0
null
null
null
null
UTF-8
Java
false
false
1,552
java
package com.ahmedbashir.capstonemanagementapp; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; /** * Created by Ahmed on 2/17/2018. */ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdapter.NotificationsViewHolder>{ private String[] data; public NotificationsAdapter(String[] data){ this.data = data; } @Override public NotificationsViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); View view = inflater.inflate(R.layout.notifications_list,parent,false); return new NotificationsAdapter.NotificationsViewHolder(view); } @Override public void onBindViewHolder(NotificationsViewHolder holder, int position) { String notificationText = data[position]; holder.setNotificationText(notificationText); } @Override public int getItemCount() { return data.length; } public class NotificationsViewHolder extends RecyclerView.ViewHolder{ public TextView notificationText; public NotificationsViewHolder(View itemView) { super(itemView); notificationText = itemView.findViewById(R.id.notification_text_view); } public void setNotificationText(String text){ notificationText.setText(text); } } }
[ "14137043@gift.edu.pk" ]
14137043@gift.edu.pk
453ee1367f19155cd3fa072bcb42077b5a62e1f0
59201349e159fdd142072605ac100a283c79b1d6
/app/src/main/java/com/luocj/jetpacktest/model/Person.java
6d2fe5c76a80968a66b15404d73dee4549cc699e
[]
no_license
rcj60560/JetPackTest
19f912500082c8c68edd5d051ebb216e641eec58
6eec149d84de63e032fe0361875bd7c68dc9b083
refs/heads/master
2021-11-20T19:39:20.597269
2021-09-03T12:18:11
2021-09-03T12:18:11
242,301,376
0
0
null
null
null
null
UTF-8
Java
false
false
804
java
package com.luocj.jetpacktest.model; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.PrimaryKey; @Entity public class Person { @PrimaryKey(autoGenerate = true) private int id; @ColumnInfo(name = "name") private String name; @ColumnInfo(name = "age") private String age; public Person(String name, String age) { this.name = name; this.age = age; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } }
[ "让63560560" ]
让63560560
972ccbcb5fcdae46bb7304b8c4cdf6869d9b80da
4b1d526d75dd4edfaf9901da5e34d6de8e310a08
/app/src/main/java/gov/anzong/androidnga/activity/HaFlexibleTopicListActivity.java
c1aa1773f4f3cff0d12fc8602e4c48b1ca92063a
[]
no_license
xfdingustc/MaterialNgaClient
99f5f986e9c6ce808575823fc0b89667d5609ff0
a9c084238b812c5f394308c7026bef51ff9d49f3
refs/heads/master
2020-12-30T18:02:23.843987
2017-06-06T03:01:46
2017-06-06T03:01:46
90,941,641
0
0
null
null
null
null
UTF-8
Java
false
false
180
java
package gov.anzong.androidnga.activity; import io.xfdingustc.mdngaclient.ui.activities.TopicListActivity; public class HaFlexibleTopicListActivity extends TopicListActivity { }
[ "ding.xiaofei@whaley.cn" ]
ding.xiaofei@whaley.cn
48f30c983e96f55994b95905c0bf8ee97a87e18a
78141d23e9af92617f437666b4f8fdb3741f55c5
/src/main/java/com/java/zoo/ZooApplication.java
d9780ad0deb270afef08a2aed2d3dbe1f7c651a8
[]
no_license
Gana253/zoo
400dc55647b001abe2c67c58ea65d4d1b8b137d0
4319e2c18e358fbf5f14205cb2ec6d92ebcf11a5
refs/heads/master
2022-11-17T17:42:07.451529
2020-07-16T08:53:18
2020-07-16T08:53:18
278,689,414
0
0
null
null
null
null
UTF-8
Java
false
false
1,046
java
package com.java.zoo; import com.java.zoo.service.CommandLineService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import java.io.IOException; @SpringBootApplication public class ZooApplication implements CommandLineRunner { @Autowired private CommandLineService commandLineService; @Value("${load.default-data}") private boolean loadData; public static void main(String[] args) { SpringApplication.run(ZooApplication.class, args); } public void run(String... params) throws IOException { commandLineService.loadUsers(); if (loadData) { //Load default data for room and animal. This flag will be false by default commandLineService.saveRoomData(); commandLineService.saveAnimalData(); } } }
[ "ganapathy@Ganapathys-MacBook-Pro.local" ]
ganapathy@Ganapathys-MacBook-Pro.local
80a852a3e26774f3084e7a42e20ed276ae97dc77
a4a57ba6fc716441717110b9bf55f0c871fe8d97
/Domain/src/main/java/cm/supinfo/formagreen/domain/Green_areaEntity.java
536f2a3990c6fdc2f7f8266ef169f30a4e62a278
[]
no_license
donui/FormaGreen
fa14eaebb750763d56aed220e573883c9f87dac9
550604d28cf46bdda9b5af8081c80cf7ad810cb4
refs/heads/master
2023-04-16T12:14:05.950900
2021-04-28T08:48:32
2021-04-28T08:48:32
284,449,928
0
0
null
2021-04-28T08:48:33
2020-08-02T11:41:04
Java
UTF-8
Java
false
false
2,824
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 cm.supinfo.formagreen.domain; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import lombok.Getter; import lombok.Setter; import org.apache.commons.lang.Validate; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.domain.Persistable; /** * * @author ryank */ @Entity(name = "Green_areaEntity") @Table(name = "green_area") @Getter @Setter public class Green_areaEntity implements Serializable, Persistable<Long> { @Id @Column(nullable = false, name = "id") @GeneratedValue(generator = "ALERT_SEQ_GEN") @GenericGenerator( name = "ALERT_SEQ_GEN", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = { @Parameter(name = "sequence_name", value = "ALERT_SEQ_GEN"), @Parameter(name = "initial_value", value = "1"), @Parameter(name = "increment_size", value = "1") } ) private Long Id; @Column(name = "location", nullable = false, unique = false) private String location; @Column(name = "name", nullable = false, unique = false) private String name; @Column(name = "matricule", nullable = false, unique = false) private String matricule; @Column(name = "creation_date", nullable = false, updatable = false) @CreatedDate @Temporal(TemporalType.TIMESTAMP) private Date creationDate; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "membersId", nullable = false) private MembersEntity membersId; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "green_area_typeId", nullable = false) private Green_area_typeEntity green_area_typeId; @Override public Long getId() { return Id; } @Override public boolean isNew() { return Id == null; } @PrePersist @PreUpdate protected void prePersistAndPreUpdate() { Validate.notNull(creationDate, "createDate must not be null"); Validate.isTrue(creationDate.getTime() < System.currentTimeMillis(), "creationDate cannot be in the past"); } }
[ "karl.meudje@sinequanone-conseil.fr" ]
karl.meudje@sinequanone-conseil.fr
155dbef0886e05fc9e78f406bc767d1ba80888d9
4a5edd9ccf46023309060d4ca7745cea1975ebdf
/src/gen/com/verilogplugin/lang/core/psi/impl/VerilogAssert_Impl.java
8a49f552e0af6d3b6658983c557451c7cbbc07fd
[]
no_license
max6cn/verilogplugin
eb20e28356a886d14c4ed928bc785c8189f91345
70d3e26a35317f4f0d5b7b51a2c5dda160995c6b
refs/heads/master
2021-01-10T19:16:42.346056
2020-10-22T00:30:15
2020-10-22T00:30:15
18,118,466
12
6
null
null
null
null
UTF-8
Java
false
true
1,034
java
// This is a generated file. Not intended for manual editing. package com.verilogplugin.lang.core.psi.impl; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; import static com.verilogplugin.lang.core.psi.VerilogTokenTypes.*; import com.intellij.extapi.psi.ASTWrapperPsiElement; import com.verilogplugin.lang.core.psi.*; public class VerilogAssert_Impl extends ASTWrapperPsiElement implements VerilogAssert_ { public VerilogAssert_Impl(@NotNull ASTNode node) { super(node); } public void accept(@NotNull VerilogVisitor visitor) { visitor.visitAssert_(this); } public void accept(@NotNull PsiElementVisitor visitor) { if (visitor instanceof VerilogVisitor) accept((VerilogVisitor)visitor); else super.accept(visitor); } @Override @NotNull public VerilogExpr getExpr() { return findNotNullChildByClass(VerilogExpr.class); } }
[ "max6cn@users.noreply.github.com" ]
max6cn@users.noreply.github.com
461501eedaee81936833330c4211613ddb48dd71
92039134078dd9db6772653ad1310a6f047ad54a
/FileManipulation/src/com/ui/FileManipulationApp.java
4dbae2f0b4c4a78ed8a475827835b5a33870c9c4
[]
no_license
maxpayneatlarge/FileManipulation
1eff984898b14a8ca3f53eb218b7be191c144ba2
51c4959b81f99310f407a3998b8a63f4c329e519
refs/heads/master
2021-01-22T05:16:36.005638
2015-08-06T18:04:18
2015-08-06T18:04:18
39,838,321
0
0
null
null
null
null
UTF-8
Java
false
false
1,686
java
package com.ui; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; import com.conf.FileManipulationProperties; import com.core.FileOperator; public class FileManipulationApp { public static void main(String[] args) { FileManipulationProperties fmp = new FileManipulationProperties(); File newFile = new File(fmp.getProp().getProperty("filelocation")); FileOperator fo = new FileOperator(newFile); BufferedReader textReader = null; try { FileReader reader = new FileReader(newFile); textReader = new BufferedReader(reader); int numberOfLines = fo.countLines(); String[] textData = new String[numberOfLines]; for (int i = 0; i < numberOfLines; i++) { textData[i] = textReader.readLine(); System.out.println(textData[i]); if (i == 0) { StringTokenizer tokens = new StringTokenizer(textData[i]); while (tokens.hasMoreTokens()) { System.out.println(tokens.nextToken()); } } } } catch (Exception x) { System.out.println(x.getMessage()); } finally { if (textReader != null) try { textReader.close(); } catch (IOException e) { System.out.println("Error closing textReader"); e.printStackTrace(); } } } }
[ "chris.goad@ttiinc.com" ]
chris.goad@ttiinc.com
a90e3cf5c2849882c15856081550803bf8ce0a7f
355e9ab5612f5989799a4a528169a662bb00f61f
/Java/getShorty/GetShorty.java
642ba320a3962308d6754afb4a6452d6c1eb6e4b
[ "MIT" ]
permissive
rvrheenen/OpenKattis
97d824cb553d0168fe12d7389095ccf3da8b7221
53e3dd06b1c495ad3d708b9f8b20e4c25de37ab4
refs/heads/master
2022-09-23T06:05:41.530131
2022-09-06T19:11:17
2022-09-06T19:11:17
45,612,543
12
11
MIT
2019-10-29T13:19:57
2015-11-05T13:22:04
Java
UTF-8
Java
false
false
2,606
java
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; import java.lang.Math; public class GetShorty { static class V implements Comparable<V> { public final int name; public List<E> adj; // public double dist = Double.POSITIVE_INFINITY; public double dist = Double.POSITIVE_INFINITY; public V prev; public V(int _n) { name = _n; adj = new ArrayList<E>(); } public int compareTo(V o) { return Double.compare(dist, o.dist); } } static class E { public final V end; public final double w; public E(V _e, double _w) { end = _e; w = _w; } } static void compute(V source, IO io) { source.dist = 1.; PriorityQueue<V> q = new PriorityQueue<>(); q.add(source); while (!q.isEmpty()) { V v = q.poll(); for (E e : v.adj) { V u = e.end; double uDist = v.dist * e.w; if (uDist < u.dist) { q.remove(u); u.dist = uDist; u.prev = v; q.add(u); } } } } public static void main(String[] args) throws IOException { IO io = new IO(System.in); while(true) { int nV = io.nextInt(); int nE = io.nextInt(); if (nV == 0) { break; } V[] vertices = new V[nV]; E[] edges = new E[2*nE]; // Create verices for (int j = 0; j < nV; j++) { vertices[j] = new V(j); } // Add edges (corridors) for (int j = 0; j < nE; j++) { int start = io.nextInt(); int end = io.nextInt(); double w = Math.pow(io.nextDouble(), -1); edges[2*j] = new E(vertices[end], w); edges[2*j+1] = new E(vertices[start], w); vertices[start].adj.add(edges[2*j]); vertices[end].adj.add(edges[2*j+1]); } compute(vertices[0], io); io.printf("%.4f\n", Math.pow(vertices[nV-1].dist, -1)); } io.close(); } // Class io only for testing. static class IO extends PrintWriter { static BufferedReader r; static StringTokenizer t; public IO(InputStream i) { super(new BufferedOutputStream(System.out)); r = new BufferedReader(new InputStreamReader(i)); t = new StringTokenizer(""); } public String next() throws IOException { while (!t.hasMoreTokens()) { t = new StringTokenizer(r.readLine()); } return t.nextToken(); } public int nextInt() throws IOException{ return Integer.parseInt(next()); } public long nextLong() throws IOException { return Long.parseLong(next()); } public double nextDouble() throws IOException { return Double.parseDouble(next()); } } }
[ "rick.van.rheenen@gmail.com" ]
rick.van.rheenen@gmail.com
7fd10f5095486e626990ff29921a0401d1390f73
c2fd3dea95b0713f56e7f92d12ea091ccbdcc42d
/springdoc-openapi-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java
e8e1d83d3a2241386487be490e55062b28ffe685
[ "Apache-2.0" ]
permissive
up1/springdoc-openapi
ab4734c869f1e599125bd701142b3b0bd2943e34
401840f34fb30efa94d4dbc38c4f8cc2d13003bb
refs/heads/master
2022-12-01T21:12:51.237619
2020-08-09T00:59:33
2020-08-09T00:59:33
286,665,694
1
0
Apache-2.0
2020-08-11T06:36:53
2020-08-11T06:36:52
null
UTF-8
Java
false
false
2,314
java
/* * * * Copyright 2019-2020 the original author or authors. * * * * 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 * * * * https://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 test.org.springdoc.ui; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import nonapi.io.github.classgraph.utils.FileUtils; import org.springdoc.core.SpringDocConfigProperties; import org.springdoc.core.SpringDocConfiguration; import org.springdoc.core.SwaggerUiConfigProperties; import org.springdoc.core.SwaggerUiOAuthProperties; import org.springdoc.webflux.core.SpringDocWebFluxConfiguration; import org.springdoc.webflux.ui.SwaggerConfig; import org.springdoc.webflux.ui.SwaggerWelcome; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.web.reactive.server.WebTestClient; @ActiveProfiles("test") @WebFluxTest @ContextConfiguration(classes = { SpringDocConfiguration.class, SpringDocConfigProperties.class, SpringDocWebFluxConfiguration.class, SwaggerUiConfigProperties.class, SwaggerConfig.class, SwaggerWelcome.class, SwaggerUiOAuthProperties.class }) public abstract class AbstractSpringDocTest { @Autowired protected WebTestClient webTestClient; protected String getContent(String fileName) { try { Path path = Paths.get(FileUtils.class.getClassLoader().getResource(fileName).toURI()); byte[] fileBytes = Files.readAllBytes(path); return new String(fileBytes, StandardCharsets.UTF_8); } catch (Exception e) { throw new RuntimeException("Failed to read file: " + fileName, e); } } }
[ "badr.nasslashen@gmail.com" ]
badr.nasslashen@gmail.com