blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30a0c1d64438aedb3ee0862ebc10326dc815916b | c802f82c89b612e1dd3f6749353e0dd45558e7e7 | /src/model/ProductDAO.java | c9ea269c9328058b073c2713d04cd61ff2468079 | [] | no_license | Anass-Daoudi/jee-struts1-ecommerce-app | 30ab4826af9639872d6b438bf237dbd9f7c563c4 | 3960e412a207eec46d0ac84920e5e959b8a047c7 | refs/heads/master | 2021-07-13T05:11:21.111458 | 2017-10-18T12:18:34 | 2017-10-18T12:18:34 | 107,403,593 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package model;
import java.util.ArrayList;
public interface ProductDAO {
public abstract boolean insert(Product product);
public abstract ArrayList<Product> myProducts(long idUser);
public abstract ArrayList<Product> allProducts();
public abstract void removeProduct(long idProduct);
public abstract Product getProduct(long idProduct);
}
| [
"[email protected]"
] | |
cb978ee187e8ed928b464696fbf7181c2f0b94bb | 7a57974e8dab403dbdcda67c16728c7f524d5fea | /src/main/java/com/cw/reducejoin/RJReducer.java | f9649a8c6ffce6a3e516ffc5d9c35ad7930142a8 | [] | no_license | cw1322311203/mapreducedemo | 4330b3087e670768b029886fd38e5f3222e1d425 | f9d6066551f63fea339845665663f88d78e46918 | refs/heads/master | 2022-05-06T15:09:23.296848 | 2019-12-04T07:37:51 | 2019-12-04T07:37:51 | 225,807,465 | 0 | 0 | null | 2022-04-12T21:57:44 | 2019-12-04T07:37:34 | Java | UTF-8 | Java | false | false | 940 | java | package com.cw.reducejoin;
import com.cw.reducejoin.bean.OrderBean;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Reducer;
import java.io.IOException;
import java.util.Iterator;
public class RJReducer extends Reducer<OrderBean, NullWritable, OrderBean, NullWritable> {
@Override
protected void reduce(OrderBean key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
//拿到迭代器
Iterator<NullWritable> iterator = values.iterator();
//数据指针下移,获取第一个OrderBean
iterator.next();
//从第一个OrderBean中取出品牌名称
String pname = key.getPname();
//遍历剩下的OrderBean,设置品牌名称并写出
while (iterator.hasNext()) {
iterator.next();
key.setPname(pname);
context.write(key, NullWritable.get());
}
}
}
| [
"[email protected]"
] | |
69557486a3bd87b9c53f42953817beb2f63cb2f9 | ba7e7dc3296784b07c35dd4e01d7f0cd5d84ab86 | /dungeonsAndMonsters/src/main/java/com/Charles/Dungeons/dungeonsAndMonsters/bootstrap/repositories/heroRepositories/SubHeroClassRepository.java | eedbb9becc212e78ac52a22823e0ab53ac23c807 | [] | no_license | manitobaMingo/dyingInDungeons | 443fd087e45fe351600607b6516cfe3b289493d1 | 68b1a33256be021a6fd9f3ec7108c689942b7653 | refs/heads/master | 2021-08-08T17:25:19.429410 | 2017-11-10T18:28:54 | 2017-11-10T18:28:54 | 109,410,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package com.Charles.Dungeons.dungeonsAndMonsters.bootstrap.repositories.heroRepositories;
import com.Charles.Dungeons.dungeonsAndMonsters.bootstrap.domain.hero.SubHeroClass;
import org.springframework.data.repository.CrudRepository;
public interface SubHeroClassRepository extends CrudRepository<SubHeroClass, Integer> {
}
| [
"[email protected]"
] | |
9a06f3a83a2fae373304ae024ac5c8417759198e | b46b91486ae015ec4625b131efda40c64b6ad639 | /OpenONG/backend/src/java/dao/interfaces/IItemDAO.java | a3e13c21289ba1d57c86cae98d62d85452be150b | [] | no_license | thiagomelof/OpenONG | 42a71fcd87e719e3ee515657ddb6c1cda8bd43ba | bd4e490c8f279182015c2aee1e73d68a37a3c3d8 | refs/heads/master | 2022-12-23T14:43:55.541513 | 2019-12-07T15:44:35 | 2019-12-07T15:44:35 | 211,663,287 | 0 | 0 | null | 2022-12-11T15:17:55 | 2019-09-29T12:57:45 | TypeScript | UTF-8 | Java | false | false | 299 | java | package dao.interfaces;
import java.util.List;
import model.Item;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import dao.base.IBaseDao;
public interface IItemDAO extends IBaseDao<Item, Long> {
List<Item> pesquisarTodos(Session session) throws HibernateException;
}
| [
"[email protected]"
] | |
fa2b7cbb169ec37e7929765a8737bc8822a13091 | bf7644aa9cdddd49178a3121fdf7e69d1fb566ba | /src/main/java/br/com/webbudget/application/controller/entries/CostCenterBean.java | 0702f3ac39d0244ebbfe1c4fae5b82f32d51661b | [] | no_license | AlcantaraGabriel/geren | c0c3d5ea33028b028e9f08639446ef28f98f0d67 | 4cbfb23880c2a257efe7646098e32ca45ef88c89 | refs/heads/master | 2022-04-09T22:24:01.042170 | 2020-02-24T14:26:20 | 2020-02-24T14:26:20 | 242,752,488 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,546 | java | /*
* Copyright (C) 2015 Arthur Gregorio, AG.Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package br.com.webbudget.application.controller.entries;
import br.com.webbudget.application.controller.AbstractBean;
import br.com.webbudget.domain.model.entity.entries.CostCenter;
import br.com.webbudget.domain.misc.ex.InternalServiceError;
import br.com.webbudget.application.component.table.AbstractLazyModel;
import br.com.webbudget.application.component.table.Page;
import br.com.webbudget.application.component.table.PageRequest;
import br.com.webbudget.domain.model.service.MovementService;
import java.util.List;
import java.util.Map;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import lombok.Getter;
import org.hibernate.exception.ConstraintViolationException;
import org.primefaces.model.SortOrder;
/**
* Controller da view de centros de custo
*
* @author Arthur Gregorio
*
* @version 1.3.0
* @since 1.0.0, 04/03/2014
*/
@Named
@ViewScoped
public class CostCenterBean extends AbstractBean {
@Getter
private CostCenter costCenter;
@Getter
private List<CostCenter> costCenters;
@Inject
private MovementService movementService;
@Getter
private final AbstractLazyModel<CostCenter> costCentersModel;
/**
*
*/
public CostCenterBean() {
this.costCentersModel = new AbstractLazyModel<CostCenter>() {
@Override
public List<CostCenter> load(int first, int pageSize, String sortField,
SortOrder sortOrder, Map<String, Object> filters) {
final PageRequest pageRequest = new PageRequest();
pageRequest
.setFirstResult(first)
.withPageSize(pageSize)
.sortingBy(sortField, "inclusion")
.withDirection(sortOrder.name());
final Page<CostCenter> page = movementService.listCostCentersLazily(null, pageRequest);
this.setRowCount(page.getTotalPagesInt());
return page.getContent();
}
};
}
/**
*
*/
public void initializeListing() {
this.viewState = ViewState.LISTING;
}
/**
* @param costCenterId
*/
public void initializeForm(long costCenterId) {
this.costCenters = this.movementService.listCostCenters(false);
if (costCenterId == 0) {
this.viewState = ViewState.ADDING;
this.costCenter = new CostCenter();
} else {
this.viewState = ViewState.EDITING;
this.costCenter = this.movementService.findCostCenterById(costCenterId);
}
}
/**
* @return
*/
public String changeToAdd() {
return "formCostCenter.xhtml?faces-redirect=true";
}
/**
* @return
*/
public String changeToListing() {
return "listCostCenters.xhtml?faces-redirect=true";
}
/**
* @param costCenterId
* @return
*/
public String changeToEdit(long costCenterId) {
return "formCostCenter.xhtml?faces-redirect=true&costCenterId=" + costCenterId;
}
/**
* @param costCenterId
*/
public void changeToDelete(long costCenterId) {
this.costCenter = this.movementService.findCostCenterById(costCenterId);
this.updateAndOpenDialog("deleteCostCenterDialog", "dialogDeleteCostCenter");
}
/**
* @return
*/
public String doCancel() {
return "listCostCenters.xhtml?faces-redirect=true";
}
/**
*
*/
public void doSave() {
try {
this.movementService.saveCostCenter(this.costCenter);
this.costCenter = new CostCenter();
// busca novamente os centros de custo para atualizar a lista de parentes
this.costCenters = this.movementService.listCostCenters(false);
this.addInfo(true, "cost-center.saved");
} catch (InternalServiceError ex) {
this.addError(true, ex.getMessage(), ex.getParameters());
} catch (Exception ex) {
this.logger.error(ex.getMessage(), ex);
this.addError(true, "error.undefined-error", ex.getMessage());
}
}
/**
*
*/
public void doUpdate() {
try {
this.costCenter = this.movementService.updateCostCenter(this.costCenter);
// busca novamente os centros de custo para atualizar a lista de parentes
this.costCenters = this.movementService.listCostCenters(false);
this.addInfo(true, "cost-center.updated");
} catch (InternalServiceError ex) {
this.addError(true, ex.getMessage(), ex.getParameters());
} catch (Exception ex) {
this.logger.error(ex.getMessage(), ex);
this.addError(true, "error.undefined-error", ex.getMessage());
}
}
/**
*
*/
public void doDelete() {
try {
this.movementService.deleteCostCenter(this.costCenter);
this.addInfo(true, "cost-center.deleted");
} catch (InternalServiceError ex) {
this.addError(true, ex.getMessage(), true, ex.getParameters());
} catch (Exception ex) {
if (this.containsException(ConstraintViolationException.class, ex)) {
this.addError(true, "error.cost-center.integrity-violation",
this.costCenter.getName());
} else {
this.logger.error(ex.getMessage(), ex);
this.addError(true, "error.undefined-error", ex.getMessage());
}
} finally {
this.closeDialog("dialogDeleteCostCenter");
this.updateComponent("costCentersList");
}
}
}
| [
"[email protected]"
] | |
b2df38ed5a3262fff070736ccb67f9c55c893f54 | 47cb4dae902527ceb1471094a46823db38664fba | /app/src/main/java/ua/zt/mezon/graphomania/fsmandstrategydemo/stratm/IStrategyState.java | e9f7ce61f98c6c2b658165e45baa6cbf107fac5d | [] | no_license | NickZt/FSM-and-Strategy-Demo | 38e37a47cc2d0bcdc36defba9554bc955715dc2e | d3622be81c41e3f3517be202b7af9e06f86c26f5 | refs/heads/master | 2021-06-20T12:16:10.595553 | 2020-11-29T17:34:07 | 2020-11-29T17:34:07 | 193,275,466 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package ua.zt.mezon.graphomania.fsmandstrategydemo.stratm;
import ua.zt.mezon.graphomania.fsmandstrategydemo.utils.fsm.FSMAction;
/**
* Created by NickZT on 01.02.2019.
*/
public
interface IStrategyState {
String getStateDesc();
void addAction(FSMAction fsmAction);
void executeAction();
}
| [
"[email protected]"
] | |
1c8ec7f46c94cb5006b0f3998cb1cfcae1492ff9 | 159ba85ccf6d0484eacd893454ad6a3a4d9af02c | /app/src/main/java/ru/ok/android/services/utils/users/OnlineUsersManager.java | c5134601f2d769e795e788353a0f9daa21ff518d | [] | no_license | kronar/OK | 71cee4639d090a0883767c4a932cc5bab2058482 | 8883fc78bac291f82e96a10215f5071c9d532b89 | refs/heads/master | 2021-05-31T19:47:54.639316 | 2016-03-25T11:52:52 | 2016-03-25T11:54:37 | 109,688,978 | 1 | 0 | null | 2017-11-06T11:52:48 | 2017-11-06T11:52:48 | null | UTF-8 | Java | false | false | 1,534 | java | package ru.ok.android.services.utils.users;
import ru.ok.android.bus.BusEvent;
import ru.ok.android.bus.GlobalBus;
import ru.ok.android.bus.annotation.Subscribe;
import ru.ok.android.utils.Logger;
public final class OnlineUsersManager {
private static OnlineUsersManager instance;
private boolean isWaitingResult;
private long timeCallBack;
private OnlineUsersManager() {
}
public static OnlineUsersManager getInstance() {
if (instance == null) {
instance = new OnlineUsersManager();
}
return instance;
}
public boolean getOnlineUsers() {
if (System.currentTimeMillis() - this.timeCallBack < 120000 || this.isWaitingResult) {
return false;
}
requestGetOnlineUsers();
return true;
}
public void getOnlineUsersNow() {
this.timeCallBack = 0;
getOnlineUsers();
}
public void clear() {
this.timeCallBack = 0;
}
private void requestGetOnlineUsers() {
Logger.m172d("|>>>>>> get online users");
this.isWaitingResult = true;
GlobalBus.register(this);
GlobalBus.send(2131623986, new BusEvent());
}
@Subscribe(on = 2131623946, to = 2131624165)
public void onOnlineFetched(BusEvent event) {
this.isWaitingResult = false;
GlobalBus.unregister(this);
if (event.resultCode == -1) {
this.timeCallBack = System.currentTimeMillis();
} else {
this.timeCallBack = 0;
}
}
}
| [
"[email protected]"
] | |
4f83684a32c8e6ac35b2b1b5e99c663c8a4172d0 | 69daddae6ebb18635adbf7dd5a240654e9abc42f | /Gateway/Agents/UniversalGatewayAgent/com.predic8.membrane.core/src/com/predic8/membrane/core/model/IPortChangeListener.java | 128c1b17e9bf854355c43c10731854f0e8ace1dd | [] | no_license | Developer-Integration-Lab/InterOp-SOA | 01c5f73dfa366f25e9a61c675a42bfbdcb697cf1 | 7661b3d8c1bdf9260e908b52235962bed37a8bd8 | refs/heads/master | 2021-01-17T11:56:07.998097 | 2012-09-20T20:10:35 | 2012-09-20T20:10:35 | 5,890,626 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 807 | java | /* Copyright 2009 predic8 GmbH, www.predic8.com
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.predic8.membrane.core.model;
public interface IPortChangeListener {
public void addPort(int port);
public void removePort(int port);
public void updatePort(int oldPort,int newPort);
}
| [
"[email protected]"
] | |
8439ceed2e000ce56c738bb7a9f2158fac6a62f9 | edbcaca44ad114345f45ccc1beb9144eb9a54f91 | /src/main/java/generator/annotation/EightDigits.java | 2d6fffe2520c05654a68fb519a5b9c01642af9cf | [] | no_license | RoundbootyGuilliman/EJBTutorial | aa3feba2c90d6af659b6eaac037c1c7ed273128c | 695f8c7fd16d56d2b4898a6ded0021f30e86b728 | refs/heads/master | 2020-03-25T23:28:15.841530 | 2018-08-10T11:38:26 | 2018-08-10T11:38:26 | 144,276,258 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package generator.annotation;
import javax.inject.Qualifier;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE, ElementType.METHOD})
public @interface EightDigits {
}
| [
"[email protected]"
] | |
4e570479a8e559f92a6117fbd02294afc13cf20c | 8cbf12678a13e288b4aee5a0de1ef408347321f6 | /ChillFAM/app/src/main/java/com/app/uzmav/chillfam/AdapterYT/MyCustomAdapter.java | 1937146180b084f3d9755c5141afc5b274b137f1 | [] | no_license | uzma010/ChillFAM-APP | f500b508edc6949ea41471b720771666b74fab60 | e5ac1368a4c8deadd2fb7badc4782b6b663e6f24 | refs/heads/master | 2020-04-21T13:01:41.651288 | 2019-03-14T19:01:58 | 2019-03-14T19:01:58 | 169,584,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,828 | java | package com.app.uzmav.chillfam.AdapterYT;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.app.uzmav.chillfam.ModelYT.VideoDetails;
import com.app.uzmav.chillfam.R;
import com.app.uzmav.chillfam.PlayVideoDetails;
import com.app.uzmav.chillfam.StartVideoActivity;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import static android.support.constraint.Constraints.TAG;
public class MyCustomAdapter extends BaseAdapter {
Activity mActivity;
ArrayList<VideoDetails> mVideoDetailsArrayList;
LayoutInflater mInflater;
VideoDetails mVideoDetails;
// widgets
private ImageView mImageVid;
private TextView mTextTitle;
private LinearLayout mLinerLayout;
// private OnItemClickListener mListener;
public static String VIDEO;
//constructor
public MyCustomAdapter(Activity mActivity, ArrayList<VideoDetails> mVideoDetailsArrayList) {
this.mActivity = mActivity;
this.mVideoDetailsArrayList = mVideoDetailsArrayList;
}
@Override
public int getCount() {
return this.mVideoDetailsArrayList.size();
}
@Override
public Object getItem(int position) {
return this.mVideoDetailsArrayList.get(position);//i
}
@Override
public long getItemId(int position) {
return (long)position;
}
public static String getVideoID(){
// mVideoDetails.getVIDEO_ID()
return VIDEO;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
if (mInflater == null){
mInflater = this.mActivity.getLayoutInflater();
}
if (convertView == null){
convertView = mInflater.inflate(R.layout.activity_custom, null);
}
mImageVid = (ImageView)convertView.findViewById(R.id.ImageVid);
mTextTitle = (TextView)convertView.findViewById(R.id.heading);
mLinerLayout = (LinearLayout)convertView.findViewById(R.id.VIDEOS);
final VideoDetails mVideoDetails = mVideoDetailsArrayList.get(position);
Log.d("chief", "message of pos: " + mVideoDetails.getTITLE() +" -- VideoID: "+ mVideoDetails.getVIDEO_ID());
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//int position = getAdapterPosition();
//mTextTitle = (TextView) v;
VideoDetails mVideoDetails2 = mVideoDetailsArrayList.get(position);
Intent i = new Intent(mActivity, PlayVideoDetails.class); //StartVideoActivity.class);
i.putExtra("videoId", VIDEO = mVideoDetails2.getVIDEO_ID());//name = videoId to playlistId
mActivity.startActivity(i);
Log.d("MYCOMPACTACTIVITY", "Title: " + mVideoDetails.getTITLE());
Log.d("MYCOMPACTACTIVITY", "Title 2: " + mVideoDetails2.getTITLE());
Log.d("MYCOMPACTACTIVITY","VideoID: " + mVideoDetails.getVIDEO_ID());
Log.d("MYCOMPACTACTIVITY","VideoID 2: " + mVideoDetails2.getVIDEO_ID());
Log.d("MYCOMPACTACTIVITY","URL: " + mVideoDetails.getURL());
Log.d("MYCOMPACTACTIVITY","URL 2: " + mVideoDetails2.getURL());
//Log.d("MYCOMPACTACTIVITY3","VIEW V: " + v.findViewById(R.id.ImageVid));
}
});
Picasso.get().load(mVideoDetails.getURL()).into(mImageVid);
mTextTitle.setText(mVideoDetails.getTITLE());
return convertView;
}
}
| [
"[email protected]"
] | |
1c2ee1b02f9efcb37824ef9b1c6835f87c10cc90 | 11a50de585429d946da853413807d2c562dc7741 | /EvaJavaPractice/src/Java/TicTacToe.java | ca0c5a7ce92b5461f517956131fc7dd2aad9d20e | [] | no_license | EvaHelloKitty/SummerTech2017 | 71af91a561c233c4c78cc5a5a754dbbc5cb8b212 | 0ad615fd0c22ad11926f5fa8aa2fb389ace70941 | refs/heads/master | 2020-11-29T20:45:17.696596 | 2017-07-11T04:11:30 | 2017-07-11T04:11:30 | 96,656,342 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,121 | java | package Java;
import java.util.Scanner;
public class TicTacToe {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner (System.in);
String array[][] = new String[3][3];
for (int i = 0; i < array[0].length; i++) {
for (int j = 0; j < array.length; j++) {
array[j][i]="[ ]";
}
}
for (int i = 0; i< array[0].length; i++) {
for (int j = 0; j < array.length; j++) {
System.out.print(array[j][i]);
}
System.out.println();
}
System.out.println("Welcome to Tic-Tac-Toe");
boolean gameplay =true;
while (gameplay){
System.out.println("Player one, please indicate the place where you want to put an 'x'");
System.out.print("\nColumn: ");
int x = scan.nextInt();
System.out.print("Row: ");
int y = scan.nextInt();
System.out.println();
if (x<array.length&&array[x][y].equals("[ ]")){
array[x][y]="[X]";
}
for (int i = 0; i< array[0].length; i++) {
for (int j = 0; j < array.length; j++) {
System.out.print(array[j][i]);
}
System.out.println();
}
//Horizontal
int g = 0;
for (int k=0;k<array[0].length; k++){
for (int i=0; i<array.length; i++){
if (array[i][k].equals("[X]")){
g++;
}
else{
g=0;
}
}
if (g==3){
System.out.println("X has won!");
return;
}
g=0;
}
//Verticle
int e = 0;
for (int i=0;i<array.length; i++){
for (int k=0; k<array[0].length; k++){
if (array[i][k].equals("[X]")){
e++;
}
else{
e=0;
}
}
if (e==3){
System.out.println("X has won!");
return;
}
e=0;
}
System.out.println("Player two, please indicate the place where you want to put an 'O'");
System.out.print("\nColumn: ");
int q = scan.nextInt();
System.out.print("Row: ");
int r = scan.nextInt();
System.out.println();
if (q<array.length&&array[q][r].equals("[ ]")){
array[q][r]="[O]";
}
for (int i = 0; i< array[0].length; i++) {
for (int j = 0; j < array.length; j++) {
System.out.print(array[j][i]);
}
System.out.println();
}
}
}
}
| [
"[email protected]"
] | |
b9f63c9797aa82a6de747815368dcea4cd6f2d59 | a8f3457fb4d1f12f3706f6f3fda73befc66ddecf | /src/test/java/com/lance/test/dubbo/Provider.java | f140bd5b219ade30e72f0d6c5ec2c2ae3722ce80 | [] | no_license | LanceHuang/test | ff636a45342119a132640db6a016e2b4b79a3ca5 | 5cf2cf95e736d06d2540cf2635a823cae23e32d6 | refs/heads/master | 2022-10-19T21:17:40.781477 | 2022-05-16T08:02:28 | 2022-05-16T08:02:28 | 101,545,043 | 0 | 1 | null | 2022-10-12T20:09:55 | 2017-08-27T10:26:47 | Java | UTF-8 | Java | false | false | 432 | java | package com.lance.test.dubbo;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.io.IOException;
public class Provider {
public static void main(String[] args) throws IOException {
ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("classpath:dubbo-demo-provider.xml");
ac.start();
//Press any key to continue
System.in.read();
}
}
| [
"[email protected]"
] | |
746f873835cb6c3f68dc4ac888f83332ced99d7b | 409b781806f9f5ce771168c640df293be4d683a2 | /nmi-core/src/main/java/com/rails/nmi/core/wrapper/GPVTG.java | 5c3d35da71ff351d330d34003de9d8729dc27588 | [] | no_license | WengShengyuan/configurableMicroService | cebff99ab0c7bda1b3df0dd450a49afd376ff2b9 | 2e11b5e2755cdcbac5a16c827930bb4defd16e97 | refs/heads/master | 2021-01-10T14:33:39.462206 | 2016-04-01T08:36:12 | 2016-04-01T08:36:12 | 55,194,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,065 | java | package com.rails.nmi.core.wrapper;
import java.io.Serializable;
/**
* 地面速度信息
* @author WengShengyuan
*
*/
public class GPVTG implements Serializable{
private static final long serialVersionUID = 3281814699149356318L;
private String realCourse="";// 以真北为参考基准的地面航向(000~359度,前面的0也将被传输)
private String magCourse="";// 以磁北为参考基准的地面航向(000~359度,前面的0也将被传输)
private String speed_knots="";// 地面速率(000.0~999.9节,前面的0也将被传输)
private String speed_km="";// 地面速率(0000.0~1851.8公里/小时,前面的0也将被传输)
private String mode="";// 模式指示(仅NMEA0183 3.00版本输出,A=自主定位,D=差分,E=估算,N=数据无效)
public void describe(){
System.out.println("\n*******地面速度信息(GPVTG)*******");
System.out.println("真北航向:"+this.realCourse);
System.out.println("磁北航向:"+this.magCourse);
System.out.println("地面速率(节):"+this.speed_knots);
System.out.println("地面速率(km):"+this.speed_km);
}
public GPVTG(String inStr){
if(inStr == null || inStr.isEmpty())
return;
String[] parts = inStr.split(",");
this.realCourse = parts[1];
this.magCourse = parts[3];
this.speed_knots = parts[5];
this.speed_km = parts[7];
this.mode = parts[9];
}
public GPVTG(){}
public String getRealCourse() {
return realCourse;
}
public void setRealCourse(String realCourse) {
this.realCourse = realCourse;
}
public String getMagCourse() {
return magCourse;
}
public void setMagCourse(String magCourse) {
this.magCourse = magCourse;
}
public String getSpeed_knots() {
return speed_knots;
}
public void setSpeed_knots(String speed_knots) {
this.speed_knots = speed_knots;
}
public String getSpeed_km() {
return speed_km;
}
public void setSpeed_km(String speed_km) {
this.speed_km = speed_km;
}
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
}
| [
"[email protected]"
] | |
9cae21456c3624e1e4e85e150f9c6b719278cd08 | a1de475d5240b0a78489a76c6363c52afa201767 | /lehome-queue/src/main/java/cn/lehome/dispatcher/queue/listener/entrance/OldHouseholdAutoEntranceMessageListener.java | 8a60ca609bdaf3b6139aedba70ac5d4687737fcc | [] | no_license | greatypine/lehome-dispatcher | de993b7a8f5d81509c20f7c546c68ec3e60ad40c | b6549264c85b848c57ed6d61989e0db0dfcd4483 | refs/heads/master | 2022-10-24T19:08:03.509914 | 2019-12-17T02:10:06 | 2019-12-17T02:10:06 | 242,515,799 | 0 | 1 | null | 2022-10-04T23:57:40 | 2020-02-23T12:48:21 | Java | UTF-8 | Java | false | false | 6,825 | java | package cn.lehome.dispatcher.queue.listener.entrance;
import cn.lehome.base.api.old.pro.bean.entrance.OldEntranceGuardUser;
import cn.lehome.base.api.old.pro.bean.entrance.OldEntranceGuardUserFacilityRelationship;
import cn.lehome.base.api.old.pro.bean.entrance.QOldEntranceGuardUserFacilityRelationship;
import cn.lehome.base.api.old.pro.bean.facility.OldExtendFacility;
import cn.lehome.base.api.old.pro.bean.facility.OldExtendFacilityRelation;
import cn.lehome.base.api.old.pro.bean.facility.QOldExtendFacility;
import cn.lehome.base.api.old.pro.bean.facility.QOldExtendFacilityRelation;
import cn.lehome.base.api.old.pro.bean.household.OldHouseholdsSettingsInfo;
import cn.lehome.base.api.old.pro.service.entrance.OldEntranceGuardUserApiService;
import cn.lehome.base.api.old.pro.service.entrance.OldEntranceGuardUserFacilityRelationApiService;
import cn.lehome.base.api.old.pro.service.facility.OldExtendFacilityApiService;
import cn.lehome.base.api.old.pro.service.household.OldHouseholdsInfoApiService;
import cn.lehome.bean.pro.old.enums.EnabledStatus;
import cn.lehome.bean.pro.old.enums.entrance.EntranceGuardDeviceUserType;
import cn.lehome.bean.pro.old.enums.facility.EntranceGuardType;
import cn.lehome.dispatcher.queue.listener.AbstractJobListener;
import cn.lehome.framework.base.api.core.event.IEventMessage;
import cn.lehome.framework.base.api.core.event.LongEventMessage;
import cn.lehome.framework.base.api.core.request.ApiRequest;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created by wuzhao on 2018/3/13.
*/
public class OldHouseholdAutoEntranceMessageListener extends AbstractJobListener {
@Autowired
private OldHouseholdsInfoApiService oldHouseholdsInfoApiService;
@Autowired
private OldExtendFacilityApiService extendFacilityApiService;
@Autowired
private OldEntranceGuardUserFacilityRelationApiService oldEntranceGuardUserFacilityRelationApiService;
@Autowired
private OldEntranceGuardUserApiService oldEntranceGuardUserApiService;
@Override
public void execute(IEventMessage eventMessage) throws Exception {
if (!(eventMessage instanceof LongEventMessage)) {
logger.error("消息类型不对");
return;
}
LongEventMessage longEventMessage = (LongEventMessage) eventMessage;
OldHouseholdsSettingsInfo oldHouseholdsSettingsInfo = oldHouseholdsInfoApiService.findSettingByHouseholdId(longEventMessage.getData().intValue());
if (oldHouseholdsSettingsInfo == null) {
logger.error("住户信息未找到, householdId = " + longEventMessage.getData());
return;
}
OldEntranceGuardUser oldEntranceGuardUser = oldEntranceGuardUserApiService.findByUserTypeAndObjectIdAndAreaId(EntranceGuardDeviceUserType.Households, oldHouseholdsSettingsInfo.getHouseholdsId(), oldHouseholdsSettingsInfo.getAreaId());
if (oldEntranceGuardUser == null) {
logger.error("开门用户未找到, householdId = " + longEventMessage.getData());
return;
}
List<OldExtendFacility> doorList = extendFacilityApiService.findFacilityAll(ApiRequest.newInstance().filterEqual(QOldExtendFacility.category, EntranceGuardType.AreaDoor).filterEqual(QOldExtendFacility.areaId, oldHouseholdsSettingsInfo.getAreaId()).filterEqual(QOldExtendFacility.status, EnabledStatus.Enabled));
if (CollectionUtils.isEmpty(doorList)) {
doorList = Lists.newArrayList();
}
List<OldExtendFacilityRelation> relationList = extendFacilityApiService.findAll(ApiRequest.newInstance().filterEqual(QOldExtendFacilityRelation.unitId, oldHouseholdsSettingsInfo.getUnitId()));
if (!CollectionUtils.isEmpty(relationList)) {
Map<Integer, OldExtendFacility> oldExtendFacilityMap = extendFacilityApiService.findExtendAll(relationList.stream().map(OldExtendFacilityRelation::getFacilityId).collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(oldExtendFacilityMap)) {
for (OldExtendFacility oldExtendFacility : oldExtendFacilityMap.values()) {
doorList.add(oldExtendFacility);
}
}
}
List<OldEntranceGuardUserFacilityRelationship> oldEntranceGuardUserFacilityRelationships = oldEntranceGuardUserFacilityRelationApiService.findAll(ApiRequest.newInstance().filterEqual(QOldEntranceGuardUserFacilityRelationship.entranceGuardUserId, oldEntranceGuardUser.getId()).filterIn(QOldEntranceGuardUserFacilityRelationship.facilityId, doorList.stream().map(OldExtendFacility::getId).collect(Collectors.toList())));
List<OldEntranceGuardUserFacilityRelationship> insertList = Lists.newArrayList();
List<OldEntranceGuardUserFacilityRelationship> updateList = Lists.newArrayList();
Map<Integer, OldEntranceGuardUserFacilityRelationship> relationshipMap = Maps.newHashMap();
if (!CollectionUtils.isEmpty(oldEntranceGuardUserFacilityRelationships)) {
oldEntranceGuardUserFacilityRelationships.forEach(oldEntranceGuardUserFacilityRelationship -> relationshipMap.put(oldEntranceGuardUserFacilityRelationship.getFacilityId(), oldEntranceGuardUserFacilityRelationship));
}
for (OldExtendFacility oldExtendFacility : doorList) {
OldEntranceGuardUserFacilityRelationship oldEntranceGuardUserFacilityRelationship = relationshipMap.get(oldExtendFacility.getId());
if (oldEntranceGuardUserFacilityRelationship != null) {
oldEntranceGuardUserFacilityRelationship.setEnabledStatus(EnabledStatus.Enabled);
updateList.add(oldEntranceGuardUserFacilityRelationship);
} else {
oldEntranceGuardUserFacilityRelationship = new OldEntranceGuardUserFacilityRelationship();
oldEntranceGuardUserFacilityRelationship.setEnabledStatus(EnabledStatus.Enabled);
oldEntranceGuardUserFacilityRelationship.setEntranceGuardUserId(oldEntranceGuardUser.getId());
oldEntranceGuardUserFacilityRelationship.setFacilityId(oldExtendFacility.getId());
insertList.add(oldEntranceGuardUserFacilityRelationship);
}
}
if (!CollectionUtils.isEmpty(insertList)) {
oldEntranceGuardUserFacilityRelationApiService.batchSave(insertList);
}
if (!CollectionUtils.isEmpty(updateList)) {
oldEntranceGuardUserFacilityRelationApiService.batchSave(updateList);
}
}
@Override
public String getConsumerId() {
return "old_household_auto_entrance";
}
}
| [
"[email protected]"
] | |
5d34f3e1724b13a265a2361b6f4b1d9625baec4e | beffc6542dc4bf85946ceca7cca4a31ac230d376 | /spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java | 8c3e7220ff2b467055b4b9e9d4e3e773bff1515e | [
"Apache-2.0"
] | permissive | ZhouKaiDongGitHub/spring-boot-2.0.x | 4395970b183eff7321748d4ad0155784aa94eaa6 | 3f443764747c4ee01085bed6381292fa44744a49 | refs/heads/master | 2023-01-07T07:27:51.067468 | 2020-09-13T07:13:04 | 2020-09-13T07:13:04 | 215,676,265 | 1 | 0 | Apache-2.0 | 2022-12-27T14:52:46 | 2019-10-17T01:24:02 | Java | UTF-8 | Java | false | false | 9,986 | java | /*
* Copyright 2012-2019 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 org.springframework.boot.autoconfigure.web.reactive.error;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import reactor.core.publisher.Mono;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders;
import org.springframework.boot.autoconfigure.web.ResourceProperties;
import org.springframework.boot.web.reactive.error.ErrorAttributes;
import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
import org.springframework.http.codec.HttpMessageReader;
import org.springframework.http.codec.HttpMessageWriter;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.reactive.result.view.ViewResolver;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.util.HtmlUtils;
/**
* Abstract base class for {@link ErrorWebExceptionHandler} implementations.
*
* @author Brian Clozel
* @since 2.0.0
* @see ErrorAttributes
*/
public abstract class AbstractErrorWebExceptionHandler implements ErrorWebExceptionHandler, InitializingBean {
private final ApplicationContext applicationContext;
private final ErrorAttributes errorAttributes;
private final ResourceProperties resourceProperties;
private final TemplateAvailabilityProviders templateAvailabilityProviders;
private List<HttpMessageReader<?>> messageReaders = Collections.emptyList();
private List<HttpMessageWriter<?>> messageWriters = Collections.emptyList();
private List<ViewResolver> viewResolvers = Collections.emptyList();
public AbstractErrorWebExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
ApplicationContext applicationContext) {
Assert.notNull(errorAttributes, "ErrorAttributes must not be null");
Assert.notNull(resourceProperties, "ResourceProperties must not be null");
Assert.notNull(applicationContext, "ApplicationContext must not be null");
this.errorAttributes = errorAttributes;
this.resourceProperties = resourceProperties;
this.applicationContext = applicationContext;
this.templateAvailabilityProviders = new TemplateAvailabilityProviders(applicationContext);
}
/**
* Configure HTTP message writers to serialize the response body with.
* @param messageWriters the {@link HttpMessageWriter}s to use
*/
public void setMessageWriters(List<HttpMessageWriter<?>> messageWriters) {
Assert.notNull(messageWriters, "'messageWriters' must not be null");
this.messageWriters = messageWriters;
}
/**
* Configure HTTP message readers to deserialize the request body with.
* @param messageReaders the {@link HttpMessageReader}s to use
*/
public void setMessageReaders(List<HttpMessageReader<?>> messageReaders) {
Assert.notNull(messageReaders, "'messageReaders' must not be null");
this.messageReaders = messageReaders;
}
/**
* Configure the {@link ViewResolver} to use for rendering views.
* @param viewResolvers the list of {@link ViewResolver}s to use
*/
public void setViewResolvers(List<ViewResolver> viewResolvers) {
this.viewResolvers = viewResolvers;
}
/**
* Extract the error attributes from the current request, to be used to populate error
* views or JSON payloads.
* @param request the source request
* @param includeStackTrace whether to include the error stacktrace information
* @return the error attributes as a Map.
*/
protected Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
return this.errorAttributes.getErrorAttributes(request, includeStackTrace);
}
/**
* Extract the original error from the current request.
* @param request the source request
* @return the error
*/
protected Throwable getError(ServerRequest request) {
return this.errorAttributes.getError(request);
}
/**
* Check whether the trace attribute has been set on the given request.
* @param request the source request
* @return {@code true} if the error trace has been requested, {@code false} otherwise
*/
protected boolean isTraceEnabled(ServerRequest request) {
String parameter = request.queryParam("trace").orElse("false");
return !"false".equalsIgnoreCase(parameter);
}
/**
* Render the given error data as a view, using a template view if available or a
* static HTML file if available otherwise. This will return an empty
* {@code Publisher} if none of the above are available.
* @param viewName the view name
* @param responseBody the error response being built
* @param error the error data as a map
* @return a Publisher of the {@link ServerResponse}
*/
protected Mono<ServerResponse> renderErrorView(String viewName, ServerResponse.BodyBuilder responseBody,
Map<String, Object> error) {
if (isTemplateAvailable(viewName)) {
return responseBody.render(viewName, error);
}
Resource resource = resolveResource(viewName);
if (resource != null) {
return responseBody.body(BodyInserters.fromResource(resource));
}
return Mono.empty();
}
private boolean isTemplateAvailable(String viewName) {
return this.templateAvailabilityProviders.getProvider(viewName, this.applicationContext) != null;
}
private Resource resolveResource(String viewName) {
for (String location : this.resourceProperties.getStaticLocations()) {
try {
Resource resource = this.applicationContext.getResource(location);
resource = resource.createRelative(viewName + ".html");
if (resource.exists()) {
return resource;
}
}
catch (Exception ex) {
// Ignore
}
}
return null;
}
/**
* Render a default HTML "Whitelabel Error Page".
* <p>
* Useful when no other error view is available in the application.
* @param responseBody the error response being built
* @param error the error data as a map
* @return a Publisher of the {@link ServerResponse}
*/
protected Mono<ServerResponse> renderDefaultErrorView(ServerResponse.BodyBuilder responseBody,
Map<String, Object> error) {
StringBuilder builder = new StringBuilder();
Object message = error.get("message");
Date timestamp = (Date) error.get("timestamp");
builder.append("<html><body><h1>Whitelabel Error Page</h1>")
.append("<p>This application has no configured error view, so you are seeing this as a fallback.</p>")
.append("<div id='created'>").append(timestamp).append("</div>")
.append("<div>There was an unexpected error (type=").append(htmlEscape(error.get("error")))
.append(", status=").append(htmlEscape(error.get("status"))).append(").</div>");
if (message != null) {
builder.append("<div>").append(htmlEscape(message)).append("</div>");
}
builder.append("</body></html>");
return responseBody.syncBody(builder.toString());
}
private String htmlEscape(Object input) {
return (input != null) ? HtmlUtils.htmlEscape(input.toString()) : null;
}
@Override
public void afterPropertiesSet() throws Exception {
if (CollectionUtils.isEmpty(this.messageWriters)) {
throw new IllegalArgumentException("Property 'messageWriters' is required");
}
}
/**
* Create a {@link RouterFunction} that can route and handle errors as JSON responses
* or HTML views.
* <p>
* If the returned {@link RouterFunction} doesn't route to a {@code HandlerFunction},
* the original exception is propagated in the pipeline and can be processed by other
* {@link org.springframework.web.server.WebExceptionHandler}s.
* @param errorAttributes the {@code ErrorAttributes} instance to use to extract error
* information
* @return a {@link RouterFunction} that routes and handles errors
*/
protected abstract RouterFunction<ServerResponse> getRoutingFunction(ErrorAttributes errorAttributes);
@Override
public Mono<Void> handle(ServerWebExchange exchange, Throwable throwable) {
if (exchange.getResponse().isCommitted()) {
return Mono.error(throwable);
}
this.errorAttributes.storeErrorInformation(throwable, exchange);
ServerRequest request = ServerRequest.create(exchange, this.messageReaders);
return getRoutingFunction(this.errorAttributes).route(request).switchIfEmpty(Mono.error(throwable))
.flatMap((handler) -> handler.handle(request)).flatMap((response) -> write(exchange, response));
}
private Mono<? extends Void> write(ServerWebExchange exchange, ServerResponse response) {
// force content-type since writeTo won't overwrite response header values
exchange.getResponse().getHeaders().setContentType(response.headers().getContentType());
return response.writeTo(exchange, new ResponseContext());
}
private class ResponseContext implements ServerResponse.Context {
@Override
public List<HttpMessageWriter<?>> messageWriters() {
return AbstractErrorWebExceptionHandler.this.messageWriters;
}
@Override
public List<ViewResolver> viewResolvers() {
return AbstractErrorWebExceptionHandler.this.viewResolvers;
}
}
}
| [
"[email protected]"
] | |
948c6f32d5b12c218834694320e3a97c24e79063 | 8da927e0f7ded536d6df98d44668ebf273c74c22 | /adminportal/src/main/java/com/adminportal/domain/User.java | 15b3b8653746ff85a505b57257d7780da439a97d | [] | no_license | prabalshrestha/G-G | 9489ccdedf94409220a007449517e9b10211a9fa | ff21dd71092c49caae4f31253a140e6af76c2d76 | refs/heads/master | 2023-03-08T19:33:36.083179 | 2021-02-25T08:23:46 | 2021-02-25T08:23:46 | 331,943,660 | 0 | 0 | null | 2021-02-25T08:23:46 | 2021-01-22T12:45:12 | JavaScript | UTF-8 | Java | false | false | 3,842 | java | package com.adminportal.domain;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import com.adminportal.domain.security.Authority;
import com.adminportal.domain.security.UserRole;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class User implements UserDetails{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="id",nullable= false,updatable=false)
private Long id;
private String username;
private String password;
private String firstName;
private String lastName;
@Column(name="email", nullable= false,updatable=false)
private String email;
private String phone;
private boolean enabled= true;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "user")
private List<UserShipping> userShippingList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "user")
private List<UserPayment> userPaymentList;
@OneToOne(cascade = CascadeType.ALL, mappedBy = "user")
private ShoppingCart shoppingCart;
public ShoppingCart getShoppingCart() {
return shoppingCart;
}
public void setShoppingCart(ShoppingCart shoppingCart) {
this.shoppingCart = shoppingCart;
}
public List<UserShipping> getUserShippingList() {
return userShippingList;
}
public void setUserShippingList(List<UserShipping> userShippingList) {
this.userShippingList = userShippingList;
}
public List<UserPayment> getUserPaymentList() {
return userPaymentList;
}
public void setUserPaymentList(List<UserPayment> userPaymentList) {
this.userPaymentList = userPaymentList;
}
@OneToMany(mappedBy="user", cascade = CascadeType.ALL, fetch= FetchType.EAGER)
@JsonIgnore
private Set<UserRole> userRoles= new HashSet<>();
public Set<UserRole> getUserRoles() {
return userRoles;
}
public void setUserRoles(Set<UserRole> userRoles) {
this.userRoles = userRoles;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
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;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
Set<GrantedAuthority> authorities=new HashSet<>();
userRoles.forEach(ur -> authorities.add(new Authority(ur.getRole().getName())));
return authorities;
}
@Override
public boolean isAccountNonExpired() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean isAccountNonLocked() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean isCredentialsNonExpired() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean isEnabled() {
return enabled;
}
}
| [
"[email protected]"
] | |
0b59b87b9f67091af4a90688ddfa44d4397203d6 | 64beb157b66c6eeee93d0b694e02d881f79ba71b | /testsrc/regression/Clients/AddClientTest2.java | 79534d02b3055af6fe38f5600cbf666de3e268d7 | [] | no_license | amolujagare123/POM-70-sept21 | d706e4446a20ef76a8a2d3bb86735307ce708a05 | a1298d54ad5767b8211d79b2ec7372c1d8226be0 | refs/heads/master | 2023-08-26T05:22:15.214147 | 2021-11-12T07:58:56 | 2021-11-12T07:58:56 | 410,929,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,411 | java | package regression.Clients;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import pages.Clients.AddClient;
import pages.Login;
import pages.Menu;
import util.DoLogin;
import java.io.IOException;
import static utilities.ConfigReader.*;
public class AddClientTest2 extends DoLogin {
@Test
public void addClientTest() throws IOException {
Menu menu = new Menu(driver);
menu.clickAddClient();
AddClient addClient = new AddClient(driver);
addClient.setTxtName("Ayushee1");
addClient.setTxtSurname("xyz");
addClient.setLanguage("Spanish");
addClient.setTxtAdd1("abcd1");
addClient.setTxtAdd2("abcd2");
addClient.setTxtCity("pune");
addClient.setTxtState("MH");
addClient.setTxtZip("78787878");
addClient.setCountry("Hungary");
addClient.setGender("Female");
addClient.setBirthdate("07/27/2021");
addClient.setTxtPhone("8989");
addClient.setTxtFax("9099");
addClient.setTxtMobile("998989");
addClient.setTxtEmail("[email protected]");
addClient.setTxtWeb("www.xyz.com");
addClient.setTxtVat("89899");
addClient.setTxtTax("898989");
addClient.clickBtnSave();
}
}
| [
"[email protected]"
] | |
7ac2c6f0fc675bcc4e57305b4e1ed7a327b13cbe | d90c016fa3cb052bdd240d1a6307de7d242fa90c | /gameserver/src/main/java/org/mmocore/gameserver/model/instances/DecoyInstance.java | 4617e3d2df0b731a92ea2b340b2c1050e700968f | [] | no_license | netvirus/JTS_Src | 124bf1dc6dc488e83c6905d4f314a58ba4488e2f | 3e40ce37147b0e6be056d3a739bf32f586789bc5 | refs/heads/master | 2023-02-19T23:22:36.909600 | 2021-01-25T07:29:44 | 2021-01-25T07:29:44 | 332,664,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,888 | java | package org.mmocore.gameserver.model.instances;
import org.mmocore.commons.lang.reference.HardReference;
import org.mmocore.commons.threading.RunnableImpl;
import org.mmocore.gameserver.ThreadPoolManager;
import org.mmocore.gameserver.network.lineage.serverpackets.AutoAttackStart;
import org.mmocore.gameserver.network.lineage.serverpackets.CharInfo;
import org.mmocore.gameserver.network.lineage.serverpackets.L2GameServerPacket;
import org.mmocore.gameserver.network.lineage.serverpackets.MyTargetSelected;
import org.mmocore.gameserver.object.Creature;
import org.mmocore.gameserver.object.Player;
import org.mmocore.gameserver.skills.SkillEntry;
import org.mmocore.gameserver.tables.SkillTable;
import org.mmocore.gameserver.templates.npc.NpcTemplate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
public class DecoyInstance extends NpcInstance {
private final HardReference<Player> _playerRef;
private int _lifeTime, _timeRemaining;
private ScheduledFuture<?> _decoyLifeTask, _hateSpam;
public DecoyInstance(final int objectId, final NpcTemplate template, final Player owner, final int lifeTime) {
super(objectId, template);
setUndying(false);
_playerRef = owner.getRef();
_lifeTime = lifeTime;
_timeRemaining = _lifeTime;
final int skilllevel = getNpcId() < 13257 ? getNpcId() - 13070 : getNpcId() - 13250;
_decoyLifeTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new DecoyLifetime(), 1000, 1000);
_hateSpam = ThreadPoolManager.getInstance().scheduleAtFixedRate(new HateSpam(SkillTable.getInstance().getSkillEntry(5272, skilllevel)), 1000, 3000);
}
@Override
protected void onDeath(final Creature killer) {
super.onDeath(killer);
if (_hateSpam != null) {
_hateSpam.cancel(false);
_hateSpam = null;
}
_lifeTime = 0;
}
public void unSummon() {
if (_decoyLifeTask != null) {
_decoyLifeTask.cancel(false);
_decoyLifeTask = null;
}
if (_hateSpam != null) {
_hateSpam.cancel(false);
_hateSpam = null;
}
deleteMe();
}
public void decTimeRemaining(final int value) {
_timeRemaining -= value;
}
public int getTimeRemaining() {
return _timeRemaining;
}
public int getLifeTime() {
return _lifeTime;
}
@Override
public Player getPlayer() {
return _playerRef.get();
}
@Override
public boolean isAutoAttackable(final Creature attacker) {
final Player owner = getPlayer();
return owner != null && owner.isAutoAttackable(attacker);
}
@Override
public boolean isAttackable(final Creature attacker) {
final Player owner = getPlayer();
return owner != null && owner.isAttackable(attacker);
}
@Override
protected void onDelete() {
final Player owner = getPlayer();
if (owner != null) {
owner.setDecoy(null);
}
super.onDelete();
}
@Override
public void onAction(final Player player, final boolean shift) {
if (player.getTarget() != this) {
player.setTarget(this);
player.sendPacket(new MyTargetSelected(getObjectId(), 0));
} else if (isAutoAttackable(player)) {
player.getAI().Attack(this, false, shift);
}
}
@Override
public List<L2GameServerPacket> addPacketList(final Player forPlayer, final Creature dropper) {
if (!isInCombat()) {
return Collections.<L2GameServerPacket>singletonList(new CharInfo(this));
} else {
final List<L2GameServerPacket> list = new ArrayList<>(2);
list.add(new CharInfo(this));
list.add(new AutoAttackStart(objectId));
return list;
}
}
class DecoyLifetime extends RunnableImpl {
@Override
public void runImpl() throws Exception {
try {
final double newTimeRemaining;
decTimeRemaining(1000);
newTimeRemaining = getTimeRemaining();
if (newTimeRemaining < 0) {
unSummon();
}
} catch (Exception e) {
LOGGER.error("", e);
}
}
}
class HateSpam extends RunnableImpl {
private final SkillEntry _skill;
HateSpam(final SkillEntry skill) {
_skill = skill;
}
@Override
public void runImpl() throws Exception {
try {
setTarget(DecoyInstance.this);
doCast(_skill, DecoyInstance.this, true);
} catch (Exception e) {
LOGGER.error("", e);
}
}
}
} | [
"[email protected]"
] | |
2505dd6f708d15250e98377db6b108639b73c649 | cb6b51910fdd0462ddbed1d7fecb7b5f717f1e28 | /Downloads/M1/src/main/Person4.java | 12f287dc686900af471c58b12b95d3beaf222285 | [] | no_license | robert-ha14/counter-app | 1ec12b90f3333ac1b67c8fca7ae0dade27c4244f | 56bcad0dbeeb5a7911d40ece5fd8d5b5fb39a233 | refs/heads/main | 2021-07-15T20:03:04.512426 | 2021-02-26T18:27:04 | 2021-02-26T18:27:04 | 242,311,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | package main;
/**
* TODO:
* 1. Change the author to your full name
* 2. Follow the tutorial located here: https://www.tutorialspoint.com/junit/junit_environment_setup.htm
* to setup your junit environment and begin creating test cases.
* 3. Create a new directory for your tests located at M1/src/tests/person4
* 4. Now create a TestPerson4 Class and write methods to test add, subtract, multiply and divide
* 5. Create a TestRunner Class and verify your tests run successfully.
* Reminder: Each individual is to complete this TODO
*
* @author Bob
* @version 1.1
*/
public class Person4 {
private String name;
public Person4(String name) {
this.name = name;
}
public long add(long first, long second) {
return first + second;
}
public long subtract(long first, long second) {
return first - second;
}
public long multiply(long first, long second) {
return first * second;
}
public long divide(long first, long second) {
if (second == 0L)
throw new IllegalArgumentException("Cannot divide by zero!");
return first / second;
}
}
| [
"[email protected]"
] | |
3adba19ce14156ab6177030ce03fdfd1c13cfc85 | 08c11d6bc3c06e89730d25cef211d5dc1c57708c | /pandaFX/LoginController.java | 52bcd7b29afb2b32d9bb67f5352cfc023159111f | [] | no_license | AsjadIftikhar/PandaFX | b1fa3c2adfa07664ad570705c2d442722ba2a99f | 5b2da0f848da595ce24a99f3d605c473ef2cb1e2 | refs/heads/master | 2023-02-24T17:05:24.424953 | 2021-01-30T19:48:34 | 2021-01-30T19:48:34 | 334,487,603 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,181 | java | package pandaFX;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
import pandaFX.models.GUI;
import java.io.File;
import java.io.IOException;
import java.net.URL;
public class LoginController {
@FXML
private TextField userName;
@FXML
private TextField password;
@FXML
private Button loginButton;
@FXML
private Label error;
@FXML
public void initialize() {
loginButton.setDisable(true);
error.setDisable(true);
}
@FXML
public void onButtonClicked(ActionEvent event) throws IOException {
String ID = userName.getText();
String Pass = password.getText();
if (GUI.getInstance().findInDatabase(ID, Pass)) {
if (GUI.getInstance().getPerson().getClass().toString().equals("class pandaFX.models.Teacher")){
String sceneFile = "FXML_TeacherHome.fxml";
Parent root = null;
URL url = null;
try {
url = getClass().getResource(sceneFile);
FXMLLoader loader = new FXMLLoader();
loader.setLocation(url);
root = loader.load();
Scene scene = new Scene(root);
Stage window = (Stage) ((Node) event.getSource()).getScene().getWindow();
window.setScene(scene);
window.show();
} catch (Exception ex) {
System.out.println("Exception on FXMLLoader.load()" + ex);
throw ex;
}
}
else if (GUI.getInstance().getPerson().getClass().toString().equals("class pandaFX.models.AC_Officer")) {
String sceneFile = "FXML_ACHome.fxml";
Parent root = null;
URL url = null;
try {
url = getClass().getResource(sceneFile);
FXMLLoader loader = new FXMLLoader();
loader.setLocation(url);
root = loader.load();
Scene scene = new Scene(root);
Stage window = (Stage) ((Node) event.getSource()).getScene().getWindow();
window.setScene(scene);
window.show();
} catch (Exception ex) {
System.out.println("Exception on FXMLLoader.load()" + ex);
throw ex;
}
}
else if (GUI.getInstance().getPerson().getClass().toString().equals("class pandaFX.models.Student")){
String sceneFile = "FXML_StuShowMain.fxml";
Parent root = null;
URL url = null;
try {
url = getClass().getResource(sceneFile);
FXMLLoader loader = new FXMLLoader();
loader.setLocation(url);
root = loader.load();
Scene scene = new Scene(root);
Stage window = (Stage) ((Node) event.getSource()).getScene().getWindow();
window.setScene(scene);
window.show();
} catch (Exception ex) {
System.out.println("Exception on FXMLLoader.load()" + ex);
throw ex;
}
}
} else {
String err = "Invalid Email or Password";
error.setDisable(false);
error.setText(err);
}
}
@FXML
public void handleKeyReleased() {
String UN = userName.getText();
String pass = password.getText();
boolean disableButtons = false;
if (UN.isEmpty() || pass.isEmpty() || UN.trim().isEmpty() || pass.trim().isEmpty()) {
disableButtons = true;
} else if (UN.length() < 6 || pass.length() < 4) {
disableButtons = true;
}
loginButton.setDisable(disableButtons);
}
}
| [
"[email protected]"
] | |
048ed185d908251cd24c070de2f62bbb1a6e2b13 | 40cb6cd2f9e919fe2f2e59bbe5adb214896a3641 | /src/assignment/globalrelay/ServiceListener.java | 91f5705999bbec1e2b5fef70ea3ed60ba3a4c668 | [
"BSD-3-Clause"
] | permissive | mushkevych/assignment | c055247760db09763b758ce3e5799e703c007703 | 079701dfbf7fa94bd512ec089d87b9fa42bb7fb1 | refs/heads/master | 2020-03-30T15:37:03.544626 | 2013-03-30T03:00:22 | 2013-03-30T03:00:22 | 9,108,222 | 1 | 5 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package assignment.globalrelay;
/**
* license: BSD - see LICENSE for details
*
* @author Bohdan Mushkevych
* Description: Interface of main monitoring events: server up and server down
*/
public interface ServiceListener {
void serviceUp(String name, long timestamp);
void serviceDown(String name, long timestamp);
}
| [
"[email protected]"
] | |
fccb44bb01b5de56de7c063d956ace96f3cab2cf | 273bc28d424267501942dba3533fc3f3bf634f15 | /src/myfirstapplication/MainJFrame.java | 2600924ab89209f0123fd64dd3f91983e874330c | [] | no_license | MakerMan22/BankingSoftware | d99cab4b9458806baa991accc182260cf4c8042e | ef98a8a7ea85e3f76f8e38ce21e6d9979f69e793 | refs/heads/master | 2022-09-24T07:05:09.848087 | 2020-06-04T15:07:03 | 2020-06-04T15:07:03 | 269,390,278 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131,896 | 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.
*/
//NOTE
//THIS IS A MODIFIED VERSION OF ORIGINAL BANKING SOFTWARE
//SOME FUNCTIONALITY THAT IS NOT REQUIRED FOR ITERATION 2 HAS BEEN REMOVED
//CUSTOMER ONLY HAS A CURRENT ACCOUNT IN THIS VERSION
//FUNCTIONALITY TO ADD SORT CODE AND ACCOUNT NUMBER IN GUI HAS BEEN ADDED
//FUNCTIONALITY TO COMMUNICATE WITH SUPERMARKET SOFTWARE (SOCKET) HAS BEEN ADDED
package myfirstapplication;
import java.io.IOException;
import java.math.BigDecimal;
//import java.sql.Date;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.Date;
/**
*
* @author Connor
*/
//This is the class definition
//Here we declare the constructor.
//We are Declaring the variables - variables must be declared to bring them into the file
public class MainJFrame extends javax.swing.JFrame {
/**
* Creates new form MainJFrame
*/
public MainJFrame() {
initComponents();
theCustomer = new Customer();
theCustomerList = new CustomerList();
theBranch = new Branch();
theBranchList = new BranchList();
jTabInMemory1 = jMainTabbedPane.getComponent(1);
jMainTabbedPane.remove(1);
jTabInMemory2 = jMainTabbedPane.getComponent(1);
jMainTabbedPane.remove(1);
jTabInMemory3 = jMainTabbedPane.getComponent(1);
jMainTabbedPane.remove(1);
jTabInMemory4 = jMainTabbedPane.getComponent(1);
jMainTabbedPane.remove(1);
jTabInMemory5 = jMainTabbedPane.getComponent(1);
jMainTabbedPane.remove(1);
jMainTabbedPane.setSelectedIndex(0);
theHeadOfficeBranch = new Branch();
theHeadOfficeBranch.Edit("8.00-17.30", "22-66-17", "David Jones");
theUser = new User();
searchSelection = 0;
for(int index=0; index < jMainTabbedPane.getTabCount();index++)
{
if(!jMainTabbedPane.getTitleAt(index).contentEquals("Login"))
jMainTabbedPane.setEnabledAt(index,false);
}
this.LoadAllFromFile();
//////FOR ITERATION 2 PURPOSES ONLY////////////////////
try {
server = new BankServer();
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
jSavings1CheckBox.setEnabled(false);
jISACheckBox.setEnabled(false);
jSavings2CheckBox.setEnabled(false);
////////////////////////////////////////////////////////
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jStatusPanel = new javax.swing.JPanel();
jStatusMessageLabel = new javax.swing.JLabel();
jProgressCompletionBar = new javax.swing.JProgressBar();
jMainPanel = new javax.swing.JPanel();
jMainTabbedPane = new javax.swing.JTabbedPane();
jLoginPanel = new javax.swing.JPanel();
jNameLabel = new javax.swing.JLabel();
jPasswordLabel = new javax.swing.JLabel();
jRoleLabel = new javax.swing.JLabel();
jLoginButton = new javax.swing.JButton();
jRegisterButton = new javax.swing.JButton();
jNameTextField = new javax.swing.JTextField();
jPasswordField = new javax.swing.JPasswordField();
jRoleSelectionBox = new javax.swing.JComboBox<>();
jCalculatorPanel = new javax.swing.JPanel();
jInput1Label = new javax.swing.JLabel();
jIntut2Label = new javax.swing.JLabel();
jCylinderHeightLabel = new javax.swing.JLabel();
jCylinderRadiusLabel = new javax.swing.JLabel();
jSphereRadiusLabel = new javax.swing.JLabel();
jOutputLabel = new javax.swing.JLabel();
jInput1TextField = new javax.swing.JTextField();
jInput2TextField = new javax.swing.JTextField();
jOutputTextField = new javax.swing.JTextField();
jCylinderHeightTextField = new javax.swing.JTextField();
jCylinderRadiusTextField = new javax.swing.JTextField();
jSphereRadiusTextField = new javax.swing.JTextField();
jAdditionButton = new javax.swing.JButton();
jSubtractionButton = new javax.swing.JButton();
jMultiplicationButton = new javax.swing.JButton();
jDivisionButton = new javax.swing.JButton();
jPowerButton = new javax.swing.JButton();
jVolumeOfCylinderButton = new javax.swing.JButton();
jVolumeOfSphereButton = new javax.swing.JButton();
jHeadOfficePanel = new javax.swing.JPanel();
jDisplayHeadOfficeDetailsButton = new javax.swing.JButton();
jEnterDOBButton = new javax.swing.JButton();
jHeadOfficeTextArea = new javax.swing.JTextArea();
jDOBTestResultTextArea = new javax.swing.JTextArea();
jEnterDOBTextField = new javax.swing.JTextField();
jEnterDOBLabel = new javax.swing.JLabel();
jEditHeadOfficeDetailsPanel = new javax.swing.JPanel();
jHeadOfficeInfoLabel = new javax.swing.JLabel();
jHeadOfficeNameLabel = new javax.swing.JLabel();
jHeadOfficeOpeningHoursLabel = new javax.swing.JLabel();
jHeadOfficeHouseNumberLabel = new javax.swing.JLabel();
jHeadOfficeStreetLabel = new javax.swing.JLabel();
jHeadOfficeCityLabel = new javax.swing.JLabel();
jHeadOfficePostcodeLabel = new javax.swing.JLabel();
jHeadOfficeCountryLabel = new javax.swing.JLabel();
jHeadOfficeNameTextField = new javax.swing.JTextField();
jHeadOfficeOpeningHoursTextField = new javax.swing.JTextField();
jHeadOfficeHouseNumberTextField = new javax.swing.JTextField();
jHeadOfficeStreetTextField = new javax.swing.JTextField();
jHeadOfficeCityTextField = new javax.swing.JTextField();
jHeadOfficePostcodeTextField = new javax.swing.JTextField();
jHeadOfficeCountryTextField = new javax.swing.JTextField();
jHeadOfficeSaveNewDetailsButton = new javax.swing.JButton();
jClientsPanel = new javax.swing.JPanel();
jAddCustomerButton = new javax.swing.JButton();
jClearCustomerFieldsButton = new javax.swing.JButton();
jRemoveCustomerButton = new javax.swing.JButton();
jFindCustomerButton = new javax.swing.JButton();
jDisplayCustomerDetailsButton = new javax.swing.JButton();
jDisplayCustomerAccountButton = new javax.swing.JButton();
jWithdrawButton = new javax.swing.JButton();
jDepositButton = new javax.swing.JButton();
jCustomerDetailsScrollPane = new javax.swing.JScrollPane();
jCustomerDetailsTextArea = new javax.swing.JTextArea();
jFirstnameTextField = new javax.swing.JTextField();
jSurnameTextField = new javax.swing.JTextField();
jDOBTextField = new javax.swing.JTextField();
jCustomerSinceTextField = new javax.swing.JTextField();
jName2TextField = new javax.swing.JTextField();
jHousenameTextField = new javax.swing.JTextField();
jHousenumberTextField = new javax.swing.JTextField();
jStreetTextField = new javax.swing.JTextField();
jAreaTextField = new javax.swing.JTextField();
jPostCodeTextField = new javax.swing.JTextField();
jTownTextField = new javax.swing.JTextField();
jCountryTextField = new javax.swing.JTextField();
jAmountTextField = new javax.swing.JTextField();
jSurnameLabel = new javax.swing.JLabel();
jFirstnameLabel = new javax.swing.JLabel();
jDOBLabel = new javax.swing.JLabel();
jName2Label = new javax.swing.JLabel();
jHousenameLabel = new javax.swing.JLabel();
jCustomerSinceLabel = new javax.swing.JLabel();
jHouseNoLabel = new javax.swing.JLabel();
jPostcodeLabel = new javax.swing.JLabel();
jAreaLabel = new javax.swing.JLabel();
jStreetLabel = new javax.swing.JLabel();
jTownLabel1 = new javax.swing.JLabel();
jCountryLabel = new javax.swing.JLabel();
jAmountLabel = new javax.swing.JLabel();
jFirstNameCheckBox = new javax.swing.JCheckBox();
jSurnameCheckBox = new javax.swing.JCheckBox();
jISACheckBox = new javax.swing.JCheckBox();
jCurrentCheckBox = new javax.swing.JCheckBox();
jSavings1CheckBox = new javax.swing.JCheckBox();
jSavings2CheckBox = new javax.swing.JCheckBox();
jAreaLabel1 = new javax.swing.JLabel();
jSortCodeTextField = new javax.swing.JTextField();
jAccountNoTextField = new javax.swing.JTextField();
jAreaLabel2 = new javax.swing.JLabel();
jProcessTransactionButton = new javax.swing.JButton();
jBranchesPanel = new javax.swing.JPanel();
jBranchDetailsScrollPane = new javax.swing.JScrollPane();
jBranchDetailsTextArea = new javax.swing.JTextArea();
jAddBranchButton = new javax.swing.JButton();
jClearBranchFieldsButton = new javax.swing.JButton();
jRemoveBranchButton = new javax.swing.JButton();
jDisplayBranchDetailsButton = new javax.swing.JButton();
jBranchManagerLabel = new javax.swing.JLabel();
jBranchOpeningHoursLabel = new javax.swing.JLabel();
jSortCodeLabel = new javax.swing.JLabel();
jBranchNameLabel = new javax.swing.JLabel();
jBranchHouseNumberLabel = new javax.swing.JLabel();
jBranchHouseNameLabel = new javax.swing.JLabel();
jBranchStreetLabel = new javax.swing.JLabel();
jBranchCityLabel = new javax.swing.JLabel();
jBranchPostcodeLabel = new javax.swing.JLabel();
jBranchAreaLabel = new javax.swing.JLabel();
jBranchCountryLabel = new javax.swing.JLabel();
jBranchManagerTextField = new javax.swing.JTextField();
jBranchOpeningHoursTextField = new javax.swing.JTextField();
jBranchSortCodeTextField = new javax.swing.JTextField();
jBranchNameTextField = new javax.swing.JTextField();
jBranchHouseNumberTextField = new javax.swing.JTextField();
jBranchHouseNameTextField = new javax.swing.JTextField();
jBranchStreetTextField = new javax.swing.JTextField();
jBranchTownTextField = new javax.swing.JTextField();
jBranchPostcodeTextField = new javax.swing.JTextField();
jBranchAreaTextField = new javax.swing.JTextField();
jBranchCountryTextField = new javax.swing.JTextField();
jMenuBarMain = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(102, 153, 255));
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jStatusPanel.setBackground(new java.awt.Color(204, 255, 255));
jStatusPanel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 3, true));
jStatusMessageLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
jStatusMessageLabel.setText("My first application is running");
javax.swing.GroupLayout jStatusPanelLayout = new javax.swing.GroupLayout(jStatusPanel);
jStatusPanel.setLayout(jStatusPanelLayout);
jStatusPanelLayout.setHorizontalGroup(
jStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jStatusPanelLayout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(jStatusMessageLabel)
.addGap(85, 85, 85)
.addComponent(jProgressCompletionBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jStatusPanelLayout.setVerticalGroup(
jStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jStatusPanelLayout.createSequentialGroup()
.addContainerGap(18, Short.MAX_VALUE)
.addGroup(jStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jProgressCompletionBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jStatusMessageLabel))
.addContainerGap())
);
jLoginPanel.setBackground(new java.awt.Color(204, 255, 255));
jLoginPanel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 3, true));
jNameLabel.setText("What is your name?");
jPasswordLabel.setText("Password");
jRoleLabel.setText("Role");
jLoginButton.setText("Login");
jLoginButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jLoginButtonActionPerformed(evt);
}
});
jRegisterButton.setText("Register");
jRegisterButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRegisterButtonActionPerformed(evt);
}
});
jNameTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jNameTextFieldActionPerformed(evt);
}
});
jRoleSelectionBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Please select an option", "Administrator", "Manager", "Advisor", "Customer" }));
jRoleSelectionBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRoleSelectionBoxActionPerformed(evt);
}
});
javax.swing.GroupLayout jLoginPanelLayout = new javax.swing.GroupLayout(jLoginPanel);
jLoginPanel.setLayout(jLoginPanelLayout);
jLoginPanelLayout.setHorizontalGroup(
jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jLoginPanelLayout.createSequentialGroup()
.addGap(25, 25, 25)
.addGroup(jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jLoginPanelLayout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPasswordLabel)
.addComponent(jRoleLabel)))
.addComponent(jPasswordField, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
.addComponent(jNameTextField))
.addGroup(jLoginPanelLayout.createSequentialGroup()
.addComponent(jLoginButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jRegisterButton))
.addComponent(jRoleSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(550, Short.MAX_VALUE))
.addGroup(jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jLoginPanelLayout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jNameLabel)
.addContainerGap(670, Short.MAX_VALUE)))
);
jLoginPanelLayout.setVerticalGroup(
jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jLoginPanelLayout.createSequentialGroup()
.addGap(67, 67, 67)
.addComponent(jNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPasswordLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jRoleLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jRoleSelectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 134, Short.MAX_VALUE)
.addGroup(jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jRegisterButton)
.addComponent(jLoginButton))
.addGap(24, 24, 24))
.addGroup(jLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jLoginPanelLayout.createSequentialGroup()
.addGap(41, 41, 41)
.addComponent(jNameLabel)
.addContainerGap(363, Short.MAX_VALUE)))
);
jMainTabbedPane.addTab("Login", jLoginPanel);
jInput1Label.setText("Input 1");
jIntut2Label.setText("Input 2");
jCylinderHeightLabel.setText("Height");
jCylinderRadiusLabel.setText("Radius");
jSphereRadiusLabel.setText("Radius");
jOutputLabel.setText("Output");
jInput1TextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jInput1TextFieldActionPerformed(evt);
}
});
jOutputTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jOutputTextFieldActionPerformed(evt);
}
});
jCylinderHeightTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCylinderHeightTextFieldActionPerformed(evt);
}
});
jSphereRadiusTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jSphereRadiusTextFieldActionPerformed(evt);
}
});
jAdditionButton.setText("+");
jAdditionButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jAdditionButtonActionPerformed(evt);
}
});
jSubtractionButton.setText("-");
jSubtractionButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jSubtractionButtonActionPerformed(evt);
}
});
jMultiplicationButton.setText("*");
jMultiplicationButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMultiplicationButtonActionPerformed(evt);
}
});
jDivisionButton.setText("/");
jDivisionButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jDivisionButtonActionPerformed(evt);
}
});
jPowerButton.setText("Power");
jPowerButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jPowerButtonActionPerformed(evt);
}
});
jVolumeOfCylinderButton.setText("Volume of Cylinder");
jVolumeOfCylinderButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jVolumeOfCylinderButtonActionPerformed(evt);
}
});
jVolumeOfSphereButton.setText("Volume of Sphere");
jVolumeOfSphereButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jVolumeOfSphereButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jCalculatorPanelLayout = new javax.swing.GroupLayout(jCalculatorPanel);
jCalculatorPanel.setLayout(jCalculatorPanelLayout);
jCalculatorPanelLayout.setHorizontalGroup(
jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addGap(27, 27, 27)
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jCalculatorPanelLayout.createSequentialGroup()
.addComponent(jSphereRadiusLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSphereRadiusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jCalculatorPanelLayout.createSequentialGroup()
.addComponent(jCylinderRadiusLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCylinderRadiusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCylinderHeightLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCylinderHeightTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jVolumeOfSphereButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jVolumeOfCylinderButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 257, Short.MAX_VALUE)))
.addComponent(jPowerButton)))
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addComponent(jInput1Label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jInput1TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addComponent(jIntut2Label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jInput2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jCalculatorPanelLayout.createSequentialGroup()
.addComponent(jOutputLabel)
.addGap(15, 15, 15)
.addComponent(jOutputTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jAdditionButton, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSubtractionButton, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jMultiplicationButton, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDivisionButton, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap(389, Short.MAX_VALUE))
);
jCalculatorPanelLayout.setVerticalGroup(
jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCalculatorPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jInput1Label)
.addComponent(jInput1TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jOutputLabel)
.addComponent(jOutputTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jIntut2Label)
.addComponent(jInput2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jAdditionButton)
.addComponent(jSubtractionButton)
.addComponent(jMultiplicationButton)
.addComponent(jDivisionButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPowerButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jVolumeOfCylinderButton)
.addGap(6, 6, 6)
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCylinderHeightLabel)
.addComponent(jCylinderHeightTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCylinderRadiusLabel)
.addComponent(jCylinderRadiusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jVolumeOfSphereButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jCalculatorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jSphereRadiusLabel)
.addComponent(jSphereRadiusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(169, Short.MAX_VALUE))
);
jMainTabbedPane.addTab("Calculator", jCalculatorPanel);
jDisplayHeadOfficeDetailsButton.setText("Display Head Office Details ");
jDisplayHeadOfficeDetailsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jDisplayHeadOfficeDetailsButtonActionPerformed(evt);
}
});
jEnterDOBButton.setText("Check");
jEnterDOBButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jEnterDOBButtonActionPerformed(evt);
}
});
jHeadOfficeTextArea.setColumns(20);
jHeadOfficeTextArea.setRows(5);
jDOBTestResultTextArea.setColumns(20);
jDOBTestResultTextArea.setRows(5);
jEnterDOBTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jEnterDOBTextFieldActionPerformed(evt);
}
});
jEnterDOBLabel.setText("Enter your DOB dd/mm/yy");
javax.swing.GroupLayout jHeadOfficePanelLayout = new javax.swing.GroupLayout(jHeadOfficePanel);
jHeadOfficePanel.setLayout(jHeadOfficePanelLayout);
jHeadOfficePanelLayout.setHorizontalGroup(
jHeadOfficePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jHeadOfficePanelLayout.createSequentialGroup()
.addGap(23, 23, 23)
.addGroup(jHeadOfficePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jHeadOfficeTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDisplayHeadOfficeDetailsButton))
.addGap(47, 47, 47)
.addGroup(jHeadOfficePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDOBTestResultTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jHeadOfficePanelLayout.createSequentialGroup()
.addComponent(jEnterDOBTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jEnterDOBButton))
.addComponent(jEnterDOBLabel))
.addGap(91, 344, Short.MAX_VALUE))
);
jHeadOfficePanelLayout.setVerticalGroup(
jHeadOfficePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jHeadOfficePanelLayout.createSequentialGroup()
.addGap(46, 46, 46)
.addComponent(jDisplayHeadOfficeDetailsButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jHeadOfficeTextArea, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE)
.addContainerGap())
.addGroup(jHeadOfficePanelLayout.createSequentialGroup()
.addGap(41, 41, 41)
.addComponent(jEnterDOBLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jHeadOfficePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jEnterDOBTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jEnterDOBButton))
.addGap(18, 18, 18)
.addComponent(jDOBTestResultTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jMainTabbedPane.addTab("Head Office", jHeadOfficePanel);
jHeadOfficeInfoLabel.setText("Edit Head Office Details Below");
jHeadOfficeNameLabel.setText("Name");
jHeadOfficeOpeningHoursLabel.setText("Opening Hours");
jHeadOfficeHouseNumberLabel.setText("House Number ");
jHeadOfficeStreetLabel.setText("Street");
jHeadOfficeCityLabel.setText("City");
jHeadOfficePostcodeLabel.setText("Postcode");
jHeadOfficeCountryLabel.setText("Country");
jHeadOfficeCityTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jHeadOfficeCityTextFieldActionPerformed(evt);
}
});
jHeadOfficeCountryTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jHeadOfficeCountryTextFieldActionPerformed(evt);
}
});
jHeadOfficeSaveNewDetailsButton.setText("Save new details");
jHeadOfficeSaveNewDetailsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jHeadOfficeSaveNewDetailsButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jEditHeadOfficeDetailsPanelLayout = new javax.swing.GroupLayout(jEditHeadOfficeDetailsPanel);
jEditHeadOfficeDetailsPanel.setLayout(jEditHeadOfficeDetailsPanelLayout);
jEditHeadOfficeDetailsPanelLayout.setHorizontalGroup(
jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addComponent(jHeadOfficeHouseNumberLabel)
.addGap(18, 18, 18))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addComponent(jHeadOfficeCountryLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addComponent(jHeadOfficePostcodeLabel)
.addGap(18, 18, 18))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jHeadOfficeStreetLabel)
.addComponent(jHeadOfficeCityLabel))
.addGap(35, 35, 35))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addComponent(jHeadOfficeOpeningHoursLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addComponent(jHeadOfficeNameLabel)
.addGap(31, 31, 31)))))
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jHeadOfficeOpeningHoursTextField)
.addComponent(jHeadOfficeNameTextField)
.addComponent(jHeadOfficeHouseNumberTextField)
.addComponent(jHeadOfficeStreetTextField)
.addComponent(jHeadOfficeCityTextField)
.addComponent(jHeadOfficePostcodeTextField)
.addComponent(jHeadOfficeCountryTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
.addGap(374, 374, 374))
.addGroup(jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGap(106, 106, 106)
.addComponent(jHeadOfficeInfoLabel))
.addGroup(jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGap(135, 135, 135)
.addComponent(jHeadOfficeSaveNewDetailsButton)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jEditHeadOfficeDetailsPanelLayout.setVerticalGroup(
jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jHeadOfficeInfoLabel)
.addGap(4, 4, 4)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHeadOfficeNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHeadOfficeNameLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHeadOfficeOpeningHoursTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHeadOfficeOpeningHoursLabel))
.addGap(5, 5, 5)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGap(29, 29, 29)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createSequentialGroup()
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHeadOfficeStreetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHeadOfficeStreetLabel))
.addGap(29, 29, 29))
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHeadOfficeCityTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHeadOfficeCityLabel)))
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHeadOfficePostcodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHeadOfficePostcodeLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHeadOfficeCountryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHeadOfficeCountryLabel)))
.addGroup(jEditHeadOfficeDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHeadOfficeHouseNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHeadOfficeHouseNumberLabel)))
.addGap(18, 18, 18)
.addComponent(jHeadOfficeSaveNewDetailsButton)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jMainTabbedPane.addTab("Edit Head Office Details", jEditHeadOfficeDetailsPanel);
jAddCustomerButton.setText("Add");
jAddCustomerButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jAddCustomerButtonActionPerformed(evt);
}
});
jClearCustomerFieldsButton.setText("Clear Fields");
jClearCustomerFieldsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jClearCustomerFieldsButtonActionPerformed(evt);
}
});
jRemoveCustomerButton.setText("Remove");
jRemoveCustomerButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRemoveCustomerButtonActionPerformed(evt);
}
});
jFindCustomerButton.setText("Find");
jFindCustomerButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jFindCustomerButtonActionPerformed(evt);
}
});
jDisplayCustomerDetailsButton.setText("Display All Customer Details ");
jDisplayCustomerDetailsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jDisplayCustomerDetailsButtonActionPerformed(evt);
}
});
jDisplayCustomerAccountButton.setText("Display Account");
jDisplayCustomerAccountButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jDisplayCustomerAccountButtonActionPerformed(evt);
}
});
jWithdrawButton.setText("Withdraw");
jWithdrawButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jWithdrawButtonActionPerformed(evt);
}
});
jDepositButton.setText("Deposit");
jDepositButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jDepositButtonActionPerformed(evt);
}
});
jCustomerDetailsTextArea.setColumns(20);
jCustomerDetailsTextArea.setRows(5);
jCustomerDetailsScrollPane.setViewportView(jCustomerDetailsTextArea);
jFirstnameTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jFirstnameTextFieldActionPerformed(evt);
}
});
jSurnameTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jSurnameTextFieldActionPerformed(evt);
}
});
jName2TextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jName2TextFieldActionPerformed(evt);
}
});
jHousenumberTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jHousenumberTextFieldActionPerformed(evt);
}
});
jStreetTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jStreetTextFieldActionPerformed(evt);
}
});
jPostCodeTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jPostCodeTextFieldActionPerformed(evt);
}
});
jAmountTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jAmountTextFieldActionPerformed(evt);
}
});
jSurnameLabel.setText("Surname");
jFirstnameLabel.setText("Firstname");
jDOBLabel.setText("DOB");
jName2Label.setText("Name");
jHousenameLabel.setText("housename");
jCustomerSinceLabel.setText("Customer since");
jHouseNoLabel.setText("House #");
jPostcodeLabel.setText("postcode");
jAreaLabel.setText("area");
jStreetLabel.setText("street");
jTownLabel1.setText("town");
jCountryLabel.setText("country");
jAmountLabel.setText("Amount");
jFirstNameCheckBox.setText("Search Firstname");
jFirstNameCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jFirstNameCheckBoxActionPerformed(evt);
}
});
jSurnameCheckBox.setText("Search Surname");
jSurnameCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jSurnameCheckBoxActionPerformed(evt);
}
});
jISACheckBox.setText("ISA");
jISACheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jISACheckBoxActionPerformed(evt);
}
});
jCurrentCheckBox.setText("Current");
jCurrentCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCurrentCheckBoxActionPerformed(evt);
}
});
jSavings1CheckBox.setText("Savings 1");
jSavings1CheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jSavings1CheckBoxActionPerformed(evt);
}
});
jSavings2CheckBox.setText("Savings 2");
jSavings2CheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jSavings2CheckBoxActionPerformed(evt);
}
});
jAreaLabel1.setText("Sort Code");
jAreaLabel2.setText("Account No");
jProcessTransactionButton.setText("Process Supermarket Transaction");
jProcessTransactionButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jProcessTransactionButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jClientsPanelLayout = new javax.swing.GroupLayout(jClientsPanel);
jClientsPanel.setLayout(jClientsPanelLayout);
jClientsPanelLayout.setHorizontalGroup(
jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addComponent(jAddCustomerButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jClearCustomerFieldsButton))
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jFirstnameLabel)
.addComponent(jDOBLabel)
.addComponent(jName2Label))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jName2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jFirstnameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDOBTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGap(67, 67, 67)
.addComponent(jPostcodeLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCountryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClientsPanelLayout.createSequentialGroup()
.addGap(55, 55, 55)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClientsPanelLayout.createSequentialGroup()
.addComponent(jStreetLabel)
.addGap(29, 29, 29)
.addComponent(jStreetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClientsPanelLayout.createSequentialGroup()
.addComponent(jHousenameLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jHousenameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jRemoveCustomerButton)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCustomerSinceLabel)
.addComponent(jSurnameLabel)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCustomerSinceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jSurnameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClientsPanelLayout.createSequentialGroup()
.addComponent(jCountryLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPostCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jAreaLabel)
.addComponent(jTownLabel1))
.addGap(41, 41, 41)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jAreaTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTownTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jClientsPanelLayout.createSequentialGroup()
.addComponent(jHouseNoLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jHousenumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addComponent(jSurnameCheckBox)
.addGap(47, 47, 47)
.addComponent(jProcessTransactionButton))
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addComponent(jAreaLabel1)
.addGap(18, 18, 18)
.addComponent(jSortCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jAreaLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jAccountNoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jFirstNameCheckBox)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addComponent(jFindCustomerButton)
.addGap(8, 8, 8)
.addComponent(jDisplayCustomerAccountButton)
.addGap(18, 18, 18)
.addComponent(jAmountLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jAmountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDisplayCustomerDetailsButton)
.addComponent(jCustomerDetailsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jWithdrawButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jDepositButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addComponent(jISACheckBox)
.addGap(39, 39, 39)
.addComponent(jSavings1CheckBox))
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addComponent(jCurrentCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jSavings2CheckBox)))))))))
.addContainerGap(80, Short.MAX_VALUE))
);
jClientsPanelLayout.setVerticalGroup(
jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jAddCustomerButton)
.addComponent(jRemoveCustomerButton)
.addComponent(jClearCustomerFieldsButton))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jFirstnameLabel)
.addComponent(jFirstnameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jSurnameLabel)
.addComponent(jSurnameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jDOBLabel)
.addComponent(jCustomerSinceLabel)
.addComponent(jCustomerSinceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDOBTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jName2Label)
.addComponent(jName2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(12, 12, 12))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jHousenameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHousenameLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jHouseNoLabel)
.addComponent(jHousenumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jStreetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jStreetLabel)))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGap(9, 9, 9)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTownLabel1)
.addComponent(jAreaTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClientsPanelLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCountryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPostcodeLabel))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jAreaLabel)
.addComponent(jTownTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPostCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jCountryLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jAreaLabel1)
.addComponent(jSortCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jAccountNoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jAreaLabel2))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jFindCustomerButton)
.addComponent(jDisplayCustomerAccountButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jFirstNameCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(jClientsPanelLayout.createSequentialGroup()
.addComponent(jDisplayCustomerDetailsButton)
.addGap(0, 0, 0)
.addComponent(jCustomerDetailsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jAmountLabel)
.addComponent(jAmountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jWithdrawButton)
.addComponent(jISACheckBox)
.addComponent(jSavings1CheckBox)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDepositButton)
.addComponent(jCurrentCheckBox)
.addComponent(jSavings2CheckBox))
.addGap(25, 25, 25)))
.addGroup(jClientsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jSurnameCheckBox)
.addComponent(jProcessTransactionButton))))
.addContainerGap())
);
jMainTabbedPane.addTab("Clients", jClientsPanel);
jBranchDetailsTextArea.setColumns(20);
jBranchDetailsTextArea.setRows(5);
jBranchDetailsScrollPane.setViewportView(jBranchDetailsTextArea);
jAddBranchButton.setText("Add");
jAddBranchButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jAddBranchButtonActionPerformed(evt);
}
});
jClearBranchFieldsButton.setText("Clear Fields");
jClearBranchFieldsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jClearBranchFieldsButtonActionPerformed(evt);
}
});
jRemoveBranchButton.setText("Remove");
jRemoveBranchButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRemoveBranchButtonActionPerformed(evt);
}
});
jDisplayBranchDetailsButton.setText("Display Branch Details ");
jDisplayBranchDetailsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jDisplayBranchDetailsButtonActionPerformed(evt);
}
});
jBranchManagerLabel.setText("Manager ");
jBranchOpeningHoursLabel.setText("Opening Hours");
jSortCodeLabel.setText("Sort Code");
jBranchNameLabel.setText("Name");
jBranchHouseNumberLabel.setText("House Number ");
jBranchHouseNameLabel.setText("House Name");
jBranchStreetLabel.setText("Street");
jBranchCityLabel.setText("City");
jBranchPostcodeLabel.setText("Postcode");
jBranchAreaLabel.setText("Area");
jBranchCountryLabel.setText("Country");
jBranchTownTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBranchTownTextFieldActionPerformed(evt);
}
});
jBranchPostcodeTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBranchPostcodeTextFieldActionPerformed(evt);
}
});
jBranchAreaTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBranchAreaTextFieldActionPerformed(evt);
}
});
jBranchCountryTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBranchCountryTextFieldActionPerformed(evt);
}
});
javax.swing.GroupLayout jBranchesPanelLayout = new javax.swing.GroupLayout(jBranchesPanel);
jBranchesPanel.setLayout(jBranchesPanelLayout);
jBranchesPanelLayout.setHorizontalGroup(
jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addComponent(jAddBranchButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addComponent(jClearBranchFieldsButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jRemoveBranchButton))
.addComponent(jBranchNameLabel)))
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jBranchesPanelLayout.createSequentialGroup()
.addComponent(jSortCodeLabel)
.addGap(18, 18, 18)
.addComponent(jBranchSortCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addComponent(jBranchManagerLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBranchManagerTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addComponent(jBranchOpeningHoursLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBranchOpeningHoursTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jBranchNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jBranchesPanelLayout.createSequentialGroup()
.addComponent(jBranchHouseNumberLabel)
.addGap(3, 3, 3)
.addComponent(jBranchHouseNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jBranchesPanelLayout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addComponent(jBranchCountryLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jBranchCountryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jBranchHouseNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jBranchesPanelLayout.createSequentialGroup()
.addComponent(jBranchPostcodeLabel)
.addGap(18, 18, 18))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jBranchesPanelLayout.createSequentialGroup()
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jBranchStreetLabel)
.addComponent(jBranchCityLabel))
.addGap(20, 20, 20)))
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addComponent(jBranchAreaLabel)
.addGap(48, 48, 48)))
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jBranchAreaTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
.addComponent(jBranchPostcodeTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
.addComponent(jBranchTownTextField)
.addComponent(jBranchStreetTextField)))))))
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jBranchHouseNameLabel)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDisplayBranchDetailsButton)
.addComponent(jBranchDetailsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(135, Short.MAX_VALUE))
);
jBranchesPanelLayout.setVerticalGroup(
jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jAddBranchButton)
.addComponent(jDisplayBranchDetailsButton)
.addComponent(jRemoveBranchButton)
.addComponent(jClearBranchFieldsButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchManagerTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jBranchManagerLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jBranchOpeningHoursLabel)
.addComponent(jBranchOpeningHoursTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(4, 4, 4)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchSortCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jSortCodeLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jBranchNameLabel))
.addGap(1, 1, 1)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchHouseNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jBranchHouseNumberLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchHouseNameLabel)
.addComponent(jBranchHouseNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jBranchesPanelLayout.createSequentialGroup()
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchStreetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jBranchStreetLabel))
.addGap(29, 29, 29))
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchTownTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jBranchCityLabel)))
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchPostcodeLabel)
.addComponent(jBranchPostcodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jBranchDetailsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchAreaLabel)
.addComponent(jBranchAreaTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jBranchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBranchCountryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jBranchCountryLabel)))
);
jMainTabbedPane.addTab("Branches", jBranchesPanel);
javax.swing.GroupLayout jMainPanelLayout = new javax.swing.GroupLayout(jMainPanel);
jMainPanel.setLayout(jMainPanelLayout);
jMainPanelLayout.setHorizontalGroup(
jMainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jMainTabbedPane)
);
jMainPanelLayout.setVerticalGroup(
jMainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jMainTabbedPane)
);
jMenuBarMain.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jMenuBarMain.setForeground(new java.awt.Color(102, 153, 255));
jMenu1.setText("File");
jMenuBarMain.add(jMenu1);
jMenu2.setText("Edit");
jMenuBarMain.add(jMenu2);
setJMenuBar(jMenuBarMain);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jMainPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jStatusPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jMainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jStatusPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jLoginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jLoginButtonActionPerformed
// if((theUser.isUser(jNameTextField.getText(),String.valueOf(jPasswordField.getPassword()))==true))
if(theUser.isCustomer(jNameTextField.getText(),jPasswordField.getText(),jRoleSelectionBox.getSelectedItem().toString())==true)
{
jStatusMessageLabel.setText(jNameTextField.getText() + " is logged in as " +jRoleSelectionBox.getSelectedItem().toString()+" .");
jMainTabbedPane.addTab("Calculator", jTabInMemory1);
jMainTabbedPane.addTab("Head Office", jTabInMemory2);}
else{
jStatusMessageLabel.setText("Cannot login, please check login and password");
}
if(theUser.isManager(jNameTextField.getText(),jPasswordField.getText(),jRoleSelectionBox.getSelectedItem().toString())==true)
{
jStatusMessageLabel.setText(jNameTextField.getText() + " is logged in as " +jRoleSelectionBox.getSelectedItem().toString()+" .");
jMainTabbedPane.addTab("Calculator", jTabInMemory1);
jMainTabbedPane.addTab("Head Office", jTabInMemory2);
jMainTabbedPane.addTab("Edit Head Office Details", jTabInMemory3);
jMainTabbedPane.addTab("Customer Details", jTabInMemory4);
jMainTabbedPane.addTab("Branches", jTabInMemory5);
}
else{
jStatusMessageLabel.setText("Cannot login, please check login and password");
}
if(theUser.isAdministrator(jNameTextField.getText(),jPasswordField.getText(),jRoleSelectionBox.getSelectedItem().toString())==true)
{
jStatusMessageLabel.setText(jNameTextField.getText() + " is logged in as " +jRoleSelectionBox.getSelectedItem().toString()+" .");
jMainTabbedPane.addTab("Calculator", jTabInMemory1);
jMainTabbedPane.addTab("Head Office", jTabInMemory2);
jMainTabbedPane.addTab("Edit Head Office Details", jTabInMemory3);
// jHeadOfficeSaveNewDetailsButton.setEnabled(false);
}
else{
jStatusMessageLabel.setText("Cannot login, please check login and password");
}
if(theUser.isAdvisor(jNameTextField.getText(),jPasswordField.getText(),jRoleSelectionBox.getSelectedItem().toString())==true)
{
jStatusMessageLabel.setText(jNameTextField.getText() + " is logged in as " +jRoleSelectionBox.getSelectedItem().toString()+" .");
jMainTabbedPane.addTab("Calculator", jTabInMemory1);
jMainTabbedPane.addTab("Head Office", jTabInMemory2);}
else{
jStatusMessageLabel.setText("Cannot login, please check login and password");
}
}//GEN-LAST:event_jLoginButtonActionPerformed
private void jMultiplicationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMultiplicationButtonActionPerformed
double input1 = Double.valueOf(jInput1TextField.getText());
double input2 = Double.valueOf(jInput2TextField.getText());
double output = input1 * input2;
DecimalFormat df = new DecimalFormat("#.###");
jOutputTextField.setText(String.valueOf(df.format(output)));
}//GEN-LAST:event_jMultiplicationButtonActionPerformed
private void jDivisionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDivisionButtonActionPerformed
double input1 = Double.valueOf(jInput1TextField.getText());
double input2 = Double.valueOf(jInput2TextField.getText());
double output = input1 / input2;
if(this.isDivisorZero()==true){
jOutputTextField.setText("Cannot divide by zero");}
else
{
DecimalFormat df = new DecimalFormat("#.###");
jOutputTextField.setText(String.valueOf(df.format(output)));}
}//GEN-LAST:event_jDivisionButtonActionPerformed
private void jAdditionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAdditionButtonActionPerformed
double input1 = Double.valueOf(jInput1TextField.getText());
double input2 = Double.valueOf(jInput2TextField.getText());
BigDecimal input1rounded = BigDecimal.valueOf(input1);
BigDecimal input2rounded = BigDecimal.valueOf(input2);
BigDecimal result = input1rounded.add(input2rounded);
jOutputTextField.setText(String.valueOf(result));
}//GEN-LAST:event_jAdditionButtonActionPerformed
private void jSubtractionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSubtractionButtonActionPerformed
double input1 = Double.valueOf(jInput1TextField.getText());
double input2 = Double.valueOf(jInput2TextField.getText());
BigDecimal input1rounded = BigDecimal.valueOf(input1);
BigDecimal input2rounded = BigDecimal.valueOf(input2);
BigDecimal result = input1rounded.subtract(input2rounded);
jOutputTextField.setText(String.valueOf(result));
}//GEN-LAST:event_jSubtractionButtonActionPerformed
private void jOutputTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jOutputTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jOutputTextFieldActionPerformed
private void jPowerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPowerButtonActionPerformed
double input1 = Double.valueOf(jInput1TextField.getText());
double input2 = Double.valueOf(jInput2TextField.getText());
double output = this.power(input1, input2);
jOutputTextField.setText(String.valueOf(output));
}//GEN-LAST:event_jPowerButtonActionPerformed
private void jVolumeOfCylinderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jVolumeOfCylinderButtonActionPerformed
double output = this.cylinderVolume();
jOutputTextField.setText(String.valueOf(output)); // TODO add your handling code here:
}//GEN-LAST:event_jVolumeOfCylinderButtonActionPerformed
private void jCylinderHeightTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCylinderHeightTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jCylinderHeightTextFieldActionPerformed
private void jVolumeOfSphereButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jVolumeOfSphereButtonActionPerformed
double output = this.sphereVolume();
jOutputTextField.setText(String.valueOf(output));
}//GEN-LAST:event_jVolumeOfSphereButtonActionPerformed
private void jSphereRadiusTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSphereRadiusTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jSphereRadiusTextFieldActionPerformed
private void jInput1TextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jInput1TextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jInput1TextFieldActionPerformed
private void jDisplayHeadOfficeDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDisplayHeadOfficeDetailsButtonActionPerformed
theHeadOfficeBranch.LoadFromFile();//theHeadOfficeBranch.EditAddress("Banking House", "Stoke Road", 22, "Barclays Bank", "Berkshire", "SL2 5AW", "Slough", "United Kingdom");
theHeadOfficeBranch.Display(jHeadOfficeTextArea); // TODO add your handling code here:
}//GEN-LAST:event_jDisplayHeadOfficeDetailsButtonActionPerformed
private void jEnterDOBTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEnterDOBTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jEnterDOBTextFieldActionPerformed
private void jEnterDOBButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEnterDOBButtonActionPerformed
try {
if(theCustomer.CheckDOB(String.valueOf(jEnterDOBTextField.getText())) == true){
jDOBTestResultTextArea.setText("This DOB matches Customer DOB");
}
else{
jDOBTestResultTextArea.setText("This DOB does not match Customer DOB");
}
} catch (ParseException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jEnterDOBButtonActionPerformed
private void jRegisterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRegisterButtonActionPerformed
if(theUser.roleSelected(jRoleSelectionBox.getSelectedItem().toString())==true){
try {
if((theUser.isRegistered(jNameTextField.getText(),jPasswordField.getText(),jRoleSelectionBox.getSelectedItem().toString())==true)){
jStatusMessageLabel.setText(jNameTextField.getText() + " is Registered..Please log in");
}
else{
jStatusMessageLabel.setText(jNameTextField.getText() + " Did not Register.");
}
}
catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}
else {
jStatusMessageLabel.setText(jNameTextField.getText() + " Please select a role.");
}
}//GEN-LAST:event_jRegisterButtonActionPerformed
private void jRoleSelectionBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRoleSelectionBoxActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jRoleSelectionBoxActionPerformed
private void jHeadOfficeCountryTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jHeadOfficeCountryTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jHeadOfficeCountryTextFieldActionPerformed
private void jHeadOfficeCityTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jHeadOfficeCityTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jHeadOfficeCityTextFieldActionPerformed
private void jHeadOfficeSaveNewDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jHeadOfficeSaveNewDetailsButtonActionPerformed
this.theHeadOfficeBranch.Edit(jHeadOfficeOpeningHoursTextField.getText(),
new IAddress( jHeadOfficeNameTextField.getText(),Integer.valueOf(jHeadOfficeHouseNumberTextField.getText()), jHeadOfficeStreetTextField.getText(),
jHeadOfficePostcodeTextField.getText(),jHeadOfficeCityTextField.getText(),jHeadOfficeCountryTextField.getText(), "",""));
try {
this.theHeadOfficeBranch.saveToFile(false);
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jHeadOfficeSaveNewDetailsButtonActionPerformed
private void jNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jNameTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jNameTextFieldActionPerformed
private void jAddCustomerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAddCustomerButtonActionPerformed
{
if(theCustomer!=null){
System.out.print("The customer is instantiated"+"\n");
}
else{System.out.print("The customer is NOT instantiated"+"\n");}
try {
theCustomer = new Customer();
theCustomer.Edit(jFirstnameTextField.getText(), jSurnameTextField.getText(), jDOBTextField.getText(), jCustomerSinceTextField.getText(),
new IAddress(jName2TextField.getText(), Integer.valueOf(jHousenumberTextField.getText()),jHousenameTextField.getText(),
jStreetTextField.getText(),jTownTextField.getText(),jPostCodeTextField.getText(),jAreaTextField.getText(),jCountryTextField.getText()),
new CurrentAccount(jSortCodeTextField.getText(),jAccountNoTextField.getText()));
}
catch (ParseException ex) {
System.out.print("Unable to parse the text field to a date - either DOB or customer since or both");
}
}
try {
theCustomerList.add(theCustomer);
theCustomerList.saveToFile(true);
}
catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jAddCustomerButtonActionPerformed
private void jPostCodeTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPostCodeTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jPostCodeTextFieldActionPerformed
private void jName2TextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jName2TextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jName2TextFieldActionPerformed
private void jHousenumberTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jHousenumberTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jHousenumberTextFieldActionPerformed
private void jSurnameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSurnameTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jSurnameTextFieldActionPerformed
private void jFirstnameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFirstnameTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jFirstnameTextFieldActionPerformed
private void jStreetTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jStreetTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jStreetTextFieldActionPerformed
private void jDisplayCustomerDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDisplayCustomerDetailsButtonActionPerformed
theCustomerList.display(jCustomerDetailsTextArea);
}//GEN-LAST:event_jDisplayCustomerDetailsButtonActionPerformed
private void jRemoveCustomerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRemoveCustomerButtonActionPerformed
try {
theCustomerList.remove(jFirstnameTextField.getText(), jSurnameTextField.getText()); // TODO add your handling code here:
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jRemoveCustomerButtonActionPerformed
private void jClearCustomerFieldsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jClearCustomerFieldsButtonActionPerformed
jFirstnameTextField.setText("");
jSurnameTextField.setText("");
jDOBTextField.setText("");
jCustomerSinceTextField.setText("");
jName2TextField.setText("");
jHousenumberTextField.setText("");
jHousenameTextField.setText("");
jStreetTextField.setText("");
jAreaTextField.setText("");
jTownTextField.setText("");
jPostCodeTextField.setText("");
jCountryTextField.setText("");
}//GEN-LAST:event_jClearCustomerFieldsButtonActionPerformed
private void jAddBranchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAddBranchButtonActionPerformed
{
if(theBranch!=null){
System.out.print("The customer is instantiated"+"\n");
}
else{System.out.print("The customer is NOT instantiated"+"\n");}
theBranch = new Branch();
theBranch.Edit(jBranchManagerTextField.getText(), jBranchOpeningHoursTextField.getText(), jBranchSortCodeTextField.getText(),
new IAddress(jBranchNameTextField.getText(),Integer.valueOf(jBranchHouseNumberTextField.getText()), jBranchHouseNameTextField.getText(), jBranchStreetTextField.getText(),
jBranchTownTextField.getText(),jBranchPostcodeTextField.getText(),jBranchAreaTextField.getText(),jBranchCountryTextField.getText()));
}
try {
theBranchList.Branches.add(theBranch);
theBranchList.saveToFile(true);
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jAddBranchButtonActionPerformed
private void jClearBranchFieldsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jClearBranchFieldsButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jClearBranchFieldsButtonActionPerformed
private void jRemoveBranchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRemoveBranchButtonActionPerformed
try {
theBranchList.remove(jBranchManagerTextField.getText()); // TODO add your handling code here:
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jRemoveBranchButtonActionPerformed
private void jDisplayBranchDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDisplayBranchDetailsButtonActionPerformed
theBranchList.display(jBranchDetailsTextArea);
}//GEN-LAST:event_jDisplayBranchDetailsButtonActionPerformed
private void jBranchTownTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBranchTownTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jBranchTownTextFieldActionPerformed
private void jBranchCountryTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBranchCountryTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jBranchCountryTextFieldActionPerformed
private void jBranchPostcodeTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBranchPostcodeTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jBranchPostcodeTextFieldActionPerformed
private void jBranchAreaTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBranchAreaTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jBranchAreaTextFieldActionPerformed
private void jFindCustomerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFindCustomerButtonActionPerformed
String textFieldToCompare = "";
switch(searchSelection){
case 1: textFieldToCompare = jFirstnameTextField.getText();
break;
case 2: textFieldToCompare = jSurnameTextField.getText();
break;
case 3: textFieldToCompare = jDOBTextField.getText();
break;
}
theCustomerList.FindCustomerz(searchSelection,textFieldToCompare);
int SelectedCustomer = theCustomerList.getCustomerIndex();
theCustomerList.getClients().get(SelectedCustomer).Display(false,jCustomerDetailsTextArea);
}//GEN-LAST:event_jFindCustomerButtonActionPerformed
private void jFirstNameCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFirstNameCheckBoxActionPerformed
if(jFirstNameCheckBox.isSelected()) {
jSurnameCheckBox.setSelected(false);
//jDOBCheckBox.setSelected(false);
searchSelection = 1;
} // TODO add your handling code here:
}//GEN-LAST:event_jFirstNameCheckBoxActionPerformed
private void jSurnameCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSurnameCheckBoxActionPerformed
if(jSurnameCheckBox.isSelected()) {
jFirstNameCheckBox.setSelected(false);
//jDOBCheckBox.setSelected(false);
searchSelection = 2;
} // TODO add your handling code here:
}//GEN-LAST:event_jSurnameCheckBoxActionPerformed
private void jDisplayCustomerAccountButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDisplayCustomerAccountButtonActionPerformed
String textFieldToCompare = "";
switch(searchSelection){
case 1: textFieldToCompare = jFirstnameTextField.getText();
break;
case 2: textFieldToCompare = jSurnameTextField.getText();
break;
case 3: textFieldToCompare = jDOBTextField.getText();
break;
}
theCustomerList.DisplayCustomerAccount(searchSelection,textFieldToCompare,jCustomerDetailsTextArea); // TODO add your handling code here:
}//GEN-LAST:event_jDisplayCustomerAccountButtonActionPerformed
private void jAmountTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAmountTextFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jAmountTextFieldActionPerformed
private void jWithdrawButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jWithdrawButtonActionPerformed
String textFieldToCompare = "";
switch(searchSelection){
case 1: textFieldToCompare = jFirstnameTextField.getText();
break;
case 2: textFieldToCompare = jSurnameTextField.getText();
break;
case 3: textFieldToCompare = jDOBTextField.getText();
break;
}
if(theCustomer!=null){
System.out.print("The customer is instantiated"+"\n");
}
else{System.out.print("The customer is NOT instantiated"+"\n");}
int SelectedCustomer = theCustomerList.getCustomerIndex();
if(theCustomerList.FindCustomerz(searchSelection,textFieldToCompare)) // sets value of getCustomerIndex()
//Stops null from being returned
if(jCurrentCheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersCurrentAccount().Withdrawal(Double.valueOf(jAmountTextField.getText()));
theCustomerList.getClients().get(SelectedCustomer).getCustomersCurrentAccount().calculateAvailableBalance();
}
if(jISACheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersISAAccount().Withdrawal(Double.valueOf(jAmountTextField.getText()));
}
if(jSavings1CheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersSavingAccount1().Withdrawal(Double.valueOf(jAmountTextField.getText()));
}
if(jSavings2CheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersSavingAccount2().Withdrawal(Double.valueOf(jAmountTextField.getText()));
}
else{
jCustomerDetailsTextArea.setText("Customer not found");
}
theCustomerList.getClients().get(SelectedCustomer).DisplayCustomerAccount(false,jCustomerDetailsTextArea);
}//GEN-LAST:event_jWithdrawButtonActionPerformed
private void jDepositButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDepositButtonActionPerformed
String textFieldToCompare = "";
switch(searchSelection){
case 1: textFieldToCompare = jFirstnameTextField.getText();
break;
case 2: textFieldToCompare = jSurnameTextField.getText();
break;
case 3: textFieldToCompare = jDOBTextField.getText();
break;
}
if(theCustomer!=null){
System.out.print("The customer is instantiated"+"\n");
}
else{System.out.print("The customer is NOT instantiated"+"\n");}
int SelectedCustomer = theCustomerList.getCustomerIndex();
if(theCustomerList.FindCustomerz(searchSelection,textFieldToCompare)) // sets value of getCustomerIndex()
//Stops null from being returned
if(jCurrentCheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersCurrentAccount().Deposit(Double.valueOf(jAmountTextField.getText()));
theCustomerList.getClients().get(SelectedCustomer).getCustomersCurrentAccount().calculateAvailableBalance();
}
if(jISACheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersISAAccount().Deposit(Double.valueOf(jAmountTextField.getText()));
}
if(jSavings1CheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersSavingAccount1().Deposit(Double.valueOf(jAmountTextField.getText()));
}
if(jSavings2CheckBox.isSelected()){
theCustomerList.getClients().get(SelectedCustomer).getCustomersSavingAccount2().Deposit(Double.valueOf(jAmountTextField.getText()));
}
else{
jCustomerDetailsTextArea.setText("Customer not found");
}
theCustomerList.getClients().get(SelectedCustomer).DisplayCustomerAccount(false,jCustomerDetailsTextArea);
}//GEN-LAST:event_jDepositButtonActionPerformed
private void jISACheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jISACheckBoxActionPerformed
if(jISACheckBox.isSelected()){
jCurrentCheckBox.setSelected(false);
jSavings1CheckBox.setSelected(false);
jSavings2CheckBox.setSelected(false);}
//searchSelection = 1; // TODO add your handling code here:
}//GEN-LAST:event_jISACheckBoxActionPerformed
private void jCurrentCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCurrentCheckBoxActionPerformed
if(jCurrentCheckBox.isSelected()) {
jISACheckBox.setSelected(false);
jSavings1CheckBox.setSelected(false);
jSavings2CheckBox.setSelected(false);}
}//GEN-LAST:event_jCurrentCheckBoxActionPerformed
private void jSavings1CheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSavings1CheckBoxActionPerformed
if(jSavings1CheckBox.isSelected()) {
jCurrentCheckBox.setSelected(false);
jISACheckBox.setSelected(false);
jSavings2CheckBox.setSelected(false);}
}//GEN-LAST:event_jSavings1CheckBoxActionPerformed
private void jSavings2CheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSavings2CheckBoxActionPerformed
if(jSavings2CheckBox.isSelected()) {
jCurrentCheckBox.setSelected(false);
jISACheckBox.setSelected(false);
jSavings1CheckBox.setSelected(false);}
}//GEN-LAST:event_jSavings2CheckBoxActionPerformed
private void jProcessTransactionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jProcessTransactionButtonActionPerformed
try {
String SortCode = server.readInputData();
String AccountNumber = server.readInputData();
Double cost = Double.valueOf(server.readInputData());
if(theCustomerList.findAccount(SortCode, AccountNumber)==null){
server.sendToClient("Sort code and/or account number does not match any customers in Bank database");
}
else{
if(theCustomerList.findAccount(SortCode, AccountNumber).getCustomersCurrentAccount().performTransaction(cost)==false){
System.out.println("Transaction Declined");
server.sendToClient("Transaction Declined");
}
else{
System.out.println("Transaction Approved");
server.sendToClient("Transaction Approved");
}
}
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jProcessTransactionButtonActionPerformed
private boolean isDivisorZero(){
double input2 = Double.valueOf(jInput2TextField.getText());
boolean answer = true;
if(input2==0){
answer = true;
}
else{
answer = false;
}
return answer;
}
private double power(double base, double exponent){
double output = 1;
while(exponent>0){
output = output * base;
exponent--;
}
return output;
}
private double cylinderVolume(){
//volume = πr^2h, where r = radius and h = height;
double pi = 3.14159265359;
double radius = Double.valueOf(jCylinderRadiusTextField.getText());
double exponent = 2;
double height = Double.valueOf(jCylinderHeightTextField.getText());
double output = pi * this.power(radius, exponent) * height;
// the middle part squares the radius and outputs it to join the rest of the forumula
return output; }
private double sphereVolume(){
// Volume = (4/3)πr^3
double pi = 3.14159265359;
double radius = Double.valueOf(jSphereRadiusTextField.getText());
double exponent = 3;
double output = (4/3) * pi * this.power(radius, exponent);
return output;
}
private void LoadAllFromFile(){
try {
theCustomerList.loadFromFile(); // TODO add your handling code here:
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParseException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
try {
theBranchList.loadFromFile(); // TODO add your handling code here:
} catch (IOException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParseException ex) {
Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainJFrame().setVisible(true);
}
});
}
private CustomerList theCustomerList;
private Customer theCustomer;
private Branch theBranch;
private BranchList theBranchList;
private User theUser;
private Branch theHeadOfficeBranch;
private int searchSelection;
private BankServer server;
private java.awt.Component jTabInMemory1;
private java.awt.Component jTabInMemory2;
private java.awt.Component jTabInMemory3;
private java.awt.Component jTabInMemory4;
private java.awt.Component jTabInMemory5;
private SimpleDateFormat simpledateformat;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField jAccountNoTextField;
private javax.swing.JButton jAddBranchButton;
private javax.swing.JButton jAddCustomerButton;
private javax.swing.JButton jAdditionButton;
private javax.swing.JLabel jAmountLabel;
private javax.swing.JTextField jAmountTextField;
private javax.swing.JLabel jAreaLabel;
private javax.swing.JLabel jAreaLabel1;
private javax.swing.JLabel jAreaLabel2;
private javax.swing.JTextField jAreaTextField;
private javax.swing.JLabel jBranchAreaLabel;
private javax.swing.JTextField jBranchAreaTextField;
private javax.swing.JLabel jBranchCityLabel;
private javax.swing.JLabel jBranchCountryLabel;
private javax.swing.JTextField jBranchCountryTextField;
private javax.swing.JScrollPane jBranchDetailsScrollPane;
private javax.swing.JTextArea jBranchDetailsTextArea;
private javax.swing.JLabel jBranchHouseNameLabel;
private javax.swing.JTextField jBranchHouseNameTextField;
private javax.swing.JLabel jBranchHouseNumberLabel;
private javax.swing.JTextField jBranchHouseNumberTextField;
private javax.swing.JLabel jBranchManagerLabel;
private javax.swing.JTextField jBranchManagerTextField;
private javax.swing.JLabel jBranchNameLabel;
private javax.swing.JTextField jBranchNameTextField;
private javax.swing.JLabel jBranchOpeningHoursLabel;
private javax.swing.JTextField jBranchOpeningHoursTextField;
private javax.swing.JLabel jBranchPostcodeLabel;
private javax.swing.JTextField jBranchPostcodeTextField;
private javax.swing.JTextField jBranchSortCodeTextField;
private javax.swing.JLabel jBranchStreetLabel;
private javax.swing.JTextField jBranchStreetTextField;
private javax.swing.JTextField jBranchTownTextField;
private javax.swing.JPanel jBranchesPanel;
private javax.swing.JPanel jCalculatorPanel;
private javax.swing.JButton jClearBranchFieldsButton;
private javax.swing.JButton jClearCustomerFieldsButton;
private javax.swing.JPanel jClientsPanel;
private javax.swing.JLabel jCountryLabel;
private javax.swing.JTextField jCountryTextField;
private javax.swing.JCheckBox jCurrentCheckBox;
private javax.swing.JScrollPane jCustomerDetailsScrollPane;
private javax.swing.JTextArea jCustomerDetailsTextArea;
private javax.swing.JLabel jCustomerSinceLabel;
private javax.swing.JTextField jCustomerSinceTextField;
private javax.swing.JLabel jCylinderHeightLabel;
private javax.swing.JTextField jCylinderHeightTextField;
private javax.swing.JLabel jCylinderRadiusLabel;
private javax.swing.JTextField jCylinderRadiusTextField;
private javax.swing.JLabel jDOBLabel;
private javax.swing.JTextArea jDOBTestResultTextArea;
private javax.swing.JTextField jDOBTextField;
private javax.swing.JButton jDepositButton;
private javax.swing.JButton jDisplayBranchDetailsButton;
private javax.swing.JButton jDisplayCustomerAccountButton;
private javax.swing.JButton jDisplayCustomerDetailsButton;
private javax.swing.JButton jDisplayHeadOfficeDetailsButton;
private javax.swing.JButton jDivisionButton;
private javax.swing.JPanel jEditHeadOfficeDetailsPanel;
private javax.swing.JButton jEnterDOBButton;
private javax.swing.JLabel jEnterDOBLabel;
private javax.swing.JTextField jEnterDOBTextField;
private javax.swing.JButton jFindCustomerButton;
private javax.swing.JCheckBox jFirstNameCheckBox;
private javax.swing.JLabel jFirstnameLabel;
private javax.swing.JTextField jFirstnameTextField;
private javax.swing.JLabel jHeadOfficeCityLabel;
private javax.swing.JTextField jHeadOfficeCityTextField;
private javax.swing.JLabel jHeadOfficeCountryLabel;
private javax.swing.JTextField jHeadOfficeCountryTextField;
private javax.swing.JLabel jHeadOfficeHouseNumberLabel;
private javax.swing.JTextField jHeadOfficeHouseNumberTextField;
private javax.swing.JLabel jHeadOfficeInfoLabel;
private javax.swing.JLabel jHeadOfficeNameLabel;
private javax.swing.JTextField jHeadOfficeNameTextField;
private javax.swing.JLabel jHeadOfficeOpeningHoursLabel;
private javax.swing.JTextField jHeadOfficeOpeningHoursTextField;
private javax.swing.JPanel jHeadOfficePanel;
private javax.swing.JLabel jHeadOfficePostcodeLabel;
private javax.swing.JTextField jHeadOfficePostcodeTextField;
private javax.swing.JButton jHeadOfficeSaveNewDetailsButton;
private javax.swing.JLabel jHeadOfficeStreetLabel;
private javax.swing.JTextField jHeadOfficeStreetTextField;
private javax.swing.JTextArea jHeadOfficeTextArea;
private javax.swing.JLabel jHouseNoLabel;
private javax.swing.JLabel jHousenameLabel;
private javax.swing.JTextField jHousenameTextField;
private javax.swing.JTextField jHousenumberTextField;
private javax.swing.JCheckBox jISACheckBox;
private javax.swing.JLabel jInput1Label;
private javax.swing.JTextField jInput1TextField;
private javax.swing.JTextField jInput2TextField;
private javax.swing.JLabel jIntut2Label;
private javax.swing.JButton jLoginButton;
private javax.swing.JPanel jLoginPanel;
private javax.swing.JPanel jMainPanel;
private javax.swing.JTabbedPane jMainTabbedPane;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBarMain;
private javax.swing.JButton jMultiplicationButton;
private javax.swing.JLabel jName2Label;
private javax.swing.JTextField jName2TextField;
private javax.swing.JLabel jNameLabel;
private javax.swing.JTextField jNameTextField;
private javax.swing.JLabel jOutputLabel;
private javax.swing.JTextField jOutputTextField;
private javax.swing.JPasswordField jPasswordField;
private javax.swing.JLabel jPasswordLabel;
private javax.swing.JTextField jPostCodeTextField;
private javax.swing.JLabel jPostcodeLabel;
private javax.swing.JButton jPowerButton;
private javax.swing.JButton jProcessTransactionButton;
private javax.swing.JProgressBar jProgressCompletionBar;
private javax.swing.JButton jRegisterButton;
private javax.swing.JButton jRemoveBranchButton;
private javax.swing.JButton jRemoveCustomerButton;
private javax.swing.JLabel jRoleLabel;
private javax.swing.JComboBox<String> jRoleSelectionBox;
private javax.swing.JCheckBox jSavings1CheckBox;
private javax.swing.JCheckBox jSavings2CheckBox;
private javax.swing.JLabel jSortCodeLabel;
private javax.swing.JTextField jSortCodeTextField;
private javax.swing.JLabel jSphereRadiusLabel;
private javax.swing.JTextField jSphereRadiusTextField;
private javax.swing.JLabel jStatusMessageLabel;
private javax.swing.JPanel jStatusPanel;
private javax.swing.JLabel jStreetLabel;
private javax.swing.JTextField jStreetTextField;
private javax.swing.JButton jSubtractionButton;
private javax.swing.JCheckBox jSurnameCheckBox;
private javax.swing.JLabel jSurnameLabel;
private javax.swing.JTextField jSurnameTextField;
private javax.swing.JLabel jTownLabel1;
private javax.swing.JTextField jTownTextField;
private javax.swing.JButton jVolumeOfCylinderButton;
private javax.swing.JButton jVolumeOfSphereButton;
private javax.swing.JButton jWithdrawButton;
// End of variables declaration//GEN-END:variables
}
| [
"Connor@DESKTOP-T1H26IV"
] | Connor@DESKTOP-T1H26IV |
b022984b4b062a7af90f115e353cb2e0429d90a5 | eec1df5fef4d6e01c07fbf8e48c3488df5ffdd95 | /app/src/main/java/com/futrtch/live/factorys/LiveFragmentFactory.java | 06133395f45311766fee8d72de8bce512d7b95e6 | [] | no_license | desfate/3DLive | 9e3369e436b6fded6b2193fc651bd6f827776d50 | 0888252ad0325561dd42a464fadab3ee49bee176 | refs/heads/master | 2023-04-14T13:34:53.569204 | 2021-04-21T01:35:00 | 2021-04-21T01:35:00 | 304,176,574 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package com.futrtch.live.factorys;
import androidx.fragment.app.Fragment;
import com.futrtch.live.activitys.fragments.main.LiveCareFragment;
import com.futrtch.live.activitys.fragments.main.LiveListFragment;
import com.futrtch.live.activitys.fragments.main.LiveReplayFragment;
import com.futrtch.live.mvvm.vm.LiveReplayViewModel;
public class LiveFragmentFactory {
public static Fragment getFragment(int index){
switch (index){
case 0: // 推荐
return LiveListFragment.getInstance(index);
case 1: // 关注
return LiveCareFragment.getInstance(index);
case 2: // 回放
return LiveReplayFragment.getInstance(index);
}
return new Fragment();
}
}
| [
"[email protected]"
] | |
9bbcf9d719c87fe3e0ecef0cf2ea63f7aed7df7c | d8f336adfcc25bd560aa328b7b538cfb52049522 | /src/main/java/com/tomar/app/security/UserDetailsService.java | 8aa01b7076533dfbe06f2deda0603207f0f0a0f6 | [] | no_license | BulkSecurityGeneratorProject/LatLang | 29721b0e009ecadbda72f0a6858cd1ae959e3e5b | 7b4ee42a056106c65bcd31925f408a1f9b84f8c0 | refs/heads/master | 2022-12-15T07:32:04.846297 | 2016-08-18T19:17:51 | 2016-08-18T19:17:51 | 296,523,165 | 0 | 0 | null | 2020-09-18T05:31:40 | 2020-09-18T05:31:39 | null | UTF-8 | Java | false | false | 2,014 | java | package com.tomar.app.security;
import com.tomar.app.domain.User;
import com.tomar.app.repository.UserRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.inject.Inject;
import java.util.*;
import java.util.stream.Collectors;
/**
* Authenticate a user from the database.
*/
@Component("userDetailsService")
public class UserDetailsService implements org.springframework.security.core.userdetails.UserDetailsService {
private final Logger log = LoggerFactory.getLogger(UserDetailsService.class);
@Inject
private UserRepository userRepository;
@Override
@Transactional
public UserDetails loadUserByUsername(final String login) {
log.debug("Authenticating {}", login);
String lowercaseLogin = login.toLowerCase(Locale.ENGLISH);
Optional<User> userFromDatabase = userRepository.findOneByLogin(lowercaseLogin);
return userFromDatabase.map(user -> {
if (!user.getActivated()) {
throw new UserNotActivatedException("User " + lowercaseLogin + " was not activated");
}
List<GrantedAuthority> grantedAuthorities = user.getAuthorities().stream()
.map(authority -> new SimpleGrantedAuthority(authority.getName()))
.collect(Collectors.toList());
return new org.springframework.security.core.userdetails.User(lowercaseLogin,
user.getPassword(),
grantedAuthorities);
}).orElseThrow(() -> new UsernameNotFoundException("User " + lowercaseLogin + " was not found in the " +
"database"));
}
}
| [
"[email protected]"
] | |
df61ee8818e11407ddf59ba60767feaf9ccb3b02 | 65938f7bef22ed962269ee1e1fe26df07150e039 | /processor/src/test/java/fr/xebia/extras/selma/it/custom/cyclic/CyclicBookMapper.java | 454177ecc334197b533003edcd60e591e134ee75 | [
"Apache-2.0"
] | permissive | balachandra/selma | a441e1f8bd17e784d309e4a5f2f5936d33f75cfd | b1a2972c3d5a61f42458b29351371b4d0f004d2d | refs/heads/master | 2021-01-03T00:13:38.310681 | 2018-03-08T23:28:32 | 2018-03-08T23:28:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,014 | java | /*
* Copyright 2013 Séven Le Mesle
*
* 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 fr.xebia.extras.selma.it.custom.cyclic;
import fr.xebia.extras.selma.Mapper;
import fr.xebia.extras.selma.Maps;
import fr.xebia.extras.selma.beans.AddressIn;
import fr.xebia.extras.selma.beans.AddressOut;
/**
* Created by slemesle on 08/03/2018.
*/
@Mapper(withCyclicMapping = true)
public interface CyclicBookMapper {
@Maps(withIgnoreFields = "test") AddressOut asBookDTO(AddressIn book);
}
| [
"[email protected]"
] | |
9853a681a18c7a179766e965f70463a2d7eff6c2 | d0c29333d0b2ca7db505581761848839cd771b87 | /src/main/java/nz/ac/eit/blackjack/InputCollector.java | 054f94bb406e48f6cd970ecc2ade32fd249837b6 | [] | no_license | jexla/ST-As2-BlackJack | 9899560746cd2abec7988a33d49ee5fd256dafae | 5e9ce786b91b892f7022ed40968e6da221c27d02 | refs/heads/master | 2022-12-31T04:09:58.221761 | 2020-10-27T22:36:01 | 2020-10-27T22:36:01 | 307,843,514 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package nz.ac.eit.blackjack;
public class InputCollector
{
public boolean collectYesOrNo(String input) throws InputNotYesOrNoException
{
char choice;
try
{
choice = input.toLowerCase().charAt(0); // takes the first character of the input string and converts it to lowercase
}
catch (StringIndexOutOfBoundsException e) // if the user enters an empty string
{
throw new InputNotYesOrNoException();
}
switch (choice)
{
case 'y':
return true;
case 'n':
return false;
default: // if the first character is not 'y' or 'n'
throw new InputNotYesOrNoException(input);
}
}
}
| [
"[email protected]"
] | |
b14002608983f05f6b9f9b7ebfadb61f04c8554a | 1bafb0f20878e404096264579411007c1a67b351 | /backend/src/main/java/com/akveo/bundlejava/config/MethodSecurityConfig.java | 825841db26d25d34d2ca1d5bab9e1880a4c46b7d | [
"MIT"
] | permissive | findataanalytics/ui | e39eacd045c9ab339b50237b40643aca15a49167 | 154978fd059d39f7e32bfac7ace518d36f25f02a | refs/heads/master | 2022-12-26T18:51:54.688610 | 2020-03-22T05:57:02 | 2020-03-22T05:57:02 | 241,504,983 | 0 | 0 | MIT | 2022-12-08T23:49:14 | 2020-02-19T01:22:43 | TypeScript | UTF-8 | Java | false | false | 799 | java | /*
* Copyright (c) Akveo 2019. All Rights Reserved.
* Licensed under the Personal / Commercial License.
* See LICENSE_PERSONAL / LICENSE_COMMERCIAL in the project root for license information on type of purchased license.
*/
package com.akveo.bundlejava.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class MethodSecurityConfig extends GlobalMethodSecurityConfiguration {
}
| [
"[email protected]"
] | |
1e1993449517e862fbbed844d623edc629ba9624 | 3de720118f58e66252f6b7cf68b34abd4cc5a4b1 | /src/main/java/com/appleyk/DMA10_桥接模式/DM10/paint/color/White.java | 2c1c7f07f148b2cd7867041ba1c8a6c1a7b58b8f | [] | no_license | OakStreet17/SpringBoot-DesignMode | 326b46cffdf9baceaf3640e71bef54f6efc023ac | acffd578d73314c708a85cc2931d5bb635847f0e | refs/heads/master | 2023-08-26T07:32:47.861877 | 2019-08-13T10:25:42 | 2019-08-13T10:25:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package com.appleyk.DMA10_桥接模式.DM10.paint.color;
/**
* <p>白色</p>
*
* @Author Appleyk
* @Blob https://blog.csdn.net/appleyk
* @Date Created on 下午 1:22 2018-11-19
* @Version V.1.0.1
*/
public class White implements Color{
@Override
public void painting(String shape) {
System.out.println("绘制白色的"+shape);
}
}
| [
"[email protected]"
] | |
e942b2246ea152570cc712164f6702e3fe2da668 | c26276453e251306ba05e424f8d7764e351bf8c7 | /src/com/liam/dao/UserDaoI.java | 5a3209d435602a74746ce85eaca44a531ac03e6e | [] | no_license | liamHackers/SpringMVC-Hibernate | 8e103ebc30d28633648c5f1e4bffeb3d64e7d722 | 7e215241e2fcd9e38546565cbdd0aa841325dcc9 | refs/heads/master | 2020-06-14T03:31:00.094809 | 2016-12-04T01:41:02 | 2016-12-04T01:41:02 | 75,511,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 129 | java | package com.liam.dao;
import com.liam.domain.User;
public interface UserDaoI {
User Login(String userName,String passWord);
}
| [
"[email protected]"
] | |
3b6ad415269e925f7ac2b00e2d2f50c93eb0103b | 5ddb518403d62a62ca47357ff3f0ba0e1b625084 | /src/com/model/ParallelAlgorithm.java | c184b1b4f33aff4ac533337d8001a957c0a9b4c4 | [] | no_license | Creamery/CSC612M_Parallelized_Levenshtein_Distance | c9131c2a24b7c7a39bec7259486e25586e5cd060 | 13e4678bd0d5d16176ed0efee64a916b630d9bcb | refs/heads/master | 2021-08-28T01:08:11.589708 | 2017-12-11T01:09:03 | 2017-12-11T01:09:03 | 113,735,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,052 | java | package com.model;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import com.main.Model;
import com.main.ComputeDistance;
/**
* Algorithm referenced from:
* Levenshtein Distance, in Three Flavors
* by Michael Gilleland, Merriam Park Software
* https://people.cs.pitt.edu/
*
* @author Candy
*
*/
public class ParallelAlgorithm {
private Model model;
private int[][] matrix;
private String stringS;
private String stringT;
private int n;
private int m;
private int i;
private int j;
public ParallelAlgorithm(Model model) {
this.model = model;
}
public int levenshteinDistance(String s, String t) {
this.stringS = s;
this.stringT = t;
// Step 1
n = s.length();
m = t.length();
if(n == 0) {
return m;
}
if(m == 0) {
return n;
}
this.matrix = new int [n+1][m+1];
// Step 2
for(i = 0; i <= n; i++) {
matrix[i][0] = i;
}
for(j = 0; j <= m; j++) {
matrix[0][j] = j;
}
// Step 2.1 Initialize other values as -1, which will indicate that it's not yet finished
for(i = 1; i <= n; i++) {
for(j = 1; j <= m; j++) {
matrix[i][j] = -1;
}
}
// Step 3
ArrayList<ComputeDistance> listComputeDistance = new ArrayList<ComputeDistance>();
ComputeDistance computeDistance;
for(i = 1; i <= n; i++) {
for(j = 1; j <= m; j++) {
computeDistance = new ComputeDistance(this, i, j);
listComputeDistance.add(computeDistance);
}
}
ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, r -> {
Thread thread = Executors.defaultThreadFactory().newThread(r);
thread.setDaemon(true);
return thread;
});
Long executionTime = 0l;
try {
List<Future<Long>> timeList = executorService.invokeAll(listComputeDistance);
executorService.shutdown();
executorService.shutdownNow();
for (Future<Long> time : timeList) {
executionTime += time.get();
}
} catch (Exception e) {
e.printStackTrace();
}
// model.printMatrix(this.matrix);
System.out.println("PARALLEL: "+matrix[n][m]);
double seconds = (double)executionTime / 1000000000.0;
NumberFormat formatter = new DecimalFormat("#0.0000000000");
System.out.println("Execution Time (ns): "+executionTime);
System.out.println("Execution Time (sec): "+formatter.format(seconds));
return matrix[n][m];
}
public int[][] getMatrix() {
return matrix;
}
public void setMatrix(int[][] matrix) {
this.matrix = matrix;
}
public String getStringS() {
return stringS;
}
public String getStringT() {
return stringT;
}
public void setStringS(String stringS) {
this.stringS = stringS;
}
public void setStringT(String stringT) {
this.stringT = stringT;
}
public Model getModel() {
return model;
}
public void setModel(Model model) {
this.model = model;
}
}
| [
"[email protected]"
] | |
957aebfed36ba7e8fc6c3e5fcb3e9eff35654aff | 4cb772f10abbfad3791e407b5e64a03f03c8b4b3 | /winshare-ebic-api/src/main/java/com/winshare/edu/modules/entity/TestVo.java | 333376e2831bd7f670cde5de485d6518198d2166 | [] | no_license | tq0818/winshare-ebic-parent | b33b926c45e5f10d3ab645522d39f4c7cfe75d23 | fbc86345a5032477045d9764f08247b43e62966e | refs/heads/master | 2020-05-16T16:29:27.913144 | 2019-04-24T08:43:18 | 2019-04-24T08:43:26 | 183,162,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package com.winshare.edu.modules.entity;
import com.winshare.edu.common.persistence.BaseEntity;
public class TestVo extends BaseEntity<TestVo>{
private static final long serialVersionUID = -2798014934523991219L;
private String result;
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
}
| [
"[email protected]"
] | |
8f285f936faac4549de6499598f8a1f55be4c9ff | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_754a2bfaea3dd1de53dfe4c82e25b24b8621e151/DefaultGrailsPlugin/15_754a2bfaea3dd1de53dfe4c82e25b24b8621e151_DefaultGrailsPlugin_t.java | 4617e49922106120c00c45886a1ba2a0364badc0 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 45,631 | java | /*
* Copyright 2004-2005 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
*
* 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.codehaus.groovy.grails.plugins;
import grails.spring.BeanBuilder;
import grails.util.BuildScope;
import grails.util.BuildSettings;
import grails.util.BuildSettingsHolder;
import grails.util.Environment;
import grails.util.GrailsUtil;
import grails.util.Metadata;
import groovy.lang.Binding;
import groovy.lang.Closure;
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyObject;
import groovy.util.slurpersupport.GPathResult;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.groovy.grails.commons.ArtefactHandler;
import org.codehaus.groovy.grails.commons.GrailsApplication;
import org.codehaus.groovy.grails.commons.GrailsClassUtils;
import org.codehaus.groovy.grails.commons.GrailsResourceUtils;
import org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration;
import org.codehaus.groovy.grails.compiler.GrailsClassLoader;
import org.codehaus.groovy.grails.compiler.support.GrailsResourceLoader;
import org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder;
import org.codehaus.groovy.grails.documentation.DocumentationContext;
import org.codehaus.groovy.grails.exceptions.GrailsConfigurationException;
import org.codehaus.groovy.grails.plugins.exceptions.PluginException;
import org.codehaus.groovy.grails.support.ParentApplicationContextAware;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.type.filter.TypeFilter;
/**
* Implementation of the GrailsPlugin interface that wraps a Groovy plugin class
* and provides the magic to invoke its various methods from Java.
*
* @author Graeme Rocher
* @since 0.4
*/
@SuppressWarnings("rawtypes")
public class DefaultGrailsPlugin extends AbstractGrailsPlugin implements ParentApplicationContextAware {
private static final String PLUGIN_CHANGE_EVENT_CTX = "ctx";
private static final String PLUGIN_CHANGE_EVENT_APPLICATION = "application";
private static final String PLUGIN_CHANGE_EVENT_PLUGIN = "plugin";
private static final String PLUGIN_CHANGE_EVENT_SOURCE = "source";
private static final String PLUGIN_CHANGE_EVENT_MANAGER = "manager";
private static final String PLUGIN_OBSERVE = "observe";
private static final Log LOG = LogFactory.getLog(DefaultGrailsPlugin.class);
private static final String INCLUDES = "includes";
private static final String EXCLUDES = "excludes";
private GrailsPluginClass pluginGrailsClass;
private GroovyObject plugin;
protected BeanWrapper pluginBean;
private Closure onChangeListener;
private Resource[] watchedResources = new Resource[0];
private long[] modifiedTimes = new long[0];
private PathMatchingResourcePatternResolver resolver;
private String[] resourcesReferences;
private int[] resourceCount;
private String[] loadAfterNames = new String[0];
private String[] loadBeforeNames = new String[0];
private String[] influencedPluginNames = new String[0];
private String status = STATUS_ENABLED;
private String[] observedPlugins;
private long pluginLastModified = Long.MAX_VALUE;
private URL pluginUrl;
private Closure onConfigChangeListener;
private Closure onShutdownListener;
private Class<?>[] providedArtefacts = new Class[0];
private Map pluginScopes;
private Map pluginEnvs;
private List<String> pluginExcludes = new ArrayList<String>();
private Collection<? extends TypeFilter> typeFilters = new ArrayList<TypeFilter>();
private Resource pluginDescriptor;
public DefaultGrailsPlugin(Class<?> pluginClass, Resource resource, GrailsApplication application) {
super(pluginClass, application);
// create properties
dependencies = Collections.emptyMap();
pluginDescriptor = resource;
resolver = new PathMatchingResourcePatternResolver();
if (resource != null) {
try {
pluginUrl = resource.getURL();
URLConnection urlConnection = null;
try {
urlConnection = pluginUrl.openConnection();
pluginLastModified = urlConnection.getLastModified();
}
finally {
InputStream is = urlConnection != null ? urlConnection.getInputStream() : null;
IOUtils.closeQuietly(is);
}
}
catch (IOException e) {
LOG.warn("I/O error reading last modified date of plug-in [" + pluginClass +
"], you won't be able to reload changes: " + e.getMessage(),e);
}
}
initialisePlugin(pluginClass);
}
private void initialisePlugin(Class<?> clazz) {
pluginGrailsClass = new GrailsPluginClass(clazz);
plugin = (GroovyObject)pluginGrailsClass.newInstance();
pluginBean = new BeanWrapperImpl(plugin);
// configure plugin
evaluatePluginVersion();
evaluatePluginDependencies();
evaluatePluginLoadAfters();
evaluateProvidedArtefacts();
evaluatePluginEvictionPolicy();
evaluatePluginInfluencePolicy();
evaluateOnChangeListener();
evaluateObservedPlugins();
evaluatePluginStatus();
evaluatePluginScopes();
evaluatePluginExcludes();
evaluateTypeFilters();
}
@SuppressWarnings("unchecked")
private void evaluateTypeFilters() {
Object result = GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, TYPE_FILTERS);
if (result instanceof List) {
typeFilters = (List<TypeFilter>) result;
}
}
@SuppressWarnings("unchecked")
private void evaluatePluginExcludes() {
Object result = GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, PLUGIN_EXCLUDES);
if (result instanceof List) {
pluginExcludes = (List<String>) result;
}
}
private void evaluatePluginScopes() {
// Damn I wish Java had closures
pluginScopes = evaluateIncludeExcludeProperty(SCOPES, new Closure(this) {
private static final long serialVersionUID = 1;
@Override
public Object call(Object arguments) {
final String scopeName = ((String) arguments).toUpperCase();
try {
return BuildScope.valueOf(scopeName);
}
catch (IllegalArgumentException e) {
throw new GrailsConfigurationException("Plugin " + this + " specifies invalid scope [" + scopeName + "]");
}
}
});
pluginEnvs = evaluateIncludeExcludeProperty(ENVIRONMENTS, new Closure(this) {
private static final long serialVersionUID = 1;
@Override
public Object call(Object arguments) {
String envName = (String)arguments;
Environment env = Environment.getEnvironment(envName);
if (env != null) return env.getName();
return arguments;
}
});
}
private Map evaluateIncludeExcludeProperty(String name, Closure converter) {
Map resultMap = new HashMap();
Object propertyValue = GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, name);
if (propertyValue instanceof Map) {
Map containedMap = (Map)propertyValue;
Object includes = containedMap.get(INCLUDES);
evaluateAndAddIncludeExcludeObject(resultMap, includes, true, converter);
Object excludes = containedMap.get(EXCLUDES);
evaluateAndAddIncludeExcludeObject(resultMap, excludes, false, converter);
}
else {
evaluateAndAddIncludeExcludeObject(resultMap, propertyValue, true, converter);
}
return resultMap;
}
private void evaluateAndAddIncludeExcludeObject(Map targetMap, Object includeExcludeObject, boolean include, Closure converter) {
if (includeExcludeObject instanceof String) {
final String includeExcludeString = (String) includeExcludeObject;
evaluateAndAddToIncludeExcludeSet(targetMap,includeExcludeString, include, converter);
}
else if (includeExcludeObject instanceof List) {
List includeExcludeList = (List) includeExcludeObject;
evaluateAndAddListOfValues(targetMap,includeExcludeList, include, converter);
}
}
private void evaluateAndAddListOfValues(Map targetMap, List includeExcludeList, boolean include, Closure converter) {
for (Object scope : includeExcludeList) {
if (scope instanceof String) {
final String scopeName = (String) scope;
evaluateAndAddToIncludeExcludeSet(targetMap, scopeName, include, converter);
}
}
}
@SuppressWarnings("unchecked")
private void evaluateAndAddToIncludeExcludeSet(Map targetMap, String includeExcludeString, boolean include, Closure converter) {
Set set = lazilyCreateIncludeOrExcludeSet(targetMap,include);
set.add(converter.call(includeExcludeString));
}
@SuppressWarnings("unchecked")
private Set lazilyCreateIncludeOrExcludeSet(Map targetMap, boolean include) {
String key = include ? INCLUDES : EXCLUDES ;
Set set = (Set) targetMap.get(key);
if (set == null) {
set = new HashSet();
targetMap.put(key, set);
}
return set;
}
@SuppressWarnings("unchecked")
private void evaluateProvidedArtefacts() {
Object result = GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, PROVIDED_ARTEFACTS);
if (result instanceof Collection) {
final Collection artefactList = (Collection) result;
providedArtefacts = (Class<?>[])artefactList.toArray(new Class[artefactList.size()]);
}
}
public DefaultGrailsPlugin(Class<?> pluginClass, GrailsApplication application) {
this(pluginClass, null, application);
}
private void evaluateObservedPlugins() {
if (pluginBean.isReadableProperty(PLUGIN_OBSERVE)) {
Object observeProperty = GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, PLUGIN_OBSERVE);
if (observeProperty instanceof Collection) {
Collection observeList = (Collection)observeProperty;
observedPlugins = new String[observeList.size()];
int j = 0;
for (Object anObserveList : observeList) {
String pluginName = anObserveList.toString();
observedPlugins[j++] = pluginName;
}
}
}
if (observedPlugins == null) {
observedPlugins = new String[0];
}
}
private void evaluatePluginStatus() {
if (pluginBean.isReadableProperty(STATUS)) {
Object statusObj = GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, STATUS);
if (statusObj != null) {
status = statusObj.toString().toLowerCase();
}
}
}
@SuppressWarnings("unchecked")
private void evaluateOnChangeListener() {
if (pluginBean.isReadableProperty(ON_SHUTDOWN)) {
onShutdownListener = (Closure)GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, ON_SHUTDOWN);
}
if (pluginBean.isReadableProperty(ON_CONFIG_CHANGE)) {
onConfigChangeListener = (Closure)GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, ON_CONFIG_CHANGE);
}
if (pluginBean.isReadableProperty(ON_CHANGE)) {
onChangeListener = (Closure) GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, ON_CHANGE);
}
final boolean warDeployed = Metadata.getCurrent().isWarDeployed();
final boolean reloadEnabled = Environment.getCurrent().isReloadEnabled();
if (!((reloadEnabled || !warDeployed) && onChangeListener != null)) {
return;
}
Object referencedResources = GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, WATCHED_RESOURCES);
try {
List resourceList = null;
if (referencedResources instanceof String) {
if (LOG.isDebugEnabled()) {
LOG.debug("Configuring plugin "+this+" to watch resources with pattern: " + referencedResources);
}
resourceList = new ArrayList();
resourceList.add(referencedResources.toString());
}
else if (referencedResources instanceof List) {
resourceList = (List)referencedResources;
}
if (resourceList != null) {
List<String> resourceListTmp = new ArrayList<String>();
final Resource[] pluginDirs = GrailsPluginUtils.getPluginDirectories();
final Environment env = Environment.getCurrent();
final String baseLocation = env.getReloadLocation();
for (Object ref : resourceList) {
String stringRef = ref.toString();
if (!warDeployed) {
for (Resource pluginDir : pluginDirs) {
if (pluginDir !=null) {
String pluginResources = getResourcePatternForBaseLocation(pluginDir.getFile().getCanonicalPath(), stringRef);
resourceListTmp.add(pluginResources);
}
}
addBaseLocationPattern(resourceListTmp, baseLocation, stringRef);
}
else {
addBaseLocationPattern(resourceListTmp, baseLocation, stringRef);
}
}
resourcesReferences = new String[resourceListTmp.size()];
resourceCount = new int[resourceListTmp.size()];
for (int i = 0; i < resourcesReferences.length; i++) {
String resRef = resourceListTmp.get(i);
resourcesReferences[i]=resRef;
}
for (int i = 0; i < resourcesReferences.length; i++) {
String res = resourcesReferences[i];
// Try to load the resources that match the "res" pattern.
Resource[] tmp = new Resource[0];
try {
try {
tmp = (Resource[]) ArrayUtils.addAll(tmp,resolver.getResources(res));
}
catch (IOException e) {
// ignore, no resources at default location
}
}
catch (Exception ex) {
// The pattern is invalid so we continue as if there are no matching files.
LOG.debug("Resource pattern [" + res + "] is not valid - maybe base directory does not exist?");
}
resourceCount[i] = tmp.length;
if (LOG.isDebugEnabled()) {
LOG.debug("Watching resource set ["+(i+1)+"]: " + ArrayUtils.toString(tmp));
}
if (tmp.length == 0) {
tmp = resolver.getResources("classpath*:" + res);
}
if (tmp.length > 0) {
watchedResources = (Resource[])ArrayUtils.addAll(watchedResources, tmp);
}
}
}
}
catch (IllegalArgumentException e) {
if (GrailsUtil.isDevelopmentEnv()) {
LOG.debug("Cannot load plug-in resource watch list from [" + ArrayUtils.toString(resourcesReferences) +
"]. This means that the plugin " + this +
", will not be able to auto-reload changes effectively. Try runnng grails upgrade.: " + e.getMessage());
}
}
catch (IOException e) {
if (GrailsUtil.isDevelopmentEnv()) {
LOG.debug("Cannot load plug-in resource watch list from [" + ArrayUtils.toString(resourcesReferences) +
"]. This means that the plugin " + this +
", will not be able to auto-reload changes effectively. Try runnng grails upgrade.: " + e.getMessage());
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("Plugin "+this+" found ["+watchedResources.length+"] to watch");
}
try {
initializeModifiedTimes();
}
catch (IOException e) {
LOG.warn("I/O exception initializing modified times for watched resources: " + e.getMessage(), e);
}
}
private void addBaseLocationPattern(List<String> resourceList, final String baseLocation, String pattern) {
if (baseLocation != null) {
final String reloadLocationResourcePattern = getResourcePatternForBaseLocation(baseLocation, pattern);
resourceList.add(reloadLocationResourcePattern);
}
else {
resourceList.add(pattern);
}
}
private String getResourcePatternForBaseLocation(String baseLocation, String resourcePath) {
String location = baseLocation;
if (!location.endsWith(File.separator)) location = location + File.separator;
if (resourcePath.startsWith(".")) resourcePath = resourcePath.substring(1);
else if (resourcePath.startsWith("file:./")) resourcePath = resourcePath.substring(7);
resourcePath = "file:" + location + resourcePath;
return resourcePath;
}
@SuppressWarnings("unchecked")
private void evaluatePluginInfluencePolicy() {
if (pluginBean.isReadableProperty(INFLUENCES)) {
List influencedList = (List)pluginBean.getPropertyValue(INFLUENCES);
if (influencedList != null) {
influencedPluginNames = (String[])influencedList.toArray(new String[influencedList.size()]);
}
}
}
private void evaluatePluginVersion() {
if (!pluginBean.isReadableProperty(VERSION)) {
throw new PluginException("Plugin [" + getName() + "] must specify a version!");
}
Object vobj = plugin.getProperty(VERSION);
if (vobj != null) {
version = vobj.toString();
}
else {
throw new PluginException("Plugin " + this + " must specify a version. eg: def version = 0.1");
}
}
private void evaluatePluginEvictionPolicy() {
if (pluginBean.isReadableProperty(EVICT)) {
List pluginsToEvict = (List) GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, EVICT);
if (pluginsToEvict != null) {
evictionList = new String[pluginsToEvict.size()];
int index = 0;
for (Object o : pluginsToEvict) {
evictionList[index++] = o != null ? o.toString() : "";
}
}
}
}
@SuppressWarnings("unchecked")
private void evaluatePluginLoadAfters() {
if (pluginBean.isReadableProperty(PLUGIN_LOAD_AFTER_NAMES)) {
List loadAfterNamesList = (List) GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, PLUGIN_LOAD_AFTER_NAMES);
if (loadAfterNamesList != null) {
loadAfterNames = (String[])loadAfterNamesList.toArray(new String[loadAfterNamesList.size()]);
}
}
if (pluginBean.isReadableProperty(PLUGIN_LOAD_BEFORE_NAMES)) {
List loadBeforeNamesList = (List) GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, PLUGIN_LOAD_BEFORE_NAMES);
if (loadBeforeNamesList != null) {
loadBeforeNames = (String[])loadBeforeNamesList.toArray(new String[loadBeforeNamesList.size()]);
}
}
}
@SuppressWarnings("unchecked")
private void evaluatePluginDependencies() {
if (pluginBean.isReadableProperty(DEPENDS_ON)) {
dependencies = (Map) GrailsClassUtils.getPropertyOrStaticPropertyOrFieldValue(plugin, DEPENDS_ON);
dependencyNames = dependencies.keySet().toArray(new String[dependencies.size()]);
}
}
@Override
public String[] getLoadAfterNames() {
return loadAfterNames;
}
@Override
public String[] getLoadBeforeNames() {
return loadBeforeNames;
}
/**
* @return the resolver
*/
public PathMatchingResourcePatternResolver getResolver() {
return resolver;
}
public ApplicationContext getParentCtx() {
return application.getParentContext();
}
public BeanBuilder beans(Closure closure) {
BeanBuilder bb = new BeanBuilder(getParentCtx(), new GroovyClassLoader(application.getClassLoader()));
bb.invokeMethod("beans", new Object[]{closure});
return bb;
}
private void initializeModifiedTimes() throws IOException {
modifiedTimes = new long[watchedResources.length];
for (int i = 0; i < watchedResources.length; i++) {
Resource r = watchedResources[i];
URLConnection c = null;
try {
c = r.getURL().openConnection();
c.setDoInput(false);
c.setDoOutput(false);
modifiedTimes[i] = c.getLastModified();
}
finally {
if (c != null) {
try {
InputStream is = c.getInputStream();
if (is != null) {
is.close();
}
}
catch (IOException e) {
// ignore
}
}
}
}
}
public void doWithApplicationContext(ApplicationContext ctx) {
try {
if (pluginBean.isReadableProperty(DO_WITH_APPLICATION_CONTEXT)) {
Closure c = (Closure)plugin.getProperty(DO_WITH_APPLICATION_CONTEXT);
if (enableDocumentationGeneration()) {
DocumentationContext.getInstance().setActive(true);
}
c.setDelegate(this);
c.call(new Object[]{ctx});
}
}
finally {
if (enableDocumentationGeneration()) {
DocumentationContext.getInstance().reset();
}
}
}
private boolean enableDocumentationGeneration() {
return !Metadata.getCurrent().isWarDeployed() && isBasePlugin();
}
public void doWithRuntimeConfiguration(RuntimeSpringConfiguration springConfig) {
if (pluginBean.isReadableProperty(DO_WITH_SPRING)) {
if (LOG.isDebugEnabled()) {
LOG.debug("Plugin " + this + " is participating in Spring configuration...");
}
Closure c = (Closure)plugin.getProperty(DO_WITH_SPRING);
BeanBuilder bb = new BeanBuilder(getParentCtx(),springConfig, application.getClassLoader());
Binding b = new Binding();
b.setVariable("application", application);
b.setVariable("manager", getManager());
b.setVariable("plugin", this);
b.setVariable("parentCtx", getParentCtx());
b.setVariable("resolver", getResolver());
bb.setBinding(b);
c.setDelegate(bb);
bb.invokeMethod("beans", new Object[]{c});
}
}
@Override
public String getName() {
return pluginGrailsClass.getLogicalPropertyName();
}
public void addExclude(BuildScope buildScope) {
addExcludeRuleInternal(pluginScopes, buildScope);
}
@SuppressWarnings("unchecked")
private void addExcludeRuleInternal(Map map, Object o) {
Collection excludes = (Collection) map.get(EXCLUDES);
if (excludes == null) {
excludes = new ArrayList();
map.put(EXCLUDES, excludes);
}
Collection includes = (Collection) map.get(INCLUDES);
if (includes != null) includes.remove(o);
excludes.add(o);
}
public void addExclude(Environment env) {
addExcludeRuleInternal(pluginEnvs, env);
}
public boolean supportsScope(BuildScope buildScope) {
return supportsValueInIncludeExcludeMap(pluginScopes, buildScope);
}
public boolean supportsEnvironment(Environment environment) {
return supportsValueInIncludeExcludeMap(pluginEnvs, environment.getName());
}
public boolean supportsCurrentScopeAndEnvironment() {
BuildScope bs = BuildScope.getCurrent();
Environment e = Environment.getCurrent();
return supportsEnvironment(e) && supportsScope(bs);
}
private boolean supportsValueInIncludeExcludeMap(Map includeExcludeMap, Object value) {
if (includeExcludeMap.isEmpty()) {
return true;
}
Set includes = (Set) includeExcludeMap.get(INCLUDES);
if (includes != null) {
return includes.contains(value);
}
Set excludes = (Set)includeExcludeMap.get(EXCLUDES);
return !(excludes != null && excludes.contains(value));
}
public void doc(String text) {
if (enableDocumentationGeneration()) {
DocumentationContext.getInstance().document(text);
}
}
@Override
public String[] getDependencyNames() {
return dependencyNames;
}
/**
* @return the watchedResources
*/
public Resource[] getWatchedResources() {
return watchedResources;
}
@Override
public String getDependentVersion(String name) {
Object dependentVersion = dependencies.get(name);
if (dependentVersion == null) {
throw new PluginException("Plugin [" + getName() + "] referenced dependency [" + name + "] with no version!");
}
return dependentVersion.toString();
}
@Override
public String toString() {
return "[" + getName() + ":" + getVersion() + "]";
}
@Override
public void doWithWebDescriptor(GPathResult webXml) {
if (pluginBean.isReadableProperty(DO_WITH_WEB_DESCRIPTOR)) {
Closure c = (Closure)plugin.getProperty(DO_WITH_WEB_DESCRIPTOR);
c.setResolveStrategy(Closure.DELEGATE_FIRST);
c.setDelegate(this);
c.call(webXml);
}
}
/**
* Monitors the plugin resources defined in the watchResources property for changes and
* fires onChange events by calling an onChange closure defined in the plugin (if it exists)
*/
@Override
public boolean checkForChanges() {
if (pluginUrl != null) {
long currentModified = -1;
URLConnection conn = null;
try {
conn = pluginUrl.openConnection();
currentModified = conn.getLastModified();
if (currentModified > pluginLastModified) {
if (LOG.isInfoEnabled()) {
LOG.info("Grails plug-in " + this + " changed, reloading changes..");
}
GroovyClassLoader gcl = new GroovyClassLoader(application.getClassLoader());
initialisePlugin(gcl.parseClass(DefaultGroovyMethods.getText(conn.getInputStream())));
pluginLastModified = currentModified;
return true;
}
}
catch (IOException e) {
LOG.warn("Error reading plugin [" + pluginClass + "] last modified date, cannot reload following change: " + e.getMessage());
}
finally {
if (conn!=null) {
try {
conn.getInputStream().close();
}
catch (IOException e) {
LOG.warn("Error closing URL connection to plugin resource [" + pluginUrl + "]: " + e.getMessage(), e);
}
}
}
}
if (onChangeListener != null) {
checkForNewResources(this);
if (LOG.isDebugEnabled()) {
LOG.debug("Plugin " + this + " checking [" + watchedResources.length + "] resources for changes..");
}
for (int i = 0; i < watchedResources.length; i++) {
final Resource r = watchedResources[i];
long modifiedFlag = checkModified(r, modifiedTimes[i]) ;
if ( modifiedFlag > -1) {
if (LOG.isInfoEnabled()) LOG.info("Grails plug-in resource [" + r + "] changed, reloading changes..");
modifiedTimes[i] = modifiedFlag;
fireModifiedEvent(r, this);
refreshInfluencedPlugins();
}
}
}
return false;
}
/**
* This method will retrieve all the influenced plugins from the manager and
* call refresh() on each one.
*/
private void refreshInfluencedPlugins() {
if (LOG.isDebugEnabled()) {
LOG.debug("Plugin " + this + " starting refresh of influenced plugins " + ArrayUtils.toString(influencedPluginNames));
}
if (manager != null) {
for (String name : influencedPluginNames) {
GrailsPlugin grailsPlugin = manager.getGrailsPlugin(name);
if (grailsPlugin != null) {
if (LOG.isDebugEnabled()) {
LOG.debug(this + " plugin is refreshing influenced plugin " + grailsPlugin + " following change to resource");
}
grailsPlugin.refresh();
}
}
}
else if (LOG.isDebugEnabled()) {
LOG.debug("Plugin "+this+" cannot refresh influenced plugins, manager is not found");
}
}
/**
* Takes a Resource and checks it against the previous modified time passed
* in the arguments. If the resource was modified it will return the new modified time, otherwise
* it will return -1.
*
* @param r the Resource instance
* @param previousModifiedTime the last time the Resource was modified
* @return the new modified time or -1
*/
private long checkModified(Resource r, long previousModifiedTime) {
// If the resource doesn't exist, skip the check.
if (!r.exists()) {
return -1;
}
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Checking modified for resource " + r);
}
long lastModified = r.lastModified();
if ( previousModifiedTime < lastModified ) {
return lastModified;
}
}
catch (IOException e) {
LOG.debug("Unable to read last modified date of plugin resource" +e.getMessage(),e);
}
return -1;
}
private void checkForNewResources(final GrailsPlugin grailsPlugin) {
if (resourcesReferences == null) {
return;
}
if (LOG.isDebugEnabled()) {
LOG.debug("Plugin " + grailsPlugin + " checking [" + ArrayUtils.toString(resourcesReferences) +
"] resource references new resources that have been added..");
}
for (int i = 0; i < resourcesReferences.length; i++) {
String resourcesReference = resourcesReferences[i];
try {
Resource[] tmp = resolver.getResources(resourcesReference);
if (resourceCount[i] < tmp.length) {
Resource newResource = null;
resourceCount[i] = tmp.length;
for (Resource resource : tmp) {
if (!ArrayUtils.contains(watchedResources, resource)) {
newResource = resource;
break;
}
}
if (newResource != null) {
watchedResources = (Resource[])ArrayUtils.add(watchedResources, newResource);
if (LOG.isInfoEnabled()) {
LOG.info("Found new Grails plug-in resource [" + newResource + "], adding to application..");
}
if (newResource.getFilename().endsWith(".groovy")) {
if (LOG.isDebugEnabled()) {
LOG.debug("[GrailsPlugin] plugin resource ["+newResource+"] added, registering resource with class loader...");
}
ClassLoader classLoader = application.getClassLoader();
GrailsResourceLoader resourceLoader = GrailsResourceLoaderHolder.getResourceLoader();
Resource[] classLoaderResources = resourceLoader.getResources();
classLoaderResources = (Resource[])ArrayUtils.add(classLoaderResources, newResource);
resourceLoader.setResources(classLoaderResources);
if (classLoader instanceof GrailsClassLoader) {
((GrailsClassLoader)classLoader).setGrailsResourceLoader(resourceLoader);
}
}
initializeModifiedTimes();
if (LOG.isDebugEnabled()) {
LOG.debug("[GrailsPlugin] plugin resource [" + newResource + "] added, firing event if possible..");
}
fireModifiedEvent(newResource, grailsPlugin);
}
}
}
catch (Exception e) {
LOG.debug("Plugin " + this + " was unable to check for new plugin resources: " + e.getMessage());
}
}
}
protected void fireModifiedEvent(final Resource resource,
@SuppressWarnings("unused") final GrailsPlugin grailsPlugin) {
Class<?> loadedClass = null;
String className = GrailsResourceUtils.getClassName(resource);
Object source;
if (className != null) {
Class<?> oldClass = application.getClassForName(className);
loadedClass = attemptClassReload(className);
source = loadedClass != null ? loadedClass : oldClass;
}
else {
source = resource;
}
if (loadedClass != null && Modifier.isAbstract(loadedClass.getModifiers())) {
restartContainer();
}
else if (source != null) {
Map event = notifyOfEvent(EVENT_ON_CHANGE, source);
if (LOG.isDebugEnabled()) {
LOG.debug("Firing onChange event listener with event object ["+event+"]");
}
getManager().informObservers(getName(), event);
}
}
public void restartContainer() {
// here we touch the classes directory if the file is abstract to force the Grails server
// to restart the web application
try {
BuildSettings settings = BuildSettingsHolder.getSettings();
File classesDir = settings != null ? settings.getClassesDir() : null;
if (classesDir == null) {
Resource r = applicationContext.getResource("/WEB-INF/classes");
classesDir = r.getFile();
}
classesDir.setLastModified(System.currentTimeMillis());
}
catch (IOException e) {
LOG.error("Error retrieving /WEB-INF/classes directory: " + e.getMessage(),e);
}
}
private Class<?> attemptClassReload(String className) {
final ClassLoader loader = application.getClassLoader();
if (loader instanceof GrailsClassLoader) {
GrailsClassLoader grailsLoader = (GrailsClassLoader)loader;
return grailsLoader.reloadClass(className);
}
// Added this to see whether it helps track down an intermittent
// bug with dynamic loading of new artifacts.
LOG.warn("Expected GrailsClassLoader - got " + loader.getClass());
return null;
}
public void setWatchedResources(Resource[] watchedResources) throws IOException {
this.watchedResources = watchedResources;
initializeModifiedTimes();
}
/*
* These two properties help the closures to resolve a log and plugin variable during executing
*/
public Log getLog() {
return LOG;
}
public GrailsPlugin getPlugin() {
return this;
}
public void setParentApplicationContext(ApplicationContext parent) {
// do nothing for the moment
}
/* (non-Javadoc)
* @see org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin#refresh()
*/
@Override
public void refresh() {
refresh(true);
}
public void refresh(boolean fireEvent) {
for (Resource r : watchedResources) {
try {
r.getFile().setLastModified(System.currentTimeMillis());
}
catch (IOException e) {
// ignore
}
if (fireEvent) {
fireModifiedEvent(r, this);
}
}
}
public GroovyObject getInstance() {
return plugin;
}
public void doWithDynamicMethods(ApplicationContext ctx) {
try {
if (pluginBean.isReadableProperty(DO_WITH_DYNAMIC_METHODS)) {
Closure c = (Closure)plugin.getProperty(DO_WITH_DYNAMIC_METHODS);
if (enableDocumentationGeneration()) {
DocumentationContext.getInstance().setActive(true);
}
c.setDelegate(this);
c.call(new Object[]{ctx});
}
}
finally {
if (enableDocumentationGeneration()) {
DocumentationContext.getInstance().reset();
}
}
}
public boolean isEnabled() {
return STATUS_ENABLED.equals(status);
}
public String[] getObservedPluginNames() {
return observedPlugins;
}
public void notifyOfEvent(Map event) {
if (onChangeListener != null) {
invokeOnChangeListener(event);
}
}
@SuppressWarnings("serial")
public Map notifyOfEvent(int eventKind, final Object source) {
Map<String, Object> event = new HashMap<String, Object>() {{
put(PLUGIN_CHANGE_EVENT_SOURCE, source);
put(PLUGIN_CHANGE_EVENT_PLUGIN, plugin);
put(PLUGIN_CHANGE_EVENT_APPLICATION, application);
put(PLUGIN_CHANGE_EVENT_MANAGER, getManager());
put(PLUGIN_CHANGE_EVENT_CTX, applicationContext);
}};
switch (eventKind) {
case EVENT_ON_CHANGE:
notifyOfEvent(event);
getManager().informObservers(getName(), event);
break;
case EVENT_ON_SHUTDOWN:
invokeOnShutdownEventListener(event);
break;
case EVENT_ON_CONFIG_CHANGE:
invokeOnConfigChangeListener(event);
break;
default:
notifyOfEvent(event);
}
return event;
}
private void invokeOnShutdownEventListener(Map event) {
callEvent(onShutdownListener,event);
}
private void invokeOnConfigChangeListener(Map event) {
callEvent(onConfigChangeListener,event);
}
private void callEvent(Closure closureHook, Map event) {
if (closureHook != null) {
closureHook.setDelegate(this);
closureHook.call(new Object[]{event});
}
}
private void invokeOnChangeListener(Map event) {
onChangeListener.setDelegate(this);
onChangeListener.call(new Object[]{event});
// Apply any factory post processors in case the change listener has changed any
// bean definitions (GRAILS-5763)
if (applicationContext instanceof GenericApplicationContext) {
GenericApplicationContext ctx = (GenericApplicationContext) applicationContext;
ConfigurableListableBeanFactory beanFactory = ctx.getBeanFactory();
for (BeanFactoryPostProcessor postProcessor : ctx.getBeanFactoryPostProcessors()) {
postProcessor.postProcessBeanFactory(beanFactory);
}
}
}
public void doArtefactConfiguration() {
if (!pluginBean.isReadableProperty(ARTEFACTS)) {
return;
}
List l = (List)plugin.getProperty(ARTEFACTS);
for (Object artefact : l) {
if (artefact instanceof Class) {
Class artefactClass = (Class) artefact;
if (ArtefactHandler.class.isAssignableFrom(artefactClass)) {
try {
application.registerArtefactHandler((ArtefactHandler) artefactClass.newInstance());
}
catch (InstantiationException e) {
LOG.error("Cannot instantiate an Artefact Handler:" + e.getMessage(), e);
}
catch (IllegalAccessException e) {
LOG.error("The constructor of the Artefact Handler is not accessible:" + e.getMessage(), e);
}
}
else {
LOG.error("This class is not an ArtefactHandler:" + artefactClass.getName());
}
}
else {
if (artefact instanceof ArtefactHandler) {
application.registerArtefactHandler((ArtefactHandler) artefact);
}
else {
LOG.error("This object is not an ArtefactHandler:" + artefact + "[" + artefact.getClass().getName() + "]");
}
}
}
}
public Class<?>[] getProvidedArtefacts() {
return providedArtefacts;
}
public List<String> getPluginExcludes() {
return pluginExcludes;
}
public Collection<? extends TypeFilter> getTypeFilters() {
return typeFilters;
}
public String getFullName() {
return getName() + '-' + getVersion();
}
public Resource getDescriptor() {
return pluginDescriptor;
}
public Resource getPluginDir() {
try {
return pluginDescriptor.createRelative(".");
}
catch (IOException e) {
return null;
}
}
public Map getProperties() {
return DefaultGroovyMethods.getProperties(plugin);
}
}
| [
"[email protected]"
] | |
e506f16f8df1ed82cf0e2019afb61bd6ac97b908 | 694f36c48f564539c0aaf967245323314c77a065 | /src/com/isamorodov/contents/wcs12/FactorialArray.java | 6164b6444278a084d1cfdd315fa3142404131ac3 | [] | no_license | xaxtix/hackerrank | 27ed7ecdcd3f3518744cd4bbe83f8b0c71218937 | 1feed11523ee9d0a31c9e5ea143f0139714da823 | refs/heads/master | 2021-05-06T02:07:05.376615 | 2019-07-19T15:09:36 | 2019-07-19T15:09:36 | 114,495,064 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,992 | java | package com.isamorodov.contents.wcs12;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
/**
* Created by xaxtix on 26.12.17.
*/
public class FactorialArray {
private static final long[] factorial = new long[]{
1L,
1L,
2L,
6L,
24L,
120L,
720L,
5040L,
40320L,
362880L,
3628800L,
39916800L,
479001600L,
227020800L,
178291200L,
674368000L,
789888000L,
428096000L,
705728000L,
408832000L,
176640000L,
709440000L,
607680000L,
976640000L,
439360000L,
984000000L,
584000000L,
768000000L,
504000000L,
616000000L,
480000000L,
880000000L,
160000000L,
280000000L,
520000000L,
200000000L,
200000000L,
400000000L,
200000000L,
800000000L
};
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int[] arr = new int[n];
Set<Integer> availableIndexes = new TreeSet<>();
for (int A_i = 0; A_i < n; A_i++) {
arr[A_i] = in.nextInt();
if (arr[A_i] < 40) availableIndexes.add(A_i);
}
for (int a0 = 0; a0 < m; a0++) {
int o = in.nextInt();
int l = in.nextInt() - 1;
int r = in.nextInt() - 1;
switch (o) {
case 1:
Iterator<Integer> iterator = availableIndexes.iterator();
while (iterator.hasNext()) {
int i = iterator.next();
if (i > r) break;
if (i >= l) {
arr[i]++;
if (arr[i] >= 40) iterator.remove();
}
}
break;
case 2:
iterator = availableIndexes.iterator();
long sum = 0;
while (iterator.hasNext()) {
int i = iterator.next();
if (i > r) break;
if (i >= l) {
sum += factorial[arr[i]];
}
}
System.out.println(sum % 1000000000);
break;
case 3:
arr[l] = r + 1;
if(arr[l] >= 40){
availableIndexes.remove(l);
}else {
availableIndexes.add(l);
}
break;
}
}
}
}
| [
"[email protected]"
] | |
7726359dd8491f7af2f3fc43c4aaa08884ac5184 | c2a855fdf61de0efe74decce6d32430ded20dc97 | /app/src/main/java/mypromoguide/pro/novatechsolutions/app/mypromoguide/Splash.java | 7cb9e7eb98f3d0066e7f832ee13cbf8c0c58b507 | [] | no_license | Lukengu/MyPromoGuide | 48166d2bd046554e929f2ce9d7ccb335631a05fa | 8638ccfcb829bf9faa582dcfc520d461745d1e9d | refs/heads/master | 2020-03-26T16:55:32.918672 | 2018-08-20T14:17:58 | 2018-08-20T14:17:58 | 145,132,066 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,308 | java | package mypromoguide.pro.novatechsolutions.app.mypromoguide;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Random;
import mypromoguide.pro.novatechsolutions.app.mypromoguide.utils.AppPreferences;
import mypromoguide.pro.novatechsolutions.app.mypromoguide.utils.AppTypeFace;
import mypromoguide.pro.novatechsolutions.app.sms_portal.AppConfig;
import mypromoguide.pro.novatechsolutions.app.sms_portal.SMSPortal;
import mypromoguide.pro.novatechsolutions.app.sms_portal.client.Auth;
import mypromoguide.pro.novatechsolutions.app.sms_portal.client.ClientException;
import mypromoguide.pro.novatechsolutions.app.sms_portal.client.OnServiceResponseListener;
public class Splash extends Activity implements OnServiceResponseListener {
private AppPreferences appPreferences;
private EditText cellphone_number;
private TextView label;
private Button btn_send;
private Typeface plain;
private Typeface bold;
private JSONObject user_infos = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
ImageView logo = findViewById(R.id.logo);
cellphone_number = findViewById(R.id.cellphone_number);
label = findViewById(R.id.label);
btn_send = findViewById(R.id.btn_send);
plain = AppTypeFace.NewInstance(Splash.this).getTypeFace();
bold = AppTypeFace.NewInstance(Splash.this).getBoldTypeFace();
cellphone_number.setTypeface(plain);
label.setTypeface(plain);
btn_send.setTypeface(bold);
btn_send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (user_infos != null) {
try {
if(cellphone_number.equals(user_infos.getString("cell_no"))){
startActivity(new Intent(Splash.this, Content.class));
} else {
cellphone_number.setError("Invalid Credentials. To reset please clear the application data");
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
if (TextUtils.isEmpty(cellphone_number.getText())) {
cellphone_number.setError("Cellphone number is required");
/*
*/
} else {
int min = 11111;
int max = 99999;
Random r = new Random();
int otp = r.nextInt((max - min) + 1) + min;
appPreferences.setAuthOTP(otp);
SMSPortal sms = new SMSPortal(getApplicationContext(), Splash.this);
ArrayList<String> numbers = new ArrayList<String>();
numbers.add(cellphone_number.getText().toString());
sms.sendMS("Your MyPromoGuide OTP for Registration is " + otp, numbers);
startActivity(new Intent(Splash.this, Verify.class).putExtra("cell_no", cellphone_number.getText()));
finish();
}
}
}
});
Animation startAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fadein);
final Animation textAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fadein_fast);
logo.startAnimation(startAnimation);
appPreferences = AppPreferences.NewInstance(Splash.this);
if(!TextUtils.isEmpty(appPreferences.getUser())) {
try {
user_infos = new JSONObject(appPreferences.getUser());
} catch (JSONException e) {
e.printStackTrace();
}
}
if(user_infos != null) {
label.setText("Please enter your cellphone number to login");
btn_send.setText("Login");
}
//Toast.makeText(this, "" +appPreferences.IsfirstTimeRun(), Toast.LENGTH_LONG).show();
//Toast.makeText(this, "" + AppConfig.API_USERNAME, Toast.LENGTH_LONG).show();
startAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
if(appPreferences.IsfirstTimeRun()){
cellphone_number.setVisibility(View.VISIBLE);
label.setVisibility(View.VISIBLE);
btn_send.setVisibility(View.VISIBLE);
cellphone_number.startAnimation(textAnimation);
label.startAnimation(textAnimation);
btn_send.startAnimation(textAnimation);
} else {
startActivity(new Intent(Splash.this, Content.class));
finish();
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
@Override
public void onSuccess(Object object) {
// Toast.makeText(getApplicationContext(), ((JSONObject) object).toString(), Toast.LENGTH_LONG).show();
}
@Override
public void onFailure(ClientException e) {
}
}
| [
"[email protected]"
] | |
f3291e2c3fd8d5946d02e958fa56c00931558c3e | 32b04080c19812767910088bd38fe8409b736d21 | /src/main/java/foodportal/admin/systemmngt/vo/BoardSettingVO.java | 344c4dd61dd481c23edbacac4995f274a30685a5 | [] | no_license | moriac-min/test1_new | f9dfe2d655f6cc4eab67f163b0cba7e960511e9c | 0a1577bc551a5a046763c8f80c8a562d3b9f4489 | refs/heads/master | 2021-01-17T05:26:11.029359 | 2016-07-06T00:31:46 | 2016-07-06T00:31:46 | 62,616,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,174 | java | package foodportal.admin.systemmngt.vo;
import common.commonfacillity.uia.WqBaseBean;
public class BoardSettingVO extends WqBaseBean{
private String bbs_no; //게시판번호
private String bbs_type_cd; //게시판유형코드
private String bbs_nm; //게시판명
private String menu_nm; //메뉴명
private String bbs_templet_url; //게시판템플릭URL
private String ctgry_type_cd; //카테고리유형코드
private String list_img_use_yn; //목록이미지사용여부
private String list_img_link_yn; //목록이미지링크여부
private String atch_file_posbl_yn; //첨부파일가능여부
private String perm_extnm; //허용확장명
private String mxmm_file_size; //최대파일사이즈
private String nticmatr_yn; //공지사항여부
private String ans_yn; //답글여부
private String cmt_yn; //댓글여부
private String user_txt_write_yn; //사용자글쓰기여부
private String user_txt_del_yn; //사용자글삭제여부
private String user_txt_lock_yn; //사용자글잠금여부
private String orgnl_view_use_yn; //원문보기사용여부
private String inqry_cnd_use_yn; //조회조건사용여부
private String kword_use_yn; //키워드사용여부
private String natn_cd_use_yn; //국가코드사용여부
private String outpt_type_cd; //출력유형코드
private String tab_use_yn; //TAB사용여부
private String tab_pdcnt; //TAB갯수
private String del_yn; //삭제여부
private String rm; //비고
private String tag_use_yn; //태그사용여부
private String meta_use_yn; //메타사용여부
private String cnt; //카운트
private String ctgry_use_yn; //카테고리사요여부
private String bbs_type; //게시판타입
private String user_id; //사용자ID
private String user_nm; //사용자명
private String ptcs_nm; //직급명
private String pstofc_nm; //직책명
private String cretr_id; //생성자ID
private java.sql.Date cret_dtm; //생성일시
private String last_updtr_id; //최종수정자ID
private java.sql.Date last_updt_dtm; //최종수정일시
/*******************다른곳에서 쓰는것********************/
private String use_yn;
public String getBbs_no() {
return bbs_no;
}
public void setBbs_no(String bbs_no) {
this.bbs_no = bbs_no;
}
public String getBbs_type_cd() {
return bbs_type_cd;
}
public void setBbs_type_cd(String bbs_type_cd) {
this.bbs_type_cd = bbs_type_cd;
}
public String getBbs_nm() {
return bbs_nm;
}
public void setBbs_nm(String bbs_nm) {
this.bbs_nm = bbs_nm;
}
public String getMenu_nm() {
return menu_nm;
}
public void setMenu_nm(String menu_nm) {
this.menu_nm = menu_nm;
}
public String getBbs_templet_url() {
return bbs_templet_url;
}
public void setBbs_templet_url(String bbs_templet_url) {
this.bbs_templet_url = bbs_templet_url;
}
public String getCtgry_type_cd() {
return ctgry_type_cd;
}
public void setCtgry_type_cd(String ctgry_type_cd) {
this.ctgry_type_cd = ctgry_type_cd;
}
public String getList_img_use_yn() {
return list_img_use_yn;
}
public void setList_img_use_yn(String list_img_use_yn) {
this.list_img_use_yn = list_img_use_yn;
}
public String getList_img_link_yn() {
return list_img_link_yn;
}
public void setList_img_link_yn(String list_img_link_yn) {
this.list_img_link_yn = list_img_link_yn;
}
public String getAtch_file_posbl_yn() {
return atch_file_posbl_yn;
}
public void setAtch_file_posbl_yn(String atch_file_posbl_yn) {
this.atch_file_posbl_yn = atch_file_posbl_yn;
}
public String getPerm_extnm() {
return perm_extnm;
}
public void setPerm_extnm(String perm_extnm) {
this.perm_extnm = perm_extnm;
}
public String getMxmm_file_size() {
return mxmm_file_size;
}
public void setMxmm_file_size(String mxmm_file_size) {
this.mxmm_file_size = mxmm_file_size;
}
public String getNticmatr_yn() {
return nticmatr_yn;
}
public void setNticmatr_yn(String nticmatr_yn) {
this.nticmatr_yn = nticmatr_yn;
}
public String getAns_yn() {
return ans_yn;
}
public void setAns_yn(String ans_yn) {
this.ans_yn = ans_yn;
}
public String getCmt_yn() {
return cmt_yn;
}
public void setCmt_yn(String cmt_yn) {
this.cmt_yn = cmt_yn;
}
public String getUser_txt_write_yn() {
return user_txt_write_yn;
}
public void setUser_txt_write_yn(String user_txt_write_yn) {
this.user_txt_write_yn = user_txt_write_yn;
}
public String getUser_txt_del_yn() {
return user_txt_del_yn;
}
public void setUser_txt_del_yn(String user_txt_del_yn) {
this.user_txt_del_yn = user_txt_del_yn;
}
public String getUser_txt_lock_yn() {
return user_txt_lock_yn;
}
public void setUser_txt_lock_yn(String user_txt_lock_yn) {
this.user_txt_lock_yn = user_txt_lock_yn;
}
public String getOrgnl_view_use_yn() {
return orgnl_view_use_yn;
}
public void setOrgnl_view_use_yn(String orgnl_view_use_yn) {
this.orgnl_view_use_yn = orgnl_view_use_yn;
}
public String getInqry_cnd_use_yn() {
return inqry_cnd_use_yn;
}
public void setInqry_cnd_use_yn(String inqry_cnd_use_yn) {
this.inqry_cnd_use_yn = inqry_cnd_use_yn;
}
public String getKword_use_yn() {
return kword_use_yn;
}
public void setKword_use_yn(String kword_use_yn) {
this.kword_use_yn = kword_use_yn;
}
public String getNatn_cd_use_yn() {
return natn_cd_use_yn;
}
public void setNatn_cd_use_yn(String natn_cd_use_yn) {
this.natn_cd_use_yn = natn_cd_use_yn;
}
public String getOutpt_type_cd() {
return outpt_type_cd;
}
public void setOutpt_type_cd(String outpt_type_cd) {
this.outpt_type_cd = outpt_type_cd;
}
public String getTab_use_yn() {
return tab_use_yn;
}
public void setTab_use_yn(String tab_use_yn) {
this.tab_use_yn = tab_use_yn;
}
public String getTab_pdcnt() {
return tab_pdcnt;
}
public void setTab_pdcnt(String tab_pdcnt) {
this.tab_pdcnt = tab_pdcnt;
}
public String getDel_yn() {
return del_yn;
}
public void setDel_yn(String del_yn) {
this.del_yn = del_yn;
}
public String getRm() {
return rm;
}
public void setRm(String rm) {
this.rm = rm;
}
public String getTag_use_yn() {
return tag_use_yn;
}
public void setTag_use_yn(String tag_use_yn) {
this.tag_use_yn = tag_use_yn;
}
public String getMeta_use_yn() {
return meta_use_yn;
}
public void setMeta_use_yn(String meta_use_yn) {
this.meta_use_yn = meta_use_yn;
}
public String getCnt() {
return cnt;
}
public void setCnt(String cnt) {
this.cnt = cnt;
}
public String getCtgry_use_yn() {
return ctgry_use_yn;
}
public void setCtgry_use_yn(String ctgry_use_yn) {
this.ctgry_use_yn = ctgry_use_yn;
}
public String getBbs_type() {
return bbs_type;
}
public void setBbs_type(String bbs_type) {
this.bbs_type = bbs_type;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getUser_nm() {
return user_nm;
}
public void setUser_nm(String user_nm) {
this.user_nm = user_nm;
}
public String getPtcs_nm() {
return ptcs_nm;
}
public void setPtcs_nm(String ptcs_nm) {
this.ptcs_nm = ptcs_nm;
}
public String getPstofc_nm() {
return pstofc_nm;
}
public void setPstofc_nm(String pstofc_nm) {
this.pstofc_nm = pstofc_nm;
}
public String getCretr_id() {
return cretr_id;
}
public void setCretr_id(String cretr_id) {
this.cretr_id = cretr_id;
}
public java.sql.Date getCret_dtm() {
return cret_dtm;
}
public void setCret_dtm(java.sql.Date cret_dtm) {
this.cret_dtm = cret_dtm;
}
public String getLast_updtr_id() {
return last_updtr_id;
}
public void setLast_updtr_id(String last_updtr_id) {
this.last_updtr_id = last_updtr_id;
}
public java.sql.Date getLast_updt_dtm() {
return last_updt_dtm;
}
public void setLast_updt_dtm(java.sql.Date last_updt_dtm) {
this.last_updt_dtm = last_updt_dtm;
}
public String getUse_yn() {
return use_yn;
}
public void setUse_yn(String use_yn) {
this.use_yn = use_yn;
}
} | [
"[email protected]"
] | |
9099f1662409b6b9b5cb5ed5aa1986ba3e71949a | 4197bcbee12a5d987fab886be00f1c1cfe7034b9 | /src/main/java/exception/InvalidInputException.java | c791fe7382da569d4ef9a7e30ca31366b7d9946d | [] | no_license | khor-jingqian/ip | da6ab9319dd63b43413f09ac8a4916e04e9234c3 | 995ad9ddbac36a557bbd8cbb600bc6485078af94 | refs/heads/master | 2022-12-19T13:26:09.355339 | 2020-09-17T12:22:16 | 2020-09-17T12:22:16 | 287,791,553 | 0 | 0 | null | 2020-09-07T05:21:03 | 2020-08-15T17:15:07 | Java | UTF-8 | Java | false | false | 387 | java | package exception;
/**
* Triggers when a user inputs an invalid command.
*/
public class InvalidInputException extends DukeException {
/**
* Initialises the exception object that warns
* users of the incorrect input.
*
* @param message Informs the users of the error.
*/
public InvalidInputException(String message) {
super(message);
}
}
| [
"[email protected]"
] | |
06928c70e807307d8634e4a094868a6da0d360f9 | a67606cf4a8f7ecb5a9b676401c858a377dbf8d7 | /Assignment1/src/Exercise1/TreeMain.java | fdf3f1e1af1257b9cbe22f1b907389a1b6293a18 | [] | no_license | amelow/1DV516 | 4e835c17204a76ec44f0ba229bbaa76f7d80d693 | fd7edf7aab5bb510727fa13892c595a381592b8c | refs/heads/master | 2020-08-01T18:39:43.482611 | 2019-11-20T17:38:27 | 2019-11-20T17:38:27 | 211,079,694 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package Exercise1;
/*
* Authors: Håkan Johansson and Amelie Löwe for the 1DV516 course
*/
public class TreeMain {
/*
* Main method for the MyIntegerBST class
*/
public static void main(String[] args) {
MyIntegerBST tree = new MyIntegerBST();
tree.insert(3);
tree.insert(2);
tree.insert(1);
tree.insert(4);
tree.insert(5);
tree.insert(7);
System.out.println("- Output of PrintByLevels() method - " + "\n");
tree.printByLevels();
/* Expected Output
* Depth 0: 3
* Depth 1: 4 2
* Depth 2: 5 1
* Depth 3: 7
*/
System.out.println("\n" + "- Output of mostSimilarValue() method - " + "\n");
System.out.println("1.Output of mostSimilarValue(3)--> " + tree.mostSimilarValue(3)); //Expected Output: 3
System.out.println("2.Output of mostSimilarValue(-4)--> " + tree.mostSimilarValue(-4));//Expected Output: 1
System.out.println("3.Output of mostSimilarValue(6)--> " + tree.mostSimilarValue(6));//Expected Output: 7
}
}
| [
"[email protected]"
] | |
a30594a266d8aee3f971be4f8d3f5d50e9ac5adf | 8a766f19166e5c748f304aa3d07e6d8e07b9f887 | /jdbc-security-sample/src/main/java/com/mani/security/SecurityConfiguration.java | deeea8892ab9e35f4273ec50ee76daf4597cfd73 | [] | no_license | manikandanravi94/sample-spring-security | a8f0fbc4b081a26c4becfe38359a7fdb9cbbaf85 | 3bae43b025dc436f083f44cfe221bbd1b3a41bb1 | refs/heads/master | 2022-12-16T10:57:54.683823 | 2020-09-05T19:01:36 | 2020-09-05T19:01:36 | 292,427,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,767 | java | package com.mani.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import javax.sql.DataSource;
/*
spring security has its own authentication manager in which it will validate user
we cant directly use authentication manager instead we can provide our convenient functionality by adding the
authentication manager builder
Spring security internally uses delegation filter(bunch of filters) to provide authentication and authorization
application can have multiple authentication provider.. all those will be managed by authentication manager.
authentication provider do have support method through which manager will send the credentials to the provider
then spring internally has the user detail object.. it will store in the particular thread context
for the subsequent request, spring security has its own filter store the user context by using its own mechanism.
*/
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private DataSource dataSource;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication().dataSource(dataSource);
//since it is using inmemory db we can get everything by default.. if we are using external dbs
//we can configure our specific query by using methods available in the auth builder.
//below is the way to used the default schema configuration given by spring
// .withDefaultSchema().dataSource(dataSource)
// .withUser(User.withUsername("user").password("user").roles("USER"))
// .withUser(User.withUsername("admin").password("admin").roles("ADMIN"));
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/user").hasRole("USER")
.antMatchers("/**").hasRole("ADMIN").antMatchers("/")
.permitAll().and().formLogin();
}
@Bean
public PasswordEncoder getPasswordEncoder(){
return NoOpPasswordEncoder.getInstance();
}
}
| [
"[email protected]"
] | |
08fbfbedf32f4e3b7a32bd9d5ff8eaa75f6df01d | 0d1768bdad1be4220138c7cb0d671f53632a44c7 | /guacamole-client/guacamole/src/main/java/org/apache/guacamole/rest/history/APIConnectionRecordSortPredicate.java | a881f60eb40b96cf2e565d78cd9df32b2043c66c | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | DmitryZagr/rpi-guacamole-docker-compose | ed9786f20c7d293d7a304ac98e28204c0a98c2c9 | 1b8001bdbb2812471e93673f93b81ca257c82823 | refs/heads/master | 2021-01-23T04:00:07.400099 | 2017-03-25T19:44:21 | 2017-03-25T19:44:21 | 86,146,210 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,946 | 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.guacamole.rest.history;
import javax.ws.rs.core.Response;
import org.apache.guacamole.GuacamoleClientException;
import org.apache.guacamole.net.auth.ConnectionRecordSet;
import org.apache.guacamole.rest.APIException;
/**
* A sort predicate which species the property to use when sorting connection
* records, along with the sort order.
*
* @author Michael Jumper
*/
public class APIConnectionRecordSortPredicate {
/**
* The prefix which will be included before the name of a sortable property
* to indicate that the sort order is descending, not ascending.
*/
public static final String DESCENDING_PREFIX = "-";
/**
* All possible property name strings and their corresponding
* ConnectionRecordSet.SortableProperty values.
*/
public enum SortableProperty {
/**
* The date that the connection associated with the connection record
* began (connected).
*/
startDate(ConnectionRecordSet.SortableProperty.START_DATE);
/**
* The ConnectionRecordSet.SortableProperty that this property name
* string represents.
*/
public final ConnectionRecordSet.SortableProperty recordProperty;
/**
* Creates a new SortableProperty which associates the property name
* string (identical to its own name) with the given
* ConnectionRecordSet.SortableProperty value.
*
* @param recordProperty
* The ConnectionRecordSet.SortableProperty value to associate with
* the new SortableProperty.
*/
SortableProperty(ConnectionRecordSet.SortableProperty recordProperty) {
this.recordProperty = recordProperty;
}
}
/**
* The property to use when sorting ConnectionRecords.
*/
private ConnectionRecordSet.SortableProperty property;
/**
* Whether the requested sort order is descending (true) or ascending
* (false).
*/
private boolean descending;
/**
* Parses the given string value, determining the requested sort property
* and ordering. Possible values consist of any valid property name, and
* may include an optional prefix to denote descending sort order. Each
* possible property name is enumerated by the SortableValue enum.
*
* @param value
* The sort predicate string to parse, which must consist ONLY of a
* valid property name, possibly preceded by the DESCENDING_PREFIX.
*
* @throws APIException
* If the provided sort predicate string is invalid.
*/
public APIConnectionRecordSortPredicate(String value)
throws APIException {
// Parse whether sort order is descending
if (value.startsWith(DESCENDING_PREFIX)) {
descending = true;
value = value.substring(DESCENDING_PREFIX.length());
}
// Parse sorting property into ConnectionRecordSet.SortableProperty
try {
this.property = SortableProperty.valueOf(value).recordProperty;
}
// Bail out if sort property is not valid
catch (IllegalArgumentException e) {
throw new APIException(
Response.Status.BAD_REQUEST,
new GuacamoleClientException(String.format("Invalid sort property: \"%s\"", value))
);
}
}
/**
* Returns the SortableProperty defined by ConnectionRecordSet which
* represents the property requested.
*
* @return
* The ConnectionRecordSet.SortableProperty which refers to the same
* property as the string originally provided when this
* APIConnectionRecordSortPredicate was created.
*/
public ConnectionRecordSet.SortableProperty getProperty() {
return property;
}
/**
* Returns whether the requested sort order is descending.
*
* @return
* true if the sort order is descending, false if the sort order is
* ascending.
*/
public boolean isDescending() {
return descending;
}
}
| [
"[email protected]"
] | |
a9d61119ff7455e542ba312b1cfe4782d6674ea6 | b977663bc3f67e13346fd106b82fd7240239a85e | /src/com/bnutalk/server/SignUpThread.java | ab457e59baa4674a23ec11d5b33f5a6a2e506ed3 | [] | no_license | linxiaoby/BNUtalk_Client | 6491b1d0642ebc74f5266b5787496317917e58b1 | c685d06c86037b057fc6b725d8b270c1b6dd19c5 | refs/heads/master | 2021-01-15T15:42:06.840851 | 2016-11-18T08:49:40 | 2016-11-18T08:49:40 | 55,694,688 | 0 | 2 | null | 2016-05-12T11:07:50 | 2016-04-07T12:58:14 | Java | UTF-8 | Java | false | false | 1,695 | java | package com.bnutalk.server;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import android.R.string;
/**
*
* @author linxiaobai
* upload user infomation to server ,don't delete just because no ahttp using
*/
public class SignUpThread extends Thread {
private String url;
private String mailAdress;
private String passwd;
public SignUpThread(String url, String mailAdress, String password) {
// TODO Auto-generated constructor stub
this.url = url;
this.mailAdress = mailAdress;
this.passwd = password;
}
private void doGet() throws IOException {
System.out.print("signUpHttp�߳̿�ʼ");
url=url+"?mailAdress="+mailAdress+"&passwd="+passwd;
try {
//����ݴ���Server
URL httpUrl = new URL(url);
HttpURLConnection conn = (HttpURLConnection) httpUrl.openConnection();
conn.setRequestMethod("GET");
conn.setReadTimeout(5000);
BufferedReader reader=new BufferedReader(new InputStreamReader(conn.getInputStream()));
String str;
StringBuffer sb=new StringBuffer();
//��ȡ���������ص���Ϣ
while((str=reader.readLine())!=null)
{
sb.append(str);
}
//�ѷ���˷��ص���ݴ�ӡ����
System.out.println("result"+sb.toString());
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/*��run���doGet*/
@Override
public void run() {
try {
doGet();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
74c6602782b4515912e97a8929824e70ac778f29 | 4da99f3e80fd5c5499a75ee620cb5d16959d7806 | /SpringBootExercicios/api/src/main/java/com/example/api/repositories/UsuarioRepository.java | 54481879fb47f688de8092b9e25f4d196e9b096b | [] | no_license | zecarlos558/Aula-PanAcademy | b8273d8c73093be5f6a99ebd417af65daafb91a8 | 17efbfbe02d66f07fba75c74e69447a38963aa91 | refs/heads/main | 2023-09-06T05:52:00.490959 | 2021-11-09T22:44:37 | 2021-11-09T22:44:37 | 415,385,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 300 | java | package com.example.api.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.example.api.model.Usuario;
@Repository
public interface UsuarioRepository extends JpaRepository<Usuario, Integer> {
}
| [
"[email protected]"
] | |
c91626bf93ff662e68a0c2cf5cc3df432d2516d1 | 22f70e3b9ce4e8c262e95e45f1082977ecd0693a | /app/src/main/java/com/android/attendance/activity/DelStudentActivity.java | 80073bdb992e2e9ab8e1de9ebfeba761f95206e2 | [] | no_license | shreyazaveri/Student-Attendance-Application | 4ba1fc18e6f9705d105e2817c34c9ea10dabfbb5 | 7078cb569ca8a84a94d7567a903faeeee452cfa3 | refs/heads/master | 2022-04-27T07:06:41.783189 | 2020-04-30T10:16:11 | 2020-04-30T10:16:11 | 260,177,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,506 | java | package com.android.attendance.activity;
import com.android.attendance.bean.StudentBean;
import com.android.attendance.db.DBAdapter;
import com.example.androidattendancesystem.R;
import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class DelStudentActivity extends Activity {
Button delStudent;
EditText stu_id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.delstudent);
stu_id=(EditText)findViewById(R.id.editText2);
delStudent=(Button)findViewById(R.id.button);
delStudent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int id = stu_id.getId();
StudentBean sb = new StudentBean();
int id1=sb.getStudent_id1(id);
stu_id.setText(Integer.toString(id1));
id1+=1;
DBAdapter dbAdapter = new DBAdapter(DelStudentActivity.this);
dbAdapter.deleteStudent(id1);
Intent intent = new Intent(DelStudentActivity.this, MenuActivity.class);
startActivity(intent);
Toast.makeText(getApplicationContext(), "Student Deleted successfully", Toast.LENGTH_SHORT).show();
}
});
}
} | [
"[email protected]"
] | |
51fb4b02053bdcc6d9ea10158fa08f66e2ae08bc | d0ea4105b3f3c881ee901d226e8848a5a7a7707d | /pss-core/src/main/java/org/apache/struts2/json/JSONWriter.java | 576809c8a85621950a078ba45b4e94b75e3d4dee | [] | no_license | jelycom/pss | 5408ba62546e078c18a8f1b8f63a1f5145ff043d | 3e4e8fb621ac6ad02673b6625e243982259d37e0 | refs/heads/master | 2021-01-10T19:41:20.252153 | 2013-11-20T01:00:08 | 2013-11-20T01:00:08 | 11,272,019 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 19,768 | java | /*
* 捷利商业进销存管理系统
* @(#)JSONWriter.java
* Copyright (c) 2002-2012 Jely Corporation
* @date: 2013-4-1
*/
/*
* $Id: JSONWriter.java 1079368 2011-03-08 14:24:16Z mcucchiara $
*
* 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.struts2.json;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.json.annotations.JSON;
import org.apache.struts2.json.annotations.JSONFieldBridge;
import org.apache.struts2.json.annotations.JSONParameter;
import org.apache.struts2.json.bridge.FieldBridge;
import org.apache.struts2.json.bridge.ParameterizedBridge;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.text.CharacterIterator;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.StringCharacterIterator;
import java.util.*;
import java.util.regex.Pattern;
/**
* 此类为STRUTS2 JSON插件中的类,但由于其为包权限并且不能设置DateFormate,故作相应修改,以能接收日期格式化
* <p>
* Serializes an object into JavaScript Object Notation (JSON). If cyclic
* references are detected they will be nulled out.
* </p>
*/
public class JSONWriter {
private static final Logger LOG = LoggerFactory.getLogger(JSONWriter.class);
/**
* By default, enums are serialzied as name=value pairs
*/
public static final boolean ENUM_AS_BEAN_DEFAULT = false;
private static final String DEFAULTDATEFORMAT="yyyy-MM-dd";
static char[] hex = "0123456789ABCDEF".toCharArray();
private StringBuilder buf = new StringBuilder();
private Stack stack = new Stack();
private boolean ignoreHierarchy = true;
private Object root;
private boolean buildExpr = true;
private String exprStack = "";
private Collection<Pattern> excludeProperties;
private Collection<Pattern> includeProperties;
private DateFormat formatter;
private boolean enumAsBean = ENUM_AS_BEAN_DEFAULT;
private boolean excludeNullProperties;
public void setFormatter(DateFormat formatter) {
this.formatter = formatter;
}
/**
* @param object Object to be serialized into JSON
* @return JSON string for object
* @throws JSONException
*/
public String write(Object object) throws JSONException {
return this.write(object, null, null, false);
}
/**
* @param object Object to be serialized into JSON
* @return JSON string for object
* @throws JSONException
*/
public String write(Object object, Collection<Pattern> excludeProperties,
Collection<Pattern> includeProperties, boolean excludeNullProperties) throws JSONException {
this.excludeNullProperties = excludeNullProperties;
this.buf.setLength(0);
this.root = object;
this.exprStack = "";
this.buildExpr = ((excludeProperties != null) && !excludeProperties.isEmpty())
|| ((includeProperties != null) && !includeProperties.isEmpty());
this.excludeProperties = excludeProperties;
this.includeProperties = includeProperties;
this.value(object, null);
return this.buf.toString();
}
/**
* Detect cyclic references
*/
private void value(Object object, Method method) throws JSONException {
if (object == null) {
this.add("null");
return;
}
if (this.stack.contains(object)) {
Class clazz = object.getClass();
// cyclic reference
if (clazz.isPrimitive() || clazz.equals(String.class)) {
this.process(object, method);
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Cyclic reference detected on " + object);
}
this.add("null");
}
return;
}
this.process(object, method);
}
/**
* Serialize object into json
*/
private void process(Object object, Method method) throws JSONException {
this.stack.push(object);
if (object instanceof Class) {
this.string(object);
} else if (object instanceof Boolean) {
this.bool((Boolean) object);
} else if (object instanceof Number) {
this.add(object);
} else if (object instanceof String) {
this.string(object);
} else if (object instanceof Character) {
this.string(object);
} else if (object instanceof Map) {
this.map((Map) object, method);
} else if (object.getClass().isArray()) {
this.array(object, method);
} else if (object instanceof Iterable) {
this.array(((Iterable) object).iterator(), method);
} else if (object instanceof Date) {
this.date((Date) object, method);
} else if (object instanceof Calendar) {
this.date(((Calendar) object).getTime(), method);
} else if (object instanceof Locale) {
this.string(object);
} else if (object instanceof Enum) {
this.enumeration((Enum) object);
} else {
this.bean(object);
}
this.stack.pop();
}
/**
* Instrospect bean and serialize its properties
*/
private void bean(Object object) throws JSONException {
this.add("{");
BeanInfo info;
try {
Class clazz = object.getClass();
info = ((object == this.root) && this.ignoreHierarchy) ? Introspector.getBeanInfo(clazz, clazz
.getSuperclass()) : Introspector.getBeanInfo(clazz);
PropertyDescriptor[] props = info.getPropertyDescriptors();
boolean hasData = false;
for (PropertyDescriptor prop : props) {
String name = prop.getName();
Method accessor = prop.getReadMethod();
Method baseAccessor = findBaseAccessor(clazz, accessor);
if (baseAccessor != null) {
if (baseAccessor.isAnnotationPresent(JSON.class)) {
JSONAnnotationFinder jsonFinder = new JSONAnnotationFinder(baseAccessor).invoke();
if (!jsonFinder.shouldSerialize()) continue;
if (jsonFinder.getName() != null) {
name = jsonFinder.getName();
}
}
// ignore "class" and others
if (this.shouldExcludeProperty(prop)) {
continue;
}
String expr = null;
if (this.buildExpr) {
expr = this.expandExpr(name);
if (this.shouldExcludeProperty(expr)) {
continue;
}
expr = this.setExprStack(expr);
}
Object value = accessor.invoke(object);
if (baseAccessor.isAnnotationPresent(JSONFieldBridge.class)) {
value = getBridgedValue(baseAccessor, value);
}
boolean propertyPrinted = this.add(name, value, accessor, hasData);
hasData = hasData || propertyPrinted;
if (this.buildExpr) {
this.setExprStack(expr);
}
}
}
// special-case handling for an Enumeration - include the name() as
// a property */
if (object instanceof Enum) {
Object value = ((Enum) object).name();
this.add("_name", value, object.getClass().getMethod("name"), hasData);
}
} catch (Exception e) {
throw new JSONException(e);
}
this.add("}");
}
private Object getBridgedValue(Method baseAccessor, Object value) throws InstantiationException, IllegalAccessException {
JSONFieldBridge fieldBridgeAnn = baseAccessor.getAnnotation(JSONFieldBridge.class);
if (fieldBridgeAnn != null) {
Class impl = fieldBridgeAnn.impl();
FieldBridge instance = (FieldBridge) impl.newInstance();
if (fieldBridgeAnn.params().length > 0 && ParameterizedBridge.class.isAssignableFrom(impl)) {
Map<String, String> params = new HashMap<String, String>(fieldBridgeAnn.params().length);
for (JSONParameter param : fieldBridgeAnn.params()) {
params.put(param.name(), param.value());
}
((ParameterizedBridge) instance).setParameterValues(params);
}
value = instance.objectToString(value);
}
return value;
}
private Method findBaseAccessor(Class clazz, Method accessor) {
Method baseAccessor = null;
if (clazz.getName().indexOf("$$EnhancerByCGLIB$$") > -1) {
try {
baseAccessor = Class.forName(
clazz.getName().substring(0, clazz.getName().indexOf("$$"))).getMethod(
accessor.getName(), accessor.getParameterTypes());
} catch (Exception ex) {
LOG.debug(ex.getMessage(), ex);
}
} else if (clazz.getName().indexOf("$$_javassist") > -1) {
try {
baseAccessor = Class.forName(
clazz.getName().substring(0, clazz.getName().indexOf("_$$")))
.getMethod(accessor.getName(), accessor.getParameterTypes());
} catch (Exception ex) {
LOG.debug(ex.getMessage(), ex);
}
} else {
return accessor;
}
return baseAccessor;
}
/**
* Instrospect an Enum and serialize it as a name/value pair or as a bean
* including all its own properties
*/
private void enumeration(Enum enumeration) throws JSONException {
if (enumAsBean) {
this.bean(enumeration);
} else {
this.string(enumeration.name());
}
}
private boolean shouldExcludeProperty(PropertyDescriptor prop) throws SecurityException,
NoSuchFieldException {
String name = prop.getName();
return name.equals("class") || name.equals("declaringClass") || name.equals("cachedSuperClass")
|| name.equals("metaClass");
}
private String expandExpr(int i) {
return this.exprStack + "[" + i + "]";
}
private String expandExpr(String property) {
if (this.exprStack.length() == 0)
return property;
return this.exprStack + "." + property;
}
private String setExprStack(String expr) {
String s = this.exprStack;
this.exprStack = expr;
return s;
}
private boolean shouldExcludeProperty(String expr) {
if (this.excludeProperties != null) {
for (Pattern pattern : this.excludeProperties) {
if (pattern.matcher(expr).matches()) {
if (LOG.isDebugEnabled())
LOG.debug("Ignoring property because of exclude rule: " + expr);
return true;
}
}
}
if (this.includeProperties != null) {
for (Pattern pattern : this.includeProperties) {
if (pattern.matcher(expr).matches()) {
return false;
}
}
if (LOG.isDebugEnabled())
LOG.debug("Ignoring property because of include rule: " + expr);
return true;
}
return false;
}
/**
* Add name/value pair to buffer
*/
private boolean add(String name, Object value, Method method, boolean hasData) throws JSONException {
if (!excludeNullProperties || (value != null)) {
if (hasData) {
this.add(',');
}
this.add('"');
this.add(name);
this.add("\":");
this.value(value, method);
return true;
}
return false;
}
/**
* Add map to buffer
*/
private void map(Map map, Method method) throws JSONException {
this.add("{");
Iterator it = map.entrySet().iterator();
boolean warnedNonString = false; // one report per map
boolean hasData = false;
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Object key = entry.getKey();
String expr = null;
if (this.buildExpr) {
if (key == null) {
LOG.error("Cannot build expression for null key in " + this.exprStack);
continue;
} else {
expr = this.expandExpr(key.toString());
if (this.shouldExcludeProperty(expr)) {
continue;
}
expr = this.setExprStack(expr);
}
}
if (hasData) {
this.add(',');
}
hasData = true;
if (!warnedNonString && !(key instanceof String)) {
LOG.warn("JavaScript doesn't support non-String keys, using toString() on "
+ key.getClass().getName());
warnedNonString = true;
}
this.value(key.toString(), method);
this.add(":");
this.value(entry.getValue(), method);
if (this.buildExpr) {
this.setExprStack(expr);
}
}
this.add("}");
}
/**
* Add date to buffer
*/
private void date(Date date, Method method) {
JSON json = null;
if (method != null)
json = method.getAnnotation(JSON.class);
if (this.formatter == null)
this.formatter = new SimpleDateFormat(DEFAULTDATEFORMAT);
DateFormat formatter = (json != null) && (json.format().length() > 0) ? new SimpleDateFormat(json
.format()) : this.formatter;
this.string(formatter.format(date));
}
/**
* Add array to buffer
*/
private void array(Iterator it, Method method) throws JSONException {
this.add("[");
boolean hasData = false;
for (int i = 0; it.hasNext(); i++) {
String expr = null;
if (this.buildExpr) {
expr = this.expandExpr(i);
if (this.shouldExcludeProperty(expr)) {
it.next();
continue;
}
expr = this.setExprStack(expr);
}
if (hasData) {
this.add(',');
}
hasData = true;
this.value(it.next(), method);
if (this.buildExpr) {
this.setExprStack(expr);
}
}
this.add("]");
}
/**
* Add array to buffer
*/
private void array(Object object, Method method) throws JSONException {
this.add("[");
int length = Array.getLength(object);
boolean hasData = false;
for (int i = 0; i < length; ++i) {
String expr = null;
if (this.buildExpr) {
expr = this.expandExpr(i);
if (this.shouldExcludeProperty(expr)) {
continue;
}
expr = this.setExprStack(expr);
}
if (hasData) {
this.add(',');
}
hasData = true;
this.value(Array.get(object, i), method);
if (this.buildExpr) {
this.setExprStack(expr);
}
}
this.add("]");
}
/**
* Add boolean to buffer
*/
private void bool(boolean b) {
this.add(b ? "true" : "false");
}
/**
* escape characters
*/
private void string(Object obj) {
this.add('"');
CharacterIterator it = new StringCharacterIterator(obj.toString());
for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) {
if (c == '"') {
this.add("\\\"");
} else if (c == '\\') {
this.add("\\\\");
} else if (c == '/') {
this.add("\\/");
} else if (c == '\b') {
this.add("\\b");
} else if (c == '\f') {
this.add("\\f");
} else if (c == '\n') {
this.add("\\n");
} else if (c == '\r') {
this.add("\\r");
} else if (c == '\t') {
this.add("\\t");
} else if (Character.isISOControl(c)) {
this.unicode(c);
} else {
this.add(c);
}
}
this.add('"');
}
/**
* Add object to buffer
*/
private void add(Object obj) {
this.buf.append(obj);
}
/**
* Add char to buffer
*/
private void add(char c) {
this.buf.append(c);
}
/**
* Represent as unicode
*
* @param c character to be encoded
*/
private void unicode(char c) {
this.add("\\u");
int n = c;
for (int i = 0; i < 4; ++i) {
int digit = (n & 0xf000) >> 12;
this.add(hex[digit]);
n <<= 4;
}
}
public void setIgnoreHierarchy(boolean ignoreHierarchy) {
this.ignoreHierarchy = ignoreHierarchy;
}
/**
* If true, an Enum is serialized as a bean with a special property
* _name=name() as all as all other properties defined within the enum.<br/>
* If false, an Enum is serialized as a name=value pair (name=name())
*
* @param enumAsBean true to serialize an enum as a bean instead of as a name=value
* pair (default=false)
*/
public void setEnumAsBean(boolean enumAsBean) {
this.enumAsBean = enumAsBean;
}
private static class JSONAnnotationFinder {
private boolean serialize = true;
private Method accessor;
private String name;
public JSONAnnotationFinder(Method accessor) {
this.accessor = accessor;
}
boolean shouldSerialize() {
return serialize;
}
public String getName() {
return name;
}
public JSONAnnotationFinder invoke() {
JSON json = accessor.getAnnotation(JSON.class);
serialize = json.serialize();
if (serialize && json.name().length() > 0) {
name = json.name();
}
return this;
}
}
}
| [
"[email protected]"
] | |
2683c1b9356831b908e7ac66db8fb1c0b71f1e48 | 251981ac605ffca76a93212a0d3727e7e1cb1602 | /src/test/java/com/stackroute/newsaggregator/NewsRestApiApplicationTests.java | d724e17a4c780d68d4238b65a358d72fc6ce88a8 | [] | no_license | devendra0901/SpringBootNewsAggregator | a1208a3a2e72733552a7d9730f330b2d604b8b03 | a4ac38dd633354fc9c877b459efbd0174b63697e | refs/heads/master | 2021-07-10T11:05:58.555096 | 2017-10-14T11:28:45 | 2017-10-14T11:28:45 | 106,921,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,479 | java | package com.stackroute.newsaggregator;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
import com.stackroute.newsaggregator.NewsRestApiApplication;
import com.stackroute.newsaggregator.model.Article;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = NewsRestApiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class NewsRestApiApplicationTests {
@LocalServerPort
private int port;
TestRestTemplate restTemplate = new TestRestTemplate();
HttpHeaders headers = new HttpHeaders();
Article article;
@Before
public void setUp() throws Exception {
article = new Article();
article.setAuthor("Andrew MarchandESPN Senior Writer");
}
private String createURLWithPort(String uri) {
return "http://localhost:" + port + uri;
}
@After
public void tearDown() throws Exception {
}
@Test
public void testPostArticle() throws Exception {
HttpEntity<Article> entity = new HttpEntity<Article>(article, headers);
ResponseEntity<String> response = restTemplate.exchange(
createURLWithPort("/v1/news/article"),
HttpMethod.POST, entity, String.class);
assertNotNull(response);
String actual = response.getBody();
System.out.println(actual);
assertNotNull(actual);
}
// @Test
// public void testList() throws Exception {
// HttpEntity<String> entity = new HttpEntity<String>(null, headers);
// ResponseEntity<String> response = restTemplate.exchange(
// createURLWithPort("/user/list"),
// HttpMethod.GET, entity, String.class);
// assertNotNull(response);
//
// }
// @Test
// public void testGetUser() throws Exception {
//
// }
// @Test
// public void testUpdateUser() throws Exception {
//
// }
//
// @Test
// public void testDeleteUser() throws Exception {
//
// }
}
| [
"[email protected]"
] | |
e7dfd5fd7105ae0a922ddb064db549ace97d1671 | c60a629410b1fe0a4e47b90f82507ebd7f636fc7 | /src/test/java/edu/upc/dsa/TracksManagerServerTest/AlbumsServiceTest.java | 8bf7032ca2baff0f6aa63f8658e318cf40ed42ae | [] | no_license | carlogattuso/TracksManager | 68b928db405531e942a33eb2f28790304f1eccd8 | 0e378e5b02e68f836423f0610772cbe02d266a40 | refs/heads/master | 2020-05-07T22:46:30.773436 | 2019-04-12T07:59:57 | 2019-04-12T07:59:57 | 180,400,850 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,120 | java | package edu.upc.dsa.TracksManagerServerTest;
import edu.upc.dsa.Main;
import edu.upc.dsa.models.*;
import org.glassfish.grizzly.http.server.HttpServer;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class AlbumsServiceTest {
private HttpServer server;
private WebTarget target;
@Before
public void setUp() {
// start the server
server = Main.startServer();
// create the client
Client c = ClientBuilder.newClient();
// uncomment the following line if you want to enable
// support for JSON in the client (you also have to uncomment
// dependency on jersey-media-json module in pom.xml and Main.startServer())
// --
// c.configuration().enable(new org.glassfish.jersey.media.json.JsonJaxbFeature());
target = c.target(Main.BASE_URI);
}
@After
public void tearDown() {
server.shutdown();
}
@Test
public void getAlbumsTest() {
Response response = target.path("/albums/").request().get();
assertEquals("should return status 201", 201, response.getStatus());
List<AlbumTOGet> list = response.readEntity(new GenericType<List<AlbumTOGet>>() {
});
Assert.assertNotNull("should return album list", list);
Assert.assertEquals(4,list.size());
}
@Test
public void getAlbumTest() {
Response response = target.path("/albums/bad").request().get();
assertEquals("should return status 201", 201, response.getStatus());
AlbumTOInfo a = response.readEntity(new GenericType<AlbumTOInfo>() {
});
Assert.assertNotNull("Should return an album", a);
Assert.assertEquals("bad",a.getId());
}
@Test
public void postAlbumTest() {
AlbumTOPost a = new AlbumTOPost("rumbaalodesconocido","Rumba A Lo Desconocido","estopa");
Entity<AlbumTOPost> entity = Entity.entity(a, MediaType.APPLICATION_JSON_TYPE);
Response response = target.path("/albums/").request().post(entity);
assertEquals("should return status 201", 201, response.getStatus());
AlbumTOPost album = response.readEntity(new GenericType<AlbumTOPost>() {
});
assertEquals("rumbaalodesconocido",album.getId());
}
@Test
public void deleteTrackTest() {
Response response = target.path("/albums/thriller").request().delete();
assertEquals("should return status 201", 201, response.getStatus());
Response response2 = target.path("/albums/").request().get();
List<AlbumTOGet> list = response2.readEntity(new GenericType<List<AlbumTOGet>>() {
});
Assert.assertEquals(3,list.size());
}
@Test
public void putTrackTest() {
AlbumTOUpdate a = new AlbumTOUpdate("destrangis","Pepito");
Entity<AlbumTOUpdate> entity = Entity.entity(a, MediaType.APPLICATION_JSON_TYPE);
Response response = target.path("/albums/").request().put(entity);
assertEquals("should return status 201", 201, response.getStatus());
Response response2 = target.path("/albums/destrangis").request().get();
AlbumTOInfo album = response2.readEntity(new GenericType<AlbumTOInfo>() {
});
Assert.assertEquals("Pepito",album.getName());
}
@Test
public void getTracksByAlbum() {
Response response = target.path("/albums/destrangis/tracks").request().get();
assertEquals("should return status 201", 201, response.getStatus());
List<TrackTOUpdate> list = response.readEntity(new GenericType<List<TrackTOUpdate>>() {
});
Assert.assertEquals(3,list.size());
}
} | [
"[email protected]"
] | |
199a2285baf680cd0afbb943a7002192d8bde316 | bc5dd15a2d28ae6f90b86f87d8ec4e740ebc4e98 | /geekspring/src/main/java/com/geekbrains/geekspring/services/ShoppingCartService.java | dd89375ad53b99873484a94211e562931d7a4305 | [] | no_license | AndreySamylkin86/Spring2 | 5206aec9cd8ba5b6c52cd4b96dcf0fc7c805420f | 2bd543004331fb0590f5575d692c5efc9537af3e | refs/heads/main | 2023-03-19T07:10:25.190629 | 2021-03-09T08:16:12 | 2021-03-09T08:16:12 | 344,204,108 | 0 | 0 | null | 2021-03-10T07:12:21 | 2021-03-03T17:14:22 | CSS | UTF-8 | Java | false | false | 2,115 | java | package com.geekbrains.geekspring.services;
import com.geekbrains.geekspring.entities.Product;
import com.geekbrains.geekspring.entities.ShoppingCart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
@Service
public class ShoppingCartService {
private ProductService productService;
@Autowired
public void setProductService(ProductService productService) {
this.productService = productService;
}
public ShoppingCart getCurrentCart(HttpSession session) {
ShoppingCart cart = (ShoppingCart) session.getAttribute("cart");
if (cart == null) {
cart = new ShoppingCart();
session.setAttribute("cart", cart);
}
return cart;
}
public void resetCart(HttpSession session) {
session.removeAttribute("cart");
}
public void addToCart(HttpSession session, Long productId) {
Product product = productService.getProductById(productId);
addToCart(session, product);
}
public void addToCart(HttpSession session, Product product) {
ShoppingCart cart = getCurrentCart(session);
cart.add(product);
}
public void removeFromCart(HttpSession session, Long productId) {
Product product = productService.getProductById(productId);
removeFromCart(session, product);
}
public void removeFromCart(HttpSession session, Product product) {
ShoppingCart cart = getCurrentCart(session);
cart.remove(product);
}
public void setProductCount(HttpSession session, Long productId, Long quantity) {
Product product = productService.getProductById(productId);
setProductCount(session, productId, quantity);
}
public void setProductCount(HttpSession session, Product product, Long quantity) {
ShoppingCart cart = getCurrentCart(session);
cart.setQuantity(product, quantity);
}
public double getTotalCost(HttpSession session) {
return getCurrentCart(session).getTotalCost();
}
}
| [
"[email protected]"
] | |
0b08306695520e8c29296cbbb2fb5fbcf0862f0e | 50079251400e2d983506d289b05e7d14aa040cbf | /src/test/java/za/co/goosen/web/rest/errors/ExceptionTranslatorTestController.java | e1b44bb5080deb12ee71d7678bd1e68c41f4d8af | [] | no_license | gerhardgoosen/ngBootTodo | a987cd9d55de920ddc40263ce3fd4fbad4c6ff61 | c925a57f4f2ea35ac873ff33e1c161ba16baba1f | refs/heads/master | 2022-12-21T12:17:06.414903 | 2019-08-22T23:45:13 | 2019-08-22T23:45:13 | 203,889,809 | 0 | 0 | null | 2022-12-16T05:03:09 | 2019-08-22T23:44:31 | Java | UTF-8 | Java | false | false | 2,075 | java | package za.co.goosen.web.rest.errors;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
@RestController
public class ExceptionTranslatorTestController {
@GetMapping("/test/concurrency-failure")
public void concurrencyFailure() {
throw new ConcurrencyFailureException("test concurrency failure");
}
@PostMapping("/test/method-argument")
public void methodArgument(@Valid @RequestBody TestDTO testDTO) {
}
@GetMapping("/test/missing-servlet-request-part")
public void missingServletRequestPartException(@RequestPart String part) {
}
@GetMapping("/test/missing-servlet-request-parameter")
public void missingServletRequestParameterException(@RequestParam String param) {
}
@GetMapping("/test/access-denied")
public void accessdenied() {
throw new AccessDeniedException("test access denied!");
}
@GetMapping("/test/unauthorized")
public void unauthorized() {
throw new BadCredentialsException("test authentication failed!");
}
@GetMapping("/test/response-status")
public void exceptionWithResponseStatus() {
throw new TestResponseStatusException();
}
@GetMapping("/test/internal-server-error")
public void internalServerError() {
throw new RuntimeException();
}
public static class TestDTO {
@NotNull
private String test;
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
}
@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "test response status")
@SuppressWarnings("serial")
public static class TestResponseStatusException extends RuntimeException {
}
}
| [
"[email protected]"
] | |
04d8bc69e04491d824cce1416889acd0fe1dd4b0 | 0e0f238f130a411fd594110a06d8f174864a64c9 | /src/com/kendall/algorithmic/jzoffer/Permutation.java | accd905225ee39375d1c8eee5ebf4596503275c0 | [] | no_license | Pudgedd/Algorithmic-practice | bf393471fa6680ead9741d9c56e5cfd04194100d | 6c9d630bebd884cd8c65968da246860ca9830702 | refs/heads/master | 2020-03-30T23:04:52.713898 | 2019-05-08T11:48:22 | 2019-05-08T11:48:22 | 151,689,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,737 | java | package com.kendall.algorithmic.jzoffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.TreeSet;
/**
* @description:输入一个字符串,按字典序打印出该字符串中字符的所有排列。 例如输入字符串abc, 则打印出由字符a, b, c所能排列出来的所有字符串abc, acb, bac, bca, cab和cba。
* 输入描述:输入一个字符串,长度不超过9(可能有字符重复),字符只包括大小写字母。
* 1
* abc
* abc acb bac bca cab cba
* @author: kendall
* @since: 2018/12/4
*/
public class Permutation {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int groupNum = scanner.nextInt();
List<String> strs = new ArrayList<>();
for (int i = 0; i < groupNum; i++) {
String str = scanner.next();
strs.add(str);
}
for (String str : strs) {
List<String> res = fun(str);
res.forEach(System.out::println);
}
}
/**
* 本题可以用回溯算法
*
* abc
* 1。首字符和0位的字符交换,对后面对字符进行排列,首字符和第0位交换复原成最初的位置
* 2。首字符和第1位的字符交换,对后面的字符进行排列,首字符和第1位交换复原成最初的位置
* 有n个字符,交换n次,对后面的字符排列n次,再复原n次
* @param str
* @return
*/
private static List<String> fun(String str) {
List<String> res = new ArrayList<>();
if (str == null || str.length() == 0) {
return res;
}
TreeSet<String> resSet = new TreeSet<>();
permutate(str.toCharArray(), 0, resSet);
res.addAll(resSet);
return res;
}
/**
* 排列,生产字符串,加入resSet
* @param chars
* @param index 与第index的字符交换
* @param resSet
*/
private static void permutate(char[] chars, int index, TreeSet<String> resSet) {
if (index == chars.length - 1) {
resSet.add(new String(chars));
return;
}
//从index选取该位作为首字符进行交换,然后对后面对字符进行排列,再回溯
//f(abc) = a+f(bc) 如1,abc= a+ bc-cb 2 交换ab b+ac-ca 然后交换ab复位回溯 3 交换ac c+ab-ba 结束
for (int i = index; i < chars.length; i++) {
swap(chars, i, index);
permutate(chars, index+1, resSet);
swap(chars, i, index);
}
}
private static void swap(char[] chars, int n, int m) {
char tmp = chars[n];
chars[n] = chars[m];
chars[m] = tmp;
}
}
| [
"[email protected]"
] | |
e8f1da5cf402aefdc8cbef892c7ac5e7b041b119 | 43f74ea498cb0dae05bf2390b448d16f398a0a2b | /workspace/ncp_cmp/src/main/java/com/plgrim/ncp/cmp/common/bo/system/SystemBaseBOComponent.java | 56008e7717734eae0a1b5eb9289bee0003356760 | [] | no_license | young-hee/pc_mlb | 2bdf5813418c14be2d7e2de78f0f294ed8264dde | 708417eada78eed398e068460bda44adea16cbdf | refs/heads/master | 2022-11-22T00:11:05.335853 | 2020-07-22T08:27:03 | 2020-07-22T09:10:07 | 281,615,442 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 15,936 | java | /* Copyright (c) 2015 plgrim, Inc.
* All right reserved.
* http://plgrim.com
* This software is the confidential and proprietary information of plgrim
* , Inc. You shall not disclose such Confidential Information and
* shall use it only in accordance with the terms of the license agreement
* you entered into with plgrim.
*
* ------------------------------------------------------------------------
* @author shsunhee.kim
* @since 2015. 8. 4
*/
package com.plgrim.ncp.cmp.common.bo.system;
import java.util.List;
import java.util.Map;
import com.plgrim.ncp.base.entities.datasource1.sys.*;
import com.plgrim.ncp.commons.data.*;
import com.plgrim.ncp.commons.result.*;
import com.plgrim.ncp.framework.data.SystemPK;
import org.springframework.data.domain.Page;
public interface SystemBaseBOComponent {
/**
* 시스템 브랜드 등록
*
* @param paramData
* @throws Exception
*/
public void insertSysBrnd(FormSysBrndDTO paramData) throws Exception;
/**
* 시스템 브랜드 이미지 등록
*
* @param paramList
* @throws Exception
*/
public void insertSysBrndImg(List<SysBrndImg> paramList) throws Exception;
/**
* 시스템 브랜드 수정
*
* @param paramData
* @throws Exception
*/
public void updateSysBrnd(FormSysBrndDTO paramData) throws Exception;
/**
* 시스템 브랜드 이미지 수정
*
* @param paramList
* @throws Exception
*/
public void updateSysBrndImg(List<SysBrndImg> paramList) throws Exception;
/**
* 시스템 브랜드 이미지 삭제
*
* @param paramList
* @throws Exception
*/
public void deleteSysBrndImg(List<SysBrndImg> paramList) throws Exception;
/**
* 일괄 시스템 브랜드 정보 수정
*
* @param paramList
* @throws Exception
*/
public void updateSysBrndList(List<SysBrandDTO> paramList) throws Exception;
/**
* 임직원 할인율 수정
* <p>
* <p/>
* <p>
* [사용 방법 설명].
*
* @param list [설명]
* @throws Exception the exception
* @since 2015. 8. 4
*/
public void updateSysBrandEmpDcRtList(List<SysBrandDTO> list) throws Exception;
/**
* 포인트적립률 수정.
* <p>
* <p/>
* <p>
* [사용 방법 설명].
*
* @param list [설명]
* @throws Exception the exception
* @since 2015. 7. 13
*/
public void updateSysBrandPntAccmlList(List<SysBrandDTO> list) throws Exception;
/**
* 포인트종류별 적립률 수정.
* <p>
* <p/>
* <p>
* [사용 방법 설명].
*
* @param list [설명]
* @throws Exception the exception
* @since 2015. 7. 13
*/
public void updateSysBrandPntAccmlListByType(List<SysBrandDTO> list) throws Exception;
/**
* 브랜드별 일모 할인률 목록 조회
*
* @param sysBrandDTO
* @return
* @throws Exception
*/
public List<SysBrandResult> selectSysBrandPntAccmlList(SysBrandDTO sysBrandDTO) throws Exception;
/**
* 브랜드별 포인트 적립률 목록 TotalCount
*
* @param sysBrandDTO
* @return
* @throws Exception
*/
public int selectSysBrandPntAccmlTotalCount(SysBrandDTO sysBrandDTO) throws Exception;
/**
* 브랜드별 포인트 적립률 목록 엑셀다운로드.
* <p>
* <p/>
* <p>
* [사용 방법 설명].
*
* @param sysBrandDTO [설명]
* @return List [설명]
* @throws Exception the exception
* @since 2015. 7. 8
*/
public List<Map<String, Object>> selectSysBrandPntAccmlListByAll(SysBrandDTO sysBrandDTO) throws Exception;
/**
* 브랜드코드관리 > 브랜드목록 조회
*
* @param paramData
* @return
* @throws Exception
*/
public List<SysBrandResult> selectListSysBrnd(FormSysBrndDTO paramData) throws Exception;
/**
* 브랜드코드관리 > 자식 브랜드 목록 조회
*
* @param paramData (selBrndId 필수)
* @return
* @throws Exception
*/
public List<SysBrandResult> selectListChildSysBrnd(FormSysBrndDTO paramData) throws Exception;
/**
* 브랜드코드관리 > 자식 브랜드 정보 조회
*
* @param paramData (selBrndId 필수)
* @return
* @throws Exception
*/
public SysBrandResult selectRowSysBrnd(FormSysBrndDTO paramData) throws Exception;
/**
* 브랜드코드관리 > 브랜드코드 사용가능 여부
*
* @param paramData
* @return 사용가능(true)
* @throws Exception
*/
public boolean isUseBrndId(FormSysBrndDTO paramData) throws Exception;
/**
* 인터페이스 브랜드ID 조회
*
* @param paramData
* @return
* @throws Exception
*/
public List<ErpBrndIdResult> selectListErpBrndId(FormSysBrndDTO paramData) throws Exception;
/**
* 인터페이스 브랜드 tag 조회
*
* @param paramData
* @return
* @throws Exception
*/
public List<BrndTagCdResult> selectListBrndTagCd(FormSysBrndDTO paramData, SystemPK systemPk) throws Exception;
/**
* beaker brand 체크 ( 1이면 beaker 브랜드 그룹 브랜드)
*
* @param paramData
* @return
* @throws Exception
*/
public int checkBeakerBrndCount(FormSysBrndDTO paramData) throws Exception;
/**
* 공통그룹코드 수정처리
*
* @param paramData
* @throws Exception
*/
public void updateSysGrpCd(List<SysCdDTO> paramData) throws Exception;
/**
* 공통그룹코드 등록처리
*
* @param paramList
* @throws Exception
*/
public void insertSysGrpCd(List<SysCdDTO> paramList) throws Exception;
/**
* 공통그룹 상세코드 수정처리
*
* @param paramList
* @throws Exception
*/
public void updateSysGrpCdDetail(List<SysCdDTO> paramList) throws Exception;
/**
* 공통그룹 상세코드 등록처리
*
* @param paramList
* @throws Exception
*/
public void insertSysGrpCdDetail(String grpCd, List<SysCdDTO> paramList) throws Exception;
/**
* 공통코드그룹 목록 조회
*
* @param
* @return
*/
public List<SysCodeResult> selectListCdGrp(FormSysCodeDTO paramData) throws Exception;
/**
* 공통코드그룹 상세코드목록 조회
*
* @param paramData
* @return
* @throws Exception
*/
public List<SysCodeResult> selectListCdGrpDetail(FormSysCodeDTO paramData) throws Exception;
/**
* 사용하고 있는 코드인지 체크한다.
*
* @param cd
* @return true:사용
* @throws Exception
*/
public boolean isUseFromSysCd(String cd) throws Exception;
/**
* 시스템예외그룹코드 List 조회
*
* @param sysExcpCdExtend
* @return
* @throws Exception
*/
public List<SysExcpCdExtend> selectAllSysExcpGrpCd(SysExcpCdExtend sysExcpCdExtend) throws Exception;
/* 일괄 PrudCd 저장처리
* @param paramList
* @throws Exception
*/
public void updatePrudCd(List<SysPrudDTO> paramList) throws Exception;
/**
* 목록 조회
*
* @param
* @return
*/
public List<SysPrudResult> selectSysPrudCdList(SystemPK systemPK, FormSysPrudDTO paramData) throws Exception;
/**
* 목록 총 횟수
*
* @param systemPK
* @param paramData
* @return
* @throws Exception
*/
public long selectCountSysPrudCd(SystemPK systemPK, FormSysPrudDTO paramData) throws Exception;
/**
* 품목코드 목록 엑셀다운로드
*
* @param paramData
* @return
* @throws Exception
*/
public List<Map<String, String>> selectSysPrudCdListExcel(FormSysPrudDTO paramData) throws Exception;
/**
* 일괄 PrudWtCd 업데이트
*
* @param paramList
* @throws Exception
*/
public void updatePrudWtCd(List<SysPrudWtDTO> paramList) throws Exception;
/**
* PrudWtCd 저장
*
* @param paramData
* @throws Exception
*/
public int insertPrudWtCd(SysPrudWtDTO paramData) throws Exception;
/**
* 목록 조회
*
* @param
* @return
*/
public List<SysPrudWtResult> selectSysPrudWtCdList(SystemPK systemPK, SysPrudWtDTO paramData) throws Exception;
/**
* 목록 총 횟수
*
* @param systemPK
* @param paramData
* @return
* @throws Exception
*/
public long selectCountSysPrudWtCd(SystemPK systemPK, SysPrudWtDTO paramData) throws Exception;
/**
* 품목코드 목록 엑셀다운로드
*
* @param paramData
* @return
* @throws Exception
*/
public List<Map<String, String>> selectSysPrudWtCdListExcel(FormSysPrudDTO paramData) throws Exception;
/**
* 품목코드 등록 페이지 품목 select box
*
* @return
* @throws Exception
*/
public List<SysPrudResult> selectSysPrdlstCd() throws Exception;
/**
* 판매점코드조회(페이징처리되지않은)
*
* @param sysErpSaleShop
* @return
* @throws Exception
*/
public List<SysErpSaleShop> selectSysErpSaleShopList(SysErpSaleShop sysErpSaleShop) throws Exception ;
/**
* 매장 등록.
*
* @param systemPK [설명]
* @param paramData [설명]
* @throws Exception the exception
* @since 2015. 5. 29
*/
public void insertSysShop( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 매장 수정.
*
* @param systemPK [설명]
* @param paramData [설명]
* @throws Exception the exception
* @since 2015. 5. 29
*/
public void updateSysShop( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 매장 이미지관리 페이지 수정.
*
* @param systemPK [설명]
* @param paramData [설명]
* @throws Exception the exception
* @since 2015. 8. 10
*/
public void updateSysShopImgPage( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 매장 그리드 수정.
*
* @param paramData [설명]
* @throws Exception the exception
* @since 2015. 5. 29
*/
public void updateSysShopGrid(List<SysShopDataDTO> paramData) throws Exception ;
/**
* 매장 이미지 수정
*
* @param systemPK [설명]
* @param paramData [설명]
* @throws Exception the exception
* @since 2015. 8. 8
*/
public void updateSysShopImg( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 매장 이벤트 등록
* @param sysShopEvt
* @return
* @throws Exception
*/
public String insertSysShopEvt(SysShopEvt sysShopEvt)throws Exception;
/**
* 매장 이벤트 수정
* @param sysShopEvt
* @return
* @throws Exception
*/
public String updateSysShopEvt(SysShopEvt sysShopEvt)throws Exception;
/**
* 브랜드 매장 휴일 일자별 등록
* @param sysShopHoldy
* @return
* @throws Exception
*/
public String insertSysShopHoldyDay(SysShopHoldy sysShopHoldy) throws Exception;
/**
* 브랜드 매장 휴일 일자별 수정
* @param sysShopHoldyDTO
* @return
* @throws Exception
*/
public String updateSysShopHoldyDay(SysShopHoldyDTO sysShopHoldyDTO) throws Exception;
/**
* 브랜드 매장 휴일 일자별 삭제
* @param sysShopHoldy
* @return
* @throws Exception
*/
public int deleteSysShopHoldyDay(SysShopHoldy sysShopHoldy) throws Exception;
/**
* 브랜드 매장 휴일 요일별 등록
* @param sysShopHoldyDTO
* @return
* @throws Exception
*/
public void insertSysShopHoldyWeek(SysShopHoldyDTO sysShopHoldyDTO) throws Exception;
/**
* 매장 목록 조회.
*
* @param systemPK [설명]
* @param paramData [설명]
* @return List [설명]
* @throws Exception the exception
* @since 2015. 5. 29
*/
public List<SysShopResult> selectSysShopList( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 매장 목록 조회 개수.
*
* @param systemPK [설명]
* @param paramData [설명]
* @return Long [설명]
* @throws Exception the exception
* @since 2015. 5. 29
*/
public long selectSysShopListCount( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 매장 목록 조회 엑셀.
*
* @param systemPK [설명]
* @param paramData [설명]
* @return List [설명]
* @throws Exception the exception
* @since 2015. 5. 29
*/
public List<Map<String, Object>> selectSysShopListExcel( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 매장 상세 조회.
*
* @param systemPK [설명]
* @param paramData [설명]
* @return Sys cmmn noti result [설명]
* @throws Exception the exception
* @since 2015. 5. 29
*/
public SysShopResult selectSysShopDetail( SystemPK systemPK, SysShopDTO paramData) throws Exception ;
/**
* 브랜드 매장 이벤트 상세조회
* @param sysShopEvt
* @return
* @throws Exception
* @since 2015. 8. 10
*/
public SysShopEvtResult selectSysShopEvt(SysShopEvt sysShopEvt)throws Exception;
/**
* 브랜드 매장 이벤트 목록
* @param systemPK
* @param sysShopDTO
* @return
* @throws Exception
* @since 2015. 8. 10
*/
public Page<SysShopResult> selectSysShopEvtList(SystemPK systemPK, SysShopDTO sysShopDTO) throws Exception;
/**
* 브랜드 매장 이벤트 목록 엑셀
* @param systemPK
* @param sysShopDTO
* @return
* @throws Exception
* @since 2015. 8. 10
*/
public List<Map<String, Object>> selectSysShopEvtListExcel(SystemPK systemPK, SysShopDTO sysShopDTO) throws Exception;
/**
* 브랜드 매장 휴일 조회
* @param systemPK
* @param sysShopDTO
* @return
* @throws Exception
*/
public Page<SysShopHoldyResult> selectSysShopHoldyList(SystemPK systemPK, SysShopDTO sysShopDTO) throws Exception ;
/**
* 브랜드 매장 휴일 조회 엑셀
* @param systemPK
* @param sysShopDTO
* @return
* @throws Exception
*/
public List<Map<String, Object>> selectSysShopHoldyListExcel(SystemPK systemPK, SysShopDTO sysShopDTO) throws Exception ;
/**
* 상담 휴일 조회
* @param systemPK
* @param sysShopDTO
* @return
* @throws Exception
*/
public Page<SysShopHoldyResult> selectCounselHoldyList(SystemPK systemPK, SysShopDTO sysShopDTO) throws Exception ;
/**
* 상담 휴일 조회 엑셀
* @param systemPK
* @param sysShopDTO
* @return
* @throws Exception
*/
public List<Map<String, Object>> selectCounselHoldyListExcel(SystemPK systemPK, SysShopDTO sysShopDTO) throws Exception ;
/**
* 브랜드 매장 휴일 상세조회
* @param sysShopHoldy
* @return
* @throws Exception
*/
public SysShopHoldyResult getSysShopHoldyDay(SysShopHoldy sysShopHoldy) throws Exception ;
/**
* 브랜드 매장 휴일 요일별 상세조회
* @param sysShopHoldyDow
* @return
* @throws Exception
*/
public List<SysShopHoldyResult> getSysShopHoldyWeek(SysShopHoldyDow sysShopHoldyDow) throws Exception ;
/**
* ERP 브랜드 ID
* @param shopId
* @return
* @throws Exception
*/
public String selectSysShopErpBrandId(String shopId) throws Exception ;
} | [
"[email protected]"
] | |
fab97d4d708bd5aa21c2e5279c50de2166d861f4 | 717726f88a576bb04e4c6ad2ee300e4004b6a2fa | /app/src/main/java/com/example/donald/calendar/DBEvent.java | 1f86c6ca93c3b44057daaf7d8c0296f8acfbf2b7 | [] | no_license | literalnon/Calendar | 2ff8c8a9a21bb8d3120b4ff23a3ee794850d94b1 | 4348974cc97175f37aff2455e9c525d1bb5cc4fa | refs/heads/master | 2021-01-24T08:00:16.235037 | 2017-06-05T05:38:19 | 2017-06-05T05:38:19 | 93,368,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,534 | java | package com.example.donald.calendar;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;
/**
* Created by Donald on 20.10.2016.
*/
public class DBEvent extends SQLiteOpenHelper implements BaseColumns{
public static final String NAME_COLLUMN_DATE = "date";
public static final String NAME_COLLUMN_TIME_IN = "time_in";
public static final String NAME_COLLUMN_TIME_END = "time_end";
public static final String NAME_COLLUMN_EVENT = "event";
public static final String NAME_COLLUMN_REPEAT = "repeat";
public static final String NAME_DB = "mydb.db";
public static final String NAME_TABLE = "events";
public static final int DB_VERSION = 1;
private static final String DBScript = "create table "
+ NAME_TABLE + " (" + BaseColumns._ID
+ " integer primary key autoincrement, " + NAME_COLLUMN_DATE
+ " string, " + NAME_COLLUMN_TIME_IN + " string, "
+ NAME_COLLUMN_TIME_END + " string, "
+ NAME_COLLUMN_EVENT + " string, "
+ NAME_COLLUMN_REPEAT + " integer);";
public DBEvent(Context context) {
super(context, NAME_DB, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DBScript);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
| [
"[email protected]"
] | |
7b39158578f6c8003e7f9077f59b508c1985fc16 | 291cb804c6fa4cd86e4a0b399bcae6ce69bbcc51 | /Java7/src/main/java/com/alexander/java/examples/java7/designpatterns/template/PersonalLoanApplication.java | 9a829f440208c3b68c3c90080a3321278238dba6 | [] | no_license | ahopgood/Java-Language-Examples | 1c8838de50b7f83df91920e427b25b36046727ec | 1ff996d0c858d1c311200c976e58b0c839993a21 | refs/heads/master | 2022-11-09T17:46:04.628610 | 2022-10-30T14:49:22 | 2022-10-30T14:49:22 | 30,507,489 | 0 | 0 | null | 2022-10-30T14:49:23 | 2015-02-08T21:59:02 | Java | UTF-8 | Java | false | false | 718 | java | package com.alexander.java.examples.java7.designpatterns.template;
/**
* Created by alexhopgood on 28/04/17.
*/
public class PersonalLoanApplication extends LoanApplication {
@Override
protected void checkIdentity() throws ApplicationDenied {
System.out.println("Checking provided bills and bank statements");
}
@Override
protected void checkIncomeHistory() throws ApplicationDenied {
System.out.println("Checking employment and payslips");
}
@Override
protected void checkCreditHistory() throws ApplicationDenied {
System.out.println("Using dubious third party to check credit history");
}
@Override
protected void reportFindings() {
}
}
| [
"[email protected]"
] | |
82d18844229d40092be401cce59b3f4e79dcf76f | f05b376dc8b210335cf07cc14803422feb9470f0 | /Company.java | 609b0900829f41e64a12fc9aa49f71c6ad1651e2 | [] | no_license | fr334a11/CorbinA_lab4 | aa94977ed53380e9641c9db015705644313cce8a | 6ed1a25e287ab66b40722c78074d476e3aa73baa | refs/heads/master | 2020-05-19T13:03:35.912145 | 2014-08-17T21:17:27 | 2014-08-17T21:17:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,791 | java | import java.util.*;
/**
* @Anthony Corbin
* Neumont University
* Class: Intro to Computer Sciences A
* Quarter: 1
* Lab 4
* I'm a firing ma lazor
*/
public class Company {
private String name;
private double salePrice;
private double sales;
private static double manafactureCost;
private static final int DAILY_BILLS = 300;
private static final int SHIPPING_COST = 20;
/**
* constructor for class,
* Prompts for company name and finicial information
*/
public Company() {
Scanner input = new Scanner(System.in);
System.out.print("Welcome to SkyNet's buisness start up plan,\nWhat would you like to call your company: ");
name = input.nextLine();
}
/**
* formats doubles for formatting money rounding off to the nearest cent
*/
private static double formatMoney(double num) {
int temp = (int)(100*(num));
return temp/100.0;
}
/**
* returns absoulte value of given int
*/
private static int abs(int num) {
if(num<0) { return -num; }
return num;
}
/**
* formats given double, into $#.##
*/
private static String S_formatMoney(double num) {
int temp = (int)(100*(num));
return "$"+temp/100+"."+abs(temp - 100*((int)temp/100));
}
/**
* gets the sale price for each item from user
*/
public double salePrice() {
Scanner input = new Scanner(System.in);
System.out.print("\nWhat is the sale price of each laser($) ");
salePrice = Double.parseDouble(input.nextLine());
return Company.formatMoney(salePrice);
}
/**
* gets the manafacture cost for each item from user
*/
public double manafactureCost() {
Scanner input = new Scanner(System.in);
System.out.print("\nSkyNet helps you sell lasers, but places you in charge of book keeping\nHow much does it cost to manafacture one laser($): ");
manafactureCost = Double.parseDouble(input.nextLine());
return Company.formatMoney(manafactureCost);
}
/**
* gets the number of sales from the user
*/
public double numOfSales() {//will round to the nearest cent
Scanner input = new Scanner(System.in);
System.out.print("\nHow many items has "+name+" sold today: ");
sales = Double.parseDouble(input.nextLine());
return Company.formatMoney(sales);
}
/**
* returns the amount that the company has made in profits
*/
public double amountOfProfit() {
return Company.formatMoney(((salePrice-manafactureCost)*sales)-DAILY_BILLS);
}
/**
* will create and return a laser
*/
public LaserCannon makeDeathRay() {
return new LaserCannon();
}
/**
* main fucnction starts up company and laser
*/
public static void main(String[] args) {
Company skyNet = new Company();
skyNet.manafactureCost();
skyNet.salePrice();
skyNet.numOfSales();
System.out.print("\n\nCongrads on making "+S_formatMoney(skyNet.amountOfProfit())+
" after paying "+S_formatMoney(DAILY_BILLS)+" in bills.\n\n");
//create laser
LaserCannon catToy = skyNet.makeDeathRay();
double temp = catToy.speed();
System.out.print("\n\nA laser mesured the distance of the moon within a "+catToy.time()+"s period finding\n"+
catToy.distanceOne()+"\nand\n"+catToy.distanceTwo()+"\nthe angle between these shots was\n"+
catToy.angle()+"\nWith this data the speed of the moon is "+temp+" m/s");
System.out.print("\n\nWe also blew up that moon, have a nice day");
}
}
| [
"Corbin"
] | Corbin |
931663788a5f79628a421aaf88425aa25572f01e | 5e2a26f3c6eacf1bd002b785683969135c0b4389 | /src/main/java/com/example/config/msgresolver/MessageHandler.java | b8a30d897261ff0eabc07a1ab14e51f05b4236f0 | [
"MIT"
] | permissive | pramy143/demo-springbootrest-jdbc | 39138cfcae7c46e3ba67002feb3068c6b46c7118 | dd51c14093f80eceec1131839a25e68680b5a8ae | refs/heads/master | 2022-11-12T19:44:14.580241 | 2020-07-09T21:14:50 | 2020-07-09T21:14:50 | 276,701,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 835 | java | package com.example.config.msgresolver;
import com.example.exception.util.ErrorEnumeration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.stereotype.Component;
import java.util.Locale;
@Component
public class MessageHandler {
private static ReloadableResourceBundleMessageSource messageSource;
@Autowired
MessageHandler(ReloadableResourceBundleMessageSource messageSource) {
MessageHandler.messageSource = messageSource;
}
public static String toLocale(ErrorEnumeration message) {
Locale locale = LocaleContextHolder.getLocale();
return messageSource.getMessage(message.getMessageKey(), null, locale);
}
} | [
"[email protected]"
] | |
99282c25720f0f39467faf128ce2975606f134ae | e3c6404c236463c0803610d31d75ef0afbdce637 | /Hibernate_IS_A_Table-per-class/src/bean/SEmployee.java | 553bc7c11613b238208952865d83fb06f7656d73 | [] | no_license | jagadish100/Hibernate | e1f23d5cdb2a2b7cfd47e8ec658290e3260d684c | 574f1b45d3d84373219d91f94b9353e14e1dd0a8 | refs/heads/master | 2020-04-11T23:13:17.403624 | 2019-01-03T03:33:00 | 2019-01-03T03:33:00 | 162,160,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package bean;
public class SEmployee extends Employee{
private String tool;
public SEmployee() {
// TODO Auto-generated constructor stub
}
public SEmployee(int id, String name, String email, int salary, String tool) {
super(id, name, email, salary);
this.tool = tool;
}
public String getTool() {
return tool;
}
public void setTool(String tool) {
this.tool = tool;
}
}
| [
"Jagadish Somisetty@Jaga"
] | Jagadish Somisetty@Jaga |
ca32982d0e5f701932aaf2982d574c3b041fa43d | 9c0c50738cd18c186d4e7c172f6c20729b0c6121 | /Student.java | a02432843619a7844e434fe41705d6dfeede7ece | [] | no_license | Waan1665/Bai3 | 4f99471d9e43d158e2d86a8f2424deae4356fcc1 | d6808fdb9970f1da8614b7ccdda4c8129c93bffa | refs/heads/main | 2023-08-26T07:57:08.383484 | 2021-10-02T17:21:15 | 2021-10-02T17:21:15 | 412,862,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 137 | java | public class Student extends Person {
private long studentlD;
public void Student() {
}
public void learn() {
}
}
| [
"[email protected]"
] | |
86701bcf666de0029cd2d699f157d82d30176266 | 482a0fe6424b42de7f2768f7b64c4fd36dd24054 | /apps/gmail/gmail_uncompressed/app/src/com/google/android/gms/people/accountswitcherview/v.java | 67ace000340a6cac682960fc71f534b973c074e9 | [] | no_license | dan7800/SoftwareTestingGradProjectTeamB | b96d10c6b42e2e554e51fc1d7fd7a7189afe79d6 | 0ad2d46d692c77bdc75f8a82162749e2e652c7ab | refs/heads/master | 2021-01-22T09:27:25.378594 | 2015-05-15T23:59:13 | 2015-05-15T23:59:13 | 30,304,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 126 | java | package com.google.android.gms.people.accountswitcherview;
import android.view.*;
public interface v
{
u aK(View p0);
}
| [
"[email protected]"
] | |
7b6fefdff230e7f7bcc494582e7bc423d86053f4 | 798288aeeee47d9cec034cbde245432d2adafdf3 | /src/main/java/de/mariushubatschek/is/algorithms/util/ExtendedCells.java | daddbc484d2592b7dd0da7e9deca25b228304204 | [] | no_license | Minification/trees-and-tents | 6c074d1867f8f8a2cc004415b7c421a92613ccce | c1f4c5bb7fab5afc238f5d860a6d2ff7db0f26b5 | refs/heads/master | 2023-07-11T07:40:04.175087 | 2021-08-24T02:13:24 | 2021-08-24T02:13:24 | 399,301,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 117 | java | package de.mariushubatschek.is.algorithms.util;
public enum ExtendedCells {
UNDETERMINED, BLANK, TREE, TENT
}
| [
"[email protected]"
] | |
a71c99c215c9787caebb270e57dfa54ce3a3dc07 | 7b3fec30727b79482a91b1350c55bbf79cf42bd3 | /2 - ILP010 Linguagem de Programação/Robson Ferreira/Prj_Lote1/src/main/java/Lt01_EstSeq02.java | 6fe1a3cce51255de524df854a0a896973a91b7bf | [] | no_license | RobsonHF/fatec2SEM | 2486fdf5d205e88479bc431028f199fd1b5fd6b5 | 31f1f55609a42f6b6adc14f608e0cb3550c693d0 | refs/heads/master | 2021-02-27T18:46:29.468669 | 2020-03-07T17:48:00 | 2020-03-07T17:48:00 | 245,627,515 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | /*
+++++++++++++++++++++++++++++++++++
Lote 01 - Exercício 02
Receba o salário de um funcionário e mostre o novo salário com reajuste
de 15%.
Programador: Robson Henrique Ferreira
Professor: Ricardo Satoshi
+++++++++++++++++++++++++++++++++++++
*/
import javax.swing.JOptionPane;
public class Lt01_EstSeq02
{
public static void main (String args[])
{
double salario, liquido;
salario = Double.parseDouble(JOptionPane.showInputDialog("Digite o salário com duas casas decimais.\nSepare as casas decimais com ponto.\nR$ "));
liquido = salario + (salario * 0.15);
JOptionPane.showMessageDialog(null,"O salário com reajuste de 15% é R$ "+liquido);
}
} | [
"[email protected]"
] | |
f999ff98bb5a778d08d02ac8bb5aafe7b79d6f34 | 55fd6d231c66f420e4f8c0db135f37ce2e23a8f2 | /park-common/src/main/java/com/park/cloud/common/domain/vo/cms/OpmUnbindVehicleInfoVO.java | b9b220d0855682dabb22390c6259b5bea80171d8 | [] | no_license | QianUser/park | 0cc1e3c78595eca5537bdef85e9e2fecad329173 | 726879bb498f24be7b3399449b27c4547002607c | refs/heads/master | 2023-02-02T19:28:02.689427 | 2020-11-27T11:15:11 | 2020-12-22T06:52:33 | 323,564,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 950 | java | package com.park.cloud.common.domain.vo.cms;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@ApiModel
public class OpmUnbindVehicleInfoVO implements Serializable {
@ApiModelProperty(value = "手机号")
private String mobileNumber;
@ApiModelProperty(value = "解绑车牌号")
private String plateNumber;
@ApiModelProperty(value = "解绑车牌类型(1蓝牌、2绿牌、3黄牌、4其他)")
private Integer plateType;
@ApiModelProperty(value = "当前绑定车牌号")
private String nowPlateNumber;
@ApiModelProperty(value = "当前绑定车牌类型(1蓝牌、2绿牌、3黄牌、4其他)")
private Integer nowPlateType;
@ApiModelProperty(value = "解绑时间")
private Date addTime;
@ApiModelProperty(value = "解绑人")
private String addUserName;
} | [
"[email protected]"
] | |
8be1fa2141c66e6327537e846b8253c2e2f519f6 | 825b853e428f44ba0c50e54903c7fb0e3ce3cc80 | /Practice/Servlet/Filter/src/main/java/com/abdu/servlet/LoginFilter.java | ff857801a75eb4487c07ac48e9e0040220328756 | [] | no_license | AbduEndrisM/web-programming | 5bf924b59d6ad014b4f50fb29e13b7ddf071736c | 282a223ea4730cbe0e2bcaed12383827ff49da4f | refs/heads/master | 2020-05-04T02:50:35.864504 | 2019-04-25T02:38:45 | 2019-04-25T02:38:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,031 | java | package com.abdu.servlet;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@WebFilter("/login")
public class LoginFilter implements Filter {
public void destroy() {
}
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
HttpServletRequest request = (HttpServletRequest) req;
String username=request.getParameter("username");
String password=request.getParameter("password");
if(username.length()<3){
chain.doFilter(req, resp);
}
else {
req.setAttribute("error", "Username Length should be not less than 3");
RequestDispatcher requestDispatcher = req.getRequestDispatcher("index.jsp");
requestDispatcher.forward(req, resp);
}
}
public void init(FilterConfig config) throws ServletException {
}
}
| [
"[email protected]"
] | |
02972220e98864a85eb4f024d9d6e8a352f7b8a1 | 79162ace613282d02d30ced1869c4ecf92c2ff57 | /chinabrands2jumia/src/main/java/com/myweb/jumia/Head.java | 65dc5572913ff5d6164c98883cceacec83a30a49 | [] | no_license | wangyongst/backend | 93e96fffd867ecfd4caceeba540fd731f25f8306 | 5687ffec66b5493c59e550b16afc2535523b2f02 | refs/heads/master | 2021-09-11T23:36:39.685910 | 2018-04-13T04:00:27 | 2018-04-13T04:00:27 | 60,140,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | package com.myweb.jumia;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Head {
@JsonProperty("Head")
private ErrorMsg Head;
public ErrorMsg getHead() {
return Head;
}
public void setHead(ErrorMsg head) {
Head = head;
}
}
| [
"[email protected]"
] | |
3b09bf132786e1f6589d9d841c0167df6fa5cbc2 | 8d63354bc1347f8de5713b7ccd8bc28caee47574 | /Employee.java | fce97b6a204863a2b2416900a8f04ffce3678c3c | [] | no_license | Suraj1408/JavaAssignment | 5d9536493b9dd17a49cd61e9f88391070f52e477 | 329f5db2f2d1566278ee21c3819d2edf9a525265 | refs/heads/main | 2023-01-22T03:53:09.440970 | 2020-11-28T13:38:41 | 2020-11-28T13:38:41 | 314,967,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,163 | java | package com.brizelab.review4;
public class Employee {
String employeeName;
String companyName;
double wages;
double partTimeWages;
double fullTimewages;
public int getWorkingDay() {
return workingDay;
}
public void setWorkingDay(int workingDay) {
this.workingDay = workingDay;
}
int hours;
int workingDay;
public String getEmployeeName() {
return employeeName;
}
public void setEmployeeName(String employeeName) {
this.employeeName = employeeName;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public double getWages() {
return wages;
}
public void setWages(double wages) {
this.wages = wages;
}
public double getPartTimeWages() {
return partTimeWages;
}
public void setPartTimeWages(double partTimeWages) {
this.partTimeWages = partTimeWages;
}
public double getFullTimewages() {
return fullTimewages;
}
public void setFullTimewages(double fullTimewages) {
this.fullTimewages = fullTimewages;
}
public int getHours() {
return hours;
}
public void setHours(int hours) {
this.hours = hours;
}
}
| [
"[email protected]"
] | |
9f24b586c359578e29882f4ab241084bf1c5c475 | c3648862740da9c00f0bba4f713fd361baf8f8ed | /BOJ/2020.02/Solution_17616_등수찾기.java | 4f7b26529ecbc011767cc677f746a7d201ecb202 | [] | no_license | SURAMCHOI/algorithm | de560f21eab2b2af027daa8a6f97b7250618d209 | 62effb824e4d4f1db7d749414d666b345855cd4d | refs/heads/master | 2021-07-09T15:42:42.304588 | 2020-08-31T15:52:06 | 2020-08-31T15:52:06 | 181,139,185 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,638 | java |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
public class Solution_17616_등수찾기 {
static int cnt,N,M,X;
static int [] high_rank,lower_rank;
static int [][] info;
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st=new StringTokenizer(br.readLine()," ");
N=Integer.parseInt(st.nextToken());
M=Integer.parseInt(st.nextToken());
X=Integer.parseInt(st.nextToken());
high_rank=new int [N+1];
info=new int [M][2];
lower_rank=new int [N+1];
for(int i=0;i<M;i++){
st=new StringTokenizer(br.readLine()," ");
info[i][0]=Integer.parseInt(st.nextToken());
info[i][1]=Integer.parseInt(st.nextToken());
}
Arrays.sort(info,new Comparator<int []>() {
@Override
public int compare(int[] o1, int[] o2) {
// TODO Auto-generated method stub
return o1[0]-o2[0];
}
});
//higher rank 채우기
for(int i=0;i<M;i++){
int u=info[i][0];
int v=info[i][1];
high_rank[v]=Math.max(high_rank[u]+1,high_rank[v]+1);
}
//lower rank 채우기
for(int i=0;i<M;i++)
{
cnt=1;
int u=info[i][0];
int v=info[i][1];
bfs(v);
lower_rank[u]=cnt;
}
int min=high_rank[X]+1;
int max=N-lower_rank[X];
System.out.println(min+" "+max);
}// end of main
//bfs로 점수가 낮은 학생수 구하기
private static void bfs(int v) {
// TODO Auto-generated method stub
boolean visit[]=new boolean [N+1];
}
}//end of class
| [
"[email protected]"
] | |
f0338ffc443712861e45e43258e39aee4a1675db | 6a2f63d971fd5ce988c10cdc2401aae3ba5e0fee | /net/minecraft/event/ClickEvent.java | 21a338756075eb263f92fe98a957435d29f02e3f | [
"MIT"
] | permissive | MikeWuang/hawk-client | 22d0d723b70826f74d91f0928384513a419592c1 | 7f62687c62709c595e2945d71678984ba1b832ea | refs/heads/main | 2023-04-05T19:50:35.459096 | 2021-04-28T00:52:19 | 2021-04-28T00:52:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,158 | java | package net.minecraft.event;
import com.google.common.collect.Maps;
import java.util.Map;
public class ClickEvent {
private final String value;
private final ClickEvent.Action action;
private static final String __OBFID = "CL_00001260";
public ClickEvent(ClickEvent.Action var1, String var2) {
this.action = var1;
this.value = var2;
}
public String getValue() {
return this.value;
}
public boolean equals(Object var1) {
if (this == var1) {
return true;
} else if (var1 != null && this.getClass() == var1.getClass()) {
ClickEvent var2 = (ClickEvent)var1;
if (this.action != var2.action) {
return false;
} else {
if (this.value != null) {
if (!this.value.equals(var2.value)) {
return false;
}
} else if (var2.value != null) {
return false;
}
return true;
}
} else {
return false;
}
}
public ClickEvent.Action getAction() {
return this.action;
}
public int hashCode() {
int var1 = this.action.hashCode();
var1 = 31 * var1 + (this.value != null ? this.value.hashCode() : 0);
return var1;
}
public String toString() {
return String.valueOf((new StringBuilder("ClickEvent{action=")).append(this.action).append(", value='").append(this.value).append('\'').append('}'));
}
public static enum Action {
private static final ClickEvent.Action[] $VALUES = new ClickEvent.Action[]{OPEN_URL, OPEN_FILE, RUN_COMMAND, TWITCH_USER_INFO, SUGGEST_COMMAND, CHANGE_PAGE};
private static final String __OBFID = "CL_00001261";
OPEN_URL("OPEN_URL", 0, "open_url", true),
CHANGE_PAGE("CHANGE_PAGE", 5, "change_page", true),
SUGGEST_COMMAND("SUGGEST_COMMAND", 4, "suggest_command", true),
RUN_COMMAND("RUN_COMMAND", 2, "run_command", true),
TWITCH_USER_INFO("TWITCH_USER_INFO", 3, "twitch_user_info", false);
private static final ClickEvent.Action[] ENUM$VALUES = new ClickEvent.Action[]{OPEN_URL, OPEN_FILE, RUN_COMMAND, TWITCH_USER_INFO, SUGGEST_COMMAND, CHANGE_PAGE};
OPEN_FILE("OPEN_FILE", 1, "open_file", false);
private final String canonicalName;
private static final Map nameMapping = Maps.newHashMap();
private final boolean allowedInChat;
private Action(String var3, int var4, String var5, boolean var6) {
this.canonicalName = var5;
this.allowedInChat = var6;
}
public static ClickEvent.Action getValueByCanonicalName(String var0) {
return (ClickEvent.Action)nameMapping.get(var0);
}
public String getCanonicalName() {
return this.canonicalName;
}
public boolean shouldAllowInChat() {
return this.allowedInChat;
}
static {
ClickEvent.Action[] var0 = values();
int var1 = var0.length;
for(int var2 = 0; var2 < var1; ++var2) {
ClickEvent.Action var3 = var0[var2];
nameMapping.put(var3.getCanonicalName(), var3);
}
}
}
}
| [
"[email protected]"
] | |
58c942f228b8829acaed6b7873a3e85041e51ff8 | f0a51a03e7dc117aa8614650f0c446afff15da09 | /Netty/im/packet/JSONSerializer.java | 7a00f6d4276de99281d5df8f265b86e0d5277c35 | [] | no_license | Fudashi233/demo | 3cc8d6d73bd471928e75bfeb333a0443315a78c6 | 328bde6c32b117cea7a292d26a5c26afcbd79458 | refs/heads/master | 2021-01-25T14:21:44.794895 | 2019-11-18T10:02:33 | 2019-11-18T10:02:33 | 123,682,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package cn.edu.jxau.im.packet;
import com.alibaba.fastjson.JSON;
/**
* Desc:
* ------------------------------------
* Author:[email protected]
* Date:2019/11/3
* Time:下午3:44
*/
public class JSONSerializer implements Serializer {
@Override
public Integer getSerializerAlgorithm() {
return SerializerAlgorithm.JSON_SERIALIZER;
}
@Override
public byte[] serialize(Object obj) {
return JSON.toJSONBytes(obj);
}
@Override
public <T> T deserialize(Class<T> klass, byte[] bytes) {
return JSON.parseObject(bytes,klass);
}
}
| [
"[email protected]"
] | |
670b4eaff3ad3d9234c0bebd6f01e2b965fc3cee | 41151b1e71c085347bd2d5d0be6e8ab7d4c989f5 | /prj/src/java/com/i10n/fleet/datasets/impl/SkinSetDataset.java | bb5e3ffc880ae79d2ddfc4d9105248e2330aeec6 | [] | no_license | venkat-developer/FeetVTS | b267f7db9d259c817dbfe1d8ef5c538c3626e379 | 7d735f4056dd0d9816db50fcaeeec10b38aa1659 | refs/heads/master | 2021-01-10T02:11:02.911658 | 2017-04-26T17:59:02 | 2017-04-26T17:59:02 | 55,285,574 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | package com.i10n.fleet.datasets.impl;
import java.util.ArrayList;
import java.util.List;
/**
* An extension to {@link Dataset} for providing skin functionalities
*
* @author sabarish
*
*/
public class SkinSetDataset extends NamedDataset {
/**
*
*/
private static final long serialVersionUID = -2614956734401804094L;
/**
* Checks whether a skin exists or not
*
* @param name
* @return
*/
public boolean hasSkin(String name) {
return containsKey(name);
}
/**
* returns a list of supported skins.
*
* @return
*/
public List<String> getSupportedSkins() {
return new ArrayList<String>(this.keySet());
}
}
| [
"[email protected]"
] | |
f04cb9bf3ef1cbe6a63209c9d7ce76fa04dba97c | c33cc79cfdbcb9a4f8e9d86328fe3a41d2e64773 | /app/build/generated/source/r/debug/com/google/android/gms/gcm/R.java | 97724d68b40adb849192d3423792dd5dff5d63d3 | [] | no_license | radinaldn/AR-LocationBased | 8e71b2f4eac2dce70e14512252552e91c82a7308 | 8587fee1e376f793de2d160450fcd7a0c8d887ca | refs/heads/master | 2021-07-17T22:11:48.964215 | 2017-10-26T00:45:52 | 2017-10-26T00:45:52 | 107,912,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,940 | 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.google.android.gms.gcm;
public final class R {
public static final class attr {
public static final int adSize = 0x7f010027;
public static final int adSizes = 0x7f010028;
public static final int adUnitId = 0x7f010029;
public static final int ambientEnabled = 0x7f01006f;
public static final int appTheme = 0x7f010134;
public static final int buttonSize = 0x7f010091;
public static final int buyButtonAppearance = 0x7f01013b;
public static final int buyButtonHeight = 0x7f010138;
public static final int buyButtonText = 0x7f01013a;
public static final int buyButtonWidth = 0x7f010139;
public static final int cameraBearing = 0x7f010060;
public static final int cameraTargetLat = 0x7f010061;
public static final int cameraTargetLng = 0x7f010062;
public static final int cameraTilt = 0x7f010063;
public static final int cameraZoom = 0x7f010064;
public static final int circleCrop = 0x7f01005e;
public static final int colorScheme = 0x7f010092;
public static final int environment = 0x7f010135;
public static final int fragmentMode = 0x7f010137;
public static final int fragmentStyle = 0x7f010136;
public static final int imageAspectRatio = 0x7f01005d;
public static final int imageAspectRatioAdjust = 0x7f01005c;
public static final int liteMode = 0x7f010065;
public static final int mapType = 0x7f01005f;
public static final int maskedWalletDetailsBackground = 0x7f01013e;
public static final int maskedWalletDetailsButtonBackground = 0x7f010140;
public static final int maskedWalletDetailsButtonTextAppearance = 0x7f01013f;
public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f01013d;
public static final int maskedWalletDetailsLogoImageType = 0x7f010142;
public static final int maskedWalletDetailsLogoTextColor = 0x7f010141;
public static final int maskedWalletDetailsTextAppearance = 0x7f01013c;
public static final int scopeUris = 0x7f010093;
public static final int uiCompass = 0x7f010066;
public static final int uiMapToolbar = 0x7f01006e;
public static final int uiRotateGestures = 0x7f010067;
public static final int uiScrollGestures = 0x7f010068;
public static final int uiTiltGestures = 0x7f010069;
public static final int uiZoomControls = 0x7f01006a;
public static final int uiZoomGestures = 0x7f01006b;
public static final int useViewLifecycle = 0x7f01006c;
public static final int windowTransitionStyle = 0x7f01004b;
public static final int zOrderOnTop = 0x7f01006d;
}
public static final class color {
public static final int common_action_bar_splitter = 0x7f0c0017;
public static final int common_google_signin_btn_text_dark = 0x7f0c007a;
public static final int common_google_signin_btn_text_dark_default = 0x7f0c0018;
public static final int common_google_signin_btn_text_dark_disabled = 0x7f0c0019;
public static final int common_google_signin_btn_text_dark_focused = 0x7f0c001a;
public static final int common_google_signin_btn_text_dark_pressed = 0x7f0c001b;
public static final int common_google_signin_btn_text_light = 0x7f0c007b;
public static final int common_google_signin_btn_text_light_default = 0x7f0c001c;
public static final int common_google_signin_btn_text_light_disabled = 0x7f0c001d;
public static final int common_google_signin_btn_text_light_focused = 0x7f0c001e;
public static final int common_google_signin_btn_text_light_pressed = 0x7f0c001f;
public static final int common_plus_signin_btn_text_dark = 0x7f0c007c;
public static final int common_plus_signin_btn_text_dark_default = 0x7f0c0020;
public static final int common_plus_signin_btn_text_dark_disabled = 0x7f0c0021;
public static final int common_plus_signin_btn_text_dark_focused = 0x7f0c0022;
public static final int common_plus_signin_btn_text_dark_pressed = 0x7f0c0023;
public static final int common_plus_signin_btn_text_light = 0x7f0c007d;
public static final int common_plus_signin_btn_text_light_default = 0x7f0c0024;
public static final int common_plus_signin_btn_text_light_disabled = 0x7f0c0025;
public static final int common_plus_signin_btn_text_light_focused = 0x7f0c0026;
public static final int common_plus_signin_btn_text_light_pressed = 0x7f0c0027;
public static final int place_autocomplete_prediction_primary_text = 0x7f0c004a;
public static final int place_autocomplete_prediction_primary_text_highlight = 0x7f0c004b;
public static final int place_autocomplete_prediction_secondary_text = 0x7f0c004c;
public static final int place_autocomplete_search_hint = 0x7f0c004d;
public static final int place_autocomplete_search_text = 0x7f0c004e;
public static final int place_autocomplete_separator = 0x7f0c004f;
public static final int wallet_bright_foreground_disabled_holo_light = 0x7f0c0062;
public static final int wallet_bright_foreground_holo_dark = 0x7f0c0063;
public static final int wallet_bright_foreground_holo_light = 0x7f0c0064;
public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f0c0065;
public static final int wallet_dim_foreground_holo_dark = 0x7f0c0066;
public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f0c0067;
public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f0c0068;
public static final int wallet_highlighted_text_holo_dark = 0x7f0c0069;
public static final int wallet_highlighted_text_holo_light = 0x7f0c006a;
public static final int wallet_hint_foreground_holo_dark = 0x7f0c006b;
public static final int wallet_hint_foreground_holo_light = 0x7f0c006c;
public static final int wallet_holo_blue_light = 0x7f0c006d;
public static final int wallet_link_text_light = 0x7f0c006e;
public static final int wallet_primary_text_holo_light = 0x7f0c0080;
public static final int wallet_secondary_text_holo_dark = 0x7f0c0081;
}
public static final class dimen {
public static final int place_autocomplete_button_padding = 0x7f09006e;
public static final int place_autocomplete_powered_by_google_height = 0x7f09006f;
public static final int place_autocomplete_powered_by_google_start = 0x7f090070;
public static final int place_autocomplete_prediction_height = 0x7f090071;
public static final int place_autocomplete_prediction_horizontal_margin = 0x7f090072;
public static final int place_autocomplete_prediction_primary_text = 0x7f090073;
public static final int place_autocomplete_prediction_secondary_text = 0x7f090074;
public static final int place_autocomplete_progress_horizontal_margin = 0x7f090075;
public static final int place_autocomplete_progress_size = 0x7f090076;
public static final int place_autocomplete_separator_start = 0x7f090077;
}
public static final class drawable {
public static final int cast_ic_notification_0 = 0x7f020052;
public static final int cast_ic_notification_1 = 0x7f020053;
public static final int cast_ic_notification_2 = 0x7f020054;
public static final int cast_ic_notification_connecting = 0x7f020055;
public static final int cast_ic_notification_on = 0x7f020056;
public static final int common_full_open_on_phone = 0x7f020057;
public static final int common_google_signin_btn_icon_dark = 0x7f020058;
public static final int common_google_signin_btn_icon_dark_disabled = 0x7f020059;
public static final int common_google_signin_btn_icon_dark_focused = 0x7f02005a;
public static final int common_google_signin_btn_icon_dark_normal = 0x7f02005b;
public static final int common_google_signin_btn_icon_dark_pressed = 0x7f02005c;
public static final int common_google_signin_btn_icon_light = 0x7f02005d;
public static final int common_google_signin_btn_icon_light_disabled = 0x7f02005e;
public static final int common_google_signin_btn_icon_light_focused = 0x7f02005f;
public static final int common_google_signin_btn_icon_light_normal = 0x7f020060;
public static final int common_google_signin_btn_icon_light_pressed = 0x7f020061;
public static final int common_google_signin_btn_text_dark = 0x7f020062;
public static final int common_google_signin_btn_text_dark_disabled = 0x7f020063;
public static final int common_google_signin_btn_text_dark_focused = 0x7f020064;
public static final int common_google_signin_btn_text_dark_normal = 0x7f020065;
public static final int common_google_signin_btn_text_dark_pressed = 0x7f020066;
public static final int common_google_signin_btn_text_light = 0x7f020067;
public static final int common_google_signin_btn_text_light_disabled = 0x7f020068;
public static final int common_google_signin_btn_text_light_focused = 0x7f020069;
public static final int common_google_signin_btn_text_light_normal = 0x7f02006a;
public static final int common_google_signin_btn_text_light_pressed = 0x7f02006b;
public static final int common_ic_googleplayservices = 0x7f02006c;
public static final int common_plus_signin_btn_icon_dark = 0x7f02006d;
public static final int common_plus_signin_btn_icon_dark_disabled = 0x7f02006e;
public static final int common_plus_signin_btn_icon_dark_focused = 0x7f02006f;
public static final int common_plus_signin_btn_icon_dark_normal = 0x7f020070;
public static final int common_plus_signin_btn_icon_dark_pressed = 0x7f020071;
public static final int common_plus_signin_btn_icon_light = 0x7f020072;
public static final int common_plus_signin_btn_icon_light_disabled = 0x7f020073;
public static final int common_plus_signin_btn_icon_light_focused = 0x7f020074;
public static final int common_plus_signin_btn_icon_light_normal = 0x7f020075;
public static final int common_plus_signin_btn_icon_light_pressed = 0x7f020076;
public static final int common_plus_signin_btn_text_dark = 0x7f020077;
public static final int common_plus_signin_btn_text_dark_disabled = 0x7f020078;
public static final int common_plus_signin_btn_text_dark_focused = 0x7f020079;
public static final int common_plus_signin_btn_text_dark_normal = 0x7f02007a;
public static final int common_plus_signin_btn_text_dark_pressed = 0x7f02007b;
public static final int common_plus_signin_btn_text_light = 0x7f02007c;
public static final int common_plus_signin_btn_text_light_disabled = 0x7f02007d;
public static final int common_plus_signin_btn_text_light_focused = 0x7f02007e;
public static final int common_plus_signin_btn_text_light_normal = 0x7f02007f;
public static final int common_plus_signin_btn_text_light_pressed = 0x7f020080;
public static final int ic_plusone_medium_off_client = 0x7f0200a6;
public static final int ic_plusone_small_off_client = 0x7f0200a7;
public static final int ic_plusone_standard_off_client = 0x7f0200a8;
public static final int ic_plusone_tall_off_client = 0x7f0200a9;
public static final int places_ic_clear = 0x7f0200c8;
public static final int places_ic_search = 0x7f0200c9;
public static final int powered_by_google_dark = 0x7f0200cc;
public static final int powered_by_google_light = 0x7f0200cd;
}
public static final class id {
public static final int adjust_height = 0x7f0d0034;
public static final int adjust_width = 0x7f0d0035;
public static final int android_pay = 0x7f0d0060;
public static final int android_pay_dark = 0x7f0d0057;
public static final int android_pay_light = 0x7f0d0058;
public static final int android_pay_light_with_border = 0x7f0d0059;
public static final int auto = 0x7f0d0041;
public static final int book_now = 0x7f0d0050;
public static final int buyButton = 0x7f0d004d;
public static final int buy_now = 0x7f0d0051;
public static final int buy_with = 0x7f0d0052;
public static final int buy_with_google = 0x7f0d0053;
public static final int cast_notification_id = 0x7f0d0004;
public static final int classic = 0x7f0d005a;
public static final int dark = 0x7f0d0042;
public static final int donate_with = 0x7f0d0054;
public static final int donate_with_google = 0x7f0d0055;
public static final int google_wallet_classic = 0x7f0d005b;
public static final int google_wallet_grayscale = 0x7f0d005c;
public static final int google_wallet_monochrome = 0x7f0d005d;
public static final int grayscale = 0x7f0d005e;
public static final int holo_dark = 0x7f0d0047;
public static final int holo_light = 0x7f0d0048;
public static final int hybrid = 0x7f0d0036;
public static final int icon_only = 0x7f0d003e;
public static final int light = 0x7f0d0043;
public static final int logo_only = 0x7f0d0056;
public static final int match_parent = 0x7f0d004f;
public static final int monochrome = 0x7f0d005f;
public static final int none = 0x7f0d0011;
public static final int normal = 0x7f0d000d;
public static final int place_autocomplete_clear_button = 0x7f0d00ee;
public static final int place_autocomplete_powered_by_google = 0x7f0d00f0;
public static final int place_autocomplete_prediction_primary_text = 0x7f0d00f2;
public static final int place_autocomplete_prediction_secondary_text = 0x7f0d00f3;
public static final int place_autocomplete_progress = 0x7f0d00f1;
public static final int place_autocomplete_search_button = 0x7f0d00ec;
public static final int place_autocomplete_search_input = 0x7f0d00ed;
public static final int place_autocomplete_separator = 0x7f0d00ef;
public static final int production = 0x7f0d0049;
public static final int sandbox = 0x7f0d004a;
public static final int satellite = 0x7f0d0037;
public static final int selectionDetails = 0x7f0d004e;
public static final int slide = 0x7f0d0030;
public static final int standard = 0x7f0d003f;
public static final int strict_sandbox = 0x7f0d004b;
public static final int terrain = 0x7f0d0038;
public static final int test = 0x7f0d004c;
public static final int wide = 0x7f0d0040;
public static final int wrap_content = 0x7f0d0046;
}
public static final class integer {
public static final int google_play_services_version = 0x7f0b0005;
}
public static final class layout {
public static final int place_autocomplete_fragment = 0x7f030040;
public static final int place_autocomplete_item_powered_by_google = 0x7f030041;
public static final int place_autocomplete_item_prediction = 0x7f030042;
public static final int place_autocomplete_progress = 0x7f030043;
}
public static final class raw {
public static final int gtm_analytics = 0x7f060000;
}
public static final class string {
public static final int accept = 0x7f07004a;
public static final int auth_google_play_services_client_facebook_display_name = 0x7f070054;
public static final int auth_google_play_services_client_google_display_name = 0x7f070055;
public static final int cast_notification_connected_message = 0x7f07005c;
public static final int cast_notification_connecting_message = 0x7f07005d;
public static final int cast_notification_disconnect = 0x7f07005e;
public static final int common_google_play_services_api_unavailable_text = 0x7f070013;
public static final int common_google_play_services_enable_button = 0x7f070014;
public static final int common_google_play_services_enable_text = 0x7f070015;
public static final int common_google_play_services_enable_title = 0x7f070016;
public static final int common_google_play_services_install_button = 0x7f070017;
public static final int common_google_play_services_install_text_phone = 0x7f070018;
public static final int common_google_play_services_install_text_tablet = 0x7f070019;
public static final int common_google_play_services_install_title = 0x7f07001a;
public static final int common_google_play_services_invalid_account_text = 0x7f07001b;
public static final int common_google_play_services_invalid_account_title = 0x7f07001c;
public static final int common_google_play_services_network_error_text = 0x7f07001d;
public static final int common_google_play_services_network_error_title = 0x7f07001e;
public static final int common_google_play_services_notification_ticker = 0x7f07001f;
public static final int common_google_play_services_restricted_profile_text = 0x7f070020;
public static final int common_google_play_services_restricted_profile_title = 0x7f070021;
public static final int common_google_play_services_sign_in_failed_text = 0x7f070022;
public static final int common_google_play_services_sign_in_failed_title = 0x7f070023;
public static final int common_google_play_services_unknown_issue = 0x7f070024;
public static final int common_google_play_services_unsupported_text = 0x7f070025;
public static final int common_google_play_services_unsupported_title = 0x7f070026;
public static final int common_google_play_services_update_button = 0x7f070027;
public static final int common_google_play_services_update_text = 0x7f070028;
public static final int common_google_play_services_update_title = 0x7f070029;
public static final int common_google_play_services_updating_text = 0x7f07002a;
public static final int common_google_play_services_updating_title = 0x7f07002b;
public static final int common_google_play_services_wear_update_text = 0x7f07002c;
public static final int common_open_on_phone = 0x7f07002d;
public static final int common_signin_button_text = 0x7f07002e;
public static final int common_signin_button_text_long = 0x7f07002f;
public static final int create_calendar_message = 0x7f07006c;
public static final int create_calendar_title = 0x7f07006d;
public static final int decline = 0x7f070072;
public static final int place_autocomplete_clear_button = 0x7f07003b;
public static final int place_autocomplete_search_hint = 0x7f07003c;
public static final int store_picture_message = 0x7f0700a4;
public static final int store_picture_title = 0x7f0700a5;
public static final int wallet_buy_button_place_holder = 0x7f07003e;
}
public static final class style {
public static final int Theme_AppInvite_Preview = 0x7f0a00f8;
public static final int Theme_AppInvite_Preview_Base = 0x7f0a0016;
public static final int Theme_IAPTheme = 0x7f0a00f9;
public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f0a0101;
public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f0a0102;
public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f0a0103;
public static final int WalletFragmentDefaultStyle = 0x7f0a0104;
}
public static final class styleable {
public static final int[] AdsAttrs = { 0x7f010027, 0x7f010028, 0x7f010029 };
public static final int AdsAttrs_adSize = 0;
public static final int AdsAttrs_adSizes = 1;
public static final int AdsAttrs_adUnitId = 2;
public static final int[] CustomWalletTheme = { 0x7f01004b };
public static final int CustomWalletTheme_windowTransitionStyle = 0;
public static final int[] LoadingImageView = { 0x7f01005c, 0x7f01005d, 0x7f01005e };
public static final int LoadingImageView_circleCrop = 2;
public static final int LoadingImageView_imageAspectRatio = 1;
public static final int LoadingImageView_imageAspectRatioAdjust = 0;
public static final int[] MapAttrs = { 0x7f01005f, 0x7f010060, 0x7f010061, 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066, 0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a, 0x7f01006b, 0x7f01006c, 0x7f01006d, 0x7f01006e, 0x7f01006f };
public static final int MapAttrs_ambientEnabled = 16;
public static final int MapAttrs_cameraBearing = 1;
public static final int MapAttrs_cameraTargetLat = 2;
public static final int MapAttrs_cameraTargetLng = 3;
public static final int MapAttrs_cameraTilt = 4;
public static final int MapAttrs_cameraZoom = 5;
public static final int MapAttrs_liteMode = 6;
public static final int MapAttrs_mapType = 0;
public static final int MapAttrs_uiCompass = 7;
public static final int MapAttrs_uiMapToolbar = 15;
public static final int MapAttrs_uiRotateGestures = 8;
public static final int MapAttrs_uiScrollGestures = 9;
public static final int MapAttrs_uiTiltGestures = 10;
public static final int MapAttrs_uiZoomControls = 11;
public static final int MapAttrs_uiZoomGestures = 12;
public static final int MapAttrs_useViewLifecycle = 13;
public static final int MapAttrs_zOrderOnTop = 14;
public static final int[] SignInButton = { 0x7f010091, 0x7f010092, 0x7f010093 };
public static final int SignInButton_buttonSize = 0;
public static final int SignInButton_colorScheme = 1;
public static final int SignInButton_scopeUris = 2;
public static final int[] WalletFragmentOptions = { 0x7f010134, 0x7f010135, 0x7f010136, 0x7f010137 };
public static final int WalletFragmentOptions_appTheme = 0;
public static final int WalletFragmentOptions_environment = 1;
public static final int WalletFragmentOptions_fragmentMode = 3;
public static final int WalletFragmentOptions_fragmentStyle = 2;
public static final int[] WalletFragmentStyle = { 0x7f010138, 0x7f010139, 0x7f01013a, 0x7f01013b, 0x7f01013c, 0x7f01013d, 0x7f01013e, 0x7f01013f, 0x7f010140, 0x7f010141, 0x7f010142 };
public static final int WalletFragmentStyle_buyButtonAppearance = 3;
public static final int WalletFragmentStyle_buyButtonHeight = 0;
public static final int WalletFragmentStyle_buyButtonText = 2;
public static final int WalletFragmentStyle_buyButtonWidth = 1;
public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 6;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 8;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 7;
public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 5;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 10;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9;
public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 4;
}
}
| [
"[email protected]"
] | |
fd9aecf052311fb75219a55827c6a348b469ed25 | b23fdece5b5b7f5b11992934f15fb401e6319878 | /src/main/java/com/luckyun/tjam/mtAssetMag/assetTranMag/service/AmAssetTransferDtService.java | b7c92926fb17338d3f5ef617a02df648199296c5 | [] | no_license | kyo9988789/com-luckyun-tjam-admin | ba16154aa52a282837c1d936782a6696b56003b7 | 49432d4c718fc2e1c1fda7585952ff303dbdd276 | refs/heads/master | 2023-05-09T00:50:36.923611 | 2020-06-18T02:34:07 | 2020-06-18T02:34:07 | 273,123,926 | 0 | 0 | null | 2021-06-04T02:46:34 | 2020-06-18T02:33:14 | Java | UTF-8 | Java | false | false | 5,481 | java | package com.luckyun.tjam.mtAssetMag.assetTranMag.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import com.luckyun.base.provider.feign.BaseSysDeptProvider;
import com.luckyun.base.provider.feign.BaseSysUserProvider;
import com.luckyun.core.annotation.TransactionalException;
import com.luckyun.core.data.BaseMapper;
import com.luckyun.core.data.BaseService;
import com.luckyun.model.dept.SysDept;
import com.luckyun.model.user.SysAccount;
import com.luckyun.tjam.mtAssetMag.assetTranMag.mapper.AmAssetTransferDtMapper;
import com.luckyun.tjam.mtAssetMag.assetTranMag.model.AmAssetTransferDt;
import com.luckyun.tjam.mtAssetMag.assetTranMag.param.AmAssetTransferDtParam;
import com.luckyun.tjam.prophaseMag.acceptance.common.DatadicKeys;
import com.luckyun.tjam.prophaseMag.acceptance.helper.BaseServiceHelperImpl;
@Service
public class AmAssetTransferDtService extends BaseService<AmAssetTransferDt> {
@Autowired
private AmAssetTransferDtMapper amAssetTransferDtMapper;
@Autowired
private BaseServiceHelperImpl baseServiceHelperImpl;
@Autowired
private BaseSysUserProvider baseSysUserProvider;
@Autowired
private BaseSysDeptProvider baseSysDeptProvider;
@Override
public BaseMapper<AmAssetTransferDt> getMapper() {
return amAssetTransferDtMapper;
}
/**
* 条件查询所有
* @param condition
* @return
*/
public List<AmAssetTransferDt> findAll(AmAssetTransferDtParam condition){
List<AmAssetTransferDt> all = amAssetTransferDtMapper.findAll(condition);
if (!CollectionUtils.isEmpty(all)){
all.forEach(e->{
// 所属线路
if(null != e.getIlineid()) {
e.setSlinenm(baseServiceHelperImpl.getDatadicName(DatadicKeys.CAP_ACCEPTANCE_EQUIP_ILINEID,
e.getIlineid() != null ? e.getIlineid() : ""));
}
// 管理部门
if(null != e.getImanagedeptid()) {
SysDept sysDept = this.baseSysDeptProvider.findByIndocno(e.getImanagedeptid());
if(null != sysDept) {
e.setSmanagedeptnm(sysDept.getSname());
}
}
// 责任人
if(null != e.getIdutyid()) {
SysAccount sysAccount1 = this.baseSysUserProvider.findFSysUserByIndocno(e.getIdutyid());
if(null != sysAccount1) {
e.setSdutynm(sysAccount1.getSname());
}
}
//使用人
if(null != e.getIuserid()) {
SysAccount sysAccount = this.baseSysUserProvider.findFSysUserByIndocno(e.getIuserid());
e.setSusernm(sysAccount.getSname());
}
});
}
return all;
}
/***
*
* 删除
*
*/
@TransactionalException
public void delOpr(AmAssetTransferDtParam condition){
List<AmAssetTransferDt> delList = condition.getDelList();
if (!CollectionUtils.isEmpty(delList)){
delList.forEach(e->{
amAssetTransferDtMapper.delete(e);
});
}
}
/**
* 查询明细
* @param condition
* @return
*/
public AmAssetTransferDt findOne(Long indocno){
AmAssetTransferDt e = amAssetTransferDtMapper.findOne(indocno);
if (!StringUtils.isEmpty(e)){
// 所属线路
if(null != e.getIlineid()) {
e.setSlinenm(baseServiceHelperImpl.getDatadicName(DatadicKeys.CAP_ACCEPTANCE_EQUIP_ILINEID,
e.getIlineid() != null ? e.getIlineid() : ""));
}
// 管理部门
if(null != e.getImanagedeptid()) {
SysDept sysDept = this.baseSysDeptProvider.findByIndocno(e.getImanagedeptid());
if(null != sysDept) {
e.setSmanagedeptnm(sysDept.getSname());
}
}
// 责任人
if(null != e.getIdutyid()) {
SysAccount sysAccount1 = this.baseSysUserProvider.findFSysUserByIndocno(e.getIdutyid());
if(null != sysAccount1) {
e.setSdutynm(sysAccount1.getSname());
}
}
//使用人
if(null != e.getIuserid()) {
SysAccount sysAccount = this.baseSysUserProvider.findFSysUserByIndocno(e.getIuserid());
e.setSusernm(sysAccount.getSname());
}
}
return e;
}
/**
* 添加
*
*/
@TransactionalException
public void add(AmAssetTransferDtParam entity){
List<AmAssetTransferDt> addList = entity.getAddList();
if (!CollectionUtils.isEmpty(addList)){
addList.forEach(e->{
super.insert(e);
});
}
}
/**
*修改
**/
@TransactionalException
public void updateBasic(AmAssetTransferDtParam entity) {
List<AmAssetTransferDt> delList = entity.getDelList();
if(!CollectionUtils.isEmpty(delList)){
delList.forEach(e->{
amAssetTransferDtMapper.update(e);
});
}
}
}
| [
"[email protected]"
] | |
1f99ee6f75025c8815926b4f1c01e82d72c8dba6 | 06ac0ab2f1048f5538ac92e9ebc40181a6becdcd | /football_scores/app/src/main/java/barqsoft/footballscores/service/MyFetchService.java | 90eb479042f7fb3bb4585ee16c19407526b8e3c0 | [] | no_license | ivanisidrowu/AND-project-3-superduo | 079c85f45bcbc9c1241e18e73624da32c675d4f1 | 2c7322e9a453947182fee8c09e8dd6731dd53241 | refs/heads/master | 2021-01-10T10:27:56.062657 | 2016-02-12T08:43:03 | 2016-02-12T08:43:03 | 51,539,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,223 | java | package barqsoft.footballscores.service;
import android.app.IntentService;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.Vector;
import barqsoft.footballscores.BuildConfig;
import barqsoft.footballscores.database.DatabaseContract;
import barqsoft.footballscores.R;
import retrofit.GsonConverterFactory;
import retrofit.Response;
import retrofit.Retrofit;
/**
* Created by yehya khaled on 3/2/2015.
*/
public class MyFetchService extends IntentService {
public static final String LOG_TAG = "myFetchService";
private FootballApi footballApi;
private String apiKey;
public MyFetchService() {
super("myFetchService");
}
@Override
protected void onHandleIntent(Intent intent) {
apiKey = getString(R.string.api_key);
getApi();
getData("n2");
getData("p2");
return;
}
private void getData(String timeFrame) {
//Creating fetch URL
final String BASE_URL = "http://api.football-data.org/alpha/fixtures"; //Base URL
final String QUERY_TIME_FRAME = "timeFrame"; //Time Frame parameter to determine days
//final String QUERY_MATCH_DAY = "matchday";
Uri fetch_build = Uri.parse(BASE_URL).buildUpon().
appendQueryParameter(QUERY_TIME_FRAME, timeFrame).build();
//Log.v(LOG_TAG, "The url we are looking at is: "+fetch_build.toString()); //log spam
HttpURLConnection m_connection = null;
BufferedReader reader = null;
String JSON_data = null;
//Opening Connection
try {
URL fetch = new URL(fetch_build.toString());
m_connection = (HttpURLConnection) fetch.openConnection();
m_connection.setRequestMethod("GET");
m_connection.addRequestProperty("X-Auth-Token", getString(R.string.api_key));
m_connection.connect();
// Read the input stream into a String
InputStream inputStream = m_connection.getInputStream();
StringBuffer buffer = new StringBuffer();
if (inputStream == null) {
// Nothing to do.
return;
}
reader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = reader.readLine()) != null) {
// Since it's JSON, adding a newline isn't necessary (it won't affect parsing)
// But it does make debugging a *lot* easier if you print out the completed
// buffer for debugging.
buffer.append(line + "\n");
}
if (buffer.length() == 0) {
// Stream was empty. No point in parsing.
return;
}
JSON_data = buffer.toString();
} catch (Exception e) {
Log.e(LOG_TAG, "Exception here" + e.getMessage());
} finally {
if (m_connection != null) {
m_connection.disconnect();
}
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
Log.e(LOG_TAG, "Error Closing Stream");
}
}
}
try {
if (JSON_data != null) {
//This bit is to check if the data contains any matches. If not, we call processJson on the dummy data
JSONArray matches = new JSONObject(JSON_data).getJSONArray("fixtures");
if (matches.length() == 0) {
//if there is no data, call the function on dummy data
//this is expected behavior during the off season.
processJSONdata(getString(R.string.dummy_data), getApplicationContext(), false);
return;
}
processJSONdata(JSON_data, getApplicationContext(), true);
} else {
//Could not Connect
Log.d(LOG_TAG, "Could not connect to server.");
}
} catch (Exception e) {
Log.e(LOG_TAG, e.getMessage());
}
}
private void processJSONdata(String JSONdata, Context mContext, boolean isReal) {
//JSON data
// This set of league codes is for the 2015/2016 season. In fall of 2016, they will need to
// be updated. Feel free to use the codes
final String BUNDESLIGA1 = "394";
final String BUNDESLIGA2 = "395";
final String LIGUE1 = "396";
final String LIGUE2 = "397";
final String PREMIER_LEAGUE = "398";
final String PRIMERA_DIVISION = "399";
final String SEGUNDA_DIVISION = "400";
final String SERIE_A = "401";
final String PRIMERA_LIGA = "402";
final String Bundesliga3 = "403";
final String EREDIVISIE = "404";
final String SEASON_LINK = "http://api.football-data.org/alpha/soccerseasons/";
final String MATCH_LINK = "http://api.football-data.org/alpha/fixtures/";
final String FIXTURES = "fixtures";
final String LINKS = "_links";
final String SOCCER_SEASON = "soccerseason";
final String SELF = "self";
final String MATCH_DATE = "date";
final String HOME_TEAM = "homeTeamName";
final String AWAY_TEAM = "awayTeamName";
final String RESULT = "result";
final String HOME_GOALS = "goalsHomeTeam";
final String AWAY_GOALS = "goalsAwayTeam";
final String MATCH_DAY = "matchday";
final String HOME_TEAM_ID = "homeTeam";
final String AWAY_TEAM_ID = "awayTeam";
//Match data
String League = null;
String mDate = null;
String mTime = null;
String Home = null;
String Away = null;
String Home_goals = null;
String Away_goals = null;
String match_id = null;
String match_day = null;
try {
JSONArray matches = new JSONObject(JSONdata).getJSONArray(FIXTURES);
//ContentValues to be inserted
Vector<ContentValues> values = new Vector<ContentValues>(matches.length());
for (int i = 0; i < matches.length(); i++) {
JSONObject match_data = matches.getJSONObject(i);
League = match_data.getJSONObject(LINKS).getJSONObject(SOCCER_SEASON).
getString("href");
League = League.replace(SEASON_LINK, "");
//This if statement controls which leagues we're interested in the data from.
//add leagues here in order to have them be added to the DB.
// If you are finding no data in the app, check that this contains all the leagues.
// If it doesn't, that can cause an empty DB, bypassing the dummy data routine.
if (League.equals(PREMIER_LEAGUE) ||
League.equals(SERIE_A) ||
League.equals(BUNDESLIGA1) ||
League.equals(BUNDESLIGA2) ||
League.equals(PRIMERA_DIVISION)) {
match_id = match_data.getJSONObject(LINKS).getJSONObject(SELF).
getString("href");
match_id = match_id.replace(MATCH_LINK, "");
if (!isReal) {
//This if statement changes the match ID of the dummy data so that it all goes into the database
match_id = match_id + Integer.toString(i);
}
mDate = match_data.getString(MATCH_DATE);
mTime = mDate.substring(mDate.indexOf("T") + 1, mDate.indexOf("Z"));
mDate = mDate.substring(0, mDate.indexOf("T"));
SimpleDateFormat match_date = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
match_date.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
Date parseddate = match_date.parse(mDate + mTime);
SimpleDateFormat new_date = new SimpleDateFormat("yyyy-MM-dd:HH:mm");
new_date.setTimeZone(TimeZone.getDefault());
mDate = new_date.format(parseddate);
mTime = mDate.substring(mDate.indexOf(":") + 1);
mDate = mDate.substring(0, mDate.indexOf(":"));
if (!isReal) {
//This if statement changes the dummy data's date to match our current date range.
Date fragmentdate = new Date(System.currentTimeMillis() + ((i - 2) * 86400000));
SimpleDateFormat mformat = new SimpleDateFormat("yyyy-MM-dd");
mDate = mformat.format(fragmentdate);
}
} catch (Exception e) {
Log.d(LOG_TAG, "error here!");
Log.e(LOG_TAG, e.getMessage());
}
Home = match_data.getString(HOME_TEAM);
Away = match_data.getString(AWAY_TEAM);
Home_goals = match_data.getJSONObject(RESULT).getString(HOME_GOALS);
Away_goals = match_data.getJSONObject(RESULT).getString(AWAY_GOALS);
match_day = match_data.getString(MATCH_DAY);
String homeTeamId = getTeamId(match_data, HOME_TEAM_ID);
String awayTeamId = getTeamId(match_data, AWAY_TEAM_ID);
String homeTeamCrestUrl = getTeamCrestURL(homeTeamId);
String awayTeamCrestUrl = getTeamCrestURL(awayTeamId);
ContentValues match_values = new ContentValues();
match_values.put(DatabaseContract.scores_table.MATCH_ID, match_id);
match_values.put(DatabaseContract.scores_table.DATE_COL, mDate);
match_values.put(DatabaseContract.scores_table.TIME_COL, mTime);
match_values.put(DatabaseContract.scores_table.HOME_COL, Home);
match_values.put(DatabaseContract.scores_table.AWAY_COL, Away);
match_values.put(DatabaseContract.scores_table.HOME_GOALS_COL, Home_goals);
match_values.put(DatabaseContract.scores_table.AWAY_GOALS_COL, Away_goals);
match_values.put(DatabaseContract.scores_table.LEAGUE_COL, League);
match_values.put(DatabaseContract.scores_table.MATCH_DAY, match_day);
match_values.put(DatabaseContract.scores_table.HOME_CREST_URL, homeTeamCrestUrl);
match_values.put(DatabaseContract.scores_table.AWAY_CREST_URL, awayTeamCrestUrl);
//log spam
//Log.v(LOG_TAG,match_id);
//Log.v(LOG_TAG,mDate);
//Log.v(LOG_TAG,mTime);
//Log.v(LOG_TAG,Home);
//Log.v(LOG_TAG,Away);
//Log.v(LOG_TAG,Home_goals);
//Log.v(LOG_TAG,Away_goals);
values.add(match_values);
}
}
int inserted_data = 0;
ContentValues[] insert_data = new ContentValues[values.size()];
values.toArray(insert_data);
inserted_data = mContext.getContentResolver().bulkInsert(
DatabaseContract.BASE_CONTENT_URI, insert_data);
//Log.v(LOG_TAG,"Succesfully Inserted : " + String.valueOf(inserted_data));
} catch (JSONException e) {
Log.e(LOG_TAG, e.getMessage());
}
}
private FootballApi getApi(){
if(footballApi == null){
Retrofit retrofit = new Retrofit.Builder().baseUrl(BuildConfig.SERVER_URL).addConverterFactory(GsonConverterFactory.create()).build();
footballApi = retrofit.create(FootballApi.class);
}
return footballApi;
}
private String getTeamId(JSONObject matchData, String teamKey){
String result = "";
try{
String[] urlPart = matchData.getJSONObject("_links").getJSONObject(teamKey).getString("href").split("/");
result = urlPart[urlPart.length - 1];
}catch (Exception exception){
Log.e(LOG_TAG, "getTeamId: ", exception);
}
return result;
}
private String getTeamCrestURL(String id){
String result = "";
try {
Response<TeamInfoResponse> response = footballApi.getTeamInformation(apiKey, id).execute();
result = response.body().getCrestUrl();
} catch (IOException e) {
Log.e(LOG_TAG, "getTeamCrestURL: ", e);
}
return result;
}
}
| [
"[email protected]"
] | |
ddf1631e3b52a9bb5e5530fffa586ca15e15917d | df1f3b81da215d689ce87c757a95f19d933a9eed | /app/src/main/java/com/xiaobangzhu/xiaobangzhu/UI/activity/NormalVisitorInfoActivity.java | dfc6dd42d4c62801b865100fe721973753466e47 | [] | no_license | liuyang3688/XiaoBangZhu | 5f81ff015c06c9adfea31987757ca3c0fbac3028 | 201d8bd0c57f6766032d2faeae857a1539ac0dc6 | refs/heads/master | 2021-06-17T08:48:45.535978 | 2017-03-31T15:15:46 | 2017-03-31T15:15:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,049 | java | package com.xiaobangzhu.xiaobangzhu.UI.activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import com.xiaobangzhu.xiaobangzhu.R;
/**
* NormalVisitorInfoActivity
*
* @author: MurphySL
* @time: 2016/12/4 22:49
*/
public class NormalVisitorInfoActivity extends AppCompatActivity implements View.OnClickListener{
private ImageView back;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.normal_visitor_info);
initView();
}
private void initView() {
back = (ImageView) findViewById(R.id.activity_normal_visitor_back_icon);
back.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.activity_normal_visitor_back_icon:
finish();
break;
}
}
}
| [
"[email protected]"
] | |
904ca3d08ee43c6b847190399c28afa55aacc0a9 | 85b85254eee7d62345e2c7f035ce54a1a7b3578b | /src/main/java/exceptions/PrintTable.java | 5630b6a2838feac9351b3f38f32e3376a2613af7 | [] | no_license | swidzi76/2019_02_23 | 5419430030255d786f61aef340142c3cc6c99ecf | 5c4391f73fbb0d78819f0a9e6f00f8e48e11b1e0 | refs/heads/master | 2020-04-24T19:08:49.065874 | 2019-04-13T10:49:44 | 2019-04-13T10:49:44 | 172,202,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 703 | java | package exceptions;
import java.util.Scanner;
public class PrintTable {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int index = 0;
try {
index = scanner.nextInt();
}catch (Exception e){
System.out.println(" Wyjątek :"+e);
System.out.println(" index to 0");
}
String[] fruits = new String[]{"apple", "organe", "mango", "cheery"};
try {
System.out.println(fruits[index]);
}catch (Exception e){
System.out.println(" wyjątek :"+e);
}finally {
System.out.println("SPRAWDZANIE WYJĄTKÓW koniec");
}
}
}
| [
"[email protected]"
] | |
64c6f67ee816b18474c28e7b9bfd1798ec774738 | 44e7adc9a1c5c0a1116097ac99c2a51692d4c986 | /aws-java-sdk-quicksight/src/main/java/com/amazonaws/services/quicksight/model/DeleteDataSourceResult.java | ca99458df43eb4b1026bf1222f657b2e6efd177d | [
"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 | 8,375 | java | /*
* Copyright 2015-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. 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.
*/
package com.amazonaws.services.quicksight.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteDataSource" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteDataSourceResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* <p>
* The Amazon Resource Name (ARN) of the data source that you deleted.
* </p>
*/
private String arn;
/**
* <p>
* The ID of the data source. This ID is unique per AWS Region for each AWS account.
* </p>
*/
private String dataSourceId;
/**
* <p>
* The AWS request ID for this operation.
* </p>
*/
private String requestId;
/**
* <p>
* The HTTP status of the request.
* </p>
*/
private Integer status;
/**
* <p>
* The Amazon Resource Name (ARN) of the data source that you deleted.
* </p>
*
* @param arn
* The Amazon Resource Name (ARN) of the data source that you deleted.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the data source that you deleted.
* </p>
*
* @return The Amazon Resource Name (ARN) of the data source that you deleted.
*/
public String getArn() {
return this.arn;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the data source that you deleted.
* </p>
*
* @param arn
* The Amazon Resource Name (ARN) of the data source that you deleted.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteDataSourceResult withArn(String arn) {
setArn(arn);
return this;
}
/**
* <p>
* The ID of the data source. This ID is unique per AWS Region for each AWS account.
* </p>
*
* @param dataSourceId
* The ID of the data source. This ID is unique per AWS Region for each AWS account.
*/
public void setDataSourceId(String dataSourceId) {
this.dataSourceId = dataSourceId;
}
/**
* <p>
* The ID of the data source. This ID is unique per AWS Region for each AWS account.
* </p>
*
* @return The ID of the data source. This ID is unique per AWS Region for each AWS account.
*/
public String getDataSourceId() {
return this.dataSourceId;
}
/**
* <p>
* The ID of the data source. This ID is unique per AWS Region for each AWS account.
* </p>
*
* @param dataSourceId
* The ID of the data source. This ID is unique per AWS Region for each AWS account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteDataSourceResult withDataSourceId(String dataSourceId) {
setDataSourceId(dataSourceId);
return this;
}
/**
* <p>
* The AWS request ID for this operation.
* </p>
*
* @param requestId
* The AWS request ID for this operation.
*/
public void setRequestId(String requestId) {
this.requestId = requestId;
}
/**
* <p>
* The AWS request ID for this operation.
* </p>
*
* @return The AWS request ID for this operation.
*/
public String getRequestId() {
return this.requestId;
}
/**
* <p>
* The AWS request ID for this operation.
* </p>
*
* @param requestId
* The AWS request ID for this operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteDataSourceResult withRequestId(String requestId) {
setRequestId(requestId);
return this;
}
/**
* <p>
* The HTTP status of the request.
* </p>
*
* @param status
* The HTTP status of the request.
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* <p>
* The HTTP status of the request.
* </p>
*
* @return The HTTP status of the request.
*/
public Integer getStatus() {
return this.status;
}
/**
* <p>
* The HTTP status of the request.
* </p>
*
* @param status
* The HTTP status of the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteDataSourceResult withStatus(Integer status) {
setStatus(status);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getDataSourceId() != null)
sb.append("DataSourceId: ").append(getDataSourceId()).append(",");
if (getRequestId() != null)
sb.append("RequestId: ").append(getRequestId()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeleteDataSourceResult == false)
return false;
DeleteDataSourceResult other = (DeleteDataSourceResult) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getDataSourceId() == null ^ this.getDataSourceId() == null)
return false;
if (other.getDataSourceId() != null && other.getDataSourceId().equals(this.getDataSourceId()) == false)
return false;
if (other.getRequestId() == null ^ this.getRequestId() == null)
return false;
if (other.getRequestId() != null && other.getRequestId().equals(this.getRequestId()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getDataSourceId() == null) ? 0 : getDataSourceId().hashCode());
hashCode = prime * hashCode + ((getRequestId() == null) ? 0 : getRequestId().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
return hashCode;
}
@Override
public DeleteDataSourceResult clone() {
try {
return (DeleteDataSourceResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
d8e864730b287d02148df36e06dab12be0f60fab | f4513d1f1389a843d3dce379562ae85050a4d2ea | /app/src/main/java/com/example/smart_adviser_for_wellbeing/Notes.java | cbaa89dcf36a68e32c182ec8937e85c658337ff7 | [] | no_license | Parma139/Smart-Adviser-for-wellbeing-Applicaiton | e016f11fa20d50d008fb5d84154b958014648668 | c443059e2e13708a800de9e038c41d6c49ef16fa | refs/heads/master | 2023-05-13T05:17:44.517226 | 2021-05-12T19:35:01 | 2021-05-12T19:35:01 | 344,234,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,209 | java | package com.example.smart_adviser_for_wellbeing;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
/**
* A simple {@link Fragment} subclass.
* create an instance of this fragment.
*/
public class Notes extends Fragment {
public Notes() {
// Required empty public constructor
}
Button addNotebtn;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_notes, container, false);
addNotebtn = view.findViewById(R.id.addBtn);
// this handle the add note button activity
addNotebtn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent newNoteIntent = new Intent(view.getContext(), NoteDetailActivity.class);
startActivity(newNoteIntent);
}
});
return view;
}
} | [
"[email protected]"
] | |
a592a02d45c529bd6f9168c8cf23383c17ffe863 | 607224e023e4bf33a2be619262e1d8b55c2a3e08 | /jars/worldwind/src/gov/nasa/worldwind/layers/rpf/wizard/DataChooserPanelDescriptor.java | 3bbf707c782688fcbe2a81626d4f6322710de671 | [] | no_license | haldean/droidcopter | 54511d836762f41b23670447f79e7457d67a216d | 2a25c5eade55e68037001fbfdba3b0f975c70e25 | refs/heads/master | 2020-05-16T22:18:53.581797 | 2013-01-27T03:58:24 | 2013-01-27T03:58:24 | 755,362 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,012 | java | /* Copyright (C) 2001, 2007 United States Government as represented by
the Administrator of the National Aeronautics and Space Administration.
All Rights Reserved.
*/
package gov.nasa.worldwind.layers.rpf.wizard;
import gov.nasa.worldwind.util.wizard.DefaultPanelDescriptor;
import gov.nasa.worldwind.util.wizard.Wizard;
import gov.nasa.worldwind.util.wizard.WizardModel;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Collection;
import java.io.File;
/**
* @author dcollins
* @version $Id: DataChooserPanelDescriptor.java 4857 2008-03-29 01:11:08Z dcollins $
*/
public class DataChooserPanelDescriptor extends DefaultPanelDescriptor
{
private DataChooserPanel panelComponent;
private PropertyEvents propertyEvents;
public static final String IDENTIFIER = "gov.nasa.worldwind.rpf.wizard.DataChooserPanel";
public DataChooserPanelDescriptor()
{
this.panelComponent = new DataChooserPanel();
this.propertyEvents = new PropertyEvents();
this.panelComponent.addPropertyChangeListener(this.propertyEvents);
setPanelIdentifier(IDENTIFIER);
setPanelComponent(this.panelComponent);
}
public Object getBackPanelDescriptor()
{
return FileChooserPanelDescriptor.IDENTIFIER;
}
public Object getNextPanelDescriptor()
{
return PreprocessPanelDescriptor.IDENTIFIER;
}
public void registerPanel(Wizard wizard)
{
WizardModel oldWizardModel = getWizardModel();
if (oldWizardModel != null)
oldWizardModel.removePropertyChangeListener(this.propertyEvents);
super.registerPanel(wizard);
WizardModel newWizardModel = getWizardModel();
if (newWizardModel != null)
newWizardModel.addPropertyChangeListener(this.propertyEvents);
}
public void aboutToDisplayPanel()
{
setNextButtonAccordingToSelection();
}
private void setNextButtonAccordingToSelection()
{
Wizard wizard = getWizard();
if (wizard != null)
{
boolean anySelected = false;
Collection<FileSet> fileSetList = RPFWizardUtil.getFileSetList(wizard.getModel());
if (fileSetList != null && fileSetList.size() > 0)
{
for (FileSet set : fileSetList)
anySelected |= set.isSelected();
}
wizard.setNextButtonEnabled(anySelected);
wizard.giveFocusToNextButton();
}
}
private void fileSetListChanged()
{
WizardModel model = getWizardModel();
if (model != null)
{
Collection<FileSet> fileSetList = RPFWizardUtil.getFileSetList(model);
updatePanelTitle(fileSetList);
updatePanelData(fileSetList);
updatePanelDataDescription(fileSetList);
}
}
private void fileSetSelectionChanged()
{
setNextButtonAccordingToSelection();
WizardModel model = getWizardModel();
if (model != null)
{
Collection<FileSet> fileSetList = RPFWizardUtil.getFileSetList(model);
updatePanelDataDescription(fileSetList);
}
}
private class PropertyEvents implements PropertyChangeListener {
public void propertyChange(PropertyChangeEvent evt) {
if (evt != null && evt.getPropertyName() != null) {
String propertyName = evt.getPropertyName();
if (propertyName.equals(RPFWizardUtil.FILE_SET_LIST)) {
fileSetListChanged();
} else if (propertyName.equals(FileSet.SELECTED)) {
fileSetSelectionChanged();
}
}
}
}
private void updatePanelTitle(Collection<FileSet> fileSetList)
{
if (fileSetList != null && fileSetList.size() > 0)
{
this.panelComponent.setTitle(RPFWizardUtil.makeLarger("Select Imagery to Import"));
}
else
{
this.panelComponent.setTitle(RPFWizardUtil.makeLarger("No Imagery Found"));
}
}
private void updatePanelData(Collection<FileSet> fileSetList)
{
this.panelComponent.setFileSetList(fileSetList);
}
private void updatePanelDataDescription(Collection<FileSet> fileSetList)
{
int totalFiles = 0;
int selectedFiles = 0;
if (fileSetList != null && fileSetList.size() > 0)
{
for (FileSet set : fileSetList)
{
if (set != null)
{
int count = set.getFileCount();
totalFiles += count;
if (set.isSelected())
selectedFiles += count;
}
}
}
if (totalFiles > 0)
{
StringBuilder sb = new StringBuilder();
if (selectedFiles > 0)
{
long WAVELET_SIZE_EST = 262160; // TODO: compute this value
long WAVELET_TIME_EST = 200; // TODO: compute this value
long estimatedBytes = selectedFiles * WAVELET_SIZE_EST;
long estimatedMillis = selectedFiles * WAVELET_TIME_EST;
sb.append("Selected files: ");
sb.append(String.format("%,d", selectedFiles));
if (estimatedBytes > 0)
{
SizeFormatter sf = new SizeFormatter();
if (sb.length() > 0)
sb.append(" - ");
sb.append("Disk space required: ~");
sb.append(sf.formatEstimate(estimatedBytes));
}
if (estimatedMillis > 0)
{
TimeFormatter tf = new TimeFormatter();
if (sb.length() > 0)
sb.append(" - ");
sb.append("Processing time: ");
sb.append(tf.formatEstimate(estimatedMillis));
}
}
else
{
sb.append("No files selected");
}
this.panelComponent.setDataDescription(RPFWizardUtil.makeSmaller(sb.toString()));
}
else
{
StringBuilder sb = new StringBuilder();
sb.append("No Imagery");
WizardModel model = getWizardModel();
if (model != null)
{
File selectedFile = RPFWizardUtil.getSelectedFile(model);
if (selectedFile != null)
sb.append(" in \'").append(selectedFile.getAbsolutePath()).append(File.separator).append("\'");
}
this.panelComponent.setDataDescription(RPFWizardUtil.makeBold(sb.toString()));
}
}
}
| [
"[email protected]"
] | |
820855dd77bc8ec2e9cfacf8c0630ded24ff7058 | 2342a71e7c651f7d674be506b001ae4b34ddd44b | /javafundamentals/src/test/java/org/liuboudubavest/AppTest.java | b74c93123d08ae3739e0bcacb10a9d148f6c9376 | [] | no_license | LiubouDubavets/EpamTasksFirstStage | 70598dd4082ec9e17e3f54f6eb8ec48b42f0c2c1 | 2aac2cdba980da69e6f41076c8a18943a5b74730 | refs/heads/main | 2023-02-19T22:13:01.436348 | 2021-01-22T10:42:59 | 2021-01-22T10:42:59 | 331,598,772 | 0 | 0 | null | 2021-01-21T22:06:23 | 2021-01-21T10:54:39 | null | UTF-8 | Java | false | false | 290 | java | package org.liuboudubavest;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
| [
"[email protected]"
] | |
dfd87bcb0d339fddafeed2c46a2a2d04abc12094 | a5144c0d62279185e4594566e3deb4ee5230bb9d | /src/main/java/com/llaparra/react/web/rest/ClientForwardController.java | d1ec5d3a65e92662fc661fcbe49d706f0172671c | [] | no_license | lapitzasclub/react | f924f373b1c4cf8649f3e287d2ec26a86cb6154a | ba89b953e16c31ecb4df99bf4447d06637b850c2 | refs/heads/master | 2023-01-14T00:34:24.017003 | 2020-11-04T10:00:07 | 2020-11-04T10:00:07 | 309,962,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package com.llaparra.react.web.rest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class ClientForwardController {
/**
* Forwards any unmapped paths (except those containing a period) to the client {@code index.html}.
* @return forward to client {@code index.html}.
*/
@GetMapping(value = "/**/{path:[^\\.]*}")
public String forward() {
return "forward:/";
}
}
| [
"[email protected]"
] | |
bd03a3c535072c53b0f258b79a91f8d62ecb42f2 | d7b2a4a222d33f2e71d31b6a158e23d09635645c | /arsdkengine/src/main/java/com/parrot/drone/groundsdk/arsdkengine/peripheral/anafi/media/MediaResourceImpl.java | d28b848fe23dd3d9a33aa9a8a64683e99fe0edfc | [] | permissive | BanditFly/groundsdk-android | fbe15cd834b28639c878737d04d3cb7b787525d0 | e1e1dbd2f948524d51e10474d19176116f031643 | refs/heads/master | 2020-08-04T08:59:20.054023 | 2019-07-01T09:29:26 | 2019-07-01T09:29:26 | 212,081,464 | 1 | 0 | BSD-3-Clause | 2019-10-01T11:40:59 | 2019-10-01T11:40:59 | null | UTF-8 | Java | false | false | 7,947 | java | /*
* Copyright (C) 2019 Parrot Drones SAS
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of the Parrot Company nor the names
* of its contributors may be used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
package com.parrot.drone.groundsdk.arsdkengine.peripheral.anafi.media;
import android.location.Location;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.parrot.drone.groundsdk.arsdkengine.http.HttpMediaItem;
import com.parrot.drone.groundsdk.device.peripheral.media.MediaItem;
import com.parrot.drone.groundsdk.internal.device.peripheral.media.MediaResourceCore;
import com.parrot.drone.sdkcore.stream.SdkCoreTracks;
import java.util.Date;
import java.util.EnumMap;
import java.util.EnumSet;
/**
* Implementation of {@code MediaResourceCore} over {@link HttpMediaItem.Resource}.
*/
final class MediaResourceImpl implements MediaResourceCore {
/**
* Unwraps a media resource to its internal {@code MediaResourceImpl} representation.
* <p>
* This method assumes that the specified media resource is based upon {@code MediaResourceImpl}.
*
* @param resource media resource to unwrap
*
* @return internal {@code MediaResourceImpl} representation of the specified media resource
*/
@NonNull
static MediaResourceImpl unwrap(@NonNull MediaResourceCore resource) {
return (MediaResourceImpl) resource;
}
/** Media item parent of this resource. */
@NonNull
private final MediaItemImpl mMedia;
/** HTTP media resource that backs this media. */
@NonNull
private final HttpMediaItem.Resource mHttpResource;
/** Available metadata types for this resource. */
@NonNull
private final EnumSet<MediaItem.MetadataType> mMetadataTypes;
/** Available stream track identifiers, by track kind. */
@NonNull
private final EnumMap<MediaItem.Track, String> mTracks;
/**
* Constructor.
*
* @param media media item parent
* @param resource HTTP media resource backend
*/
MediaResourceImpl(@NonNull MediaItemImpl media, @NonNull HttpMediaItem.Resource resource) {
if (!resource.isValid()) {
throw new IllegalArgumentException("Invalid HttpMediaItem.Resource: " + resource);
}
mMedia = media;
mHttpResource = resource;
mMetadataTypes = EnumSet.noneOf(MediaItem.MetadataType.class);
boolean thermal = mHttpResource.hasThermalMetadata();
if (thermal) {
mMetadataTypes.add(MediaItem.MetadataType.THERMAL);
}
mTracks = new EnumMap<>(MediaItem.Track.class);
if (mHttpResource.getStreamUrl() != null) {
mTracks.put(MediaItem.Track.DEFAULT_VIDEO, null);
if (thermal) {
mTracks.put(MediaItem.Track.THERMAL_UNBLENDED, SdkCoreTracks.TRACK_THERMAL_UNBLENDED);
}
}
}
@NonNull
@Override
public String getUid() {
assert mHttpResource.getId() != null;
return mHttpResource.getId();
}
@NonNull
@Override
public MediaItemImpl getMedia() {
return mMedia;
}
@NonNull
@Override
public Format getFormat() {
assert mHttpResource.getFormat() != null;
return FormatAdapter.from(mHttpResource.getFormat());
}
@Override
public long getSize() {
return mHttpResource.getSize();
}
@Override
public long getDuration() {
return mHttpResource.getDuration();
}
@NonNull
@Override
public Date getCreationDate() {
assert mHttpResource.getDate() != null;
return new Date(mHttpResource.getDate().getTime());
}
@Nullable
@Override
public Location getLocation() {
HttpMediaItem.Location location = mHttpResource.getLocation();
return location == null ? null : LocationAdapter.from(location);
}
@NonNull
@Override
public EnumSet<MediaItem.MetadataType> getAvailableMetadata() {
return EnumSet.copyOf(mMetadataTypes);
}
@NonNull
@Override
public EnumSet<MediaItem.Track> getAvailableTracks() {
return mTracks.isEmpty() ? EnumSet.noneOf(MediaItem.Track.class) : EnumSet.copyOf(mTracks.keySet());
}
@Nullable
@Override
public String getStreamUrl() {
return mHttpResource.getStreamUrl();
}
@Nullable
@Override
public String getStreamTrackIdFor(@NonNull MediaItem.Track track) {
if (mTracks.containsKey(track)) {
return mTracks.get(track);
}
throw new IllegalArgumentException("No such track in resource [track: " + track + ", uid: " + getUid() + "]");
}
/**
* Retrieves the URL to use to download this resource.
*
* @return resource download URL
*/
@NonNull
String getDownloadUrl() {
assert mHttpResource.getUrl() != null;
return mHttpResource.getUrl();
}
/**
* Retrieves the URL to use to fetch the thumbnail for this resource.
*
* @return thumbnail URL, if available, otherwise {@code null}
*/
@Nullable
String getThumbnailUrl() {
return mHttpResource.getThumbnailUrl();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MediaResourceImpl resource = (MediaResourceImpl) o;
return getUid().equals(resource.getUid());
}
@Override
public int hashCode() {
return getUid().hashCode();
}
//region Parcelable
/**
* Parcel deserializer.
*/
public static final Parcelable.Creator<MediaResourceImpl> CREATOR = new Parcelable.Creator<MediaResourceImpl>() {
@Override
public MediaResourceImpl createFromParcel(@NonNull Parcel src) {
MediaItemImpl media = src.readTypedObject(MediaItemImpl.CREATOR);
return media == null ? null : media.getResources().get(src.readInt());
}
@Override
public MediaResourceImpl[] newArray(int size) {
return new MediaResourceImpl[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(@NonNull Parcel dst, int flags) {
dst.writeTypedObject(mMedia, flags);
dst.writeInt(mMedia.getResources().indexOf(this));
}
//endregion
}
| [
"[email protected]"
] | |
3c84d3fb9236eb3aaaa0be14a8c99f91bcb4b6e8 | e813954c68ca43ec8e780739846e92a8194e7a7f | /JavaCore/task12/task1209/Solution.java | 83a177f62826544bb6630a073898960a05534917 | [] | no_license | ElenaC8/JavaRush | 0cbd839583aadb204e7c9d569d375d5558bba55d | c198ee8ba4348af5e484c8674ae11ca3287a4bfb | refs/heads/main | 2023-04-18T19:33:57.711995 | 2021-05-04T14:25:18 | 2021-05-04T14:25:18 | 364,281,402 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.javarush.task.task12.task1209;
/*
Три метода и минимум
*/
public class Solution {
public static void main(String[] args) {
}
//Напишите тут ваши методы
public static int min(int a, int b) {
return a < b ? a : b;
}
public static long min(long c, long d) {
return c < d ? c : d;
}
public static double min(double h, double f) {
return h < f ? h : f;
}
}
| [
"[email protected]"
] | |
09133a47184d3b5757ebf69d80d713c53ef9fdf3 | a760fb2ea89252aa3c2e0e5cfc33b93d2cc4d2f3 | /app/src/main/java/com/example/jeylnastoninfer/debug7/auxUtils/projectStructUtils/UsrInfo.java | 70bb7e977187a42c8c989576af7e7e5277b102a9 | [] | no_license | astoninfer/SimpleDiary | 0fa3cfa01e96c79269f199827bf594aff32a89d8 | 1ba0da5758e554cb97292430d0f8723ab72b08c5 | refs/heads/master | 2021-01-13T07:53:44.032666 | 2017-01-05T17:25:39 | 2017-01-05T17:25:39 | 71,686,534 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 466 | java | package com.example.jeylnastoninfer.debug7.auxUtils.projectStructUtils;
public class UsrInfo {
public String phone = null;
public String nickname = null;
public String pwd = null;
public DateInfo registerDate = null;
public UsrInfo(String phone, String nickname, String pwd, DateInfo registerDate){
this.phone = phone;
this.nickname = nickname;
this.pwd = pwd;
this.registerDate = registerDate;
}
}
| [
"[email protected]"
] | |
c95e5d2b2ec8b2748c77be0938b0e19b46e871ff | 329e93475540f58aafb625e1a82fdcc19fc09f3a | /src/practice/test1/test8.java | e757aa552fd58d66fb0d6c4d152a414ce0ff044c | [] | no_license | jiucaihuanshe/practice | ce2a8dd447d1095756a332d14991acb47deea38f | 4432521acf4639daca1bf813923ddc08fab287ea | refs/heads/master | 2020-03-17T16:13:20.443221 | 2018-06-20T08:48:08 | 2018-06-20T08:48:08 | 133,740,607 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 558 | java | package practice.test1;
/**
* 数组扩容
* Arrays.copyOf(original, newLength)
* original:源数组
* newLength:新数组的长度
*
* 特点:生成的新数组是原始数组的副本
* newLength<原数组的长度 截取
* newLength>原数组的长度 在新数组的后边的元素默认初始化
*/
import java.util.Arrays;
public class test8 {
public static void main(String[] args) {
int[] ary = {1,2,3};
ary = Arrays.copyOf(ary, 5);
for(int i=0;i<ary.length;i++){
System.out.print(ary[i]+" ");
}
}
}
| [
"[email protected]"
] | |
fcaf48a5911cad78344aa9a83a5cf92ec55e46d3 | d5753c263c75969b05c0b9e6ee64c88b62d6ebb7 | /src/com/worthed/designpattern/Interpreter/Context.java | d64563cdae5cdf742d103c00284bd1a19324790f | [
"Apache-2.0"
] | permissive | jingle1267/DesignPattern | 1412d0e5d20c4f4e22f0231d8c3d3e5c5f866d32 | c38192dd20500009c4d725f1ba3ea0b34118c545 | refs/heads/master | 2020-05-27T18:54:04.086827 | 2016-09-13T07:59:21 | 2016-09-13T07:59:21 | 26,900,157 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,133 | java | /*
* Copyright 2014 [email protected]
*
* 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.worthed.designpattern.Interpreter;
/**
* 包含解释器之外的一些全局信息
*
* Created by zhenguo on 12/16/14.
*/
public class Context {
private String input;
private String output;
public String getInput() {
return input;
}
public void setInput(String input) {
this.input = input;
}
public String getOutput() {
return output;
}
public void setOutput(String output) {
this.output = output;
}
}
| [
"[email protected]"
] | |
5b6fab5139adeab8a0469469c87f287054b611e1 | aa883d2c7615c8a9f53ecb1f47326df8caccdd45 | /gmall-pms/src/main/java/com/atguigu/gmall/pms/mapper/SkuMapper.java | 40cbb53ff50857ce0c115cb402ff51ef640977ac | [
"Apache-2.0"
] | permissive | maigo11/gmall-0420 | 771b1b0e06688166364b4a63bc563c25fe9d6055 | 086a22f50a0cf369ffd86317b270f4940a5b35ec | refs/heads/master | 2022-12-24T04:43:34.097656 | 2020-09-22T15:13:05 | 2020-09-22T15:13:05 | 297,220,226 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package com.atguigu.gmall.pms.mapper;
import com.atguigu.gmall.pms.entity.SkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* sku信息
*
* @author sqq
* @email [email protected]
* @date 2020-09-21 19:07:29
*/
@Mapper
public interface SkuMapper extends BaseMapper<SkuEntity> {
}
| [
"[email protected]"
] | |
5f8c829cccaa9bd0c2e586273b796c3803a17f7f | 014f7414f378aec46bb2d2460faf8f5c2344acf1 | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/coreutils/R.java | 177a2cbbf040c4b24f1f74de9d448f3a39f19bc6 | [] | no_license | mvaccaro/Checklist_UIO | fbd0e7033fb23892a8751eae71fcaf6be5c55c1b | 5e275da62b5aa4909dc682141cb3182bffdf1c65 | refs/heads/master | 2022-11-28T18:02:59.981813 | 2020-08-07T07:12:09 | 2020-08-07T07:12:09 | 285,762,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,456 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.coreutils;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f040027;
public static final int font = 0x7f0400ee;
public static final int fontProviderAuthority = 0x7f0400f0;
public static final int fontProviderCerts = 0x7f0400f1;
public static final int fontProviderFetchStrategy = 0x7f0400f2;
public static final int fontProviderFetchTimeout = 0x7f0400f3;
public static final int fontProviderPackage = 0x7f0400f4;
public static final int fontProviderQuery = 0x7f0400f5;
public static final int fontStyle = 0x7f0400f6;
public static final int fontVariationSettings = 0x7f0400f7;
public static final int fontWeight = 0x7f0400f8;
public static final int ttcIndex = 0x7f040256;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f06006e;
public static final int notification_icon_bg_color = 0x7f06006f;
public static final int ripple_material_light = 0x7f06007a;
public static final int secondary_text_default_material_light = 0x7f06007c;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f070053;
public static final int compat_button_inset_vertical_material = 0x7f070054;
public static final int compat_button_padding_horizontal_material = 0x7f070055;
public static final int compat_button_padding_vertical_material = 0x7f070056;
public static final int compat_control_corner_material = 0x7f070057;
public static final int compat_notification_large_icon_max_height = 0x7f070058;
public static final int compat_notification_large_icon_max_width = 0x7f070059;
public static final int notification_action_icon_size = 0x7f0700df;
public static final int notification_action_text_size = 0x7f0700e0;
public static final int notification_big_circle_margin = 0x7f0700e1;
public static final int notification_content_margin_start = 0x7f0700e2;
public static final int notification_large_icon_height = 0x7f0700e3;
public static final int notification_large_icon_width = 0x7f0700e4;
public static final int notification_main_column_padding_top = 0x7f0700e5;
public static final int notification_media_narrow_margin = 0x7f0700e6;
public static final int notification_right_icon_size = 0x7f0700e7;
public static final int notification_right_side_padding_top = 0x7f0700e8;
public static final int notification_small_icon_background_padding = 0x7f0700e9;
public static final int notification_small_icon_size_as_large = 0x7f0700ea;
public static final int notification_subtext_size = 0x7f0700eb;
public static final int notification_top_pad = 0x7f0700ec;
public static final int notification_top_pad_large_text = 0x7f0700ed;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f0800ad;
public static final int notification_bg = 0x7f0800ae;
public static final int notification_bg_low = 0x7f0800af;
public static final int notification_bg_low_normal = 0x7f0800b0;
public static final int notification_bg_low_pressed = 0x7f0800b1;
public static final int notification_bg_normal = 0x7f0800b2;
public static final int notification_bg_normal_pressed = 0x7f0800b3;
public static final int notification_icon_background = 0x7f0800b4;
public static final int notification_template_icon_bg = 0x7f0800b5;
public static final int notification_template_icon_low_bg = 0x7f0800b6;
public static final int notification_tile_bg = 0x7f0800b7;
public static final int notify_panel_notification_icon_bg = 0x7f0800b8;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f0a0013;
public static final int action_divider = 0x7f0a0015;
public static final int action_image = 0x7f0a0016;
public static final int action_text = 0x7f0a001c;
public static final int actions = 0x7f0a001d;
public static final int async = 0x7f0a0023;
public static final int blocking = 0x7f0a0027;
public static final int chronometer = 0x7f0a0043;
public static final int forever = 0x7f0a00a9;
public static final int icon = 0x7f0a00b3;
public static final int icon_group = 0x7f0a00b4;
public static final int info = 0x7f0a00bc;
public static final int italic = 0x7f0a00be;
public static final int line1 = 0x7f0a00d1;
public static final int line3 = 0x7f0a00d2;
public static final int normal = 0x7f0a00ea;
public static final int notification_background = 0x7f0a00eb;
public static final int notification_main_column = 0x7f0a00ec;
public static final int notification_main_column_container = 0x7f0a00ed;
public static final int right_icon = 0x7f0a00fa;
public static final int right_side = 0x7f0a00fb;
public static final int tag_transition_group = 0x7f0a012b;
public static final int tag_unhandled_key_event_manager = 0x7f0a012c;
public static final int tag_unhandled_key_listeners = 0x7f0a012d;
public static final int text = 0x7f0a012e;
public static final int text2 = 0x7f0a012f;
public static final int time = 0x7f0a0164;
public static final int title = 0x7f0a0165;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f0b000e;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0d0049;
public static final int notification_action_tombstone = 0x7f0d004a;
public static final int notification_template_custom_big = 0x7f0d0051;
public static final int notification_template_icon_group = 0x7f0d0052;
public static final int notification_template_part_chronometer = 0x7f0d0056;
public static final int notification_template_part_time = 0x7f0d0057;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0f0037;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f10011a;
public static final int TextAppearance_Compat_Notification_Info = 0x7f10011b;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f10011d;
public static final int TextAppearance_Compat_Notification_Time = 0x7f100120;
public static final int TextAppearance_Compat_Notification_Title = 0x7f100122;
public static final int Widget_Compat_NotificationActionContainer = 0x7f1001c9;
public static final int Widget_Compat_NotificationActionText = 0x7f1001ca;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f040027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0400f0, 0x7f0400f1, 0x7f0400f2, 0x7f0400f3, 0x7f0400f4, 0x7f0400f5 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0400ee, 0x7f0400f6, 0x7f0400f7, 0x7f0400f8, 0x7f040256 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"[email protected]"
] | |
01d85ebe6a996ad9d4a072e8afc157039a76b124 | 29bc36e1d744a6cf7236ed59aacc1718de3ac11c | /iaikcms/src/demo/cms/digestedData/DigestedDataOutputStreamDemo.java | cca91d0035cc328fd13e34e14000c9b213f0c9f7 | [] | no_license | xiaozeyyyy/iaik-cms | 96c478681eea119328d1663b66fc275beb9648db | 12db3d9ea7215522ba739c36f2b19a7d8ebf0aa4 | refs/heads/master | 2021-05-29T20:00:56.874806 | 2015-04-15T03:54:06 | 2015-04-15T03:54:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,913 | java | // Copyright (C) 2002 IAIK
// http://jce.iaik.tugraz.at
//
// Copyright (C) 2003 Stiftung Secure Information and
// Communication Technologies SIC
// http://jce.iaik.tugraz.at
//
// All rights reserved.
//
// This source is provided for inspection purposes and recompilation only,
// unless specified differently in a contract with IAIK. This source has to
// be kept in strict confidence and must not be disclosed to any third party
// under any circumstances. Redistribution in source and binary forms, with
// or without modification, are <not> permitted in any case!
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// $Header: /IAIK-CMS/current/src/demo/cms/digestedData/DigestedDataOutputStreamDemo.java 13 23.08.13 14:20 Dbratko $
// $Revision: 13 $
//
package demo.cms.digestedData;
import iaik.asn1.ObjectID;
import iaik.asn1.structures.AlgorithmID;
import iaik.cms.CMSException;
import iaik.cms.ContentInfoOutputStream;
import iaik.cms.DigestedDataOutputStream;
import iaik.cms.DigestedDataStream;
import iaik.utils.Util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import demo.DemoUtil;
/**
* Demonstrates the usage of class {@link iaik.cms.DigestedDataOutputStream} and
* {@link iaik.cms.DigestedData} for digesting data using the CMS type
* DigestedData.
*
* @author Dieter Bratko
*/
public class DigestedDataOutputStreamDemo {
/**
* Default constructor.
*/
public DigestedDataOutputStreamDemo() throws IOException {
System.out.println();
System.out.println("**********************************************************************************");
System.out.println("* DigestedDataOutputStream demo *");
System.out.println("* (shows the usage of the DigestedDataOutputStream implementation) *");
System.out.println("**********************************************************************************");
System.out.println();
}
/**
* Uses the IAIK-CMS DigestedDataOutputStream class to create a CMS <code>DigestedData</code>
* object for digesting the given message.
*
* @param message the message to be digested, as byte representation
* @param mode IMPLICIT (include message) or EXPLICIT (do not include message)
*
* @return the BER encoding of the <code>DigestedData</code> object just created,
* wrapped in a ContentInfo
*
* @exception CMSException if the <code>DigestedData</code> object cannot
* be created
* @exception IOException if an I/O error occurs
*/
public byte[] createDigestedData(byte[] message, int mode) throws CMSException, IOException {
System.out.println("Create a new message to be digested:");
// the stream from which to read the data to be digested
ByteArrayInputStream is = new ByteArrayInputStream(message);
// the stream to which to write the DigestedData
ByteArrayOutputStream resultStream = new ByteArrayOutputStream();
// wrap DigestedData into a ContentInfo
ContentInfoOutputStream contentInfoStream =
new ContentInfoOutputStream(ObjectID.cms_digestedData, resultStream);
// create a new DigestedData object
DigestedDataOutputStream digestedData =
new DigestedDataOutputStream(contentInfoStream,
(AlgorithmID)AlgorithmID.sha256.clone(),
mode);
int blockSize = 8; // in real world we would use a block size like 2048
// write in the data to be digested
byte[] buffer = new byte[blockSize];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1) {
digestedData.write(buffer, 0, bytesRead);
}
// closing the stream finishes digest calculation and closes the underlying stream
digestedData.close();
return resultStream.toByteArray();
}
/**
* Parses a CMS <code>DigestedData</code> object and verifies the hash.
*
* @param digestedData <code>DigestedData</code> object as BER encoded byte array
* @param message the message which may have been transmitted out-of-band
*
* @return the inherent message as byte array
*
* @exception CMSException if some parsing error occurs or the hash verification fails
* @exception IOException if an I/O error occurs
*/
public byte[] getDigestedData(byte[] digestedData, byte[] message) throws CMSException, IOException {
// we are testing the stream interface
ByteArrayInputStream is = new ByteArrayInputStream(digestedData);
// create the DigestedData object
DigestedDataStream digested_data = new DigestedDataStream(is);
if (message != null) {
// explicit mode: set content received by other means
digested_data.setInputStream(new ByteArrayInputStream(message));
}
// get an InputStream for reading the content
InputStream data = digested_data.getInputStream();
ByteArrayOutputStream os = new ByteArrayOutputStream();
Util.copyStream(data, os, null);
if (digested_data.verify()) {
System.out.println("Hash ok!");
} else {
throw new CMSException("Hash verification failed!");
}
return os.toByteArray();
}
/**
* Starts the tests.
*/
public void start() {
// the test message
String m = "This is the test message.";
System.out.println("Test message: \""+m+"\"");
System.out.println();
byte[] message = m.getBytes();
try {
byte[] encoding;
byte[] received_message = null;
//
// test CMS Implicit DigestedDataOutputStream
//
System.out.println("\nImplicit DigestedDataOutputStream demo [create]:\n");
encoding = createDigestedData(message, DigestedDataOutputStream.IMPLICIT);
// transmit data
System.out.println("\nImplicit DigestedDataOutputStream demo [parse]:\n");
received_message = getDigestedData(encoding, null);
System.out.print("\nContent: ");
System.out.println(new String(received_message));
//
// test CMS Explicit DigestedDataOutputStream
//
System.out.println("\nExplicit DigestedDataOutputStream demo [create]:\n");
encoding = createDigestedData(message, DigestedDataOutputStream.EXPLICIT);
// transmit data
System.out.println("\nExplicit DigestedDataOutputStream demo [parse]:\n");
received_message = getDigestedData(encoding, message);
System.out.print("\nContent: ");
System.out.println(new String(received_message));
} catch (Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex.toString());
}
}
/**
* Main method.
*/
public static void main(String argv[]) throws Exception {
DemoUtil.initDemos();
(new DigestedDataOutputStreamDemo()).start();
System.out.println("\nReady!");
DemoUtil.waitKey();
}
}
| [
"[email protected]"
] | |
65821a9f3bf8c8cb364e41d97ad0a1e3847bd3a1 | adf49b14155298827892c483a37c330e8261a191 | /keximbank/src/test/java/in/srssprojects/keximbank/Excel.java | 1011c71b432d6158b7b732d995df8680bf5516c8 | [] | no_license | suryaSmit/swatha-bank | 207347fd48a18b797f0ee0b882d9f76ec1813c15 | 165c501d7ad9cedfd7e12386e8808de611d290e1 | refs/heads/master | 2021-05-06T04:40:45.331973 | 2017-12-22T07:31:06 | 2017-12-22T07:31:06 | 114,975,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | package in.srssprojects.keximbank;
import java.io.FileInputStream;
import jxl.Sheet;
import jxl.Workbook;
public class Excel {
Workbook book;
Sheet sh;
String folderPath = ".//test data/";
//set excel -- set an excel in file system to read the data
public void setExcel(String fileName, String sheetName) {
try {
FileInputStream fis = new FileInputStream(folderPath+fileName);
book = Workbook.getWorkbook(fis);
sh =book.getSheet(sheetName);
} catch (Exception e) {
// TODO: handle exception
}
}
//get no of rows
public int rowCount() {
return sh.getRows();
}
//get no of columns
public int columnCount() {
return sh.getColumns();
}
//read data
public String readData(int row, int column) {
return sh.getCell(column, row).getContents();
}
}
| [
"[email protected]"
] | |
a8c0cdbaeb64bba9d4d18ed77bcaffb5c3612aa0 | 7cf7f79b29c3f8fe95ba03a7b1f542a071a4ee60 | /app/src/main/java/com/example/firebasedemo/dailog/UserDialog.java | 689c0114d437c8b9c58ef53b324b7bc04e40a1e0 | [] | no_license | Kishanjvaghela/FireBaseDemo | a5c2e993bf9b2eaf3d30bd986b837134b3d3f939 | a8d9279de4ddb81e29cf47ca217fece2d52903e4 | refs/heads/master | 2021-01-10T16:43:48.373726 | 2015-09-29T12:26:43 | 2015-09-29T12:26:43 | 43,365,616 | 3 | 0 | null | 2018-11-07T06:47:41 | 2015-09-29T12:22:17 | Java | UTF-8 | Java | false | false | 2,574 | java | package com.example.firebasedemo.dailog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import com.example.firebasedemo.R;
/**
* Created by DSK02 on 9/25/2015.
*/
public class UserDialog {
private Context context;
private EditText nameEditText, ageEditText;
private String name;
private String age;
private String title;
private UserDialogListner listner;
public interface UserDialogListner {
void onOkClick(String name, int age);
}
public UserDialog(Context context) {
this.context = context;
}
public Dialog show() {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
View view = LayoutInflater.from(context).inflate(R.layout.dialog_add_user, null);
nameEditText = (EditText) view.findViewById(R.id.name);
ageEditText = (EditText) view.findViewById(R.id.age);
if (!TextUtils.isEmpty(name)) {
nameEditText.setText(name);
}
if (!TextUtils.isEmpty(age)) {
ageEditText.setText(age);
}
if (!TextUtils.isEmpty(title)) {
builder.setTitle(title);
}
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (listner != null) {
String nameString = nameEditText.getText().toString();
String ageString = ageEditText.getText().toString();
int ageInt = TextUtils.isEmpty(ageString) ? 0 : Integer.parseInt(ageString);
if (listner != null)
listner.onOkClick(nameString, ageInt);
}
}
});
builder.setNegativeButton("Cancel", null);
builder.setView(view);
return builder.show();
}
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;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public void setListner(UserDialogListner listner) {
this.listner = listner;
}
}
| [
"[email protected]"
] | |
65e8bd221c016adce6e19a88b5f398a6cdcaaa29 | ecf48597e98969730bf53a54f6077dff890fee57 | /src/main/java/com/sparta/jas/exceptions/ChildNotFoundException.java | 2f9a4ef2d1452b9ed6d76c9ed8464b70cc7200c4 | [] | no_license | JohnAShipman/SortManager | df1856a2d33060f65a4dd104926134a52c15b683 | cf86234bac6a0a64ecd7db5f3c05e1a4352959e7 | refs/heads/master | 2020-04-05T00:08:08.792190 | 2018-11-06T13:10:34 | 2018-11-06T13:10:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package com.sparta.jas.exceptions;
public class ChildNotFoundException extends Exception {
private int element;
private String childType;
public ChildNotFoundException(int element){
this.element = element;
}
public ChildNotFoundException(int element, String childType){
this.element = element;
this.childType = childType;
}
public String getMessage(){
String message;
if (childType == null){
message = "Child Not Found Exception:\nElement " + element + " does not exist.";
} else {
message = "Child Not Found Exception:\nElement " + element + " does not have a " + childType + "Child.";
}
return message;
}
}
| [
"[email protected]"
] | |
0ed37f93ce5df6819b5829e677602907a591b902 | cff2f4931d6f0abca33d37d3d2e731908da5a150 | /java-ocpjp/src/kyocoolcool/exam_v1475/exam95/Test.java | 5de4435d6484e2b49011b18a703e9f143c9d52ef | [] | no_license | kyocoolcool/java-tutorial | 66f58d4c7d376ae9e7fa7a1b101eaa306c4eab3d | 97a86477617ece81fa9e7d265b8857f7aa226416 | refs/heads/master | 2021-07-12T23:01:18.714658 | 2020-09-11T06:31:56 | 2020-09-11T06:31:56 | 204,008,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 620 | java | package kyocoolcool.exam_v1475.exam95;
/**
* @author Chris Chen https://blog.kyocoolcool.com
* @version 1.0
* @since 2020/9/9 4:52 PM
**/
class Test2 {
static int aaa = 100;
}
public class Test extends Test2 {
static boolean doStuff() {
return !isAvailable;
}
public static boolean isAvailable = false;
public static Integer age;
int i = 0;
public static void main(String[] args) {
Test test = new Test();
System.out.println(isAvailable);
isAvailable = doStuff();
System.out.println(isAvailable);
System.out.println(test.i);
}
}
| [
"[email protected]"
] | |
90e4d4ec4449a64000521666eb715ffec590cbb3 | aca12726ed03da5123246f477535902b3b5285d9 | /src/Gravity.java | 02b50c58547895d257b6e34462607e9f9529d1c7 | [] | no_license | hgbbus/GravityTest | a6d5374cc8dd38169713d2ecb2e9f5095da2f01e | 06b0c917d88be755250c063004026262c823eb66 | refs/heads/master | 2023-04-18T13:53:18.128193 | 2021-05-11T21:22:57 | 2021-05-11T21:22:57 | 366,511,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 508 | java | import java.util.Scanner;
public class Gravity {
public double falling(double time, double v) {
return v*time + 0.5*9.8*time*time;
//return 1.0;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Time: ");
double t = sc.nextDouble();
System.out.print("Initial velocity: ");
double v0 = sc.nextDouble();
System.out.println("Meters dropped = " + new Gravity().falling(t, v0));
}
}
| [
"[email protected]"
] | |
5ae965ce0a7df04f5d08972296e06dbd6ae4f199 | 2a96533ffc58bafedad59ee4467d1a15f0df8a4c | /app/src/main/java/tk/gpereira/movielist/MovieAdapter.java | 6c830b81d80e0670dbf2cd5d1b18788a9ded720e | [] | no_license | G-Pereira/MovieList | 8610258673454803ab5a1a97e3db2587dc5cdbd0 | cf431eec9c0ec32e0ec0e577bf754ff264fabdc7 | refs/heads/master | 2021-01-19T08:45:11.249317 | 2017-10-21T16:37:51 | 2017-10-21T16:37:51 | 87,669,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,970 | java | package tk.gpereira.movielist;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
class MovieAdapter extends RecyclerView.Adapter<MovieAdapter.MovieViewHolder> {
private ArrayList<Movie> mMovies;
final private MovieClickListener mOnClickListener;
interface MovieClickListener {
void onMovieClick(int clickedMovieIndex);
}
MovieAdapter(ArrayList<Movie> movies, MovieClickListener listener) {
mOnClickListener = listener;
mMovies = movies;
}
@Override
public MovieViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
Context context = parent.getContext();
int layoutIdForListItem = R.layout.movie_list_item;
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(layoutIdForListItem, parent, false);
return new MovieViewHolder(view);
}
@Override
public int getItemCount() {
return mMovies.size();
}
@Override
public void onBindViewHolder(MovieViewHolder holder, int position) {
holder.bind(mMovies.get(position).getPoster());
}
class MovieViewHolder extends RecyclerView.ViewHolder implements OnClickListener {
ImageView listItemView;
MovieViewHolder(View itemView) {
super(itemView);
listItemView = (ImageView) itemView.findViewById(R.id.iv_item);
itemView.setOnClickListener(this);
}
void bind(String movie) {
Picasso.with(itemView.getContext()).load(movie).into(listItemView);
}
@Override
public void onClick(View v) {
mOnClickListener.onMovieClick(getAdapterPosition());
}
}
}
| [
"[email protected]"
] | |
9ffa51fce9e3276d293eea44b130fed82069ab84 | a0374471734afefec4a02f4c83ac359b846152e4 | /src/spring/ioc/Tire.java | 6ba5141a4c15534d8a360d19cf2a727f523d1877 | [] | no_license | zuentian/demo | a2661b91e84a98fa831de3064c22591fda4cd073 | 4c7f39ed22e290b525989b48bd21d20319ca6504 | refs/heads/master | 2020-05-31T22:39:13.121996 | 2019-12-18T14:32:51 | 2019-12-18T14:32:51 | 190,524,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 240 | java | package spring.ioc;
public class Tire {
private int size;
Tire(int size){
this.size=size;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
}
| [
"[email protected]"
] | |
f495a71fe6a49a71f953ac94fc5457d691e1be36 | c3ab633e6714c474e50a90ba2c4e11cd484601df | /9amforlder/FingerPrintScanner/app/src/androidTest/java/com/example/fingerprintscanner/ExampleInstrumentedTest.java | 4188ace7f1190609be89005b1cceec817b505746 | [] | no_license | devkumar537537/otherone | 172b13720dc178fdb638706e07fe1aa2fde9c0b4 | 4ca6df239c2b701d25a44eaaa254d1e74bb5663b | refs/heads/main | 2023-07-02T06:09:13.901082 | 2021-06-28T11:16:51 | 2021-06-28T11:16:51 | 381,000,444 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 774 | java | package com.example.fingerprintscanner;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented 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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.fingerprintscanner", appContext.getPackageName());
}
} | [
"[email protected]"
] | |
d93e0a916944748eaea6be760f80bb8553a7bed6 | 2c059f479f6a4852db29901670c0a6484b3cc45e | /src/com/company/Manager_Belit.java | 02f2265eca418bc0382d8fe4128495b3e860ed84 | [] | no_license | nashsh/zooproject.mine | 56bf5040687b814cf253ee17774151422c2397d5 | 69c335fa252c3a8b95c3ffec75a57dbf018c2391 | refs/heads/master | 2020-03-21T22:45:55.246326 | 2018-06-29T13:08:19 | 2018-06-29T13:08:19 | 139,145,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,899 | java | package com.company;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Manager_Belit extends JFrame {
Belit_Departeman belit_departeman = new Belit_Departeman();
Manager_Belit_Daramad mbd = new Manager_Belit_Daramad();
public Manager_Belit() {
setMinimumSize(new Dimension(1000, 500));
setPreferredSize(new Dimension(1000, 500));
setBackground(Color.decode("#CCCC00"));
setLayout(new BoxLayout(this.getContentPane(), BoxLayout.X_AXIS));
JPanel Panel = new JPanel();
Panel.setBackground(Color.decode("#CCCC00"));
Panel.setMinimumSize(new Dimension(1000, 500));
Panel.setPreferredSize(new Dimension(1000, 500));
add(Panel);
JPanel upPanel = new JPanel();
upPanel.setBackground(Color.decode("#CCCC00"));
upPanel.setMinimumSize(new Dimension(50, 400));
upPanel.setPreferredSize(new Dimension(50, 400));
Panel.add(upPanel, BorderLayout.NORTH);
Panel.add(upPanel, BorderLayout.NORTH);
JPanel centerPanel = new JPanel();
add(centerPanel, BorderLayout.CENTER);
centerPanel.add(mbd);
add(centerPanel, BorderLayout.CENTER);
centerPanel.setBackground(Color.decode("#CCCC00"));
centerPanel.add(mbd);
mbd.setVisible(false);
Manager_Belit_Daramad panel = new Manager_Belit_Daramad();
centerPanel.add(Panel);
// add(centerPanel, BorderLayout.CENTER);
// centerPanel.add(manager_showmanager);
// add(centerPanel, BorderLayout.CENTER);
// centerPanel.setBackground(Color.decode("#CCCC00"));
// centerPanel.add(manager_showmanager);
// manager_showmanager.setVisible(false);
// Manager_showmanager mshm = new Manager_showmanager();//manager show
// centerPanel.add(Panel);
JButton btn1 = new JButton("Back ");
btn1.setMinimumSize(new Dimension(120, 65));
btn1.setPreferredSize(new Dimension(120, 65));
Panel.add(btn1, BoxLayout.X_AXIS);
JButton btn2 = new JButton("Daramad");
btn2.setMinimumSize(new Dimension(120, 65));
btn2.setPreferredSize(new Dimension(120, 65));
Panel.add(btn2, BoxLayout.X_AXIS);
JButton btn5 = new JButton("Jarime");
btn5.setMinimumSize(new Dimension(120, 65));
btn5.setPreferredSize(new Dimension(120, 65));
Panel.add(btn5, BoxLayout.X_AXIS);
JButton btn6 = new JButton("Takhfif");
btn6.setMinimumSize(new Dimension(120, 65));
btn6.setPreferredSize(new Dimension(120, 65));
Panel.add(btn6, BoxLayout.X_AXIS);
JButton btn7 = new JButton("Departeman");
btn7.setMinimumSize(new Dimension(120, 65));
btn7.setPreferredSize(new Dimension(120, 65));
Panel.add(btn7, BoxLayout.X_AXIS);
JButton btn3 = new JButton("belit kharide ");
btn3.setMinimumSize(new Dimension(120, 65));
btn3.setPreferredSize(new Dimension(120, 65));
Panel.add(btn3, BoxLayout.X_AXIS);
btn1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
Manager_manager manager_manager = new Manager_manager();
setVisible(false);
manager_manager.setVisible(true);
}
});
btn2.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
mbd.setVisible(true);
}
});
// btn3.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent actionEvent) {
//
// manager_editmanager.setVisible(true);
// manager_showmanager.setVisible(false);
// }
// });
// btn4.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent actionEvent) {
// manager_showmanager.setVisible(true);
// manager_editmanager.setVisible(false);
// }
// });
// btn5.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent actionEvent) {
// AnimalsFrame animalsFrame = new AnimalsFrame();
// animalsFrame.setVisible(true);
// setVisible(false);
//
// }
// });
//
btn7.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
belit_departeman.setVisible(true);
setVisible(false);
}
});
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}
| [
"[email protected]"
] | |
7639e4a3ea7f064443485b839a052c57ae55782e | 8642d7976a4bd2194d3042d7ebbd960781356a30 | /src/from_0_to_9/Task8.java | c8534591273fbbbeb665e1bc2108bcb42e7e707b | [] | no_license | kekosius/HackerRank_Java | c7f1d3ab8e877d463b42b21f491ddbc9d6557b6a | 452732bb5f0c68c6989cc81142956f2d1c383648 | refs/heads/master | 2023-06-20T00:23:49.545670 | 2021-07-16T14:34:31 | 2021-07-16T14:34:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,841 | java | package from_0_to_9;
import java.util.Scanner;
//For each input variable n and appropriate primitive dataType,
//you must determine if the given primitives are capable of storing it. If yes, then print:
//n can be fitted in:
//* dataType
//If the number cannot be stored in one of the four aforementioned primitives, print the line:
//n can't be fitted anywhere.
public class Task8 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int T = input.nextInt();
long n;
long longMax = (long) (Math.pow(2, 63) - 1);
long longMin = (long) -(Math.pow(2, 63));
int intMax = (int) (Math.pow(2, 31) - 1);
int intMin = (int) -(Math.pow(2, 31));
short shortMax = (short) (Math.pow(2, 15) - 1);
short shortMin = (short) -(Math.pow(2, 15));
byte byteMax = (byte) (Math.pow(2, 7) -1);
byte byteMin = (byte) -(Math.pow(2, 7));
String inputValue;
input.nextLine();
for (int i = 0; i < T; i++) {
inputValue = input.nextLine();
try {
n = Long.parseLong(inputValue);
} catch (Exception e) {
System.out.println(inputValue + " can't be fitted anywhere.");
continue;
}
System.out.println(inputValue + " can be fitted in:");
if (n <= byteMax && n >= byteMin) {
System.out.println("* byte");
}
if (n <= shortMax && n >= shortMin){
System.out.println("* short");
}
if (n <= intMax && n >= intMin){
System.out.println("* int");
}
if (n <= longMax && n >= longMin){
System.out.println("* long");
}
}
input.close();
}
}
| [
"[email protected]"
] | |
73e5026e8db0d7146640650f6092bb80460cad88 | 52d52f4787c31c5ec9c0789779ac7457cad768e9 | /Arif-GCCS-Maven-20200823T183952Z-001/Arif-GCCS-Maven/CashControlEJBX/.svn/pristine/15/152a4d86f369cdc28eb7233ae952616afbb4ddf3.svn-base | 4932d26ce2e5eeed572a9516eaef1cda37873c36 | [] | no_license | mohanb147/sample_project | c5ce0eccd75f6d1e955b0159ec570a922709dd0d | e7420d89ebd15c8eb59fb0e0fa7fb02abd98a42c | refs/heads/master | 2022-12-05T10:01:50.599928 | 2020-08-24T10:15:04 | 2020-08-24T10:15:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 692 | /**
* @(#)PoaPaymentManagerLocalHome.java Tue Aug 02 15:38:51 VET 2005
*
* FedEx
* Cash Control
*
* FedEx
* Santiago, Chile
*
* Copyright (c) 2001 FedEx, All rights reserved.
*
* This software is the confidential and proprietary information
* of FedEx. ("Confidential Information").
*
* Visit our website at http://www.fedex.com for more information
*
* @author Cristian C?enas
* @version 1.0
*/
package com.fedex.lacitd.cashcontrol.datatier.manager;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface PoaPaymentManagerLocalHome extends EJBLocalHome {
public PoaPaymentManagerLocal create()
throws CreateException;
}
| [
"[email protected]"
] | ||
c14df8043aa823475a616087c2ebfbe43ec58e8a | 7fb15446b5645b7761a8ac1eee7fce8ff2bfb493 | /app/src/main/java/com/dibs/dibly/activity/DetailTermAndConditionActivity.java | 747339f4203060f5d31a444ddc7080fcd80ef78e | [] | no_license | loipn1804/Dibly | 4d7d3cbf3b895b27a3244cb52df9acaade776b20 | d94e40208b90cc602812a701c6c0a77855741721 | refs/heads/master | 2020-12-31T05:09:33.182036 | 2017-04-26T14:18:44 | 2017-04-26T14:18:44 | 59,657,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,057 | java | package com.dibs.dibly.activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.dibs.dibly.R;
import com.dibs.dibly.base.BaseActivity;
import com.dibs.dibly.daocontroller.DealController;
import com.dibs.dibly.service.ParallaxService;
import com.dibs.dibly.service.RealTimeService;
import greendao.ObjectDeal;
/**
* Created by USER on 7/1/2015.
*/
public class DetailTermAndConditionActivity extends BaseActivity {
private TextView txtTerm_1;
private Long dealId = 0l;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail_term_and_condition);
overrideFontsLight(findViewById(R.id.root));
initialIntent();
initView();
initData();
}
private void initialIntent() {
if (getIntent().getExtras() != null) {
dealId = getIntent().getLongExtra("deal_id", 0l);
}
}
private void initView() {
initialToolBar();
txtTerm_1 = (TextView) findViewById(R.id.txtTerm_1);
}
private void initData() {
ObjectDeal objectDeal = DealController.getDealById(this, dealId);
if (objectDeal != null) {
txtTerm_1.setText(objectDeal.getTerms());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_noitem, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
3c3d70e862c342d569b854f90d00eacc27125d97 | 220a7be0aca2a7299b9bdd36b4ba885c9779feb9 | /设计笔录/app/src/main/java/com/vkejun/wjs/fragment/Fragment_b.java | daf2032f9c7e5360b3695fc34ce4342a57195c6e | [] | no_license | LINYUANZHUO/CAD | 449f4a28a5f6e14fe39abd62c8ffef50c245b8b5 | c274cda1f06d67dc459ed8c378edbf1e65eb3666 | refs/heads/master | 2022-12-29T14:53:33.066790 | 2020-10-08T13:54:28 | 2020-10-08T13:54:28 | 302,340,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,270 | java | package com.vkejun.wjs.fragment;
import android.content.*;
import android.os.*;
import android.support.design.widget.*;
import android.support.v4.app.*;
import android.support.v4.widget.*;
import android.support.v7.app.*;
import android.support.v7.widget.*;
import android.view.*;
import android.widget.*;
import android.widget.AbsListView.*;
import cn.bmob.v3.*;
import cn.bmob.v3.exception.*;
import cn.bmob.v3.listener.*;
import com.vkejun.wjs.*;
import com.vkejun.wjs.bmob.*;
import com.vkejun.wjs.editor.*;
import java.util.*;
import android.support.v7.widget.Toolbar;
import com.vkejun.wjs.editor.*;
import com.vkejun.wjs.editor.as.*;
public class Fragment_b extends Fragment
{
private ListView list;
private SwipeRefreshLayout sw;
List<Post> mPostlist = new ArrayList<Post>();
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
return inflater.inflate(R.layout.fragment_2, container, false);
}
@Override
public void onActivityCreated(Bundle savedInstanceState)
{
super.onActivityCreated(savedInstanceState);
//进入时加载数据
getdata();
list = (ListView) getActivity().findViewById(R.id.listpost);
sw = (SwipeRefreshLayout) getActivity().findViewById(R.id.mainSwipeRefreshLayout1);
sw.setColorSchemeResources(android.R.color.holo_blue_light, android.R.color.holo_red_light, android.R.color.holo_green_light);
sw.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener()
{
@Override
public void onRefresh()
{
//text.setText("正在刷新");
getdata();
new Handler().postDelayed(new Runnable()
{
@Override
public void run()
{
//text.setText("刷新完成");
sw.setRefreshing(false);
//Toast.makeText(getActivity(),"刷新完成", Toast.LENGTH_SHORT).show();
}
}, 3000);
}
});
list.setOnScrollListener(new OnScrollListener()
{
@Override
public void onScrollStateChanged(AbsListView view, int scrollState)
{
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
{
boolean enable = false;
if (list != null && list.getChildCount() > 0)
{
// 检查listView第一个item是否可见
boolean firstItemVisible = list.getFirstVisiblePosition() == 0;
// 检查第一个item的顶部是否可见
boolean topOfFirstItemVisible = list.getChildAt(0).getTop() == 0;
// 启用或者禁用SwipeRefreshLayout刷新标识
enable = firstItemVisible && topOfFirstItemVisible;
}
else if (list != null && list.getChildCount() == 0)
{
// 没有数据的时候允许刷新
enable = true;
}
// 把标识传给swipeRefreshLayout
sw.setEnabled(enable);
}
});
FloatingActionButton fab=(FloatingActionButton) getActivity().findViewById(R.id.fragment_2_FAB);
fab.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View p1)
{
Intent intent = new Intent(Fragment_b.this.getActivity(),EditorCodeActivity.class);
startActivity(intent);
}
});
}
class ItemListAdapter extends BaseAdapter
{
private Intent intent;
//private ViewHolder viewHolder;
private Post fenxiang;
//适配器
@Override
public int getCount()
{
if (mPostlist.size() > 0)
{
return mPostlist.size();
}
return 0;
}
@Override
public Object getItem(int position)
{
return mPostlist.get(position);
}
@Override
public long getItemId(int position)
{
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = getActivity().getLayoutInflater().inflate(R.layout.activity_listss, null);
viewHolder.tubiao =convertView.findViewById(R.id.listfenxiangTextView1);
viewHolder.nameandtime = (TextView) convertView.findViewById(R.id.listfenxiangTextView2);
viewHolder.biaoti = (TextView) convertView.findViewById(R.id.photoname);
viewHolder.neirong = (TextView) convertView.findViewById(R.id.itempostTextView1);
viewHolder.l = (LinearLayout) convertView.findViewById(R.id.list_fenxiangLinearLayout);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder)convertView.getTag();
}
fenxiang = mPostlist.get(position);
viewHolder.tubiao.setText("这是标题");
viewHolder.nameandtime.setText("作者:"+fenxiang.getAuthors()+" 时间:"+fenxiang.getCreatedAt());
viewHolder.biaoti.setText(fenxiang.getTitle());
viewHolder.neirong.setText(fenxiang.getMessage());
// TextView设置文本
viewHolder.l.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
String biaoti=mPostlist.get(position).getTitle(); //这里就获取到了内容。操作在下面写也行
String neirong=mPostlist.get(position).getMessage();
intent = new Intent(Fragment_b.this.getActivity(), Jieshouqi.class);
intent.putExtra("biaoti", biaoti);
intent.putExtra("neirong", neirong);
startActivity(intent);
}
});
return convertView;
}
public class ViewHolder
{
public TextView tubiao,nameandtime,biaoti,neirong;
public LinearLayout l;
}
}
public void getdata()
{
//Bmob.initialize(this.getActivity(),"99a26b3b9e330afec9b6");
BmobQuery<Post> query=new BmobQuery<Post>();
query.order("-createdAt");//依照数据排序时间排序
query.setLimit(500);
query.setCachePolicy(BmobQuery.CachePolicy.NETWORK_ELSE_CACHE);
query.findObjects(new FindListener<Post>()
{
@Override
public void done(List<Post> p1, BmobException p2)
{
if(p2 == null)
{
mPostlist.clear();
for (int i = 0; i < p1.size(); i++)
{
mPostlist.add(p1.get(i));
}
list.setAdapter(new ItemListAdapter());
sw.setRefreshing(false);
//此时列表加载完成
}
else
{
sw.setRefreshing(false);
Toast.makeText(getActivity(),"数据加载失败" + "错误代号:" +p1 + "错误问题:" +p2, Toast.LENGTH_SHORT).show();
}
}
});
}
}
| [
"[email protected]"
] | |
abe694e3349f2199d06cd50a0175886045770e6a | 6101fc52d3230a1174f25725c77764b582caafb7 | /src/test/java/io/jboot/test/db/simple/DbController.java | 8b9a2fcf22bf8dbf80393681141d3727f24fd737 | [
"Apache-2.0"
] | permissive | 280455936/jboot | dcb35906e17c14a087c6f39f515293efda12036d | 5ef3f41e5b38b880111dd6bdd1a7111abea614a2 | refs/heads/master | 2023-02-18T06:06:51.871112 | 2021-01-11T07:35:19 | 2021-01-11T07:35:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,685 | java | package io.jboot.test.db.simple;
import com.jfinal.kit.Ret;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import io.jboot.app.JbootApplication;
import io.jboot.db.JbootDb;
import io.jboot.db.model.Columns;
import io.jboot.test.db.model.User;
import io.jboot.web.controller.annotation.RequestMapping;
import java.util.Arrays;
import java.util.List;
@RequestMapping("/db")
public class DbController extends SuperDbController {
public static void main(String[] args) {
//设置 数据源 的相关信息
JbootApplication.setBootArg("jboot.datasource.type", "mysql");
JbootApplication.setBootArg("jboot.datasource.url", "jdbc:mysql://127.0.0.1:3306/jbootdemo");
JbootApplication.setBootArg("jboot.datasource.user", "root");
JbootApplication.setBootArg("jboot.datasource.password", "123456");
JbootApplication.setBootArg("jboot.model.unscanPackage", "*");
JbootApplication.setBootArg("jboot.model.scanPackage", "io.jboot.test.db.model");
JbootApplication.setBootArg("undertow.devMode", "false");
//启动应用程序
JbootApplication.run(args);
Columns columns = Columns.create();
columns.between("id",1,5);
List<User> users = new User().findListByColumns(columns);
System.out.println(Arrays.toString(users.toArray()));
}
public void find1(User invocation){
User dao = new User();
Columns columns = Columns.create();
columns.between("id",1,5);
List<User> users = dao.findListByColumns(columns);
renderJson(users);
}
public void find2(){
User dao = new User();
Columns columns = Columns.create();
columns.in("id",1,2,3,4);
List<User> users = dao.findListByColumns(columns);
renderJson(users);
}
public void find3(){
User dao = new User();
Columns columns = Columns.create();
columns.in("id",1,2,3,4);
columns.likeAppendPercent("login_name","c");
List<User> users = dao.findListByColumns(columns);
renderJson(users);
}
public void find4(){
List<Record> users = JbootDb.find("user",Columns.create());
renderJson(users);
}
public void find5(){
List<Record> users = JbootDb.find("user",Columns.create("login_name","aaa"));
renderJson(users);
}
public void find6(){
List<Record> users = JbootDb.use().find("user",Columns.create("login_name","aaa"));
renderJson(users);
}
public void find7(){
User dao = new User();
Columns columns = Columns.create();
columns.in("u.id",1,2,3,4);
// columns.likeAppendPercent("login_name","c");
// List<User> users = dao.leftJoin("article","a","user.id=a.user_id").findListByColumns(columns);
List<User> users = dao.loadColumns("u.id,a.id").alias("u").leftJoin("article").as("a").on("u.id=a.user_id").findListByColumns(columns);
dao.findAll();
renderJson(users);
}
public void find8(){
List<Record> users = JbootDb.use().find("user",Columns.create("login_name",true));
renderJson(users);
}
public void find9(){
User dao = new User();
Page<User> page = dao.paginateByColumns(getInt("page",1),10,Columns.create());
renderJson(page);
}
public void del1(){
User dao = new User();
dao.batchDeleteByIds("1",2,3);
renderJson(Ret.ok());
}
public void del2(){
User dao = new User();
dao.set("id",1);
dao.delete();
renderJson(Ret.ok());
}
public void save1(){
User user = new User();
user.set("login_name","michael");
user.set("nickname","michael123");
user.save();
renderJson(Ret.ok());
}
public void safeMode(){
User dao = new User();
Columns columns = Columns.safeMode();
columns.in("user.`id`",1,2,3,4);
columns.likeAppendPercent("login_name",null);
List<User> users = dao.leftJoin("article").as("a").on("user.id=a.user_id").findListByColumns(columns);
renderJson(users);
}
public void use(){
User dao = new User();
Columns columns = Columns.create();
columns.in("user.`id`",1,2,3,4);
User newDao = (User) dao.use("aaa");
// User newDao = (User) dao.useFirst("aaa");
// List<User> users = newDao.findListByColumns(columns);
List<User> users = newDao.leftJoin("article").as("a").on("user.id=a.user_id").findListByColumns(columns);
renderJson(users);
}
}
| [
"[email protected]"
] | |
caa66aafbbc804950534c7b4737066c1a89ba900 | 6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386 | /google/cloud/dialogflow/v2beta1/google-cloud-dialogflow-v2beta1-java/proto-google-cloud-dialogflow-v2beta1-java/src/main/java/com/google/cloud/dialogflow/v2beta1/DeleteKnowledgeBaseRequest.java | c491c85af45a28323096e229850f7ea03ad42a8b | [
"Apache-2.0"
] | permissive | oltoco/googleapis-gen | bf40cfad61b4217aca07068bd4922a86e3bbd2d5 | 00ca50bdde80906d6f62314ef4f7630b8cdb6e15 | refs/heads/master | 2023-07-17T22:11:47.848185 | 2021-08-29T20:39:47 | 2021-08-29T20:39:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 24,411 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/knowledge_base.proto
package com.google.cloud.dialogflow.v2beta1;
/**
* <pre>
* Request message for [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase].
* </pre>
*
* Protobuf type {@code google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest}
*/
public final class DeleteKnowledgeBaseRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest)
DeleteKnowledgeBaseRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use DeleteKnowledgeBaseRequest.newBuilder() to construct.
private DeleteKnowledgeBaseRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DeleteKnowledgeBaseRequest() {
name_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DeleteKnowledgeBaseRequest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeleteKnowledgeBaseRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 16: {
force_ = input.readBool();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.cloud.dialogflow.v2beta1.KnowledgeBaseProto.internal_static_google_cloud_dialogflow_v2beta1_DeleteKnowledgeBaseRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2beta1.KnowledgeBaseProto.internal_static_google_cloud_dialogflow_v2beta1_DeleteKnowledgeBaseRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.class, com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* <pre>
* Required. The name of the knowledge base to delete.
* Format: `projects/<Project ID>/locations/<Location
* ID>/knowledgeBases/<Knowledge Base ID>`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* <pre>
* Required. The name of the knowledge base to delete.
* Format: `projects/<Project ID>/locations/<Location
* ID>/knowledgeBases/<Knowledge Base ID>`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FORCE_FIELD_NUMBER = 2;
private boolean force_;
/**
* <pre>
* Optional. Force deletes the knowledge base. When set to true, any documents
* in the knowledge base are also deleted.
* </pre>
*
* <code>bool force = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return The force.
*/
@java.lang.Override
public boolean getForce() {
return force_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (force_ != false) {
output.writeBool(2, force_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (force_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(2, force_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest other = (com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest) obj;
if (!getName()
.equals(other.getName())) return false;
if (getForce()
!= other.getForce()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + FORCE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getForce());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* Request message for [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase].
* </pre>
*
* Protobuf type {@code google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest)
com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.cloud.dialogflow.v2beta1.KnowledgeBaseProto.internal_static_google_cloud_dialogflow_v2beta1_DeleteKnowledgeBaseRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2beta1.KnowledgeBaseProto.internal_static_google_cloud_dialogflow_v2beta1_DeleteKnowledgeBaseRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.class, com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.Builder.class);
}
// Construct using com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
force_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.cloud.dialogflow.v2beta1.KnowledgeBaseProto.internal_static_google_cloud_dialogflow_v2beta1_DeleteKnowledgeBaseRequest_descriptor;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest getDefaultInstanceForType() {
return com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest build() {
com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest buildPartial() {
com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest result = new com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest(this);
result.name_ = name_;
result.force_ = force_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest) {
return mergeFrom((com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest other) {
if (other == com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.getForce() != false) {
setForce(other.getForce());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
* <pre>
* Required. The name of the knowledge base to delete.
* Format: `projects/<Project ID>/locations/<Location
* ID>/knowledgeBases/<Knowledge Base ID>`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* Required. The name of the knowledge base to delete.
* Format: `projects/<Project ID>/locations/<Location
* ID>/knowledgeBases/<Knowledge Base ID>`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* Required. The name of the knowledge base to delete.
* Format: `projects/<Project ID>/locations/<Location
* ID>/knowledgeBases/<Knowledge Base ID>`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* <pre>
* Required. The name of the knowledge base to delete.
* Format: `projects/<Project ID>/locations/<Location
* ID>/knowledgeBases/<Knowledge Base ID>`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <pre>
* Required. The name of the knowledge base to delete.
* Format: `projects/<Project ID>/locations/<Location
* ID>/knowledgeBases/<Knowledge Base ID>`.
* </pre>
*
* <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private boolean force_ ;
/**
* <pre>
* Optional. Force deletes the knowledge base. When set to true, any documents
* in the knowledge base are also deleted.
* </pre>
*
* <code>bool force = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return The force.
*/
@java.lang.Override
public boolean getForce() {
return force_;
}
/**
* <pre>
* Optional. Force deletes the knowledge base. When set to true, any documents
* in the knowledge base are also deleted.
* </pre>
*
* <code>bool force = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param value The force to set.
* @return This builder for chaining.
*/
public Builder setForce(boolean value) {
force_ = value;
onChanged();
return this;
}
/**
* <pre>
* Optional. Force deletes the knowledge base. When set to true, any documents
* in the knowledge base are also deleted.
* </pre>
*
* <code>bool force = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return This builder for chaining.
*/
public Builder clearForce() {
force_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest)
private static final com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest();
}
public static com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DeleteKnowledgeBaseRequest>
PARSER = new com.google.protobuf.AbstractParser<DeleteKnowledgeBaseRequest>() {
@java.lang.Override
public DeleteKnowledgeBaseRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeleteKnowledgeBaseRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DeleteKnowledgeBaseRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DeleteKnowledgeBaseRequest> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"bazel-bot-development[bot]@users.noreply.github.com"
] | bazel-bot-development[bot]@users.noreply.github.com |
27581433350906f59190c803108beeefaceb1b2a | 760f984ef88f1bfc0a86442c4df56823dc8e11fc | /CircularProgressBar/gen/com/example/circularprogressbar/BuildConfig.java | c62da9fdc0487a7990c28ca7304041e0d3097d39 | [] | no_license | Naduni18/hbworkspace2-100 | faff2ae982ffa43a6ab009959791c00f429fdbd1 | 00cbd33513d0ee68d78e7da22aa3ead37012e89b | refs/heads/master | 2020-04-11T04:54:50.383140 | 2018-07-06T11:49:47 | 2018-07-06T11:49:47 | 161,531,081 | 1 | 0 | null | 2018-12-12T18:49:44 | 2018-12-12T18:49:43 | null | UTF-8 | Java | false | false | 173 | java | /** Automatically generated file. DO NOT MODIFY */
package com.example.circularprogressbar;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.