blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
daf5ba608b0eae2b1f2b3acf6b7fdb060daf7fba
|
c813b93751d55ecb83e146f94c41e83f07efc2c3
|
/app/src/test/java/com/example/financerepublicassign/ExampleUnitTest.java
|
7fc9fd5bb524a95de2dbbc5cd8c77070634b84e6
|
[] |
no_license
|
alokitnigam/TaskFinance
|
88be08bfa036065c7a3beed0853442ea02e5d23d
|
fee5c70d7351c4f32e6d34542d02f66aacc0cbff
|
refs/heads/master
| 2020-06-06T17:36:41.186030
| 2019-06-19T21:59:07
| 2019-06-19T21:59:07
| 192,808,234
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 394
|
java
|
package com.example.financerepublicassign;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"alokitnigam@gmail.com"
] |
alokitnigam@gmail.com
|
7911d268bc5bd8dc98eb21fd07527bb92f70bdb5
|
793a5f8a66ad08cfbe777bac89f134999132cb18
|
/app/src/main/java/com/lipeng/materialanimations/RevealActivity.java
|
ec99da3cda5f6253038e46a49c07f2b9f4d17340
|
[] |
no_license
|
biginsect/MaterialAnimations
|
b6d04ac96111a780b645e3c39fee6f57671b3780
|
0031d91ded4af6ee83a0937bb1f79f0f7416d32d
|
refs/heads/master
| 2021-08-23T19:47:25.628781
| 2017-12-06T08:40:31
| 2017-12-06T08:40:31
| 112,993,691
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,698
|
java
|
package com.lipeng.materialanimations;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.Toolbar;
import android.transition.Fade;
import android.transition.Transition;
import android.transition.TransitionInflater;
import android.transition.TransitionManager;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.lipeng.materialanimations.databinding.ActivityRevealBinding;
/**
* Created by lipeng on 2017/12/5.
*/
public class RevealActivity extends BaseDetailActivity implements View.OnTouchListener{
private static final int DELAY = 100;
private RelativeLayout bgViewGroup;
private Toolbar toolbar;
private Interpolator interpolator;
private TextView body;
private View btnRed;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void bindData() {
ActivityRevealBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_reveal);
Sample sample = (Sample)getIntent().getExtras().getSerializable(EXTRA_SAMPLE);
binding.setReveal1Sample(sample);
}
@Override
protected void setupLayout() {
bgViewGroup = findViewById(R.id.reveal_root);
toolbar = findViewById(R.id.toolbar);
body = findViewById(R.id.sample_body);
findViewById(R.id.square_green).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
revealGreen();
}
});
findViewById(R.id.square_blue).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
revealRed();
}
});
btnRed = findViewById(R.id.square_red);
btnRed.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
revealBlue();
}
});
findViewById(R.id.square_yellow).setOnTouchListener(this);
}
@Override
protected void setupWindowAnimations() {
interpolator = AnimationUtils.loadInterpolator(this, android.R.interpolator.linear_out_slow_in);
setupEnterAnimations();
setupExitAnimations();
}
private void setupEnterAnimations(){
Transition transition = TransitionInflater.from(this)
.inflateTransition(R.transition.changebounds_with_arcmotion);
getWindow().setSharedElementEnterTransition(transition);
transition.addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
}
@Override
public void onTransitionEnd(Transition transition) {
transition.removeListener(this);
hideTarget();
animateRevealShow(toolbar);
animateButtonsIn();
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
}
private void setupExitAnimations(){
Fade returnTransition = new Fade();
getWindow().setReturnTransition(returnTransition);
returnTransition.setDuration(300);
returnTransition.setStartDelay(300);
returnTransition.addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
transition.removeListener(this);
animateButtonOut();
animateRevealHide(bgViewGroup);
}
@Override
public void onTransitionEnd(Transition transition) {
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
}
private void revealBlue(){
animateButtonOut();
Animator animator = animateRevealColorFromCoordinates(bgViewGroup, R.color.sample_blue,
bgViewGroup.getWidth() / 2, 0);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
animateButtonsIn();
}
});
body.setText(R.string.reveal_body4);
body.setTextColor(ContextCompat.getColor(this, R.color.theme_blue_background));
}
private void revealRed(){
final ViewGroup.LayoutParams params = btnRed.getLayoutParams();
Transition transition = TransitionInflater.from(this)
.inflateTransition(R.transition.changebounds_with_arcmotion);
transition.addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
}
@Override
public void onTransitionEnd(Transition transition) {
animateRevealColor(bgViewGroup, R.color.sample_red);
body.setText(R.string.reveal_body3);
body.setTextColor(ContextCompat.getColor(RevealActivity.this, R.color.theme_red_background));
btnRed.setLayoutParams(params);
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
TransitionManager.beginDelayedTransition(bgViewGroup, transition);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
btnRed.setLayoutParams(layoutParams);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN){
if (v.getId() == R.id.square_yellow){
revealYellow(event.getRawX(), event.getRawY());
}
}
return false;
}
private void revealYellow(float x, float y){
animateRevealColorFromCoordinates(bgViewGroup, R.color.sample_yellow, (int)x, (int)y);
body.setText(R.string.reveal_body1);
body.setTextColor(ContextCompat.getColor(this, R.color.theme_yellow_background));
}
private void revealGreen(){
animateRevealColor(bgViewGroup, R.color.sample_green);
body.setText(R.string.reveal_body2);
body.setTextColor(ContextCompat.getColor(this, R.color.theme_green_background));
}
private void hideTarget(){
findViewById(R.id.shared_target).setVisibility(View.GONE);
}
private void animateButtonsIn(){
for (int i = 0; i < bgViewGroup.getChildCount(); i++){
View child = bgViewGroup.getChildAt(i);
child.animate()
.setStartDelay(100 + i * DELAY)
.setInterpolator(interpolator)
.alpha(1)
.scaleX(1)
.scaleY(1);
}
}
private void animateButtonOut(){
for (int i = 0; i < bgViewGroup.getChildCount(); i++){
View child = bgViewGroup.getChildAt(i);
child.animate()
.setStartDelay(i)
.setInterpolator(interpolator)
.alpha(0)
.scaleX(0f)
.scaleY(0f);
}
}
private void animateRevealShow(View viewRoot){
int x = (viewRoot.getLeft() + viewRoot.getRight()) / 2;
int y = (viewRoot.getTop() + viewRoot.getBottom()) / 2;
int finalRadius = Math.max(viewRoot.getWidth(), viewRoot.getHeight());
Animator animator = ViewAnimationUtils.createCircularReveal(viewRoot, x, y, 0, finalRadius);
viewRoot.setVisibility(View.VISIBLE);
animator.setDuration(500);
animator.setInterpolator(new AccelerateInterpolator());
animator.start();
}
private void animateRevealColor(ViewGroup viewRoot, @ColorRes int color){
int x = (viewRoot.getLeft() + viewRoot.getRight()) / 2;
int y = (viewRoot.getTop() + viewRoot.getBottom()) / 2;
animateRevealColorFromCoordinates(viewRoot, color, x, y);
}
private Animator animateRevealColorFromCoordinates(ViewGroup viewRoot, @ColorRes int color, int x, int y){
float finalRadius = (float)Math.hypot(viewRoot.getWidth(), viewRoot.getHeight());
Animator animator = ViewAnimationUtils.createCircularReveal(viewRoot, x, y, 0, finalRadius);
viewRoot.setBackgroundColor(ContextCompat.getColor(this, color));
animator.setDuration(500);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.start();
return animator;
}
private void animateRevealHide(final View viewRoot){
int x = (viewRoot.getLeft() + viewRoot.getRight()) / 2;
int y = (viewRoot.getTop() + viewRoot.getBottom()) / 2;
int initialRadius = viewRoot.getWidth();
Animator animator = ViewAnimationUtils.createCircularReveal(viewRoot, x, y, initialRadius, 0);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
viewRoot.setVisibility(View.INVISIBLE);
}
});
animator.setDuration(300)
.start();
}
}
|
[
"lipeng-ds3@gomeplus.com"
] |
lipeng-ds3@gomeplus.com
|
40b9d537e7f5763486f28c0b7e9ce280c850ddfe
|
5431b0611cc2e3394199f931d3952e77d9fdf486
|
/src/test/java/com/github/jcustenborder/kafka/connect/json/FromJsonSchemaConverterTest.java
|
ff75b1c236806fea7ad376b81ddd63d6d45a0d20
|
[
"Apache-2.0"
] |
permissive
|
Dishwasha/kafka-connect-json-schema
|
7be421a6e05573fa2c19ffbcdd0bea768b5d1528
|
239c64fa6404396aef06ae036de08e4f058bf751
|
refs/heads/master
| 2022-04-10T13:39:42.792553
| 2020-04-02T03:53:52
| 2020-04-02T03:53:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,833
|
java
|
/**
* Copyright © 2020 Jeremy Custenborder (jcustenborder@gmail.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.github.jcustenborder.kafka.connect.json;
import org.apache.kafka.connect.data.Date;
import org.apache.kafka.connect.data.Schema;
import org.apache.kafka.connect.data.SchemaBuilder;
import org.apache.kafka.connect.data.Time;
import org.apache.kafka.connect.data.Timestamp;
import org.everit.json.schema.internal.DateFormatValidator;
import org.everit.json.schema.internal.DateTimeFormatValidator;
import org.everit.json.schema.internal.TimeFormatValidator;
import org.everit.json.schema.loader.SchemaLoader;
import org.json.JSONObject;
import org.json.JSONTokener;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static com.github.jcustenborder.kafka.connect.utils.AssertSchema.assertSchema;
public class FromJsonSchemaConverterTest {
org.everit.json.schema.Schema jsonSchema(String type) {
JSONObject rawSchema = new JSONObject();
rawSchema.put("type", type);
return TestUtils.jsonSchema(rawSchema);
}
org.everit.json.schema.Schema jsonSchema(String type, String key1, String value1) {
JSONObject rawSchema = new JSONObject();
rawSchema.put("type", type);
rawSchema.put(key1, value1);
return TestUtils.jsonSchema(rawSchema);
}
org.everit.json.schema.Schema jsonSchema(String type, String key1, String value1, String key2, String value2) {
JSONObject rawSchema = new JSONObject();
rawSchema.put("type", type);
rawSchema.put(key1, value1);
rawSchema.put(key2, value2);
return TestUtils.jsonSchema(rawSchema);
}
void assertJsonSchema(org.apache.kafka.connect.data.Schema expected, org.everit.json.schema.Schema input) {
FromJsonState state = FromJsonSchemaConverter.fromJSON(input);
assertSchema(expected, state.schema);
}
@Test
public void booleanSchema() {
org.everit.json.schema.Schema jsonSchema = jsonSchema("boolean");
assertJsonSchema(Schema.BOOLEAN_SCHEMA, jsonSchema);
}
@Test
public void stringSchema() {
org.everit.json.schema.Schema jsonSchema = jsonSchema("string");
assertJsonSchema(Schema.STRING_SCHEMA, jsonSchema);
}
@Test
public void integerSchema() {
org.everit.json.schema.Schema jsonSchema = jsonSchema("integer");
assertJsonSchema(Schema.INT64_SCHEMA, jsonSchema);
}
@Test
public void numberSchema() {
org.everit.json.schema.Schema jsonSchema = jsonSchema("number");
assertJsonSchema(Schema.FLOAT64_SCHEMA, jsonSchema);
}
@Test
public void dateSchema() {
org.everit.json.schema.Schema jsonSchema = jsonSchema("string", "format", "date");
assertJsonSchema(Date.SCHEMA, jsonSchema);
}
@Test
public void timeSchema() {
org.everit.json.schema.Schema jsonSchema = jsonSchema("string", "format", "time");
assertJsonSchema(Time.SCHEMA, jsonSchema);
}
@Test
public void datetimeSchema() {
org.everit.json.schema.Schema jsonSchema = jsonSchema("string", "format", "date-time");
assertJsonSchema(Timestamp.SCHEMA, jsonSchema);
}
org.everit.json.schema.Schema loadSchema(String name) throws IOException {
try (InputStream inputStream = this.getClass().getResourceAsStream(name)) {
JSONObject rawSchema = new JSONObject(new JSONTokener(inputStream));
return SchemaLoader.builder()
.draftV7Support()
.addFormatValidator(new DateFormatValidator())
.addFormatValidator(new TimeFormatValidator())
.addFormatValidator(new DateTimeFormatValidator())
.schemaJson(rawSchema)
.build()
.load()
.build();
}
}
@Test
public void productSchema() throws IOException {
org.everit.json.schema.Schema jsonSchema = loadSchema("SchemaConverterTest/product.schema.json");
Schema expected = SchemaBuilder.struct()
.name("Product")
.doc("A product from Acme's catalog")
.field("price", SchemaBuilder.float64().doc("The price of the product").build())
.field("productId", SchemaBuilder.int64().doc("The unique identifier for a product").build())
.field("productName", SchemaBuilder.string().doc("Name of the product").build())
.build();
assertJsonSchema(expected, jsonSchema);
}
@Test
public void nested() throws IOException {
org.everit.json.schema.Schema jsonSchema = loadSchema("SchemaConverterTest/nested.schema.json");
Schema addressSchema = SchemaBuilder.struct()
.name("Address")
.optional()
.field("city", SchemaBuilder.string().build())
.field("state", SchemaBuilder.string().build())
.field("street_address", SchemaBuilder.string().build())
.build();
Schema expected = SchemaBuilder.struct()
.name("Customer")
.field("billing_address", addressSchema)
.field("shipping_address", addressSchema)
.build();
assertJsonSchema(expected, jsonSchema);
}
@Test
public void array() {
JSONObject rawSchema = new JSONObject()
.put("type", "array")
.put("items", new JSONObject().put("type", "number"));
org.everit.json.schema.Schema jsonSchema = TestUtils.jsonSchema(rawSchema);
assertJsonSchema(SchemaBuilder.array(Schema.FLOAT64_SCHEMA).build(), jsonSchema);
}
}
|
[
"noreply@github.com"
] |
Dishwasha.noreply@github.com
|
7e21a84f07684e1b8eb3128f237d82b7a3fa0005
|
959c91af020dc3286d65cdca1c32044a55ad10d9
|
/ZcoreFramework/ZcoreValidation/src/main/java/org/zcoreframework/validation/util/Arrays.java
|
0608d0fe35e27c7f56aae22ef9825eb53eebc6dd
|
[] |
no_license
|
akz792000/ZcoreFramework
|
2b53dd90ebe8e754621d93662366327c084d57ba
|
cf69a0030abd10b055be351c5f5aa85e38159b6d
|
refs/heads/master
| 2020-08-03T08:26:16.990944
| 2019-10-02T12:12:09
| 2019-10-02T12:12:09
| 211,683,491
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 579
|
java
|
/**
*
* @author Ali Karimizandi
* @since 2009
*
*/
package org.zcoreframework.validation.util;
public class Arrays {
public static String toString(Object[] a) {
if (a == null)
return "[]";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(String.valueOf(a[i]));
if (i == iMax)
return b.append(']').toString();
b.append(",");
}
}
}
|
[
"a.zandi@ocs.ir"
] |
a.zandi@ocs.ir
|
31aef55b36afe14ec2676eba476d932a86e41101
|
5f82aae041ab05a5e6c3d9ddd8319506191ab055
|
/Projects/Chart/22/src/test/java/org/jfree/data/time/junit/YearTests.java
|
ff2dc7dff8e2e028f20068cdfce26d459c4d37e1
|
[] |
no_license
|
lingming/prapr_data
|
e9ddabdf971451d46f1ef2cdbee15ce342a6f9dc
|
be9ababc95df45fd66574c6af01122ed9df3db5d
|
refs/heads/master
| 2023-08-14T20:36:23.459190
| 2021-10-17T13:49:39
| 2021-10-17T13:49:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 12,945
|
java
|
/* ===========================================================
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
* (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* --------------
* YearTests.java
* --------------
* (C) Copyright 2001-2007, by Object Refinery Limited.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
*
* $Id: YearTests.java,v 1.1.2.3 2006/10/06 13:13:10 mungady Exp $
*
* Changes
* -------
* 16-Nov-2001 : Version 1 (DG);
* 19-Mar-2002 : Added tests for constructor that uses java.util.Date to ensure
* it is consistent with the getStart() and getEnd() methods (DG);
* 17-Oct-2002 : Fixed errors reported by Checkstyle (DG);
* 13-Mar-2003 : Added serialization test (DG);
* 11-Jan-2005 : Added test for non-clonability (DG);
* 05-Oct-2006 : Added some new tests (DG);
* 11-Jul-2007 : Fixed bad time zone assumption (DG);
*
*/
package org.jfree.data.time.junit;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jfree.data.time.TimePeriodFormatException;
import org.jfree.data.time.Year;
/**
* Tests for the {@link Year} class.
*/
public class YearTests extends TestCase {
/**
* Returns the tests as a test suite.
*
* @return The test suite.
*/
public static Test suite() {
return new TestSuite(YearTests.class);
}
/**
* Constructs a new set of tests.
*
* @param name the name of the tests.
*/
public YearTests(String name) {
super(name);
}
/**
* Common test setup.
*/
protected void setUp() {
// no setup
}
/**
* Check that a Year instance is equal to itself.
*
* SourceForge Bug ID: 558850.
*/
public void testEqualsSelf() {
Year year = new Year();
assertTrue(year.equals(year));
}
/**
* Tests the equals method.
*/
public void testEquals() {
Year year1 = new Year(2002);
Year year2 = new Year(2002);
assertTrue(year1.equals(year2));
}
/**
* In GMT, the end of 2001 is java.util.Date(1009843199999L). Use this to
* check the year constructor.
*/
public void testDateConstructor1() {
TimeZone zone = TimeZone.getTimeZone("GMT");
Calendar c = new GregorianCalendar(zone);
Date d1 = new Date(1009843199999L);
Date d2 = new Date(1009843200000L);
Year y1 = new Year(d1, zone);
Year y2 = new Year(d2, zone);
assertEquals(2001, y1.getYear());
assertEquals(1009843199999L, y1.getLastMillisecond(c));
assertEquals(2002, y2.getYear());
assertEquals(1009843200000L, y2.getFirstMillisecond(c));
}
/**
* In Los Angeles, the end of 2001 is java.util.Date(1009871999999L). Use
* this to check the year constructor.
*/
public void testDateConstructor2() {
TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
Calendar c = new GregorianCalendar(zone);
Year y1 = new Year(new Date(1009871999999L), zone);
Year y2 = new Year(new Date(1009872000000L), zone);
assertEquals(2001, y1.getYear());
assertEquals(1009871999999L, y1.getLastMillisecond(c));
assertEquals(2002, y2.getYear());
assertEquals(1009872000000L, y2.getFirstMillisecond(c));
}
/**
* Set up a year equal to 1900. Request the previous year, it should be
* null.
*/
public void test1900Previous() {
Year current = new Year(1900);
Year previous = (Year) current.previous();
assertNull(previous);
}
/**
* Set up a year equal to 1900. Request the next year, it should be 1901.
*/
public void test1900Next() {
Year current = new Year(1900);
Year next = (Year) current.next();
assertEquals(1901, next.getYear());
}
/**
* Set up a year equal to 9999. Request the previous year, it should be
* 9998.
*/
public void test9999Previous() {
Year current = new Year(9999);
Year previous = (Year) current.previous();
assertEquals(9998, previous.getYear());
}
/**
* Set up a year equal to 9999. Request the next year, it should be null.
*/
public void test9999Next() {
Year current = new Year(9999);
Year next = (Year) current.next();
assertNull(next);
}
/**
* Tests the year string parser.
*/
public void testParseYear() {
Year year = null;
// test 1...
try {
year = Year.parseYear("2000");
}
catch (TimePeriodFormatException e) {
year = new Year(1900);
}
assertEquals(2000, year.getYear());
// test 2...
try {
year = Year.parseYear(" 2001 ");
}
catch (TimePeriodFormatException e) {
year = new Year(1900);
}
assertEquals(2001, year.getYear());
// test 3...
try {
year = Year.parseYear("99");
}
catch (TimePeriodFormatException e) {
year = new Year(1900);
}
assertEquals(1900, year.getYear());
}
/**
* Serialize an instance, restore it, and check for equality.
*/
public void testSerialization() {
Year y1 = new Year(1999);
Year y2 = null;
try {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(y1);
out.close();
ObjectInput in = new ObjectInputStream(
new ByteArrayInputStream(buffer.toByteArray())
);
y2 = (Year) in.readObject();
in.close();
}
catch (Exception e) {
System.out.println(e.toString());
}
assertEquals(y1, y2);
}
/**
* The {@link Year} class is immutable, so should not be {@link Cloneable}.
*/
public void testNotCloneable() {
Year y = new Year(1999);
assertFalse(y instanceof Cloneable);
}
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashcode() {
Year y1 = new Year(1988);
Year y2 = new Year(1988);
assertTrue(y1.equals(y2));
int h1 = y1.hashCode();
int h2 = y2.hashCode();
assertEquals(h1, h2);
}
/**
* Some checks for the getFirstMillisecond() method.
*/
public void testGetFirstMillisecond() {
Locale saved = Locale.getDefault();
Locale.setDefault(Locale.UK);
TimeZone savedZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
Year y = new Year(1970);
// TODO: Check this result...
assertEquals(-3600000L, y.getFirstMillisecond());
Locale.setDefault(saved);
TimeZone.setDefault(savedZone);
}
/**
* Some checks for the getFirstMillisecond(TimeZone) method.
*/
public void testGetFirstMillisecondWithTimeZone() {
Year y = new Year(1950);
TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
Calendar c = new GregorianCalendar(zone);
assertEquals(-631123200000L, y.getFirstMillisecond(c));
// try null calendar
boolean pass = false;
try {
y.getFirstMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
/**
* Some checks for the getFirstMillisecond(TimeZone) method.
*/
public void testGetFirstMillisecondWithCalendar() {
Year y = new Year(2001);
GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
assertEquals(978307200000L, y.getFirstMillisecond(calendar));
// try null calendar
boolean pass = false;
try {
y.getFirstMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
/**
* Some checks for the getLastMillisecond() method.
*/
public void testGetLastMillisecond() {
Locale saved = Locale.getDefault();
Locale.setDefault(Locale.UK);
TimeZone savedZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
Year y = new Year(1970);
// TODO: Check this result...
assertEquals(31532399999L, y.getLastMillisecond());
Locale.setDefault(saved);
TimeZone.setDefault(savedZone);
}
/**
* Some checks for the getLastMillisecond(TimeZone) method.
*/
public void testGetLastMillisecondWithTimeZone() {
Year y = new Year(1950);
TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
Calendar c = new GregorianCalendar(zone);
assertEquals(-599587200001L, y.getLastMillisecond(c));
// try null calendar
boolean pass = false;
try {
y.getLastMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
/**
* Some checks for the getLastMillisecond(TimeZone) method.
*/
public void testGetLastMillisecondWithCalendar() {
Year y = new Year(2001);
GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
assertEquals(1009843199999L, y.getLastMillisecond(calendar));
// try null calendar
boolean pass = false;
try {
y.getLastMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
/**
* Some checks for the getSerialIndex() method.
*/
public void testGetSerialIndex() {
Year y = new Year(2000);
assertEquals(2000L, y.getSerialIndex());
}
/**
* Some checks for the testNext() method.
*/
public void testNext() {
Year y = new Year(2000);
y = (Year) y.next();
assertEquals(2001, y.getYear());
y = new Year(9999);
assertNull(y.next());
}
/**
* Some checks for the getStart() method.
*/
public void testGetStart() {
Locale saved = Locale.getDefault();
Locale.setDefault(Locale.ITALY);
Calendar cal = Calendar.getInstance(Locale.ITALY);
cal.set(2006, Calendar.JANUARY, 1, 0, 0, 0);
cal.set(Calendar.MILLISECOND, 0);
Year y = new Year(2006);
assertEquals(cal.getTime(), y.getStart());
Locale.setDefault(saved);
}
/**
* Some checks for the getEnd() method.
*/
public void testGetEnd() {
Locale saved = Locale.getDefault();
Locale.setDefault(Locale.ITALY);
Calendar cal = Calendar.getInstance(Locale.ITALY);
cal.set(2006, Calendar.DECEMBER, 31, 23, 59, 59);
cal.set(Calendar.MILLISECOND, 999);
Year y = new Year(2006);
assertEquals(cal.getTime(), y.getEnd());
Locale.setDefault(saved);
}
}
|
[
"2890268106@qq.com"
] |
2890268106@qq.com
|
28b240db063bf17996210d198b6c7104a2c39529
|
64e61f5a5082fb0cb0b2c3fbf738382519802e50
|
/org.eclipse.acme.action.language.edit/src/action_assurancecase/provider/Action_assurancecaseEditPlugin.java
|
69efe835fc7bb9ad2a8c2b0b4bd6479998c23594
|
[] |
no_license
|
wrwei/OMG-specification-implementations
|
f33e37a0d2a2609d4c0db851d185773aaac950bc
|
40001210089c773432ff0b074035dffbc06add60
|
refs/heads/master
| 2020-04-28T16:35:07.148838
| 2019-03-15T07:58:04
| 2019-03-15T07:58:04
| 175,416,471
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,524
|
java
|
/**
*/
package action_assurancecase.provider;
import action_argumentation.provider.Action_argumentationEditPlugin;
import action_artifact.provider.Action_artifactEditPlugin;
import action_base.provider.Action_baseEditPlugin;
import action_terminology.provider.Action_terminologyEditPlugin;
import argumentation.provider.ArgumentationEditPlugin;
import base.provider.BaseEditPlugin;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.ResourceLocator;
import terminology.provider.TerminologyEditPlugin;
/**
* This is the central singleton for the Action_assurancecase edit plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public final class Action_assurancecaseEditPlugin extends EMFPlugin {
/**
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final Action_assurancecaseEditPlugin INSTANCE = new Action_assurancecaseEditPlugin();
/**
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static Implementation plugin;
/**
* Create the instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Action_assurancecaseEditPlugin() {
super
(new ResourceLocator [] {
Action_argumentationEditPlugin.INSTANCE,
Action_artifactEditPlugin.INSTANCE,
Action_baseEditPlugin.INSTANCE,
Action_terminologyEditPlugin.INSTANCE,
ArgumentationEditPlugin.INSTANCE,
BaseEditPlugin.INSTANCE,
TerminologyEditPlugin.INSTANCE,
});
}
/**
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the singleton instance.
* @generated
*/
@Override
public ResourceLocator getPluginResourceLocator() {
return plugin;
}
/**
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the singleton instance.
* @generated
*/
public static Implementation getPlugin() {
return plugin;
}
/**
* The actual implementation of the Eclipse <b>Plugin</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class Implementation extends EclipsePlugin {
/**
* Creates an instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Implementation() {
super();
// Remember the static instance.
//
plugin = this;
}
}
}
|
[
"ran.wei@york.ac.uk"
] |
ran.wei@york.ac.uk
|
1134bd7d4b4daf1287200515d61667662421d410
|
3ca8f3a533cd1b6d941a4c3e6ef7ff0fc66e8021
|
/src/main/java/org/springboot/entity/User.java
|
6acccddd3f4da825b00e549fc240f6ed17b0b382
|
[] |
no_license
|
tyouika/spring-boot-with-activiti-example
|
ff530e90d581a21bcb1517a3f0c679e99a109979
|
f1e008b68329df0dd69aae1e8d0098fd93e355d2
|
refs/heads/master
| 2021-08-08T06:06:50.228148
| 2017-11-09T17:56:37
| 2017-11-09T17:56:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 544
|
java
|
package org.springboot.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* Created by Administrator on 2017/11/10.
*/
@Entity
public class User {
@Id
@GeneratedValue
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|
[
"ccaccab@163.com"
] |
ccaccab@163.com
|
b902909b0baaf1b16713b82f5a081b339711edde
|
2b258e9be7bff259aded0518391941de56770a84
|
/demo/springdemo/src/com/basic/intertest/InterTest.java
|
6d4869afbcf649367cbb463447039597570648f0
|
[] |
no_license
|
xiaobaig0407/springdemo
|
b258dd50b600c38f19ce383c54da8220da7fbdae
|
f7a8a577ff7b0613060c4e0e7873bc5b0159c451
|
refs/heads/master
| 2021-05-29T02:42:47.804503
| 2020-06-17T06:53:36
| 2020-06-17T06:53:36
| 254,300,135
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,324
|
java
|
package com.basic.intertest;
/**
*
* @package com.basic.abstracttest
* @author baiyutao
* @date 2020/4/22 下午11:54
* @version 1.0
*/
/**
* 当一个抽象类中的方法都是抽象的时候,这时可以将抽象类用另一种形式来定义和表示就是接口
* 即interface
*
* 对于接口当中常见的成员,而且这些成员都有固定的修饰符
* 1全局常量 public static final
* 2抽象方法 public abstract
*
* 由此得出结论,接口中的成员都是公共的权限
*/
//定义接口使用的关键字不是class,是interface
interface IntDemo{
public static final int NUM = 4;
public abstract void show1();
public abstract void show2();
}
//类与类之间是继承关系,类与接口之间是实现关系
/**
* 接口不可以实例化。只能由实现了接口的子类并覆盖了接口中所有的抽象方法后,
* 该子类才可以实例化,否则该子类就是一个抽象类
*/
class DemoImpl implements IntDemo{
@Override
public void show1(){
}
@Override
public void show2() {
}
}
/**
* 在java中不直接支持多继承,因为会出现调用的不确定性
* 所以java将多继承机制进行了改良,在java中变成了多实现
*
* 一个类可以实现多个接口
*/
interface A{
public abstract void show();
}
interface Z{
public abstract void show();
}
class Test implements A,Z //多实现
{
@Override
public void show() {
System.out.println(this);
}
}
/**
* 一个类在继承另一个类的同时还可以实现多个接口
*/
/**
*
*/
interface CC{
}
interface DD{
}
//接口与接口之间是继承关系,而且接口可以多继承
//原理在于方法体不存在
interface BokTa extends CC,DD{
}
class Q{
public void method(){
}
}
class Testme extends Q implements A,Z{
@Override
public void show(){
}
}
/**
* 接口的出现避免了单继承的局限性
*/
/***
* 接口是对外暴露的规则,是程序的功能扩展,降低藕合性
* 鼠标笔记本紧密程度降低,简称降低耦合性
* 键盘,u盘,都能插入, 提高笔记本功能扩展性
*/
public class InterTest {
public static void main(String[] args) {
Test test = new Test();
test.show();
}
}
|
[
"yutaob@opera.com"
] |
yutaob@opera.com
|
0072603796c8784d2dad3df71d8640c7b89d33a9
|
bc9360d4ac3b8b82085cf6a353b76f071c9fa889
|
/src/test/java/io/github/jhipster/application/web/rest/PackResourceIntTest.java
|
197b87cdb2270468867bfbaa32911596a8dead42
|
[] |
no_license
|
raulhechavarria/frontdesk2
|
cd7d3f8a32a1a19487353b40349e9dec763e506c
|
2161ab8f7dbb2bfa2b5aa570c1361941c832f700
|
refs/heads/master
| 2020-04-08T12:34:09.752714
| 2018-11-27T15:04:01
| 2018-11-27T15:04:01
| 159,352,627
| 0
| 0
| null | 2018-11-27T15:04:03
| 2018-11-27T14:58:58
|
Java
|
UTF-8
|
Java
| false
| false
| 30,188
|
java
|
package io.github.jhipster.application.web.rest;
import io.github.jhipster.application.Frontdesk2App;
import io.github.jhipster.application.domain.Pack;
import io.github.jhipster.application.repository.PackRepository;
import io.github.jhipster.application.repository.search.PackSearchRepository;
import io.github.jhipster.application.service.PackService;
import io.github.jhipster.application.web.rest.errors.ExceptionTranslator;
import io.github.jhipster.application.service.dto.PackCriteria;
import io.github.jhipster.application.service.PackQueryService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Base64Utils;
import javax.persistence.EntityManager;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Collections;
import java.util.List;
import static io.github.jhipster.application.web.rest.TestUtil.createFormattingConversionService;
import static org.assertj.core.api.Assertions.assertThat;
import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery;
import static org.hamcrest.Matchers.hasItem;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
/**
* Test class for the PackResource REST controller.
*
* @see PackResource
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Frontdesk2App.class)
public class PackResourceIntTest {
private static final String DEFAULT_NAME = "AAAAAAAAAA";
private static final String UPDATED_NAME = "BBBBBBBBBB";
private static final String DEFAULT_NAME_FRONT_DESK_RECEIVE = "AAAAAAAAAA";
private static final String UPDATED_NAME_FRONT_DESK_RECEIVE = "BBBBBBBBBB";
private static final String DEFAULT_NAME_FRONT_DESK_DELIVERY = "AAAAAAAAAA";
private static final String UPDATED_NAME_FRONT_DESK_DELIVERY = "BBBBBBBBBB";
private static final String DEFAULT_NAME_PICKUP = "AAAAAAAAAA";
private static final String UPDATED_NAME_PICKUP = "BBBBBBBBBB";
private static final LocalDate DEFAULT_DATE_RECEIVED = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_DATE_RECEIVED = LocalDate.now(ZoneId.systemDefault());
private static final LocalDate DEFAULT_DATE_PICKUP = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_DATE_PICKUP = LocalDate.now(ZoneId.systemDefault());
private static final byte[] DEFAULT_PIXEL = TestUtil.createByteArray(1, "0");
private static final byte[] UPDATED_PIXEL = TestUtil.createByteArray(1, "1");
private static final String DEFAULT_PIXEL_CONTENT_TYPE = "image/jpg";
private static final String UPDATED_PIXEL_CONTENT_TYPE = "image/png";
@Autowired
private PackRepository packRepository;
@Autowired
private PackService packService;
/**
* This repository is mocked in the io.github.jhipster.application.repository.search test package.
*
* @see io.github.jhipster.application.repository.search.PackSearchRepositoryMockConfiguration
*/
@Autowired
private PackSearchRepository mockPackSearchRepository;
@Autowired
private PackQueryService packQueryService;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Autowired
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Autowired
private EntityManager em;
private MockMvc restPackMockMvc;
private Pack pack;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
final PackResource packResource = new PackResource(packService, packQueryService);
this.restPackMockMvc = MockMvcBuilders.standaloneSetup(packResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
.setControllerAdvice(exceptionTranslator)
.setConversionService(createFormattingConversionService())
.setMessageConverters(jacksonMessageConverter).build();
}
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Pack createEntity(EntityManager em) {
Pack pack = new Pack()
.name(DEFAULT_NAME)
.nameFrontDeskReceive(DEFAULT_NAME_FRONT_DESK_RECEIVE)
.nameFrontDeskDelivery(DEFAULT_NAME_FRONT_DESK_DELIVERY)
.namePickup(DEFAULT_NAME_PICKUP)
.dateReceived(DEFAULT_DATE_RECEIVED)
.datePickup(DEFAULT_DATE_PICKUP)
.pixel(DEFAULT_PIXEL)
.pixelContentType(DEFAULT_PIXEL_CONTENT_TYPE);
return pack;
}
@Before
public void initTest() {
pack = createEntity(em);
}
@Test
@Transactional
public void createPack() throws Exception {
int databaseSizeBeforeCreate = packRepository.findAll().size();
// Create the Pack
restPackMockMvc.perform(post("/api/packs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(pack)))
.andExpect(status().isCreated());
// Validate the Pack in the database
List<Pack> packList = packRepository.findAll();
assertThat(packList).hasSize(databaseSizeBeforeCreate + 1);
Pack testPack = packList.get(packList.size() - 1);
assertThat(testPack.getName()).isEqualTo(DEFAULT_NAME);
assertThat(testPack.getNameFrontDeskReceive()).isEqualTo(DEFAULT_NAME_FRONT_DESK_RECEIVE);
assertThat(testPack.getNameFrontDeskDelivery()).isEqualTo(DEFAULT_NAME_FRONT_DESK_DELIVERY);
assertThat(testPack.getNamePickup()).isEqualTo(DEFAULT_NAME_PICKUP);
assertThat(testPack.getDateReceived()).isEqualTo(DEFAULT_DATE_RECEIVED);
assertThat(testPack.getDatePickup()).isEqualTo(DEFAULT_DATE_PICKUP);
assertThat(testPack.getPixel()).isEqualTo(DEFAULT_PIXEL);
assertThat(testPack.getPixelContentType()).isEqualTo(DEFAULT_PIXEL_CONTENT_TYPE);
// Validate the Pack in Elasticsearch
verify(mockPackSearchRepository, times(1)).save(testPack);
}
@Test
@Transactional
public void createPackWithExistingId() throws Exception {
int databaseSizeBeforeCreate = packRepository.findAll().size();
// Create the Pack with an existing ID
pack.setId(1L);
// An entity with an existing ID cannot be created, so this API call must fail
restPackMockMvc.perform(post("/api/packs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(pack)))
.andExpect(status().isBadRequest());
// Validate the Pack in the database
List<Pack> packList = packRepository.findAll();
assertThat(packList).hasSize(databaseSizeBeforeCreate);
// Validate the Pack in Elasticsearch
verify(mockPackSearchRepository, times(0)).save(pack);
}
@Test
@Transactional
public void getAllPacks() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList
restPackMockMvc.perform(get("/api/packs?sort=id,desc"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(pack.getId().intValue())))
.andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME.toString())))
.andExpect(jsonPath("$.[*].nameFrontDeskReceive").value(hasItem(DEFAULT_NAME_FRONT_DESK_RECEIVE.toString())))
.andExpect(jsonPath("$.[*].nameFrontDeskDelivery").value(hasItem(DEFAULT_NAME_FRONT_DESK_DELIVERY.toString())))
.andExpect(jsonPath("$.[*].namePickup").value(hasItem(DEFAULT_NAME_PICKUP.toString())))
.andExpect(jsonPath("$.[*].dateReceived").value(hasItem(DEFAULT_DATE_RECEIVED.toString())))
.andExpect(jsonPath("$.[*].datePickup").value(hasItem(DEFAULT_DATE_PICKUP.toString())))
.andExpect(jsonPath("$.[*].pixelContentType").value(hasItem(DEFAULT_PIXEL_CONTENT_TYPE)))
.andExpect(jsonPath("$.[*].pixel").value(hasItem(Base64Utils.encodeToString(DEFAULT_PIXEL))));
}
@Test
@Transactional
public void getPack() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get the pack
restPackMockMvc.perform(get("/api/packs/{id}", pack.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.id").value(pack.getId().intValue()))
.andExpect(jsonPath("$.name").value(DEFAULT_NAME.toString()))
.andExpect(jsonPath("$.nameFrontDeskReceive").value(DEFAULT_NAME_FRONT_DESK_RECEIVE.toString()))
.andExpect(jsonPath("$.nameFrontDeskDelivery").value(DEFAULT_NAME_FRONT_DESK_DELIVERY.toString()))
.andExpect(jsonPath("$.namePickup").value(DEFAULT_NAME_PICKUP.toString()))
.andExpect(jsonPath("$.dateReceived").value(DEFAULT_DATE_RECEIVED.toString()))
.andExpect(jsonPath("$.datePickup").value(DEFAULT_DATE_PICKUP.toString()))
.andExpect(jsonPath("$.pixelContentType").value(DEFAULT_PIXEL_CONTENT_TYPE))
.andExpect(jsonPath("$.pixel").value(Base64Utils.encodeToString(DEFAULT_PIXEL)));
}
@Test
@Transactional
public void getAllPacksByNameIsEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where name equals to DEFAULT_NAME
defaultPackShouldBeFound("name.equals=" + DEFAULT_NAME);
// Get all the packList where name equals to UPDATED_NAME
defaultPackShouldNotBeFound("name.equals=" + UPDATED_NAME);
}
@Test
@Transactional
public void getAllPacksByNameIsInShouldWork() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where name in DEFAULT_NAME or UPDATED_NAME
defaultPackShouldBeFound("name.in=" + DEFAULT_NAME + "," + UPDATED_NAME);
// Get all the packList where name equals to UPDATED_NAME
defaultPackShouldNotBeFound("name.in=" + UPDATED_NAME);
}
@Test
@Transactional
public void getAllPacksByNameIsNullOrNotNull() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where name is not null
defaultPackShouldBeFound("name.specified=true");
// Get all the packList where name is null
defaultPackShouldNotBeFound("name.specified=false");
}
@Test
@Transactional
public void getAllPacksByNameFrontDeskReceiveIsEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where nameFrontDeskReceive equals to DEFAULT_NAME_FRONT_DESK_RECEIVE
defaultPackShouldBeFound("nameFrontDeskReceive.equals=" + DEFAULT_NAME_FRONT_DESK_RECEIVE);
// Get all the packList where nameFrontDeskReceive equals to UPDATED_NAME_FRONT_DESK_RECEIVE
defaultPackShouldNotBeFound("nameFrontDeskReceive.equals=" + UPDATED_NAME_FRONT_DESK_RECEIVE);
}
@Test
@Transactional
public void getAllPacksByNameFrontDeskReceiveIsInShouldWork() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where nameFrontDeskReceive in DEFAULT_NAME_FRONT_DESK_RECEIVE or UPDATED_NAME_FRONT_DESK_RECEIVE
defaultPackShouldBeFound("nameFrontDeskReceive.in=" + DEFAULT_NAME_FRONT_DESK_RECEIVE + "," + UPDATED_NAME_FRONT_DESK_RECEIVE);
// Get all the packList where nameFrontDeskReceive equals to UPDATED_NAME_FRONT_DESK_RECEIVE
defaultPackShouldNotBeFound("nameFrontDeskReceive.in=" + UPDATED_NAME_FRONT_DESK_RECEIVE);
}
@Test
@Transactional
public void getAllPacksByNameFrontDeskReceiveIsNullOrNotNull() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where nameFrontDeskReceive is not null
defaultPackShouldBeFound("nameFrontDeskReceive.specified=true");
// Get all the packList where nameFrontDeskReceive is null
defaultPackShouldNotBeFound("nameFrontDeskReceive.specified=false");
}
@Test
@Transactional
public void getAllPacksByNameFrontDeskDeliveryIsEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where nameFrontDeskDelivery equals to DEFAULT_NAME_FRONT_DESK_DELIVERY
defaultPackShouldBeFound("nameFrontDeskDelivery.equals=" + DEFAULT_NAME_FRONT_DESK_DELIVERY);
// Get all the packList where nameFrontDeskDelivery equals to UPDATED_NAME_FRONT_DESK_DELIVERY
defaultPackShouldNotBeFound("nameFrontDeskDelivery.equals=" + UPDATED_NAME_FRONT_DESK_DELIVERY);
}
@Test
@Transactional
public void getAllPacksByNameFrontDeskDeliveryIsInShouldWork() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where nameFrontDeskDelivery in DEFAULT_NAME_FRONT_DESK_DELIVERY or UPDATED_NAME_FRONT_DESK_DELIVERY
defaultPackShouldBeFound("nameFrontDeskDelivery.in=" + DEFAULT_NAME_FRONT_DESK_DELIVERY + "," + UPDATED_NAME_FRONT_DESK_DELIVERY);
// Get all the packList where nameFrontDeskDelivery equals to UPDATED_NAME_FRONT_DESK_DELIVERY
defaultPackShouldNotBeFound("nameFrontDeskDelivery.in=" + UPDATED_NAME_FRONT_DESK_DELIVERY);
}
@Test
@Transactional
public void getAllPacksByNameFrontDeskDeliveryIsNullOrNotNull() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where nameFrontDeskDelivery is not null
defaultPackShouldBeFound("nameFrontDeskDelivery.specified=true");
// Get all the packList where nameFrontDeskDelivery is null
defaultPackShouldNotBeFound("nameFrontDeskDelivery.specified=false");
}
@Test
@Transactional
public void getAllPacksByNamePickupIsEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where namePickup equals to DEFAULT_NAME_PICKUP
defaultPackShouldBeFound("namePickup.equals=" + DEFAULT_NAME_PICKUP);
// Get all the packList where namePickup equals to UPDATED_NAME_PICKUP
defaultPackShouldNotBeFound("namePickup.equals=" + UPDATED_NAME_PICKUP);
}
@Test
@Transactional
public void getAllPacksByNamePickupIsInShouldWork() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where namePickup in DEFAULT_NAME_PICKUP or UPDATED_NAME_PICKUP
defaultPackShouldBeFound("namePickup.in=" + DEFAULT_NAME_PICKUP + "," + UPDATED_NAME_PICKUP);
// Get all the packList where namePickup equals to UPDATED_NAME_PICKUP
defaultPackShouldNotBeFound("namePickup.in=" + UPDATED_NAME_PICKUP);
}
@Test
@Transactional
public void getAllPacksByNamePickupIsNullOrNotNull() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where namePickup is not null
defaultPackShouldBeFound("namePickup.specified=true");
// Get all the packList where namePickup is null
defaultPackShouldNotBeFound("namePickup.specified=false");
}
@Test
@Transactional
public void getAllPacksByDateReceivedIsEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where dateReceived equals to DEFAULT_DATE_RECEIVED
defaultPackShouldBeFound("dateReceived.equals=" + DEFAULT_DATE_RECEIVED);
// Get all the packList where dateReceived equals to UPDATED_DATE_RECEIVED
defaultPackShouldNotBeFound("dateReceived.equals=" + UPDATED_DATE_RECEIVED);
}
@Test
@Transactional
public void getAllPacksByDateReceivedIsInShouldWork() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where dateReceived in DEFAULT_DATE_RECEIVED or UPDATED_DATE_RECEIVED
defaultPackShouldBeFound("dateReceived.in=" + DEFAULT_DATE_RECEIVED + "," + UPDATED_DATE_RECEIVED);
// Get all the packList where dateReceived equals to UPDATED_DATE_RECEIVED
defaultPackShouldNotBeFound("dateReceived.in=" + UPDATED_DATE_RECEIVED);
}
@Test
@Transactional
public void getAllPacksByDateReceivedIsNullOrNotNull() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where dateReceived is not null
defaultPackShouldBeFound("dateReceived.specified=true");
// Get all the packList where dateReceived is null
defaultPackShouldNotBeFound("dateReceived.specified=false");
}
@Test
@Transactional
public void getAllPacksByDateReceivedIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where dateReceived greater than or equals to DEFAULT_DATE_RECEIVED
defaultPackShouldBeFound("dateReceived.greaterOrEqualThan=" + DEFAULT_DATE_RECEIVED);
// Get all the packList where dateReceived greater than or equals to UPDATED_DATE_RECEIVED
defaultPackShouldNotBeFound("dateReceived.greaterOrEqualThan=" + UPDATED_DATE_RECEIVED);
}
@Test
@Transactional
public void getAllPacksByDateReceivedIsLessThanSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where dateReceived less than or equals to DEFAULT_DATE_RECEIVED
defaultPackShouldNotBeFound("dateReceived.lessThan=" + DEFAULT_DATE_RECEIVED);
// Get all the packList where dateReceived less than or equals to UPDATED_DATE_RECEIVED
defaultPackShouldBeFound("dateReceived.lessThan=" + UPDATED_DATE_RECEIVED);
}
@Test
@Transactional
public void getAllPacksByDatePickupIsEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where datePickup equals to DEFAULT_DATE_PICKUP
defaultPackShouldBeFound("datePickup.equals=" + DEFAULT_DATE_PICKUP);
// Get all the packList where datePickup equals to UPDATED_DATE_PICKUP
defaultPackShouldNotBeFound("datePickup.equals=" + UPDATED_DATE_PICKUP);
}
@Test
@Transactional
public void getAllPacksByDatePickupIsInShouldWork() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where datePickup in DEFAULT_DATE_PICKUP or UPDATED_DATE_PICKUP
defaultPackShouldBeFound("datePickup.in=" + DEFAULT_DATE_PICKUP + "," + UPDATED_DATE_PICKUP);
// Get all the packList where datePickup equals to UPDATED_DATE_PICKUP
defaultPackShouldNotBeFound("datePickup.in=" + UPDATED_DATE_PICKUP);
}
@Test
@Transactional
public void getAllPacksByDatePickupIsNullOrNotNull() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where datePickup is not null
defaultPackShouldBeFound("datePickup.specified=true");
// Get all the packList where datePickup is null
defaultPackShouldNotBeFound("datePickup.specified=false");
}
@Test
@Transactional
public void getAllPacksByDatePickupIsGreaterThanOrEqualToSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where datePickup greater than or equals to DEFAULT_DATE_PICKUP
defaultPackShouldBeFound("datePickup.greaterOrEqualThan=" + DEFAULT_DATE_PICKUP);
// Get all the packList where datePickup greater than or equals to UPDATED_DATE_PICKUP
defaultPackShouldNotBeFound("datePickup.greaterOrEqualThan=" + UPDATED_DATE_PICKUP);
}
@Test
@Transactional
public void getAllPacksByDatePickupIsLessThanSomething() throws Exception {
// Initialize the database
packRepository.saveAndFlush(pack);
// Get all the packList where datePickup less than or equals to DEFAULT_DATE_PICKUP
defaultPackShouldNotBeFound("datePickup.lessThan=" + DEFAULT_DATE_PICKUP);
// Get all the packList where datePickup less than or equals to UPDATED_DATE_PICKUP
defaultPackShouldBeFound("datePickup.lessThan=" + UPDATED_DATE_PICKUP);
}
/**
* Executes the search, and checks that the default entity is returned
*/
private void defaultPackShouldBeFound(String filter) throws Exception {
restPackMockMvc.perform(get("/api/packs?sort=id,desc&" + filter))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(pack.getId().intValue())))
.andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME.toString())))
.andExpect(jsonPath("$.[*].nameFrontDeskReceive").value(hasItem(DEFAULT_NAME_FRONT_DESK_RECEIVE.toString())))
.andExpect(jsonPath("$.[*].nameFrontDeskDelivery").value(hasItem(DEFAULT_NAME_FRONT_DESK_DELIVERY.toString())))
.andExpect(jsonPath("$.[*].namePickup").value(hasItem(DEFAULT_NAME_PICKUP.toString())))
.andExpect(jsonPath("$.[*].dateReceived").value(hasItem(DEFAULT_DATE_RECEIVED.toString())))
.andExpect(jsonPath("$.[*].datePickup").value(hasItem(DEFAULT_DATE_PICKUP.toString())))
.andExpect(jsonPath("$.[*].pixelContentType").value(hasItem(DEFAULT_PIXEL_CONTENT_TYPE)))
.andExpect(jsonPath("$.[*].pixel").value(hasItem(Base64Utils.encodeToString(DEFAULT_PIXEL))));
// Check, that the count call also returns 1
restPackMockMvc.perform(get("/api/packs/count?sort=id,desc&" + filter))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(content().string("1"));
}
/**
* Executes the search, and checks that the default entity is not returned
*/
private void defaultPackShouldNotBeFound(String filter) throws Exception {
restPackMockMvc.perform(get("/api/packs?sort=id,desc&" + filter))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$").isArray())
.andExpect(jsonPath("$").isEmpty());
// Check, that the count call also returns 0
restPackMockMvc.perform(get("/api/packs/count?sort=id,desc&" + filter))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(content().string("0"));
}
@Test
@Transactional
public void getNonExistingPack() throws Exception {
// Get the pack
restPackMockMvc.perform(get("/api/packs/{id}", Long.MAX_VALUE))
.andExpect(status().isNotFound());
}
@Test
@Transactional
public void updatePack() throws Exception {
// Initialize the database
packService.save(pack);
// As the test used the service layer, reset the Elasticsearch mock repository
reset(mockPackSearchRepository);
int databaseSizeBeforeUpdate = packRepository.findAll().size();
// Update the pack
Pack updatedPack = packRepository.findById(pack.getId()).get();
// Disconnect from session so that the updates on updatedPack are not directly saved in db
em.detach(updatedPack);
updatedPack
.name(UPDATED_NAME)
.nameFrontDeskReceive(UPDATED_NAME_FRONT_DESK_RECEIVE)
.nameFrontDeskDelivery(UPDATED_NAME_FRONT_DESK_DELIVERY)
.namePickup(UPDATED_NAME_PICKUP)
.dateReceived(UPDATED_DATE_RECEIVED)
.datePickup(UPDATED_DATE_PICKUP)
.pixel(UPDATED_PIXEL)
.pixelContentType(UPDATED_PIXEL_CONTENT_TYPE);
restPackMockMvc.perform(put("/api/packs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(updatedPack)))
.andExpect(status().isOk());
// Validate the Pack in the database
List<Pack> packList = packRepository.findAll();
assertThat(packList).hasSize(databaseSizeBeforeUpdate);
Pack testPack = packList.get(packList.size() - 1);
assertThat(testPack.getName()).isEqualTo(UPDATED_NAME);
assertThat(testPack.getNameFrontDeskReceive()).isEqualTo(UPDATED_NAME_FRONT_DESK_RECEIVE);
assertThat(testPack.getNameFrontDeskDelivery()).isEqualTo(UPDATED_NAME_FRONT_DESK_DELIVERY);
assertThat(testPack.getNamePickup()).isEqualTo(UPDATED_NAME_PICKUP);
assertThat(testPack.getDateReceived()).isEqualTo(UPDATED_DATE_RECEIVED);
assertThat(testPack.getDatePickup()).isEqualTo(UPDATED_DATE_PICKUP);
assertThat(testPack.getPixel()).isEqualTo(UPDATED_PIXEL);
assertThat(testPack.getPixelContentType()).isEqualTo(UPDATED_PIXEL_CONTENT_TYPE);
// Validate the Pack in Elasticsearch
verify(mockPackSearchRepository, times(1)).save(testPack);
}
@Test
@Transactional
public void updateNonExistingPack() throws Exception {
int databaseSizeBeforeUpdate = packRepository.findAll().size();
// Create the Pack
// If the entity doesn't have an ID, it will throw BadRequestAlertException
restPackMockMvc.perform(put("/api/packs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(pack)))
.andExpect(status().isBadRequest());
// Validate the Pack in the database
List<Pack> packList = packRepository.findAll();
assertThat(packList).hasSize(databaseSizeBeforeUpdate);
// Validate the Pack in Elasticsearch
verify(mockPackSearchRepository, times(0)).save(pack);
}
@Test
@Transactional
public void deletePack() throws Exception {
// Initialize the database
packService.save(pack);
int databaseSizeBeforeDelete = packRepository.findAll().size();
// Get the pack
restPackMockMvc.perform(delete("/api/packs/{id}", pack.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isOk());
// Validate the database is empty
List<Pack> packList = packRepository.findAll();
assertThat(packList).hasSize(databaseSizeBeforeDelete - 1);
// Validate the Pack in Elasticsearch
verify(mockPackSearchRepository, times(1)).deleteById(pack.getId());
}
@Test
@Transactional
public void searchPack() throws Exception {
// Initialize the database
packService.save(pack);
when(mockPackSearchRepository.search(queryStringQuery("id:" + pack.getId())))
.thenReturn(Collections.singletonList(pack));
// Search the pack
restPackMockMvc.perform(get("/api/_search/packs?query=id:" + pack.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(pack.getId().intValue())))
.andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME)))
.andExpect(jsonPath("$.[*].nameFrontDeskReceive").value(hasItem(DEFAULT_NAME_FRONT_DESK_RECEIVE)))
.andExpect(jsonPath("$.[*].nameFrontDeskDelivery").value(hasItem(DEFAULT_NAME_FRONT_DESK_DELIVERY)))
.andExpect(jsonPath("$.[*].namePickup").value(hasItem(DEFAULT_NAME_PICKUP)))
.andExpect(jsonPath("$.[*].dateReceived").value(hasItem(DEFAULT_DATE_RECEIVED.toString())))
.andExpect(jsonPath("$.[*].datePickup").value(hasItem(DEFAULT_DATE_PICKUP.toString())))
.andExpect(jsonPath("$.[*].pixelContentType").value(hasItem(DEFAULT_PIXEL_CONTENT_TYPE)))
.andExpect(jsonPath("$.[*].pixel").value(hasItem(Base64Utils.encodeToString(DEFAULT_PIXEL))));
}
@Test
@Transactional
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(Pack.class);
Pack pack1 = new Pack();
pack1.setId(1L);
Pack pack2 = new Pack();
pack2.setId(pack1.getId());
assertThat(pack1).isEqualTo(pack2);
pack2.setId(2L);
assertThat(pack1).isNotEqualTo(pack2);
pack1.setId(null);
assertThat(pack1).isNotEqualTo(pack2);
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
a83fbb64ade012aa591d0b02a5f91c2bb6a43318
|
995cfd25d8c75fb933a0e82b71c961c18a861d65
|
/src/leetcode/adt/ListNode.java
|
2633122b86f46d39bd016e258120161bc056523f
|
[] |
no_license
|
chend0316/leetcode
|
559f78580eb9907fb3ee548cbd3a5f35115ecbb3
|
a627780cd410e7cced108d54ee13aa3d34a51e3b
|
refs/heads/master
| 2023-07-10T09:56:28.038307
| 2021-08-25T16:45:26
| 2021-08-25T16:45:26
| 231,183,391
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,016
|
java
|
package leetcode.adt;
import leetcode.utils.ArrayUtils;
public class ListNode {
public int val;
public ListNode next;
public ListNode() {}
public ListNode(int val) {
this.val = val;
}
public ListNode(int val, ListNode next) {
this.val = val;
this.next = next;
}
public static ListNode from(int[] arr) {
ListNode dummy = new ListNode();
ListNode prev = dummy;
for (int a : arr) {
prev.next = new ListNode(a);
prev = prev.next;
}
return dummy.next;
}
public static ListNode from(String str) {
return from(ArrayUtils.from(str));
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
ListNode p = this;
while (p != null) {
if (p != this) sb.append(",");
sb.append(p.val);
p = p.next;
}
sb.append("]");
return sb.toString();
}
}
|
[
"chendong0316@163.com"
] |
chendong0316@163.com
|
77233425cdbc12b675cf8b3ad0db166e077a8716
|
087e91c98fd1627ec74bba5711f2309aa09bd781
|
/ReLearn.java
|
d647edb40a917ed774f72fd8e124479469328c1b
|
[] |
no_license
|
fatimazali/geoPool-game
|
4913bee4966a83bd87d6cd2e4b30487ec2721839
|
ab983c99afd64e7016f66b60490aa0e0839c8a14
|
refs/heads/master
| 2020-04-25T07:38:23.530076
| 2019-02-26T02:13:33
| 2019-02-26T02:13:33
| 172,620,119
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 657
|
java
|
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import javax.imageio.ImageIO;
public class ReLearn extends JPanel
{
private Image statImage;
private String statStr;
public ReLearn()
{
statImage = null;
statStr = "ReLearn.png";
getMyImage();
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawImage(statImage, 0, 0, 1300, 700, this);
}
public void getMyImage()
{
try
{
statImage = ImageIO.read(new File(statStr));
}
catch (IOException e)
{
System.err.println("\n\nYour picture(s) can't be found.\n\n");
e.printStackTrace();
}
}
}
|
[
"alifatima168@gmail.com"
] |
alifatima168@gmail.com
|
2e355891acd56a26fee86da81cf81f1ac271a820
|
57005ceb2e04fa88bc27c68c1c4f930968ce3569
|
/target/generated-sources/protobuf/java/org/tensorflow/framework/GraphTransferNodeInfo.java
|
2111c8d96762baecaaecbe3a3ed40dba9a6027fb
|
[] |
no_license
|
tuhucon/gateway
|
5cb2636f2f45bbadae2d16570e4cd3a88f3efb00
|
ef5dc062322e85dbfb3138dc067ead836ce5e7e1
|
refs/heads/master
| 2020-06-05T17:52:29.680165
| 2019-09-26T03:03:35
| 2019-09-26T03:03:35
| 192,502,405
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| true
| 28,106
|
java
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/graph_transfer_info.proto
package org.tensorflow.framework;
/**
* Protobuf type {@code tensorflow.GraphTransferNodeInfo}
*/
public final class GraphTransferNodeInfo extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeInfo)
GraphTransferNodeInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use GraphTransferNodeInfo.newBuilder() to construct.
private GraphTransferNodeInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private GraphTransferNodeInfo() {
name_ = "";
typeName_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private GraphTransferNodeInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 16: {
nodeId_ = input.readInt32();
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
typeName_ = s;
break;
}
case 32: {
socOpId_ = input.readInt32();
break;
}
case 40: {
paddingId_ = input.readInt32();
break;
}
case 48: {
inputCount_ = input.readInt32();
break;
}
case 56: {
outputCount_ = input.readInt32();
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 org.tensorflow.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.GraphTransferNodeInfo.class, org.tensorflow.framework.GraphTransferNodeInfo.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* <code>string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* <code>string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int NODE_ID_FIELD_NUMBER = 2;
private int nodeId_;
/**
* <code>int32 node_id = 2;</code>
*/
public int getNodeId() {
return nodeId_;
}
public static final int TYPE_NAME_FIELD_NUMBER = 3;
private volatile java.lang.Object typeName_;
/**
* <code>string type_name = 3;</code>
*/
public java.lang.String getTypeName() {
java.lang.Object ref = typeName_;
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();
typeName_ = s;
return s;
}
}
/**
* <code>string type_name = 3;</code>
*/
public com.google.protobuf.ByteString
getTypeNameBytes() {
java.lang.Object ref = typeName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
typeName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SOC_OP_ID_FIELD_NUMBER = 4;
private int socOpId_;
/**
* <code>int32 soc_op_id = 4;</code>
*/
public int getSocOpId() {
return socOpId_;
}
public static final int PADDING_ID_FIELD_NUMBER = 5;
private int paddingId_;
/**
* <code>int32 padding_id = 5;</code>
*/
public int getPaddingId() {
return paddingId_;
}
public static final int INPUT_COUNT_FIELD_NUMBER = 6;
private int inputCount_;
/**
* <code>int32 input_count = 6;</code>
*/
public int getInputCount() {
return inputCount_;
}
public static final int OUTPUT_COUNT_FIELD_NUMBER = 7;
private int outputCount_;
/**
* <code>int32 output_count = 7;</code>
*/
public int getOutputCount() {
return outputCount_;
}
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 (nodeId_ != 0) {
output.writeInt32(2, nodeId_);
}
if (!getTypeNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, typeName_);
}
if (socOpId_ != 0) {
output.writeInt32(4, socOpId_);
}
if (paddingId_ != 0) {
output.writeInt32(5, paddingId_);
}
if (inputCount_ != 0) {
output.writeInt32(6, inputCount_);
}
if (outputCount_ != 0) {
output.writeInt32(7, outputCount_);
}
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 (nodeId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, nodeId_);
}
if (!getTypeNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, typeName_);
}
if (socOpId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, socOpId_);
}
if (paddingId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(5, paddingId_);
}
if (inputCount_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, inputCount_);
}
if (outputCount_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(7, outputCount_);
}
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 org.tensorflow.framework.GraphTransferNodeInfo)) {
return super.equals(obj);
}
org.tensorflow.framework.GraphTransferNodeInfo other = (org.tensorflow.framework.GraphTransferNodeInfo) obj;
if (!getName()
.equals(other.getName())) return false;
if (getNodeId()
!= other.getNodeId()) return false;
if (!getTypeName()
.equals(other.getTypeName())) return false;
if (getSocOpId()
!= other.getSocOpId()) return false;
if (getPaddingId()
!= other.getPaddingId()) return false;
if (getInputCount()
!= other.getInputCount()) return false;
if (getOutputCount()
!= other.getOutputCount()) 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) + NODE_ID_FIELD_NUMBER;
hash = (53 * hash) + getNodeId();
hash = (37 * hash) + TYPE_NAME_FIELD_NUMBER;
hash = (53 * hash) + getTypeName().hashCode();
hash = (37 * hash) + SOC_OP_ID_FIELD_NUMBER;
hash = (53 * hash) + getSocOpId();
hash = (37 * hash) + PADDING_ID_FIELD_NUMBER;
hash = (53 * hash) + getPaddingId();
hash = (37 * hash) + INPUT_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getInputCount();
hash = (37 * hash) + OUTPUT_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getOutputCount();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.tensorflow.framework.GraphTransferNodeInfo parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.GraphTransferNodeInfo parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.GraphTransferNodeInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.GraphTransferNodeInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.GraphTransferNodeInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.GraphTransferNodeInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.GraphTransferNodeInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.GraphTransferNodeInfo 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 org.tensorflow.framework.GraphTransferNodeInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.tensorflow.framework.GraphTransferNodeInfo 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 org.tensorflow.framework.GraphTransferNodeInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.GraphTransferNodeInfo 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(org.tensorflow.framework.GraphTransferNodeInfo prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code tensorflow.GraphTransferNodeInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeInfo)
org.tensorflow.framework.GraphTransferNodeInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.GraphTransferNodeInfo.class, org.tensorflow.framework.GraphTransferNodeInfo.Builder.class);
}
// Construct using org.tensorflow.framework.GraphTransferNodeInfo.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_ = "";
nodeId_ = 0;
typeName_ = "";
socOpId_ = 0;
paddingId_ = 0;
inputCount_ = 0;
outputCount_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.tensorflow.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor;
}
@java.lang.Override
public org.tensorflow.framework.GraphTransferNodeInfo getDefaultInstanceForType() {
return org.tensorflow.framework.GraphTransferNodeInfo.getDefaultInstance();
}
@java.lang.Override
public org.tensorflow.framework.GraphTransferNodeInfo build() {
org.tensorflow.framework.GraphTransferNodeInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.tensorflow.framework.GraphTransferNodeInfo buildPartial() {
org.tensorflow.framework.GraphTransferNodeInfo result = new org.tensorflow.framework.GraphTransferNodeInfo(this);
result.name_ = name_;
result.nodeId_ = nodeId_;
result.typeName_ = typeName_;
result.socOpId_ = socOpId_;
result.paddingId_ = paddingId_;
result.inputCount_ = inputCount_;
result.outputCount_ = outputCount_;
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 org.tensorflow.framework.GraphTransferNodeInfo) {
return mergeFrom((org.tensorflow.framework.GraphTransferNodeInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.tensorflow.framework.GraphTransferNodeInfo other) {
if (other == org.tensorflow.framework.GraphTransferNodeInfo.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.getNodeId() != 0) {
setNodeId(other.getNodeId());
}
if (!other.getTypeName().isEmpty()) {
typeName_ = other.typeName_;
onChanged();
}
if (other.getSocOpId() != 0) {
setSocOpId(other.getSocOpId());
}
if (other.getPaddingId() != 0) {
setPaddingId(other.getPaddingId());
}
if (other.getInputCount() != 0) {
setInputCount(other.getInputCount());
}
if (other.getOutputCount() != 0) {
setOutputCount(other.getOutputCount());
}
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 {
org.tensorflow.framework.GraphTransferNodeInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.tensorflow.framework.GraphTransferNodeInfo) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
* <code>string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string name = 1;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* <code>string name = 1;</code>
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>string name = 1;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private int nodeId_ ;
/**
* <code>int32 node_id = 2;</code>
*/
public int getNodeId() {
return nodeId_;
}
/**
* <code>int32 node_id = 2;</code>
*/
public Builder setNodeId(int value) {
nodeId_ = value;
onChanged();
return this;
}
/**
* <code>int32 node_id = 2;</code>
*/
public Builder clearNodeId() {
nodeId_ = 0;
onChanged();
return this;
}
private java.lang.Object typeName_ = "";
/**
* <code>string type_name = 3;</code>
*/
public java.lang.String getTypeName() {
java.lang.Object ref = typeName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
typeName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string type_name = 3;</code>
*/
public com.google.protobuf.ByteString
getTypeNameBytes() {
java.lang.Object ref = typeName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
typeName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string type_name = 3;</code>
*/
public Builder setTypeName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
typeName_ = value;
onChanged();
return this;
}
/**
* <code>string type_name = 3;</code>
*/
public Builder clearTypeName() {
typeName_ = getDefaultInstance().getTypeName();
onChanged();
return this;
}
/**
* <code>string type_name = 3;</code>
*/
public Builder setTypeNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
typeName_ = value;
onChanged();
return this;
}
private int socOpId_ ;
/**
* <code>int32 soc_op_id = 4;</code>
*/
public int getSocOpId() {
return socOpId_;
}
/**
* <code>int32 soc_op_id = 4;</code>
*/
public Builder setSocOpId(int value) {
socOpId_ = value;
onChanged();
return this;
}
/**
* <code>int32 soc_op_id = 4;</code>
*/
public Builder clearSocOpId() {
socOpId_ = 0;
onChanged();
return this;
}
private int paddingId_ ;
/**
* <code>int32 padding_id = 5;</code>
*/
public int getPaddingId() {
return paddingId_;
}
/**
* <code>int32 padding_id = 5;</code>
*/
public Builder setPaddingId(int value) {
paddingId_ = value;
onChanged();
return this;
}
/**
* <code>int32 padding_id = 5;</code>
*/
public Builder clearPaddingId() {
paddingId_ = 0;
onChanged();
return this;
}
private int inputCount_ ;
/**
* <code>int32 input_count = 6;</code>
*/
public int getInputCount() {
return inputCount_;
}
/**
* <code>int32 input_count = 6;</code>
*/
public Builder setInputCount(int value) {
inputCount_ = value;
onChanged();
return this;
}
/**
* <code>int32 input_count = 6;</code>
*/
public Builder clearInputCount() {
inputCount_ = 0;
onChanged();
return this;
}
private int outputCount_ ;
/**
* <code>int32 output_count = 7;</code>
*/
public int getOutputCount() {
return outputCount_;
}
/**
* <code>int32 output_count = 7;</code>
*/
public Builder setOutputCount(int value) {
outputCount_ = value;
onChanged();
return this;
}
/**
* <code>int32 output_count = 7;</code>
*/
public Builder clearOutputCount() {
outputCount_ = 0;
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:tensorflow.GraphTransferNodeInfo)
}
// @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeInfo)
private static final org.tensorflow.framework.GraphTransferNodeInfo DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.tensorflow.framework.GraphTransferNodeInfo();
}
public static org.tensorflow.framework.GraphTransferNodeInfo getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<GraphTransferNodeInfo>
PARSER = new com.google.protobuf.AbstractParser<GraphTransferNodeInfo>() {
@java.lang.Override
public GraphTransferNodeInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new GraphTransferNodeInfo(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<GraphTransferNodeInfo> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<GraphTransferNodeInfo> getParserForType() {
return PARSER;
}
@java.lang.Override
public org.tensorflow.framework.GraphTransferNodeInfo getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
|
[
"minhtuan93@yahoo.com"
] |
minhtuan93@yahoo.com
|
1be7b97722a55e66f0198633c97021a3d82de558
|
f8821f30919c6a9bc1286dbe8899582f6029e1cd
|
/Tarea 6/4inrow/src/pkg4inrow/Gui.java
|
f6fb1856d8ea1b72d9174c2f489a2b0f49db48e1
|
[] |
no_license
|
tonymarchena26/Extraclass
|
f25e39abf8690f9e120788751558a6aca53e1b24
|
841d0864456fd54ec26b941c1b6c5184dbfc91c1
|
refs/heads/master
| 2021-08-02T07:50:10.561183
| 2021-07-27T23:46:10
| 2021-07-27T23:46:10
| 136,692,192
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 9,726
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkg4inrow;
/**
*
* @author human
*/
public class Gui extends javax.swing.JFrame {
GameLogic gl = new GameLogic();
/**
* Creates new form Gui
*/
public Gui() {
initComponents();
}
/**
* 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() {
btn_c1 = new javax.swing.JButton();
btn_c2 = new javax.swing.JButton();
btn_c3 = new javax.swing.JButton();
btn_c4 = new javax.swing.JButton();
btn_c5 = new javax.swing.JButton();
btn_c6 = new javax.swing.JButton();
btn_c7 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
txtArea_tablero = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
btn_c1.setText("C1");
btn_c1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_c1ActionPerformed(evt);
}
});
btn_c2.setText("C2");
btn_c2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_c2ActionPerformed(evt);
}
});
btn_c3.setText("C3");
btn_c3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_c3ActionPerformed(evt);
}
});
btn_c4.setText("C4");
btn_c4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_c4ActionPerformed(evt);
}
});
btn_c5.setText("C5");
btn_c5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_c5ActionPerformed(evt);
}
});
btn_c6.setText("C6");
btn_c6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_c6ActionPerformed(evt);
}
});
btn_c7.setText("C7");
btn_c7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_c7ActionPerformed(evt);
}
});
txtArea_tablero.setColumns(20);
txtArea_tablero.setRows(5);
jScrollPane1.setViewportView(txtArea_tablero);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane1)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(btn_c1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_c2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_c3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_c4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_c5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_c6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_c7)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btn_c1)
.addComponent(btn_c2)
.addComponent(btn_c3)
.addComponent(btn_c4)
.addComponent(btn_c5)
.addComponent(btn_c6)
.addComponent(btn_c7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)
.addGap(12, 12, 12))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btn_c1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_c1ActionPerformed
// TODO add your handling code here:}
gl.turno(0);
txtArea_tablero.setText(gl.getTablero());
}//GEN-LAST:event_btn_c1ActionPerformed
private void btn_c2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_c2ActionPerformed
// TODO add your handling code here:
gl.turno(1);
txtArea_tablero.setText(gl.getTablero());
}//GEN-LAST:event_btn_c2ActionPerformed
private void btn_c3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_c3ActionPerformed
// TODO add your handling code here:
gl.turno(2);
txtArea_tablero.setText(gl.getTablero());
}//GEN-LAST:event_btn_c3ActionPerformed
private void btn_c4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_c4ActionPerformed
// TODO add your handling code here:
gl.turno(3);
txtArea_tablero.setText(gl.getTablero());
}//GEN-LAST:event_btn_c4ActionPerformed
private void btn_c5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_c5ActionPerformed
// TODO add your handling code here:
gl.turno(4);
txtArea_tablero.setText(gl.getTablero());
}//GEN-LAST:event_btn_c5ActionPerformed
private void btn_c6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_c6ActionPerformed
// TODO add your handling code here:
gl.turno(5);
txtArea_tablero.setText(gl.getTablero());
}//GEN-LAST:event_btn_c6ActionPerformed
private void btn_c7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_c7ActionPerformed
// TODO add your handling code here:
gl.turno(6);
txtArea_tablero.setText(gl.getTablero());
}//GEN-LAST:event_btn_c7ActionPerformed
/**
* @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(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Gui.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 Gui().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btn_c1;
private javax.swing.JButton btn_c2;
private javax.swing.JButton btn_c3;
private javax.swing.JButton btn_c4;
private javax.swing.JButton btn_c5;
private javax.swing.JButton btn_c6;
private javax.swing.JButton btn_c7;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea txtArea_tablero;
// End of variables declaration//GEN-END:variables
}
|
[
"39474827+tonymarchena26@users.noreply.github.com"
] |
39474827+tonymarchena26@users.noreply.github.com
|
4962d9f8c9f4b323790aa9f6116c86cf75c4bbb2
|
1abdf4db945a04ab39e5eb6b7e30eb4cb91b2376
|
/src/Command.java
|
1bb08e8b7415f5aed4dd2e42c9eb2275747e9572
|
[] |
no_license
|
CameronJett/TextAdventure
|
b9ad03261fd064caf8f34da0d53ee213651c0f55
|
7b496c5dbba97507a7c1a3b17f7e7f25056fc66f
|
refs/heads/master
| 2021-09-05T06:27:20.528451
| 2018-01-24T20:02:10
| 2018-01-24T20:02:10
| 96,140,114
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 77
|
java
|
public interface Command {
Dialog getResponse(Room room, String name);
}
|
[
"jett.18@osu.edu"
] |
jett.18@osu.edu
|
d2531c17e467df4ecf8ccc3a8f45c1b553ccf392
|
5469da81b14655e1cdaba7a0f7deb924559b446a
|
/flashcard-service/src/main/java/com/revature/messaging/Operation.java
|
360021ecde477c66a9b1c47dba1bf11f3ae0e57f
|
[] |
no_license
|
201026java/demos
|
b1e52660404feb562aa28eea0ecedbf58b753e7d
|
ae982d8d5a0d061aea61469d81d7d8bb91825f89
|
refs/heads/main
| 2023-01-02T15:47:57.472826
| 2020-10-30T16:02:11
| 2020-10-30T16:02:11
| 307,390,939
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 83
|
java
|
package com.revature.messaging;
public enum Operation {
CREATE, DELETE, UPDATE
}
|
[
"moberlies1337@gmail.com"
] |
moberlies1337@gmail.com
|
d82a7ab8f3a941e61e5a3e6ef5ab1b1ded393402
|
8f3b0f7e153c16ab4df921cbb3fd1317c8b578d8
|
/src/main/java/wxclient/SocketClient.java
|
d5814e4444d042a35b532ad37861ae795c3aed10
|
[] |
no_license
|
cansou/chat
|
b371be239c377d9685bcd713b6b9e2443d2bd126
|
227203ade36aeeb394269c2f5136319006781592
|
refs/heads/master
| 2020-09-09T23:21:53.042368
| 2018-10-23T12:02:46
| 2018-10-23T12:02:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,590
|
java
|
package wxclient;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.timeout.IdleStateHandler;
import lombok.extern.slf4j.Slf4j;
import java.net.InetSocketAddress;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
@Slf4j
public class SocketClient {
public interface OnReconnectListener {
void onReconnect();
}
public interface MsgListener {
void onNewMessage();
}
private String ip;
private int port;
private Channel channel = null;
private static final EventLoopGroup eventLoopGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 4);
private OnReconnectListener onReconnectListener = null;
private ConcurrentHashMap<Integer, CallBack> backs = new ConcurrentHashMap<Integer, CallBack>();
private ChannelFutureListener channelFutureListener;
private ChannelFuture connectFuture;
private ClientHandler handler;
private Bootstrap bootstrap;
private boolean needSecond;
private boolean destroying;
public SocketClient(String longServerIp, int port, OnReconnectListener reconnectListener, MsgListener msgListener) {
this.ip = longServerIp;
this.port = port;
this.onReconnectListener = reconnectListener;
channelFutureListener = cf -> {
if (cf.isSuccess()) {
channel = cf.channel();
if (needSecond && reconnectListener != null) {
onReconnectListener.onReconnect();
}
needSecond = true;
} else {
cf.channel().eventLoop().schedule(() -> doConnect(), 1, TimeUnit.SECONDS);
}
};
handler = new ClientHandler(this, new ClientHandler.MsgCallBack() {
@Override
public void msgCallBack(int req, byte[] data) {
invokeCallBack(req, data);
}
@Override
public void newMsgCallBack() {
msgListener.onNewMessage();
}
});
createBootstrap();
}
protected synchronized void invokeCallBack(int resSeq, byte[] pkgs) {
try {
if (resSeq == 0) {
} else {
CallBack call = backs.remove(resSeq);
if (call != null) {
call.onData(pkgs);
}
}
} catch (Exception e) {
}
}
public void createBootstrap() {
bootstrap = new Bootstrap();
bootstrap.group(eventLoopGroup);
bootstrap.channel(NioSocketChannel.class);
bootstrap.option(ChannelOption.SO_KEEPALIVE, true);
bootstrap.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1000);
bootstrap.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel socketChannel) {
socketChannel.pipeline().addLast(handler);
socketChannel.pipeline().addLast(new IdleStateHandler(1000, 1000, 1000, TimeUnit.MILLISECONDS));
}
});
doConnect();
}
public void doConnect() {
if (destroying) {
return;
}
if (connectFuture != null) {
connectFuture.cancel(true);
connectFuture = null;
}
connectFuture = bootstrap.connect(new InetSocketAddress(ip, port));
connectFuture.addListener(channelFutureListener);
}
public synchronized void asynSend(byte[] sendBuff, CallBack back) {
try {
while (channel == null) {
wait(1);
}
// 获取请求标识
int reqSeq = CommonUtil.byteArrayToInt(sendBuff, 12);
backs.put(reqSeq, back);
ByteBuf buf = channel.alloc().buffer(sendBuff.length);
buf.writeBytes(sendBuff);
channel.writeAndFlush(buf);
} catch (Exception e) {
e.printStackTrace();
}
}
public synchronized void end() {
destroying = true;
if (channel != null) {
channel.close();
channel = null;
}
if (connectFuture != null) {
connectFuture.cancel(true);
}
}
}
|
[
"lj19960212"
] |
lj19960212
|
2c22915e37215d8c6bf0e03bf82e16a2aeac9d84
|
89407bdb1fee50767b4ad3ba4db4c04e7fb373d5
|
/src/main/java/com/example/demo/Entities/UniversityEntity.java
|
6868c3472ed68dd2d378a2dbfde53b21a083ce01
|
[
"MIT"
] |
permissive
|
joelbarmettlerUZH/Spring_Boot_Demo
|
373be7f0cc09ad10c2cec025341992d1cf3c3cc9
|
7f908127a926358b6a136082ecf605716a48ef51
|
refs/heads/master
| 2021-05-25T11:08:50.177883
| 2020-07-03T16:22:09
| 2020-07-03T16:22:09
| 127,212,690
| 4
| 1
|
MIT
| 2018-04-02T14:29:04
| 2018-03-29T00:00:49
|
Java
|
UTF-8
|
Java
| false
| false
| 1,177
|
java
|
package com.example.demo.Entities;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "UNIVERSITY")
public class UniversityEntity {
@Id
@Column(name = "NAME")
private String name;
@Column(name = "NUMBEROFSTUDENTS")
private int numberOfStudents;
@JsonIgnore
@Column(name = "SEMESTERCOSTS")
private int semesterCosts;
public UniversityEntity(String name, int numberOfStudents, int semesterCosts){
this.name = name;
this.numberOfStudents = numberOfStudents;
this.semesterCosts = semesterCosts;
}
public UniversityEntity(){}
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public int getNumberOfStudents() { return numberOfStudents; }
public void setNumberOfStudents(int numberOfStudents) { this.numberOfStudents = numberOfStudents; }
public int getSemesterCosts() { return semesterCosts; }
public void setSemesterCosts(int semesterCosts ) { this.semesterCosts = semesterCosts; }
}
|
[
"joel.barmettler@uzh.ch"
] |
joel.barmettler@uzh.ch
|
81eff6623729e79669fd7a4e36b5931cb79969fc
|
2abd14428fd468f9b97c9db3231903a837ea028d
|
/app/src/main/java/com/wentongwang/mysports/widget/views/WheelRecycle.java
|
87c4950cb25b2f0546bac9ad7c1ef6bbe88aac9c
|
[] |
no_license
|
NicolasLYU/GoSports_Android
|
b395ba4e423ed1bb7f366a448d2ba5082733f54d
|
55a13cca8d57f971ef9ee3e5b82b4fc776bd2185
|
refs/heads/master
| 2021-09-06T21:15:44.801336
| 2018-02-11T14:13:39
| 2018-02-11T14:13:39
| 112,522,301
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,714
|
java
|
/*
* Android Wheel Control.
* https://code.google.com/p/android-wheel/
*
* Copyright 2011 Yuri Kanivets
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wentongwang.mysports.widget.views;
import android.view.View;
import android.widget.LinearLayout;
import java.util.LinkedList;
import java.util.List;
/**
* Recycle stores wheel items to reuse.
*/
public class WheelRecycle {
// Cached items
private List<View> items;
// Cached empty items
private List<View> emptyItems;
// Wheel view
private WheelView wheel;
/**
* Constructor
*
* @param wheel
* the wheel view
*/
public WheelRecycle(WheelView wheel) {
this.wheel = wheel;
}
/**
* Recycles items from specified layout. There are saved only items not
* included to specified range. All the cached items are removed from
* original layout.
*
* @param layout
* the layout containing items to be cached
* @param firstItem
* the number of first item in layout
* @param range
* the range of current wheel items
* @return the new value of first item number
*/
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
int index = firstItem;
for (int i = 0; i < layout.getChildCount();) {
if (!range.contains(index)) {
recycleView(layout.getChildAt(i), index);
layout.removeViewAt(i);
if (i == 0) { // first item
firstItem++;
}
} else {
i++; // go to next item
}
index++;
}
return firstItem;
}
/**
* Gets item view
*
* @return the cached view
*/
public View getItem() {
return getCachedView(items);
}
/**
* Gets empty item view
*
* @return the cached empty view
*/
public View getEmptyItem() {
return getCachedView(emptyItems);
}
/**
* Clears all views
*/
public void clearAll() {
if (items != null) {
items.clear();
}
if (emptyItems != null) {
emptyItems.clear();
}
}
/**
* Adds view to specified cache. Creates a cache list if it is null.
*
* @param view
* the view to be cached
* @param cache
* the cache list
* @return the cache list
*/
private List<View> addView(View view, List<View> cache) {
if (cache == null) {
cache = new LinkedList<View>();
}
cache.add(view);
return cache;
}
/**
* Adds view to cache. Determines view type (item view or empty one) by
* index.
*
* @param view
* the view to be cached
* @param index
* the index of view
*/
private void recycleView(View view, int index) {
int count = wheel.getViewAdapter().getItemsCount();
if ((index < 0 || index >= count) && !wheel.isCyclic()) {
// empty view
emptyItems = addView(view, emptyItems);
} else {
while (index < 0) {
index = count + index;
}
index %= count;
items = addView(view, items);
}
}
/**
* Gets view from specified cache.
*
* @param cache
* the cache
* @return the first view from cache.
*/
private View getCachedView(List<View> cache) {
if (cache != null && cache.size() > 0) {
View view = cache.get(0);
cache.remove(0);
return view;
}
return null;
}
}
|
[
"396121541@qq.com"
] |
396121541@qq.com
|
fa8a337c03281fe10c31082208d566ebe0bd3d77
|
b070e1467b420077ee45c6961bcf620c329cda6c
|
/src/main/java/com/project/three/examonline/controller/PaperController.java
|
5a6aeadf1314bc29ba4ca588c0778f4ad7248e02
|
[] |
no_license
|
1172700309/Exam_online
|
e314d41288b8e6db960bc670177070c37d90f85b
|
a16b54c8932667596d30ea8c3333383715a47ebf
|
refs/heads/master
| 2020-06-27T06:30:33.315328
| 2019-07-31T14:01:33
| 2019-07-31T14:01:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,428
|
java
|
package com.project.three.examonline.controller;
import com.project.three.examonline.domain.Paper;
import com.project.three.examonline.service.PaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;
/**
* 这是类的paper功能的控制器,实现增删改试卷功能.
*/
@Controller
@RequestMapping("/paper")
public class PaperController {
@Autowired
private PaperService paperService;
/**
* insert a paper.
* 先判断这个试卷的是否有输入科目, 有则插入,跳转到成功界面,反之,跳转到失败界面(原界面)并提示。
* @param courseId 试卷科目
* @return 插入,跳转到成功界面,反之,跳转到失败界面(原界面)并提示。
*/
@RequestMapping(value = "/insert", method = RequestMethod.GET)
@ResponseBody
public String insertPaper(String courseId){
if(courseId!=null&& !courseId.equals("0")){
Paper paper = new Paper(null, 100, 60, null, Integer.valueOf(courseId));
if(paperService.queryPaper(paper)!=null&&paperService.queryPaper(paper).size()==1){
paperService.insertPaper(paper);
return "paperInsertSuccess";
}
}
return "paperInsertFailed";
}
/**
* 删除一个试卷
* 先判断这个试卷的是否有输入科目和试卷id, 有则删除,跳转到成功界面,反之,跳转到失败界面(原界面)并提示。
* @param id 试卷id
* @return 删除成功,跳转到成功界面,反之,跳转到失败界面(原界面)并提示。
*/
@RequestMapping("/delete")
@ResponseBody
public String deletePaper(Integer id) {
if(id!=null&&id!=0){
/*Paper paper = new Paper(id, null,null,null,null);
if(paperService.queryPaper(paper)!=null&&paperService.queryPaper(paper).size()==1){
paperService.deletePaper(paper);
return "paperDeleteSuccess";
}*/
return "paperDeleteSuccess";
}
return "paperDeleteFailed";
}
/**
* 更新试卷.
* 依据id,重新出题.
* @param id 试卷的Id
* @param courseId 课程的id
* @return id 已经存在,重新出题返回成功界面,反之,返回失败界面.
*/
@RequestMapping(value = "/update", method = RequestMethod.GET)
@ResponseBody
public String update(Integer id, Integer courseId){
if(id!=null&&id!=0&&courseId!=null&&courseId!=0){
Paper paper = new Paper(id, 100, 60, null, courseId);
/*List<Paper> paperList = paperService.queryPaper(paper);
if(paperList!=null&&paperList.size()==1){
paperService.updatePaper(paper);
//TODO:更新部分
return "paperUpdateSuccess";
}*/
return "paperUpdateSuccess";
}
return "paperUpdateFailed";
}
/**
* 获取全部的papper
* @return 全部的paper
*/
@RequestMapping(value = "/getAllPaper", method = RequestMethod.GET)
@ResponseBody
public List<Paper> getAllPaper(){
Paper paper = new Paper();
/*
List<Paper> papers = paperService.queryPaper(paper);
*/
List<Paper> papers = new ArrayList<>();
papers.add(new Paper(1, 100, 60, null, 2));
return papers;
}
}
|
[
"47682383+jamsonlee@users.noreply.github.com"
] |
47682383+jamsonlee@users.noreply.github.com
|
3055544b88a4131c73939f8dc47e62c6614b1f75
|
30a60736cb404b7fd1ac8e7dd905a8cd0feb4d4b
|
/src/main/java/com/agency04/sbss/pizza/repository/DeliveryRepository.java
|
de2c57a9bd72c5bfa742811eb3afe550b13312fa
|
[] |
no_license
|
aidaom17/Pizza-Delivery-App
|
3cd565d17e2b085304d5ee5c68d4d659acd054f8
|
44381060b8aa276d03deaf02b2d4e15aed154e45
|
refs/heads/master
| 2023-07-08T06:20:52.741975
| 2021-08-20T07:35:16
| 2021-08-20T07:35:16
| 387,723,784
| 0
| 1
| null | 2021-08-20T07:35:17
| 2021-07-20T08:25:02
|
Java
|
UTF-8
|
Java
| false
| false
| 238
|
java
|
package com.agency04.sbss.pizza.repository;
import com.agency04.sbss.pizza.model.impl.Delivery;
import org.springframework.data.jpa.repository.JpaRepository;
public interface DeliveryRepository extends JpaRepository<Delivery, Long> {
}
|
[
"aida.omanovic7@gmail.com"
] |
aida.omanovic7@gmail.com
|
db99a3a693e1457f1cc06b2693d9a602c62c4e69
|
f6e1017382db94458d573a53a4815a152e6285e7
|
/VisualStudioCode/11Interface/Truck.java
|
491d2dcf46bd8463ac184e1d578f24dbf34bc27e
|
[] |
no_license
|
ApexTone/JavaLearningResources
|
bd80c8ed75b9ee77059c727c80517b5426959cf4
|
423112dba97a3f6204c11d24b97d5087ff45b2f1
|
refs/heads/master
| 2020-12-03T12:05:27.283461
| 2020-03-13T09:18:52
| 2020-03-13T09:18:52
| 231,309,133
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 181
|
java
|
public class Truck implements Vehicle{
@Override
public int cashRate() {
return 80;
}
@Override
public int ePassRate() {
return 65;
}
}
|
[
"korn_tanapol@outlook.co.th"
] |
korn_tanapol@outlook.co.th
|
1c4b5351fd3a51cf513dccf7398eeb7854a2db37
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/12/12_3100df233992e49adc038efc087cf82c70b0d078/DatabaseHandler/12_3100df233992e49adc038efc087cf82c70b0d078_DatabaseHandler_t.java
|
596ba237c1812e8e748f514264f7c4a4b09c74fc
|
[] |
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
| 59,973
|
java
|
package friendzone.elec3609.service;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.Array;
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Random;
import friendzone.elec3609.model.*;
import friendzone.elec3609.model.SocialMedia.Provider;
public class DatabaseHandler{
Map<String, UnitOfStudy> uosMap = new HashMap<String, UnitOfStudy>();
Map<String, Student> studentMap = new HashMap<String, Student>();
Map<String, Admin> adminMap = new HashMap<String, Admin>();
Map<Integer, Team> teamMap = new HashMap<Integer, Team>();
Map<Integer, Project> projectMap = new HashMap<Integer, Project>();
Map<Integer, Invitation> inviteMap = new HashMap<Integer, Invitation>();
Map<Integer, Meeting> meetingMap = new HashMap<Integer, Meeting>();
Connection dbConnection;
static DatabaseHandler instance;
public static DatabaseHandler getInstance(){
if (instance == null){
instance = new DatabaseHandler();
//reset and populate!
// if (instance != null){
// instance.resetDatabase();
// instance.populate();
// }
}
return instance;
}
private DatabaseHandler(){
try {
dbConnection = getConnection();
System.out.println("Database has the following tables:");
for (String table : getTableNames()){
System.out.println("\t" + table);
for (String column : getColumnNames(table)){
System.out.println("\t\t" + column);
}
}
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
private static Connection getConnection() throws URISyntaxException, SQLException{
URI dbUri = new URI("postgres://cqqcqkwluqeeav:29RAKIdozh96I7x6ptMGlWZyL-@ec2-54-227-251-13.compute-1.amazonaws.com:5432/de5q05a1htpue7"); //SHOULD use System.getenv("DATABASE_URL"), but I can't access the environment variables on my local copy
String username = dbUri.getUserInfo().split(":")[0];
String password = dbUri.getUserInfo().split(":")[1];
String dbUrl = "jdbc:postgresql://" + dbUri.getHost() + ':' + dbUri.getPort() + dbUri.getPath();
Properties props = new Properties();
props.setProperty("user", username);
props.setProperty("password", password);
//these properties are necessary for remote access when debugging but can be removed when the application has been pushed and is running from the Heroku server
props.setProperty("ssl", "true");
props.setProperty("sslfactory", "org.postgresql.ssl.NonValidatingFactory");
System.out.println("Connecting to " + dbUrl + " as user " + username + " with password " + password);
return DriverManager.getConnection(dbUrl, props);
}
private enum CreateQuery{
STUDENT("STUDENT",
"DROP TABLE IF EXISTS Student CASCADE;"
+ "CREATE TABLE Student ("
+ " SID CHAR(9) NOT NULL,"
+ " UNIKEY CHAR(8) UNIQUE NOT NULL,"
+ " PASSWORD CHAR(64) NOT NULL,"
+ " FIRST_NAME VARCHAR(20) NOT NULL,"
+ " LAST_NAME VARCHAR(20) NOT NULL,"
+ " COURSE VARCHAR(50),"
+ " PRIMARY_EMAIL VARCHAR(50) NOT NULL,"
+ " SECONDARY_EMAIL VARCHAR(50),"
+ " MOBILE CHAR(10) NOT NULL,"
+ " SOCIAL_MEDIA_1 VARCHAR(50),"
+ " SOCIAL_MEDIA_2 VARCHAR(50),"
+ " STUDY_LEVEL VARCHAR(20) NOT NULL,"
+ " PREFERRED_ROLE VARCHAR(15)," // "Project Manager", "Programmer", "Tester"...
+ " PREFERRED_CONTACT SMALLINT,"
+ " EXPERIENCE VARCHAR(200),"
+ " ESL BOOLEAN NOT NULL,"
+ " LANGUAGES VARCHAR(50),"
+ " AVAILABILITY BOOLEAN[84]," // 7 days x 12 hours (8am-8pm)
+ " LAST_MODIFIED TIMESTAMP DEFAULT NOW(),"
+ " PRIMARY KEY (SID)"
+ ");"),
UOS("UnitOfStudy",
"DROP TABLE IF EXISTS UnitOfStudy CASCADE;"
+ "CREATE TABLE UnitOfStudy ("
+ " UOS_ID CHAR(8) NOT NULL,"
+ " UOS_NAME VARCHAR(50) NOT NULL,"
+ " UOS_DESCRIPTION VARCHAR(100),"
+ " NUM_STUDENTS INTEGER NOT NULL,"
+ " LAST_MODIFIED TIMESTAMP DEFAULT NOW(),"
+ " PRIMARY KEY (UOS_ID)"
+ ");"),
ENROLMENT("Enrolment",
"DROP TABLE IF EXISTS Enrolment CASCADE;"
+ "CREATE TABLE Enrolment ("
+ " UOS CHAR(8) REFERENCES UnitOfStudy(UOS_ID) NOT NULL,"
+ " FIRST_SEM BOOLEAN NOT NULL,"
+ " YEAR SMALLINT NOT NULL,"
+ " STUDENT CHAR(9) REFERENCES Student(SID) NOT NULL,"
+ " TUTORIAL_NUM SMALLINT NOT NULL,"
+ " PRIMARY KEY (UOS, STUDENT)"
+ ");"),
PROJECT("Project",
"DROP TABLE IF EXISTS Project CASCADE;"
+ "CREATE TABLE Project ("
+ " PROJECT_ID SERIAL NOT NULL,"
+ " UOS_ID CHAR(8) REFERENCES UnitOfStudy(UOS_ID) NOT NULL,"
+ " MAX_TEAM_SIZE INTEGER NOT NULL,"
+ " MIN_TEAM_SIZE INTEGER NOT NULL,"
+ " NAME VARCHAR(20) NOT NULL,"
+ " DESCRIPTION VARCHAR(100),"
+ " INVITE_DEADLINE DATE NOT NULL," //need to trigger GroupFormer when this date is hit!
+ " START DATE NOT NULL,"
+ " DEADLINE DATE NOT NULL,"
+ " LAST_MODIFIED TIMESTAMP DEFAULT NOW(),"
+ " PRIMARY KEY (PROJECT_ID)"
+ ");"),
TEAM_MEMBERSHIP("TeamMembership",
"DROP TABLE IF EXISTS TeamMembership CASCADE;"
+ "CREATE TABLE TeamMembership ("
+ " STUDENT CHAR(9) REFERENCES Student(SID) NOT NULL,"
+ " TEAM INTEGER REFERENCES Team(TEAM_ID) NOT NULL,"
+ " LAST_VIEWED_CONVO TIMESTAMP,"
// should enforce exists ENROLMENT with STUDENT=STUDENT, UOS= TEAM -> PROJECT_ID -> UOS_ID
+ " PRIMARY KEY (STUDENT, TEAM)"
+ ");"),
TEAM("Team",
"DROP TABLE IF EXISTS Team CASCADE;" //could not use the name "Group" since it's a reserved word in SQL
+ "CREATE TABLE Team ("
+ " TEAM_ID SERIAL NOT NULL,"
+ " NAME VARCHAR(20) NOT NULL,"
+ " PROJECT_ID INTEGER REFERENCES Project(PROJECT_ID) NOT NULL,"
+ " PRIMARY KEY (TEAM_ID)"
+ ");"),
MEETING("Meeting",
"DROP TABLE IF EXISTS Meeting CASCADE;"
+ "CREATE TABLE Meeting("
+ " MEETING_ID SERIAL NOT NULL,"
+ " TEAM INTEGER REFERENCES Team(TEAM_ID) NOT NULL,"
+ " START_TIME TIMESTAMP NOT NULL,"
+ " END_TIME TIMESTAMP NOT NULL,"
+ " LOCATION VARCHAR(20),"
+ " PRIMARY KEY (MEETING_ID)"
+ ");"),
ADMINISTRATOR("Administrator",
"DROP TABLE IF EXISTS Administrator CASCADE;"
+ "CREATE TABLE Administrator("
+ " STAFF_NUM CHAR(8) NOT NULL," //format of a USYD staff number?
+ " FIRST_NAME VARCHAR(20) NOT NULL,"
+ " PASSWORD CHAR(64) NOT NULL,"
+ " LAST_NAME VARCHAR(20) NOT NULL,"
+ " PRIMARY KEY (STAFF_NUM)" // a staff member could administer multiple courses
+ ");"),
ADMINISTRATION("Administration",
"DROP TABLE IF EXISTS Administration CASCADE;"
+ "CREATE TABLE Administration("
+ " STAFF_NUM CHAR(8) REFERENCES Administrator(STAFF_NUM) NOT NULL,"
+ " UOS CHAR(8) REFERENCES UnitOfStudy(UOS_ID) NOT NULL,"
+ " PRIMARY KEY (STAFF_NUM, UOS)"
+ ");"),
INSTANT_MESSAGE("InstantMessage",
"DROP TABLE IF EXISTS InstantMessage CASCADE;"
+ "CREATE TABLE InstantMessage ("
+ " MESSAGE_ID SERIAL NOT NULL,"
+ " SENDER CHAR(9) REFERENCES Student(SID) NOT NULL,"
+ " TEAM INTEGER REFERENCES Team(TEAM_ID) NOT NULL,"
+ " SENT_TIME TIMESTAMP NOT NULL,"
+ " MESSAGE VARCHAR(200) NOT NULL,"
+ " PRIMARY KEY (MESSAGE_ID)"
+ ");"),
INVITATION("Invitation",
"DROP TABLE IF EXISTS Invitation CASCADE;"
+ "CREATE TABLE Invitation ("
+ " INVITE_ID SERIAL NOT NULL,"
+ " MESSAGE VARCHAR(100),"
+ " ACCEPTED BOOLEAN NOT NULL,"
+ " PROJECT INTEGER REFERENCES Project(PROJECT_ID) NOT NULL,"
+ " SENDER CHAR(9) REFERENCES Student(SID) NOT NULL,"
+ " RECIPIENT CHAR(9) REFERENCES Student(SID) NOT NULL,"
+ " PRIMARY KEY (INVITE_ID)"
+ ");"),
FUNCTIONS("Functions",
"DROP FUNCTION IF EXISTS UpdateLastModified();"
+ "CREATE FUNCTION UpdateLastModified() RETURNS trigger AS $$"
+ " BEGIN"
+ " NEW.LAST_MODIFIED := NOW();"
+ " RETURN NEW;"
+ " END;"
+ "$$ LANGUAGE PLPGSQL;"
),
TRIGGERS("Triggers",
"DROP TRIGGER IF EXISTS UpdateStudentLastModified ON Invitation;"
+ "CREATE TRIGGER UpdateStudentLastModified"
+ " BEFORE UPDATE ON Student"
+ " FOR EACH ROW"
+ " EXECUTE PROCEDURE UpdateLastModified();"
+ "DROP TRIGGER IF EXISTS UpdateUnitOfStudyLastModified ON UnitOfStudy;"
+ "CREATE TRIGGER UpdateUnitOfStudyLastModified"
+ " BEFORE UPDATE ON UnitOfStudy"
+ " FOR EACH ROW"
+ " EXECUTE PROCEDURE UpdateLastModified();"
+ "DROP TRIGGER IF EXISTS UpdateProjectModified ON UnitOfStudy;"
+ "CREATE TRIGGER UpdateProjectLastModified"
+ " BEFORE UPDATE ON Project"
+ " FOR EACH ROW"
+ " EXECUTE PROCEDURE UpdateLastModified();");
private final String tableName, query;
private CreateQuery(String tableName, String query){
this.tableName = tableName;
this.query = query;
}
public String getTableName(){
return tableName;
}
public String getQuery(){
return query;
}
}
public void resetDatabase(){
for (CreateQuery query : CreateQuery.values()){
try{
Statement stmt = dbConnection.createStatement();
stmt.executeUpdate(query.getQuery());
stmt.close();
} catch (SQLException e) {
System.err.println("Failed to create " + query.getTableName());
e.printStackTrace();
System.exit(1);
}
}
System.out.println("\nDatabase has been reset!\n");
}
public String hashPassword(String password){
try{
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(password.getBytes());
byte byteData[] = md.digest();
StringBuffer hexString = new StringBuffer();
for (int i=0;i<byteData.length;i++) {
String hex=Integer.toHexString(0xff & byteData[i]);
if(hex.length()==1) hexString.append('0');
hexString.append(hex);
}
password = hexString.toString();
}
catch (NoSuchAlgorithmException e){
e.printStackTrace();
}
return password;
}
public void populate(){
try{
final int STUDENT_AMOUNT = 300;
final int UOS_AMOUNT = 4;
final int ADMIN_AMOUNT = 3;
final int MAX_PROJECTS = 2; // per UOS
final int MIN_MEMBERS = 3;
final int MAX_MEMBERS = 5; // students per team
String[] firstNames = new String[]{"Oliver", "Lucas", "Ethan", "Tom", "Noah", "Cooper", "James", "Jackson", "Liam", "Xavier",
"Lily", "Isabella", "Emily", "Chloe", "Charlotte", "Zoe", "Isabelle", "Olivia", "Sophie", "Amelia"};
String[] lastNames = new String[]{"Smith", "Jones", "Williams", "Brown", "Wilson", "Taylor", "Morton", "White", "Martin", "Anderson",
"Thompson", "Nguyen", "Thomas", "Walker", "Harris", "Lee", "Ryan", "Robinson", "Kelly", "King"};
String[] unitCodes = new String[]{"ELEC", "INFO", "COMP", "ISYS"};
HashSet<String> usedUnitCodes = new HashSet<String>();
HashSet<String> usedSIDs = new HashSet<String>();
HashSet<String> usedUnikeys = new HashSet<String>();
ArrayList<Student> students = new ArrayList<Student>();
// populate student table
boolean[][] allTrue = new boolean[7][12];
boolean[][] allFalse = new boolean[7][12];
for (int i = 0; i != allTrue.length; i++){
for (int j=0; j != allFalse.length; j++){
allTrue[i][j] = true;
allFalse[i][j] = false;
}
}
Student minStats = new Student("000000000", "mind1234", "password", "Min", "Stats", "mind1234@uni.sydney.edu.au", "041000000", StudyLevel.UNDERGRADUATE, false, new ProgrammingLanguage[0]);
minStats.setAvailability(allFalse);
Student maxStats = new Student("999999999", "maxd1234", "password", "Max", "Stats", "maxd1234@uni.sydney.edu.au", "041999999", StudyLevel.POSTGRADUATE, true, ProgrammingLanguage.values());
Admin maxStatsAdmin = new Admin("maxd1234", "password", "Max", "Stats");
maxStats.setAvailability(allTrue);
for (int i=0; i != STUDENT_AMOUNT; ++i){
String SID = null;
do{
SID = String.valueOf(300000000 + (int)(Math.random() * 100000000));
} while (usedSIDs.contains(SID));
usedSIDs.add(SID);
String firstName = firstNames[(int)(Math.random() * firstNames.length)];
String lastName = lastNames[(int)(Math.random() * firstNames.length)];
String unikey = null;
do{
unikey = (firstName.charAt(0) + lastName.substring(0, 3) + String.valueOf(1000 + (int)(Math.random() * 9000))).toLowerCase();
} while (usedUnikeys.contains(unikey));
usedUnikeys.add(unikey);
String password = "password";
System.out.println("Adding student " + (i+1) + "/" + STUDENT_AMOUNT + " (unikey " + unikey + ", password " + password + ")");
String primaryEmail = unikey + "@uni.sydney.edu.au";
String mobile = String.valueOf(041) + String.valueOf(100000 + (int)(Math.random() * 900000));
StudyLevel studyLevel = StudyLevel.values()[(int)(Math.random() * StudyLevel.values().length)];
boolean ESL = ((int)(Math.random()) == (int)(Math.random()));
ProgrammingLanguage languages[] = new ProgrammingLanguage[(int)(Math.random() * ProgrammingLanguage.values().length)];
HashSet<ProgrammingLanguage> usedLangs = new HashSet<ProgrammingLanguage>();
for (int j=0; j != languages.length; ++j){
ProgrammingLanguage newLanguage = null;
do{
newLanguage = ProgrammingLanguage.values()[(int)(Math.random() * ProgrammingLanguage.values().length)];
} while (usedLangs.contains(newLanguage));
usedLangs.add(newLanguage);
languages[j] = newLanguage;
}
Student newStudent = new Student(SID, unikey, password, firstName, lastName, primaryEmail, mobile, studyLevel, ESL, languages);
boolean[][] availability = new boolean[7][12];
for (boolean[] days : availability){
for (boolean hour : days){
hour = ((int)(Math.random() * 2)) == ((int)(Math.random() * 2)); //(int)(Math.random() * 2) returns either 0 or 1, so our cases are (0 == 1), (1 == 0), (0 == 0) or (1 == 1)
}
}
newStudent.setAvailability(availability);
students.add(newStudent);
}
// populate UoS table
for (int i=0; i != UOS_AMOUNT; ++i){
String unitCode = null;
do{
unitCode = unitCodes[(int)(Math.random() * unitCodes.length)] + String.valueOf(1000 + (int)(Math.random() * 3000));
} while (usedUnitCodes.contains(unitCode));
usedUnitCodes.add(unitCode);
System.out.println("Adding Unit of Study " + (i+1) + "/" + UOS_AMOUNT + "(unitCode " + unitCode + ")");
String unitName = "<unit name for " + unitCode + ">";
int numStudents = (int)(Math.random() * STUDENT_AMOUNT);
UnitOfStudy newUOS = new UnitOfStudy(unitCode, unitName, numStudents);
// enrol students to the UOS
ArrayList<Student> uosStudents = new ArrayList<Student>();
HashSet<Student> enrolledStudents = new HashSet<Student>();
for (int j=0; j != numStudents-1; j++){
maxStats.enrolTo(unitCode, 2, 2014);
Student student = null;
do{
student = students.get((int)(Math.random() * students.size()));
} while (enrolledStudents.contains(student));
System.out.println("Enrolling student " + student.getSID() + " to unit of study " + unitCode + " " + (j+1) + "/" + numStudents);
// param = unitcode, firstsem, year
student.enrolTo(unitCode,(1+ (int)(Math.random() * 2)), (2013 + (int)(Math.random() * 2)));
enrolledStudents.add(student);
uosStudents.add(student);
}
// add projects to this UoS
int numProjects = (int)(Math.random() * (MAX_PROJECTS+1));
for (int j=0; j != numProjects; j++){
ArrayList<Student> uosStudentsCopy = new ArrayList<Student>(uosStudents);
Date inviteDeadline = new Date(System.currentTimeMillis() + (long)(Math.random() * 31556926000L)); //current date + up to 1 year in milliseconds
Date start = new Date(inviteDeadline.getTime() + (long)(Math.random() * 31556926000L)); // invite deadline + up to 1 year in milliseconds
Date deadline = new Date(inviteDeadline.getTime() + (long)(Math.random() * 31556926000L)); // start date + up to 1 year in milliseconds
System.out.println("Adding Project to unit of study " + unitCode + " " + (j+1) + "/" + numProjects + "(deadline " + deadline.toGMTString() + ")");
Project newProject = new Project(unitCode, unitCode + " project " + j, inviteDeadline, start, deadline, MIN_MEMBERS, MAX_MEMBERS);
// create teams for this project
int numTeams = ((numStudents-1) / MAX_MEMBERS);
int projectID = newProject.getID();
for (int k = 0; k != numTeams; ++k){
System.out.println("Adding team to project " + projectID + " " + (k+1) + "/" + numTeams);
Team newTeam = new Team(projectID, "TEAM" + k);
if (k == 0) maxStats.joinTeam(newTeam.getID());
// add students to this team
int teamSize = MIN_MEMBERS + (int)(Math.random() * (MAX_MEMBERS - MIN_MEMBERS+1));
for (int l = 0; l < teamSize; l++){
int teamID = newTeam.getID();
if (uosStudents.size() == 0){
System.out.println("No more students left to put in teams!");
break;
}
int index = (int)(Math.random() * uosStudentsCopy.size());
Student selectedStudent = uosStudentsCopy.remove(index);
System.out.println("Putting student " + selectedStudent.getUnikey() + " in team " + teamID + " for project " + projectID + " " + (l+1) + "/" + MAX_MEMBERS);
selectedStudent.joinTeam(teamID);
}
}
}
// create admins for this unit
HashSet<String> usedStaffIds = new HashSet<String>();
for (int j=0; j != ADMIN_AMOUNT; j++){
String firstName = firstNames[(int)(Math.random() * firstNames.length)];
String lastName = lastNames[(int)(Math.random() * firstNames.length)];
String password = "password";
String staffID = null;
do{
staffID = (firstName.charAt(0) + lastName.substring(0, 3) + String.valueOf(1000 + (int)(Math.random() * (ADMIN_AMOUNT * 10)))).toLowerCase(); //dramatically lower range of possible staff ID's because we want staff with more than 1 subject administrated
} while (usedStaffIds.contains(staffID));
usedStaffIds.add(staffID);
System.out.println("Adding staffID " + staffID + " as an administrator of " + unitCode);
Admin newAdmin = new Admin(staffID, password, firstName, lastName); // if a student with this primary key already exists, it just wont create them in the db, so this is still valid
newAdmin.addUnitOfStudy(unitCode);
maxStatsAdmin.addUnitOfStudy(unitCode);
}
}
}
catch (NullPointerException e){
e.printStackTrace();
System.exit(1);
}
}
// //create teams for this project
// for (int k = 0; k != TEAM_AMOUNT; ++k){
// Team newTeam = new Team(newProject.getID(), "TEAM" + k);
//
// }
//
// //fill the team with students in the UOS
// for (int l=0; l != TEAM_SIZE; ++l){
// if (uosStudents.size() == 0){
// break;
// }
// Student teamMember = uosStudents.remove((int)(Math.random() * uosStudents.size()));
// }
//
// // enrol students to the UOS
// HashSet<Student> enrolledStudents = new HashSet<Student>();
// for (int j=0; j != numStudents; j++){
// Student student = null;
// do{
// student = students.get((int)(Math.random() * students.size()));
// } while (enrolledStudents.contains(student));
// student.enrolTo(unitCode);
// uosStudents.add(student);
// }
public boolean checkExists(String SID){
try{
String selectQuery = "SELECT 1"
+ " FROM Student"
+ " WHERE SID=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1 , SID);
ResultSet rs = stmt.executeQuery();
if (rs.next())
return true;
}
catch (SQLException e){
e.printStackTrace();
}
return false;
}
/*
* Takes login and returns a hashed pw of that login if the login exists.
* Returns null if login doesn't exist.
*/
public String getAuthentication(String unikey) {
String password = null;
String fetchQuery =
" SELECT PASSWORD"
+ " FROM Student"
+ " WHERE UNIKEY=?"
;
try{
PreparedStatement statement = dbConnection.prepareStatement(fetchQuery);
statement.setString(1, unikey);
ResultSet rs = statement.executeQuery();
if (rs.next()){ // using if instead of while since there can only be 1 result
password = rs.getString("PASSWORD");
}
} catch (SQLException e){
e.printStackTrace();
}
return password;
}
/*
* Takes login and returns a hashed pw of that login if the login exists.
* Returns null if login doesn't exist.
*/
public String getAdminAuthentication(String staffID) {
String password = null;
String fetchQuery =
" SELECT PASSWORD"
+ " FROM Administrator"
+ " WHERE STAFF_NUM=?"
;
try{
PreparedStatement statement = dbConnection.prepareStatement(fetchQuery);
statement.setString(1, staffID);
ResultSet rs = statement.executeQuery();
if (rs.next()){ // using if instead of while since there can only be 1 result
password = rs.getString("PASSWORD");
}
} catch (SQLException e){
e.printStackTrace();
}
return password;
}
public String getSID(String unikey){
String SID = null;
try{
String selectQuery = "SELECT SID"
+ " FROM Student"
+ " WHERE UNIKEY=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, unikey);
ResultSet rs = stmt.executeQuery();
if (rs.next()){
SID = rs.getString(1);
}
}
catch (SQLException e){
e.printStackTrace();
}
return SID;
}
// -- -- -- -- -- THE FOLLOWING METHODS ARE FOR FETCHING MODELS USING THEIR ID -- -- -- -- -- -- -- --
public Project getProject(int projectID){
Project matchingProject = projectMap.get(projectID);
try{
boolean needsUpdate = false;
if (matchingProject == null){
needsUpdate = true;
}
else{
String lastUpdateQuery = "SELECT LAST_MODIFIED"
+ " FROM Project"
+ " WHERE PROJECT_ID=?"
;
PreparedStatement lastUpdateStatement = dbConnection.prepareStatement(lastUpdateQuery);
lastUpdateStatement.setInt(1, projectID);
ResultSet lastUpdateRs = lastUpdateStatement.executeQuery();
Timestamp lastUpdate = (lastUpdateRs.next()? lastUpdateRs.getTimestamp(1) : null);
needsUpdate = matchingProject.getLastViewed().before(lastUpdate);
}
if (needsUpdate){
String uosQuery = "SELECT *"
+ " FROM Project"
+ " WHERE Project_ID=?"
;
PreparedStatement projectStatement = dbConnection.prepareStatement(uosQuery);
projectStatement.setInt(1, projectID);
ResultSet projectRs = projectStatement.executeQuery();
if (projectRs.next()){
matchingProject = new Project(projectID, projectRs.getString("UOS"), projectRs.getDate("DEADLINE"), projectRs.getInt("MIN_TEAM_SIZE"), projectRs.getInt("MAX_TEAM_SIZE"));
if (projectMap.get(projectID) == null){
projectMap.put(projectID, matchingProject);
}
else{
projectMap.get(projectID).copyValues(matchingProject);
}
matchingProject = projectMap.get(projectID);
matchingProject.setDescription(projectRs.getString("DESCRIPTION"));
}
}
} catch (SQLException e){
e.printStackTrace();
}
matchingProject.setLastViewed(new Timestamp(System.currentTimeMillis()));
return matchingProject;
}
public Team getTeam(int teamID) {
Team matchingTeam = teamMap.get(teamID);
try{
String selectQuery = "SELECT *"
+ " FROM TEAM"
+ " WHERE TEAM_ID=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setInt(1, teamID);
ResultSet uosRs = stmt.executeQuery();
if (uosRs.next()){
matchingTeam = new Team(teamID, uosRs.getInt("PROJECT_ID"), uosRs.getString("NAME"));
if (teamMap.get(teamID) == null){
teamMap.put(teamID, matchingTeam);
}
else{
teamMap.get(teamID).copyValues(matchingTeam);
}
matchingTeam = teamMap.get(teamID);
}
}
catch (SQLException e){
e.printStackTrace();
}
return matchingTeam;
}
public UnitOfStudy getUnitOfStudy(String unitCode){
UnitOfStudy matchingUOS = uosMap.get(unitCode);
try{
boolean needsUpdate = false;
if (matchingUOS == null){
needsUpdate = true;
}
else{
String lastUpdateQuery = "SELECT LAST_MODIFIED"
+ " FROM UnitOfStudy"
+ " WHERE UOS_ID=?"
;
PreparedStatement lastUpdateStatement = dbConnection.prepareStatement(lastUpdateQuery);
lastUpdateStatement.setString(1, unitCode);
ResultSet lastUpdateRs = lastUpdateStatement.executeQuery();
Timestamp lastUpdate = (lastUpdateRs.next()? lastUpdateRs.getTimestamp(1) : null);
needsUpdate = matchingUOS.getLastViewed().before(lastUpdate);
}
if (needsUpdate){
String uosQuery = "SELECT *"
+ " FROM UnitOfStudy"
+ " WHERE UOS_ID=?"
;
PreparedStatement uosStatement = dbConnection.prepareStatement(uosQuery);
uosStatement.setString(1, unitCode);
ResultSet uosRs = uosStatement.executeQuery();
if (uosRs.next()){
matchingUOS = new UnitOfStudy(unitCode, uosRs.getString("UOS_NAME"), uosRs.getInt("NUM_STUDENTS"));
if (uosMap.get(unitCode) == null){
uosMap.put(unitCode, matchingUOS);
}
else{
uosMap.get(unitCode).copyValues(matchingUOS);
}
matchingUOS = uosMap.get(unitCode);
matchingUOS.setDescription(uosRs.getString("UOS_DESCRIPTION"));
}
}
}
catch (SQLException e){
e.printStackTrace();
}
matchingUOS.setLastViewed(new Timestamp(System.currentTimeMillis()));
return matchingUOS;
}
public Admin getAdministrator(String staffID){
Admin matchingAdmin = adminMap.get(staffID);
try{
String selectQuery = "SELECT *"
+ " FROM Administrator"
+ " WHERE STAFF_NUM=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, staffID);
ResultSet rs = stmt.executeQuery();
if (rs.next()){
matchingAdmin = new Admin(rs.getString("STAFF_NUM"), rs.getString("PASSWORD"), rs.getString("FIRST_NAME"), rs.getString("LAST_NAME"));
if (adminMap.get(staffID) == null){
adminMap.put(staffID, matchingAdmin);
}
else{
adminMap.get(staffID).copyValues(matchingAdmin);
}
matchingAdmin = adminMap.get(staffID);
}
}
catch (SQLException e){
e.printStackTrace();
}
return matchingAdmin;
}
public Student getStudent(String SID){
Student matchingStudent = studentMap.get(SID);
try{
boolean needsUpdate = false;
if (matchingStudent == null){
needsUpdate = true;
}
else{
String lastUpdateQuery = "SELECT LAST_MODIFIED"
+ " FROM Student"
+ " WHERE SID=?"
;
PreparedStatement lastUpdateStatement = dbConnection.prepareStatement(lastUpdateQuery);
lastUpdateStatement.setString(1, SID);
ResultSet lastUpdateRs = lastUpdateStatement.executeQuery();
Timestamp lastUpdate = (lastUpdateRs.next()? lastUpdateRs.getTimestamp(1) : null);
needsUpdate = matchingStudent.getLastViewed().before(lastUpdate);
}
if (needsUpdate){
String fetchQuery = "SELECT *"
+ " FROM Student"
+ " WHERE SID=?"
;
PreparedStatement statement = dbConnection.prepareStatement(fetchQuery);
statement.setString(1, SID);
ResultSet rs = statement.executeQuery();
if (rs.next()){ // using if instead of while since there can only be 1 result
System.out.println("Student exists!");
String languageString = rs.getString("LANGUAGES");
String[] languageNames = languageString.split(",");
ProgrammingLanguage[] languages = new ProgrammingLanguage[(languageString.equals("")? 0 : languageNames.length)];
for (int i=0; i < languages.length; ++i){
languages[i] = ProgrammingLanguage.findMatch(languageNames[i].trim());
}
matchingStudent = new Student(SID,
rs.getString("UNIKEY"),
rs.getString("PASSWORD"),
rs.getString("FIRST_NAME"),
rs.getString("LAST_NAME"),
rs.getString("PRIMARY_EMAIL"),
rs.getString("MOBILE"),
StudyLevel.findMatch(rs.getString("STUDY_LEVEL")),
rs.getBoolean("ESL"),
languages);
System.out.println("Unikey: " + matchingStudent.getUnikey()
+ "First Name: " + matchingStudent.getFirstName()
+ "Last Name: " + matchingStudent.getLastName()
+ "Mobile: " + matchingStudent.getMobile());
if (studentMap.get(SID) == null){
studentMap.put(SID, matchingStudent);
}
else{
studentMap.get(SID).copyValues(matchingStudent);
}
matchingStudent = studentMap.get(SID);
//The constructor takes all the "NOT NULL" values, but there are others that can exist
if (rs.getString("SOCIAL_MEDIA_1") != null){
String[] socialMediaComponents = rs.getString("SOCIAL_MEDIA_1").split(":");
Provider provider = SocialMedia.Provider.findMatch(socialMediaComponents[0]);
String address = socialMediaComponents[1].trim();
matchingStudent.setFirstSocialMedia(provider, address);
}
else{
matchingStudent.setFirstSocialMedia(null, null);
}
if (rs.getString("SOCIAL_MEDIA_2") != null){
String[] socialMediaComponents = rs.getString("SOCIAL_MEDIA_2").split(":");
Provider provider = SocialMedia.Provider.findMatch(socialMediaComponents[0]);
String address = socialMediaComponents[1].trim();
matchingStudent.setSecondSocialMedia(provider, address);
}
else{
matchingStudent.setSecondSocialMedia(null, null);
}
Integer preferredContact = rs.getInt("PREFERRED_CONTACT");
matchingStudent.setPreferredContact(((preferredContact == null)? null : ContactMethod.values()[preferredContact]));
boolean[][] twoDimensionalAvail = new boolean[7][12];
if (rs.getArray("AVAILABILITY") != null){
Array availArray = rs.getArray("AVAILABILITY");
Boolean[] oneDimensionalAvail = (Boolean[])availArray.getArray();
for (int i = 0; i != twoDimensionalAvail.length; ++i){
for (int j = 0; j != twoDimensionalAvail[i].length; ++j){
twoDimensionalAvail[i][j] = oneDimensionalAvail[i * twoDimensionalAvail.length + j];
}
}
}
matchingStudent.setAvailability(twoDimensionalAvail);
matchingStudent.setCourse(rs.getString("COURSE"));
matchingStudent.setSecondaryEmail(rs.getString("SECONDARY_EMAIL"));
matchingStudent.setExperience(rs.getString("EXPERIENCE"));
matchingStudent.setPreferredRole(Role.findMatch((rs.getString("PREFERRED_ROLE") == null? null : rs.getString("PREFERRED_ROLE"))));
}
}
} catch (SQLException e){
e.printStackTrace();
}
matchingStudent.setLastViewed(new Timestamp(System.currentTimeMillis()));
return matchingStudent;
}
private Meeting getMeeting(int meetingID) {
Meeting meeting = meetingMap.get(meetingID);
try{
String selectQuery = "SELECT *"
+ " FROM Meeting"
+ " WHERE MEETING_ID=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setInt(1, meetingID);
ResultSet rs = stmt.executeQuery();
if (rs.next()){
meeting = new Meeting(meetingID,
rs.getInt("TEAM"),
rs.getTimestamp("START_TIME"),
rs.getTimestamp("END_TIME"),
rs.getString("LOCATION"));
if (meetingMap.get(meetingID) == null){
meetingMap.put(meetingID, meeting);
}
else{
meetingMap.get(meetingID).copyValues(meeting);
}
meeting = meetingMap.get(meetingID);
}
}
catch (SQLException e){
e.printStackTrace();
}
return meeting;
}
private Invitation getInvitation(int inviteID) {
Invitation invite = inviteMap.get(inviteMap);
try{
String selectQuery = "SELECT *"
+ " FROM Invitation"
+ " WHERE INVITE_ID=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setInt(1, inviteID);
ResultSet rs = stmt.executeQuery();
if (rs.next()){
invite = new Invitation(inviteID, rs.getString("SENDER"), rs.getString("RECIPIENT"), rs.getInt("PROJECT"), rs.getString("MESSAGE"));
if (inviteMap.get(inviteID) == null){
inviteMap.put(inviteID, invite);
}
else{
inviteMap.get(inviteID).copyValues(invite);
}
invite = inviteMap.get(inviteID);
}
}
catch (SQLException e){
e.printStackTrace();
}
return invite;
}
// -- -- -- -- -- -- -- THE FOLLOWING METHODS ARE USED TO ADD MODELS TO THE DATABASE -- -- -- -- -- -- -- -- --
public void addStudent(String SID, String unikey, String password,
String firstName, String lastName, String primaryEmail,
String mobile, StudyLevel studyLevel, boolean ESL, ProgrammingLanguage[] languages) {
String insertQuery = "INSERT INTO Student"
+ " (SID, UNIKEY, PASSWORD, FIRST_NAME, LAST_NAME, PRIMARY_EMAIL, MOBILE, STUDY_LEVEL, ESL, LANGUAGES)"
+ " SELECT ?,?,?,?,?,?,?,?,?,?"
+ " WHERE NOT EXISTS (SELECT 1 FROM Student WHERE SID=?)";
try{
PreparedStatement statement = dbConnection.prepareStatement(insertQuery);
statement.setString(1, SID);
statement.setString(2, unikey);
statement.setString(3, hashPassword(password));
statement.setString(4, firstName);
statement.setString(5, lastName);
statement.setString(6, primaryEmail);
statement.setString(7, mobile);
statement.setString(8, studyLevel.toString());
statement.setBoolean(9, ESL);
String languageString = "";
boolean firstPassed = false;
for (ProgrammingLanguage language : languages){
if (!firstPassed){
firstPassed = true;
}
else{
languageString += ", ";
}
languageString += language.toString();
}
statement.setString(10, languageString);
statement.setString(11, SID);
statement.execute();
} catch (SQLException e){
e.printStackTrace();
}
}
public void addUnitOfStudy(String unitCode, String unitName, int num_students){
try {
String insertQuery = "INSERT INTO UnitOfStudy"
+ " (UOS_ID, UOS_NAME, NUM_STUDENTS)"
+ " SELECT ?,?,?"
+ " WHERE NOT EXISTS (SELECT 1 FROM UnitOfStudy WHERE UOS_ID=?)"
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setString(1, unitCode);
stmt.setString(2, unitName);
stmt.setInt(3, num_students);
stmt.setString(4, unitCode);
stmt.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
public Integer addInvitation(int projectID, String senderSID, String recipientSID){
Integer id = null;
try{
String insertQuery = "INSERT INTO Invitation"
+ " (PROJECT, SENDER, RECIPIENT, ACCEPTED)"
+ " VALUES (?,?,?,?)"
+ " RETURNING INVITE_ID"
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setInt(1, projectID);
stmt.setString(2, senderSID);
stmt.setString(3, recipientSID);
stmt.setBoolean(4, false);
ResultSet rs = stmt.executeQuery();
if (rs.next())
id = rs.getInt(1);
}
catch (SQLException e){
e.printStackTrace();
}
return id;
}
public Integer addTeam(int projectID, String name){
Integer id = null;
try{
String insertQuery = "INSERT INTO Team"
+ " (PROJECT_ID, NAME)"
+ " VALUES (?,?)"
+ " RETURNING TEAM_ID"
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setInt(1, projectID);
stmt.setString(2, name);
ResultSet rs = stmt.executeQuery();
if (rs.next())
id = rs.getInt(1);
}
catch (SQLException e){
e.printStackTrace();
}
return id;
}
public Integer addProject(String unitCode, String projectName, Date inviteDeadline, Date start, Date deadline, int minTeamSize, int maxTeamSize){
Integer id = null;
try{
String insertQuery = "INSERT INTO Project"
+ " (UOS_ID, NAME, INVITE_DEADLINE, START, DEADLINE, MIN_TEAM_SIZE, MAX_TEAM_SIZE)"
+ " VALUES (?,?,?,?,?,?,?)"
+ " RETURNING PROJECT_ID"
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setString(1, unitCode);
stmt.setString(2, projectName);
stmt.setDate(3, inviteDeadline);
stmt.setDate(4, start);
stmt.setDate(5, deadline);
stmt.setInt(6, minTeamSize);
stmt.setInt(7, maxTeamSize);
ResultSet rs = stmt.executeQuery();
if (rs.next())
id = rs.getInt(1);
}
catch (SQLException e){
e.printStackTrace();
}
return id;
}
public Integer addMeeting(int teamID, Timestamp start, Timestamp end){
Integer id = null;
try{
String insertQuery = "INSERT INTO Meeting"
+ " (TEAM, START_TIME, END_TIME)"
+ " VALUES (?,?,?)"
+ " RETURNING MEETING_ID"
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setInt(1, teamID);
stmt.setTimestamp(2, start);
stmt.setTimestamp(3, end);
// stmt.setInt(4, teamID);
// stmt.setTimestamp(5, start);
ResultSet rs = stmt.executeQuery();
if (rs.next())
id = rs.getInt(1);
}
catch (SQLException e){
e.printStackTrace();
}
return id;
}
public void addTeamMembership(String SID, int teamID){
try{
String insertQuery = "INSERT INTO TeamMembership"
+ " (STUDENT, TEAM)"
+ " SELECT ?,?"
+ " WHERE NOT EXISTS (SELECT 1 FROM TeamMembership WHERE STUDENT=? AND TEAM=?)" //allows re-enrolling when already enrolled to occur without error
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setString(1, SID);
stmt.setInt(2, teamID);
stmt.setString(3, SID);
stmt.setInt(4, teamID);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public Integer addInstantMessage(String senderID, int teamID, String message){
Integer id = null;
try{
String insertQuery = "INSERT INTO InstantMessage"
+ " (SENDER, TEAM, MESSAGE)"
+ " VALUES (?,?,?)"
+ " RETURNING MESSAGE_ID"
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setString(1, senderID);
stmt.setInt(2, teamID);
stmt.setString(3, message);
ResultSet rs = stmt.executeQuery();
if (rs.next())
id = rs.getInt(1);
}
catch (SQLException e){
e.printStackTrace();
}
return id;
}
public void addAdministrator(String staffID, String password, String firstName, String lastName){
try{
String insertQuery = "INSERT INTO Administrator"
+ " (STAFF_NUM, PASSWORD, FIRST_NAME, LAST_NAME)"
+ " SELECT ?,?,?,?"
+ " WHERE NOT EXISTS (SELECT 1 FROM Administrator WHERE STAFF_NUM=?)"
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setString(1, staffID);
stmt.setString(2, hashPassword(password));
stmt.setString(3, firstName);
stmt.setString(4, lastName);
stmt.setString(5, staffID);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void addAdministration(String staffID, String unitCode){
try{
String insertQuery = "INSERT INTO Administration"
+ " (STAFF_NUM, UOS)"
+ " SELECT ?,?"
+ " WHERE NOT EXISTS (SELECT 1 FROM Administration WHERE STAFF_NUM=? AND UOS=?)" //allows re-applying as administrator when already admin without error
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setString(1, staffID);
stmt.setString(2, unitCode);
stmt.setString(3, staffID);
stmt.setString(4, unitCode);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public Team getStudentsTeam(String SID, int projectID){
Integer id = null;
try{
//team that has PROJECT_ID = projectID that also has TeamMembership with STUDENT=SID
String selectQuery = "SELECT TEAM_ID"
+ " FROM TeamMembership INNER JOIN Team ON TeamMembership(TEAM) = Team(TEAM_ID)"
+ " WHERE STUDENT=? AND PROJECT_ID=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, SID);
stmt.setInt(2, projectID);
ResultSet rs = stmt.executeQuery();
if (rs.next()) //
id = rs.getInt(0);
}
catch (SQLException e){
e.printStackTrace();
}
return getTeam(id);
}
public void addEnrolment(String unitCode, String SID, int tutorialNum, boolean firstSem, int year){
try{
String insertQuery = "INSERT INTO Enrolment"
+ " (UOS, STUDENT, TUTORIAL_NUM, FIRST_SEM, YEAR)"
+ " SELECT ?,?,?,?,?"
+ " WHERE NOT EXISTS (SELECT 1 FROM Enrolment WHERE UOS=? AND STUDENT=?)" //allows re-enrolment without throwing an error
;
PreparedStatement stmt = dbConnection.prepareStatement(insertQuery);
stmt.setString(1, unitCode);
stmt.setString(2, SID);
stmt.setInt(3, tutorialNum);
stmt.setBoolean(4, firstSem);
stmt.setInt(5, year);
stmt.setString(6, unitCode);
stmt.setString(7, SID);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
private String getIDFieldName(String tableName){
String idName = "";
if (tableName.equals("Student")){
idName = "SID";
}
else if (tableName.equals("UnitOfStudy")){
idName = "UOS_ID";
}
else if (tableName.equals("Administrator")){
idName = "STAFF_NUM";
}
else if (tableName.equals("Project")){
idName = "PROJECT_ID";
}
else if (tableName.equals("Team")){
idName = "TEAM_ID";
}
else if (tableName.equals("Meeting")){
idName = "MEETING_ID";
}
else if (tableName.equals("InstantMessage")){
idName = "MESSAGE_ID";
}
else if (tableName.equals("Invitation")){
idName = "INVITE_ID";
}
return idName;
}
// -- -- -- -- -- -- -- -- -- THE FOLLOWING METHODS ARE USED TO UPDATE ENTRIES IN THE DATABASE -- -- -- -- -- -- -- --
public void update(String tableName, String identifier, String fieldName, String newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setString(1, newValue);
stmt.setString(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, String identifier, String fieldName, boolean newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setBoolean(1, newValue);
stmt.setString(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, int identifier, String fieldName, String newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setString(1, newValue);
stmt.setInt(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, String identifier, String fieldName, int newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setInt(1, newValue);
stmt.setString(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, int identifier, String fieldName, int newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setInt(1, newValue);
stmt.setInt(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, String identifier, String fieldName, Date newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setDate(1, newValue);
stmt.setString(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, int identifier, String fieldName, Date newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setDate(1, newValue);
stmt.setInt(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, String identifier, String fieldName, Timestamp newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setTimestamp(1, newValue);
stmt.setString(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, int identifier, String fieldName, Timestamp newValue){
try{
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setTimestamp(1, newValue);
stmt.setInt(2, identifier);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public void update(String tableName, String identifier, String fieldName, boolean[][] newValue){
try {
String idName = getIDFieldName(tableName);
String updateQuery = "UPDATE " + tableName
+ " SET " + fieldName + "=?"
+ " WHERE " + idName + "=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
Boolean[] oneDimensionalAvail = new Boolean[84];
boolean[][] twoDimensionalAvail = newValue;
for (int i = 0; i != twoDimensionalAvail.length ; ++i){
for (int j = 0; j != twoDimensionalAvail[i].length; ++j){
oneDimensionalAvail[i * twoDimensionalAvail.length + j] = twoDimensionalAvail[i][j];
}
}
Array availArray = dbConnection.createArrayOf("boolean", oneDimensionalAvail);
stmt.setArray(1, availArray);
stmt.setString(2, identifier);
stmt.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
// -- -- -- -- -- -- -- THE FOLLOWING METHODS ARE USED BY THE ACCESSOR METHODS OF OUR MODELS -- -- -- -- -- -- --
public ArrayList<Invitation> getInvitations(String recipientSID){
ArrayList<Invitation> invitations = new ArrayList<Invitation>();
try{
String selectQuery = "SELECT INVITE_ID"
+ " FROM Invitation"
+ " WHERE RECIPIENT=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, recipientSID);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
int inviteID = rs.getInt(1);
Invitation invite = getInvitation(inviteID);
invitations.add(invite);
}
} catch (SQLException e){
e.printStackTrace();
}
return invitations;
}
public Integer getTutorialNum(String SID, String unitCode) {
Integer tutNum = null;
try{
String selectQuery = "SELECT TUTORIAL_NUM"
+ " FROM Enrolment"
+ " WHERE STUDENT=? AND UOS=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, SID);
stmt.setString(2, unitCode);
ResultSet rs = stmt.executeQuery();
if (rs.next())
tutNum = rs.getInt(1);
}
catch (SQLException e){
e.printStackTrace();
}
return tutNum;
}
public ArrayList<Meeting> getMeetings(String SID){
ArrayList<Meeting> meetings = new ArrayList<Meeting>();
try{
String selectQuery = "SELECT TEAM"
+ " FROM TeamMembership"
+ " WHERE STUDENT=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, SID);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
int teamID = rs.getInt(1);
String meetingQuery = "SELECT MEETING_ID"
+ " FROM Meeting"
+ " WHERE TEAM=?"
;
PreparedStatement meetingStmt = dbConnection.prepareStatement(meetingQuery);
meetingStmt.setInt(1, teamID);
ResultSet meetingRs = meetingStmt.executeQuery();
while (meetingRs.next()){
Meeting meeting = getMeeting(meetingRs.getInt(1));
meetings.add(meeting);
}
}
}
catch (SQLException e){
e.printStackTrace();
}
return meetings;
}
public ArrayList<Team> getTeams(int projectID) {
ArrayList<Team> teams = new ArrayList<Team>();
try{
String selectQuery = "SELECT TEAM_ID"
+ " FROM Team"
+ " WHERE PROJECT_ID=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setInt(1, projectID);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
int teamID = rs.getInt(1);
Team matchingTeam = getTeam(teamID);
teams.add(matchingTeam);
}
}
catch (SQLException e){
e.printStackTrace();
}
return teams;
}
public void respondToInvitation(int inviteID, boolean accepted){
try{
String updateQuery = "UPDATE Invitation"
+ " SET ACCEPTED=?"
+ " WHERE RECIPIENT=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(updateQuery);
stmt.setBoolean(1, accepted);
stmt.setInt(2, inviteID);
stmt.execute();
}
catch (SQLException e){
e.printStackTrace();
}
}
public ArrayList<Project> getProjects(String unitCode) {
ArrayList<Project> projects = new ArrayList<Project>();
try{
String selectQuery = "SELECT PROJECT_ID"
+ " FROM Project"
+ " WHERE UOS_ID=?"
;
PreparedStatement selectStatement = dbConnection.prepareStatement(selectQuery);
selectStatement.setString(1, unitCode);
ResultSet selectRs = selectStatement.executeQuery();
while (selectRs.next()){
int projectID = selectRs.getInt(1);
Project matchingProject = getProject(projectID);
projects.add(matchingProject);
}
} catch (SQLException e){
e.printStackTrace();
}
return projects;
}
public UnitOfStudy getUnitOfStudy(int projectID) {
UnitOfStudy matchingUOS = null;
try{
String selectQuery = "SELECT UOS"
+ " FROM Project"
+ " WHERE PROJECT_ID=?"
;
PreparedStatement selectStatement = dbConnection.prepareStatement(selectQuery);
selectStatement.setInt(1, projectID);
ResultSet selectRs = selectStatement.executeQuery();
if (selectRs.next()){
String unitCode = selectRs.getString(1);
matchingUOS = getUnitOfStudy(unitCode);
}
}
catch (SQLException e){
e.printStackTrace();
}
return matchingUOS;
}
public ArrayList<UnitOfStudy> getUnitsOfStudy(String SID) {
ArrayList<UnitOfStudy> subjects = new ArrayList<UnitOfStudy>();
try{
String selectQuery = "SELECT UOS"
+ " FROM Enrolment"
+ " WHERE STUDENT=?"
;
PreparedStatement selectStatement = dbConnection.prepareStatement(selectQuery);
selectStatement.setString(1, SID);
ResultSet selectRs = selectStatement.executeQuery();
while (selectRs.next()){
String unitCode = selectRs.getString(1);
UnitOfStudy matchingUOS = getUnitOfStudy(unitCode);
subjects.add(matchingUOS);
}
} catch (SQLException e){
e.printStackTrace();
}
return subjects;
}
public Project getParent(int teamID) {
Project matchingProject = null;
try{
String selectQuery = "SELECT PROJECT_ID"
+ " FROM TEAM"
+ " WHERE TEAM_ID=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setInt(1, teamID);
ResultSet rs = stmt.executeQuery();
if (rs.next()){
int projectID = rs.getInt(1);
matchingProject = getProject(projectID);
}
}
catch (SQLException e){
e.printStackTrace();
}
return matchingProject;
}
public ArrayList<Student> getMembers(int teamID) {
ArrayList<Student> teamMembers = new ArrayList<Student>();
try{
String selectQuery = "SELECT STUDENT"
+ " FROM TeamMembership"
+ " WHERE TEAM=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setInt(1, teamID);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
String sid = rs.getString(1);
Student matchingStudent = getStudent(sid);
teamMembers.add(matchingStudent);
}
}
catch (SQLException e){
e.printStackTrace();
}
return teamMembers;
}
public ArrayList<Team> getTeams(String sid) {
ArrayList<Team> studentsTeams = new ArrayList<Team>();
try{
String selectQuery = "SELECT TEAM"
+ " FROM TeamMembership"
+ " WHERE STUDENT=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, sid);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
int teamID = rs.getInt(1);
Team matchingTeam = getTeam(teamID);
studentsTeams.add(matchingTeam);
}
}
catch (SQLException e){
e.printStackTrace();
}
return studentsTeams;
}
// -- -- -- -- -- -- -- THE FOLLOWING METHODS ARE ONLY USED FOR TESTING PURPOSES -- -- -- -- -- -- --
public ArrayList<String> getTableNames(){
String selectQuery =
" SELECT table_name"
+ " FROM INFORMATION_SCHEMA.TABLES"
+ " WHERE TABLE_SCHEMA='public'"
+ " AND TABLE_TYPE='BASE TABLE'";
ArrayList<String> tableNames = new ArrayList<String>();
try{
Statement stmt = dbConnection.createStatement();
ResultSet rs = stmt.executeQuery(selectQuery);
while (rs.next()){
tableNames.add(rs.getString("table_name"));
}
} catch (SQLException e){
e.printStackTrace();
}
return tableNames;
}
public ArrayList<String> getColumnNames(String tableName){
String selectQuery =
" SELECT column_name"
+ " FROM INFORMATION_SCHEMA.COLUMNS"
+ " WHERE table_name=?";
ArrayList<String> columnNames = new ArrayList<String>();
try{
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, tableName);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
columnNames.add(rs.getString("column_name"));
}
} catch (SQLException e){
e.printStackTrace();
}
return columnNames;
}
public ArrayList<Student> getStudentsInUoS(String unitCode) {
ArrayList<Student> unitsStudents = new ArrayList<Student>();
try{
String selectQuery = "SELECT STUDENT"
+ " FROM ENROLMENT"
+ " WHERE UOS=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, unitCode);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
String sid = rs.getString(0);
Student matchingStudent= getStudent(sid);
unitsStudents.add(matchingStudent);
}
}
catch (SQLException e){
e.printStackTrace();
}
return unitsStudents;
}
public ArrayList<UnitOfStudy> getAdminUnitsOfStudy(String staffID){
ArrayList<UnitOfStudy> adminUnits = new ArrayList<UnitOfStudy>();
try{
String selectQuery = "SELECT UOS"
+ " FROM Administration"
+ " WHERE STAFF_NUM=?"
;
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setString(1, staffID);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
String unitCode = rs.getString(0);
UnitOfStudy matchingStudent= getUnitOfStudy(unitCode);
adminUnits.add(matchingStudent);
}
}
catch (SQLException e){
e.printStackTrace();
}
return adminUnits;
}
public List<Invitation> getInvitations(int projectID, boolean onlyAccepted){
ArrayList<Invitation> invites = new ArrayList<Invitation>();
try{
String selectQuery = "SELECT *"
+ " FROM Invitation"
+ " WHERE PROJECT=? " + (onlyAccepted? "AND ACCEPTED=TRUE" : "");
PreparedStatement stmt = dbConnection.prepareStatement(selectQuery);
stmt.setInt(1, projectID);
ResultSet rs = stmt.executeQuery();
while (rs.next()){
Invitation matchingInvite = new Invitation(rs.getInt("INVITE_ID"), rs.getString("SENDER"), rs.getString("RECIPIENT"), rs.getInt("PROJECT"), rs.getString("MESSAGE"));
invites.add(matchingInvite);
}
}
catch (SQLException e){
e.printStackTrace();
}
return invites;
}
public void deleteInvitation(int inviteId) {
try{
String deleteQuery = "DELETE"
+ " FROM Invitation"
+ " WHERE INVITE_ID = ?"
;
PreparedStatement stmt = dbConnection.prepareStatement(deleteQuery);
stmt.setInt(1, inviteId);
ResultSet rs = stmt.executeQuery();
}
catch (SQLException e){
e.printStackTrace();
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
54f47967b4d58c1f2723768f9bf2236467f1d5c4
|
b1db7cf979aaed9a60e376fe2a61e020b66f84e0
|
/src/java/com/jilit/irp/persistence/dto/ResultPublishOnWebId.java
|
6355885fed9616381a1c54ccec0cc78c19ca08ea
|
[] |
no_license
|
livcoding/CLXRegistration_OLD
|
c2a569c0c05c46b9fbb6e176ffc1fd9ca3ebd7e1
|
a167f29d20d9c9f1de0e4e78bfca6317f837bc4d
|
refs/heads/master
| 2023-06-21T11:14:20.595579
| 2021-07-23T07:26:29
| 2021-07-23T07:26:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,408
|
java
|
package com.jilit.irp.persistence.dto;
// Generated 24 Sep, 2011 10:05:25 AM by Hibernate Tools 3.2.1.GA
/**
* ResultpublishonwebId generated by hbm2java
*/
public class ResultPublishOnWebId implements java.io.Serializable {
private String instituteid;
private String registrationid;
private String academicyear;
private String programid;
private String sectionid;
private byte stynumber;
private String stytypeid;
public ResultPublishOnWebId() {
}
public ResultPublishOnWebId(String instituteid, String registrationid, String academicyear, String programid, String sectionid, byte stynumber, String stytypeid) {
this.instituteid = instituteid;
this.registrationid = registrationid;
this.academicyear = academicyear;
this.programid = programid;
this.sectionid = sectionid;
this.stynumber = stynumber;
this.stytypeid = stytypeid;
}
public String getInstituteid() {
return this.instituteid;
}
public void setInstituteid(String instituteid) {
this.instituteid = instituteid;
}
public String getRegistrationid() {
return this.registrationid;
}
public void setRegistrationid(String registrationid) {
this.registrationid = registrationid;
}
public String getAcademicyear() {
return this.academicyear;
}
public void setAcademicyear(String academicyear) {
this.academicyear = academicyear;
}
public String getProgramid() {
return this.programid;
}
public void setProgramid(String programid) {
this.programid = programid;
}
public String getSectionid() {
return this.sectionid;
}
public void setSectionid(String sectionid) {
this.sectionid = sectionid;
}
public byte getStynumber() {
return this.stynumber;
}
public void setStynumber(byte stynumber) {
this.stynumber = stynumber;
}
public String getStytypeid() {
return this.stytypeid;
}
public void setStytypeid(String stytypeid) {
this.stytypeid = stytypeid;
}
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof ResultPublishOnWebId) ) return false;
ResultPublishOnWebId castOther = ( ResultPublishOnWebId ) other;
return ( (this.getInstituteid()==castOther.getInstituteid()) || ( this.getInstituteid()!=null && castOther.getInstituteid()!=null && this.getInstituteid().equals(castOther.getInstituteid()) ) )
&& ( (this.getRegistrationid()==castOther.getRegistrationid()) || ( this.getRegistrationid()!=null && castOther.getRegistrationid()!=null && this.getRegistrationid().equals(castOther.getRegistrationid()) ) )
&& ( (this.getAcademicyear()==castOther.getAcademicyear()) || ( this.getAcademicyear()!=null && castOther.getAcademicyear()!=null && this.getAcademicyear().equals(castOther.getAcademicyear()) ) )
&& ( (this.getProgramid()==castOther.getProgramid()) || ( this.getProgramid()!=null && castOther.getProgramid()!=null && this.getProgramid().equals(castOther.getProgramid()) ) )
&& ( (this.getSectionid()==castOther.getSectionid()) || ( this.getSectionid()!=null && castOther.getSectionid()!=null && this.getSectionid().equals(castOther.getSectionid()) ) )
&& (this.getStynumber()==castOther.getStynumber())
&& ( (this.getStytypeid()==castOther.getStytypeid()) || ( this.getStytypeid()!=null && castOther.getStytypeid()!=null && this.getStytypeid().equals(castOther.getStytypeid()) ) );
}
public int hashCode() {
int result = 17;
result = 37 * result + ( getInstituteid() == null ? 0 : this.getInstituteid().hashCode() );
result = 37 * result + ( getRegistrationid() == null ? 0 : this.getRegistrationid().hashCode() );
result = 37 * result + ( getAcademicyear() == null ? 0 : this.getAcademicyear().hashCode() );
result = 37 * result + ( getProgramid() == null ? 0 : this.getProgramid().hashCode() );
result = 37 * result + ( getSectionid() == null ? 0 : this.getSectionid().hashCode() );
result = 37 * result + this.getStynumber();
result = 37 * result + ( getStytypeid() == null ? 0 : this.getStytypeid().hashCode() );
return result;
}
}
|
[
"uvsir001@gmail.com"
] |
uvsir001@gmail.com
|
abfd6ec96e6297afa8651b8a545fad327c12d885
|
d17aafb7c1998ce1c3dcad97aa4ce27e6170fb2b
|
/Exam1/src/exam1/Exam1.java
|
998661db0ce836220e62ba2b511c811e504e4cca
|
[] |
no_license
|
kvillamil1/CS372
|
8ea3a3e0dac26db4379bab060c531510964b01cc
|
20ff10ca827ad68fb071675038e863d92d89d536
|
refs/heads/master
| 2016-09-11T08:15:04.415133
| 2015-02-06T17:38:50
| 2015-02-06T17:38:50
| 28,836,114
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 442
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package exam1;
/**
* Exam 1: Under Over Dice Game
* @author Kat
*/
public class Exam1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
|
[
"kvillamil16@my.whitworth.edu"
] |
kvillamil16@my.whitworth.edu
|
9ef10ddf9f453845aede1aa13457492c56854424
|
963699646b387f40a1941d156cb2c28a29bf6489
|
/nrpc-registry/nrpc-registry-api/src/main/java/cn/icodening/rpc/registry/RegistryKeyConstant.java
|
5b09b54e9d733e7cd1f47370b275047cc74aa436
|
[] |
no_license
|
icodening/nrpc
|
060ceb320e9539a22de8bca2fcc1f111e7c94ebe
|
adeb160629657a68fe8ca183151b2eceb961f136
|
refs/heads/main
| 2023-05-13T04:59:35.373691
| 2021-05-27T09:10:50
| 2021-05-27T09:10:50
| 323,392,061
| 11
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 430
|
java
|
package cn.icodening.rpc.registry;
/**
* @author icodening
* @date 2020.12.30
*/
public interface RegistryKeyConstant {
String CLUSTER = "cluster";
String SERVICE = "service";
String APPLICATION = "application";
String VERSION = "version";
String GROUP = "group";
String ENABLED = "enabled";
String EPHEMERAL = "ephemeral";
String WEIGHT = "weight";
String HEALTHY = "healthy";
}
|
[
"747167846@qq.com"
] |
747167846@qq.com
|
48b4cec002cb274438df141876255ddc2fdee4f1
|
b3f3da9232505de939eefd4d84125ecb404e74f8
|
/src/main/java/com/a2937/pokemon/PokemonMain.java
|
63a1dd11e261f425f50a4c75e8de08ed5503d84c
|
[
"MIT"
] |
permissive
|
a2937/poke-plugin
|
f58914cf8e0028c1216abdaa7a8b65ce29dc7a35
|
140497ff0c1aa2cdecd1bfca0621a88c8ffe9a20
|
refs/heads/master
| 2020-07-18T04:38:11.139430
| 2019-11-02T16:47:44
| 2019-11-02T16:47:44
| 206,175,249
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 893
|
java
|
package com.a2937.pokemon;
import com.avairebot.language.Language;
import com.avairebot.plugin.JavaPlugin;
import com.avairebot.pokemon.command.FindPokemonAbilityCommand;
import com.avairebot.pokemon.command.FindPokemonCommand;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
public class PokemonMain extends JavaPlugin {
public static final Logger LOGGER = LoggerFactory.getLogger(PokemonMain.class);
@Override
public void onEnable() {
saveDefaultConfig();
reloadConfig();
try
{
registerI18n(Language.EN_US,getPluginLoader().getResource("langs/en_US.yml"));
}
catch (IOException e)
{
LOGGER.error("" + e.getMessage() ,e);
}
registerCommand(new FindPokemonCommand(this));
registerCommand(new FindPokemonAbilityCommand(this));
}
}
|
[
"a.rcottrill521@gmail.com"
] |
a.rcottrill521@gmail.com
|
1a4e80a0c729f7b30381fa4807aa4585943ad74b
|
292a0360cd91ee703746be3d6d68ef704e8b3ff4
|
/src/main/java/pl/connectis/cschool/jcourse/restservice/repository/FakturaRepository.java
|
e61a9a1ce769932cf56a50da008cdc717c9228e6
|
[] |
no_license
|
ntsprd/Faktura
|
27cf7a00821135d8e52616a41ad717f0cb00bdda
|
60603065ddd890bacfbdf237f2d0902aef64c88d
|
refs/heads/master
| 2021-07-05T11:27:54.036940
| 2017-09-25T20:16:08
| 2017-09-25T20:16:08
| 104,797,645
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 403
|
java
|
package pl.connectis.cschool.jcourse.restservice.repository;
import org.springframework.boot.context.config.ResourceNotFoundException;
import org.springframework.data.repository.CrudRepository;
import pl.connectis.cschool.jcourse.restservice.domain.Faktura;
public interface FakturaRepository extends CrudRepository<Faktura, Long> {
Faktura deleteById(long id) throws ResourceNotFoundException;
}
|
[
"ntsprd@gmail.com"
] |
ntsprd@gmail.com
|
ceee7da7e7589038ae0032d57d3303eba6d79234
|
3e0f2dfb56216b5b72120f2470e997bef71592ff
|
/app/src/main/java/com/example/administrator/videoreader/bean/news/HealthNewsList.java
|
d74ecc19053c52b02395714cf4f2a449ff35498b
|
[] |
no_license
|
jinhuizxc/VideoReader
|
d6a0ae0bf3dca575c6a571939b0f70d50f011536
|
15898cf413ee64a70d1185367bd801c527869d7b
|
refs/heads/master
| 2021-01-23T01:51:56.537336
| 2017-12-23T09:25:50
| 2017-12-23T09:25:50
| 92,898,994
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 513
|
java
|
package com.example.administrator.videoreader.bean.news;
import com.example.administrator.videoreader.config.Constants;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
/**
* Created by jinhui on 2017/5/31.
* 邮箱: 1004260403@qq.com
*/
public class HealthNewsList {
@SerializedName(Constants.NETEASY_NEWS_HEALTH)
private ArrayList<NewsBean> mHealthNewsArrayList;
public ArrayList<NewsBean> getRecNewsArrayList() {
return mHealthNewsArrayList;
}
}
|
[
"1004260403@qq.com"
] |
1004260403@qq.com
|
e12f2c73e914bea56aabe23b136c270b81c2a4a2
|
664e4c977bf8980054ab83af58a36043e0cf71b3
|
/src/main/java/com/mycompany/mavenproject15/ComparatorSize.java
|
2de34fbde0f27bee10f2043b6e87246a7b17107b
|
[] |
no_license
|
panosprokopiou/assignment-4
|
8670fff70571abca57ba516dd1c50a7fc5678b99
|
4f3bd4ef4693f3589acb0cb7d6c58aa5014e3a1f
|
refs/heads/master
| 2022-04-27T01:01:51.037261
| 2020-04-17T09:15:06
| 2020-04-17T09:15:06
| 256,456,415
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 658
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.mavenproject15;
import java.util.Comparator;
/**
*
* @author Pan
*/
public class ComparatorSize implements Comparator<Shirt> {
@Override
public int compare(Shirt t1, Shirt t2) {
return (t1.getS().ordinal() - t2.getS().ordinal());
}
@Override
public Comparator<Shirt> reversed() {
return Comparator.super.reversed();
}
}
|
[
"panosprokopiou@gmail.com"
] |
panosprokopiou@gmail.com
|
455e1b9ce7df74c98d8cdd348948d9c603a632aa
|
4c6adf0ce6ef3f02dcef9c345e0e5e4ff139d886
|
/Common/RM/rm-jar/rm-service/src/main/java/com/pay/rm/service/service/facade/ruleprovider/PayToBankDirectProvider.java
|
2e87922928ad844974510151cac87314cd819cc8
|
[] |
no_license
|
happyjianguo/pay-1
|
8631906be62707316f0ed3eb6b2337c90d213bc0
|
40ae79738cfe4e5d199ca66468f3a33e9d8f2007
|
refs/heads/master
| 2020-07-27T19:51:54.958859
| 2016-12-19T07:34:24
| 2016-12-19T07:34:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 654
|
java
|
package com.pay.rm.service.service.facade.ruleprovider;
import java.util.Map;
import com.pay.rm.service.common.RCRuleType;
import com.pay.rm.service.dto.rmlimit.rule.BaseRule;
import com.pay.rm.service.service.facade.RCLimitService;
public class PayToBankDirectProvider implements BaseProvider {
private RCLimitService rcLimitService;
@Override
public BaseRule getRule(Map<String, String> map) {
// TODO Auto-generated method stub
return BusinessLimitUtil.getRule(rcLimitService, RCRuleType.TYPE_FO_BANK_DIRECT.getType(), map);
}
public void setRcLimitService(RCLimitService rcLimitService) {
this.rcLimitService = rcLimitService;
}
}
|
[
"stanley.zou@hrocloud.com"
] |
stanley.zou@hrocloud.com
|
56b3d431a9ff00f45fc2034f5d70494bdce44d8d
|
24c71c30cdcec25347c8e5763e8ce1bae34fb653
|
/app/src/main/java/com/example/tal/customalertdialog/CreditsActivity.java
|
39b98fd4d2526d0b4c0706d1370b107e064209f7
|
[] |
no_license
|
Tal747/CustomAlertDialog
|
8fe04e4c92473d165d0aa310c92ba8b495acb0bb
|
9563ac37f65f7e1ef4be3f386151b0a2d4b6b0f2
|
refs/heads/master
| 2020-04-04T21:20:45.955481
| 2018-11-08T18:45:29
| 2018-11-08T18:45:29
| 156,282,599
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 765
|
java
|
package com.example.tal.customalertdialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
public class CreditsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_credits);
setTitle("Credits");
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home)
this.finish();
return super.onOptionsItemSelected(item);
}
}
|
[
"ty4273@bs.amalnet.k12.il"
] |
ty4273@bs.amalnet.k12.il
|
0a58d6e13e6780e41834898f58ead0962cd06c29
|
eecb97162580b846f4fdbb2247d022f9c8d1fda6
|
/src/main/java/com/core/spring_core/eventhandling/Event.java
|
30d844a39010fbb54e7ce25cebc71ffab14a3cdb
|
[] |
no_license
|
shiva508/spring_core
|
a898b94149a649834e90f8138f3b73c107dd8687
|
7ee5d56a33575b117da5307b051fdc6d379f38c3
|
refs/heads/master
| 2022-08-23T11:09:26.078311
| 2022-08-07T11:05:00
| 2022-08-07T11:05:00
| 193,502,701
| 0
| 0
| null | 2022-08-07T11:10:17
| 2019-06-24T12:38:46
|
Java
|
UTF-8
|
Java
| false
| false
| 136
|
java
|
package com.core.spring_core.eventhandling;
public class Event {
public void eventDetails() {
System.out.println("Event");
}
}
|
[
"dasarishiva1@gamil.com"
] |
dasarishiva1@gamil.com
|
d0e1a4db8c5d0ca9c8aecf4aa9a1da1439237e06
|
c9b7730f6997ebef8ef2ad822651497e979c359c
|
/myretail/src/main/java/com/ahj/retail/data/Product.java
|
895011832e9eefd89044caf36dba2e5c4f96cd3a
|
[] |
no_license
|
jasaniankit/springboot-demo
|
3bc7d1dd7bf9ae190d53769effa1121b0877347b
|
3940c72099a6e91b257052ae574883b1e288c69f
|
refs/heads/master
| 2021-01-01T05:46:11.852399
| 2016-04-14T01:16:59
| 2016-04-14T01:16:59
| 56,196,964
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,825
|
java
|
package com.ahj.retail.data;
import java.io.Serializable;
import java.sql.Date;
/**
* The Class Product.
*
* @author jasaniankit
*/
public class Product implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The id. */
private String id;
/** The name. */
private String name;
/** The category. */
private String category;
/** The sku. */
private String sku;
/** The updated on. */
private Date updatedOn;
/** The price. */
private String price;
public Product() {
}
public Product(String id, String name, String category) {
this.id = id;
this.name = name;
this.category = category;
}
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* Gets the name.
*
* @return the name
*/
public String getName() {
return name;
}
/**
* Gets the category.
*
* @return the category
*/
public String getCategory() {
return category;
}
/**
* Gets the sku.
*
* @return the sku
*/
public String getSku() {
return sku;
}
public Date getUpdatedOn() {
return updatedOn;
}
public void setId(final String id) {
this.id = id;
}
public void setName(final String name) {
this.name = name;
}
public void setCategory(final String category) {
this.category = category;
}
public void setSku(final String sku) {
this.sku = sku;
}
/**
* Sets the updated on.
*
* @param updatedOn the new updated on
*/
public void setUpdatedOn(final Date updatedOn) {
this.updatedOn = updatedOn;
}
/**
* Gets the price.
*
* @return the price
*/
public String getPrice() {
return price;
}
/**
* Sets the price.
*
* @param price the new price
*/
public void setPrice(final String price) {
this.price = price;
}
}
|
[
"Ankit Jasani"
] |
Ankit Jasani
|
2a23d9fb1a0f072648a8f3979851e2f4d0dbf44f
|
ef4129889606abf58a4764ace6d2c84b4a26286e
|
/pojos/Product.java
|
b98c9468d98518aafaa40ee01575aa109bd4fd4d
|
[] |
no_license
|
nishtha-garg/Best-Deal-Online-Shopping-Web-Application
|
e646030fe5c6c6e8cf1271b941454dd20a3ecf1a
|
fe6e8df352ef16c447c043cb851d321e8b26bfa6
|
refs/heads/master
| 2021-05-01T16:50:18.072431
| 2018-02-10T21:26:51
| 2018-02-10T21:26:51
| 121,054,822
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,811
|
java
|
package pojos;
import java.util.ArrayList;
import java.util.List;
public class Product {
private String productid;
private String productretailer;
private double productprice;
private String productType;
public Product()
{}
public Product(String productid, String productretailer, double productprice)
{
this.productid = productid;
this.productretailer = productretailer;
this.productprice = productprice;
}
public Product(String productid, String productretailer) {
super();
this.productid = productid;
this.productretailer = productretailer;
}
public Product(String productid, String productretailer,
double productprice, String productType) {
this.productid = productid;
this.productretailer = productretailer;
this.productprice = productprice;
this.productType = productType;
}
public String getProductRetailer() {
return productretailer;
}
public void setProductRetailer(String productretailer) {
this.productretailer = productretailer;
}
public String getProductId() {
return productid;
}
public void setProductId(String id) {
this.productid = productid;
}
public double getProductPrice() {
return productprice;
}
public void setProductPrice(double productprice) {
this.productprice = productprice;
}
public String getProductType() {
return productType;
}
public void setProductType(String productType) {
this.productType = productType;
}
public String toString() {
return "Product [productid=" + productid + ", productretailer="
+ productretailer + ", productprice=" + productprice
+ ", productType=" + productType + "]";
}
}
|
[
"noreply@github.com"
] |
nishtha-garg.noreply@github.com
|
cb157ebdb0b6689f060ada74b0ebc848bf62c813
|
0ebb4a97ba4e32fb2a2a6bf35ad7ed22b5bf537c
|
/src/main/java/com/hysw/qqsl/cloud/core/dao/AttribeDao.java
|
535d6d1356f91dab02598c4f8075d392148054a2
|
[] |
no_license
|
GSIL-Monitor/qqsl
|
909bbd92b7248e3694d5eea2a9ee63cb9fe21f18
|
7d849acab4d9c520db5e7664f2ea7ce583f70289
|
refs/heads/master
| 2020-04-24T07:28:14.120020
| 2018-08-02T02:33:27
| 2018-08-02T02:33:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 267
|
java
|
package com.hysw.qqsl.cloud.core.dao;
import com.hysw.qqsl.cloud.core.entity.data.Attribe;
import org.springframework.stereotype.Repository;
/**
* Created by leinuo on 17-4-7.
*/
@Repository("attribeDao")
public class AttribeDao extends BaseDao<Attribe,Long> {
}
|
[
"119238122@qq.com"
] |
119238122@qq.com
|
e9e5661b1da9df39f5ce9dcdd123af6d84b94975
|
b4a91b1caf97d64f7df30187435847f98058daf9
|
/client/android/app/src/main/java/com/client/GetLocationPackage.java
|
e16575b7056e035932ecb214063c36b64f1a6a8a
|
[] |
no_license
|
Leochens/ChatNowHere
|
cd0b09cb1f049ac6c1deff5f77c46388d9c2330a
|
619185a81fcf3e445622c5bf55e2e753cc5b1354
|
refs/heads/master
| 2020-04-05T19:26:50.326806
| 2018-12-07T13:26:39
| 2018-12-07T13:26:39
| 157,134,910
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,072
|
java
|
package com.client;
import android.content.Context;
import android.location.Criteria;
import android.location.LocationManager;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
public class GetLocationPackage implements ReactPackage{
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new GetLocation(reactContext));
return modules;
}
class GetLocation extends ReactContextBaseJavaModule {
private Context context;
@Nullable
@Override
public Map<String, Object> getConstants() {
return super.getConstants();
}
public GetLocation(ReactApplicationContext context){
super(context);
this.context = context;
}
@ReactMethod
public void getLocation(){
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setAltitudeRequired(false); //海拔信息:不需要
criteria.setBearingRequired(false); //方位信息: 不需要
criteria.setCostAllowed(true); //是否允许付费
criteria.setPowerRequirement(Criteria.POWER_LOW); //耗电量: 低功耗
}
@Override
public String getName() {
return "GetLocation";
}
}
}
|
[
"18332518328@163.com"
] |
18332518328@163.com
|
8ad2f5c54327ee0f23159616d9faaf84a2fa398b
|
2058494553b54d02ad9bc8444760dadfe9f42b39
|
/src/com/jwetherell/augmented_reality/data/ARData.java
|
c0cc0f869ac66f48dbe71c161874c7ccf3bc3b81
|
[] |
no_license
|
narate/guide-droid-android-app
|
b3fe666c4a3e1caa71e9aefee1182a54ea4d3255
|
2b3ff1735c36a53db73da1515f351b49b803879c
|
refs/heads/master
| 2021-01-01T19:56:57.260042
| 2012-10-31T15:23:24
| 2012-10-31T15:23:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,953
|
java
|
package com.jwetherell.augmented_reality.data;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import com.jwetherell.augmented_reality.common.Matrix;
import com.jwetherell.augmented_reality.ui.Marker;
import android.location.Location;
import android.util.Log;
/**
* Abstract class which should be used to set global data.
*
* @author Justin Wetherell <phishman3579@gmail.com>
*/
public abstract class ARData {
private static final String TAG = "ARData";
private static final Map<String, Marker> markerList = new ConcurrentHashMap<String, Marker>();
private static final List<Marker> cache = new CopyOnWriteArrayList<Marker>();
private static final AtomicBoolean dirty = new AtomicBoolean(false);
private static final float[] locationArray = new float[3];
/* defaulting to our place */
public static final Location hardFix = new Location("ATL");
static {
hardFix.setLatitude(14.1613596);
hardFix.setLongitude(101.3644172);
hardFix.setAltitude(1);
}
private static final Object radiusLock = new Object();
private static float radius = new Float(20);
private static String zoomLevel = new String();
private static final Object zoomProgressLock = new Object();
private static int zoomProgress = 0;
private static Location currentLocation = hardFix;
private static Matrix rotationMatrix = new Matrix();
private static final Object azimuthLock = new Object();
private static float azimuth = 0;
private static final Object pitchLock = new Object();
private static float pitch = 0;
private static final Object rollLock = new Object();
private static float roll = 0;
/**
* Set the zoom level.
*
* @param zoomLevel
* String representing the zoom level.
*/
public static void setZoomLevel(String zoomLevel) {
if (zoomLevel == null)
throw new NullPointerException();
synchronized (ARData.zoomLevel) {
ARData.zoomLevel = zoomLevel;
}
}
/**
* Get the zoom level.
*
* @return String representing the zoom level.
*/
public static String getZoomLevel() {
synchronized (ARData.zoomLevel) {
return ARData.zoomLevel;
}
}
/**
* Set the zoom progress.
*
* @param zoomProgress
* int representing the zoom progress.
*/
public static void setZoomProgress(int zoomProgress) {
synchronized (ARData.zoomProgressLock) {
if (ARData.zoomProgress != zoomProgress) {
ARData.zoomProgress = zoomProgress;
if (dirty.compareAndSet(false, true)) {
Log.v(TAG, "Setting DIRTY flag!");
cache.clear();
}
}
}
}
/**
* Get the zoom progress.
*
* @return int representing the zoom progress.
*/
public static int getZoomProgress() {
synchronized (ARData.zoomProgressLock) {
return ARData.zoomProgress;
}
}
/**
* Set the radius of the radar screen.
*
* @param radius
* float representing the radar screen.
*/
public static void setRadius(float radius) {
synchronized (ARData.radiusLock) {
ARData.radius = radius;
}
}
/**
* Get the radius (in KM) of the radar screen.
*
* @return float representing the radar screen.
*/
public static float getRadius() {
synchronized (ARData.radiusLock) {
return ARData.radius;
}
}
/**
* Set the current location.
*
* @param currentLocation
* Location to set.
* @throws NullPointerException
* if Location param is NULL.
*/
public static void setCurrentLocation(Location currentLocation) {
if (currentLocation == null)
throw new NullPointerException();
Log.d(TAG, "current location. location=" + currentLocation.toString());
synchronized (currentLocation) {
ARData.currentLocation = currentLocation;
}
onLocationChanged(currentLocation);
}
private static void onLocationChanged(Location location) {
Log.d(TAG,
"New location, updating markers. location="
+ location.toString());
for (Marker ma : markerList.values()) {
ma.calcRelativePosition(location);
}
if (dirty.compareAndSet(false, true)) {
Log.v(TAG, "Setting DIRTY flag!");
cache.clear();
}
}
/**
* Get the current Location.
*
* @return Location representing the current location.
*/
public static Location getCurrentLocation() {
synchronized (ARData.currentLocation) {
return ARData.currentLocation;
}
}
/**
* Set the rotation matrix.
*
* @param rotationMatrix
* Matrix to use for rotation.
*/
public static void setRotationMatrix(Matrix rotationMatrix) {
synchronized (ARData.rotationMatrix) {
ARData.rotationMatrix = rotationMatrix;
}
}
/**
* Get the rotation matrix.
*
* @return Matrix representing the rotation matrix.
*/
public static Matrix getRotationMatrix() {
synchronized (ARData.rotationMatrix) {
return rotationMatrix;
}
}
/**
* Add a List of Markers to our Collection.
*
* @param markers
* List of Markers to add.
*/
public static void addMarkers(Collection<Marker> markers) {
if (markers == null)
throw new NullPointerException();
Log.d(TAG,
"New markers, updating markers. new markers="
+ markers.toString());
for (Marker marker : markers) {
if (!markerList.containsKey(marker.getName())) {
marker.calcRelativePosition(ARData.getCurrentLocation());
markerList.put(marker.getName(), marker);
}
}
if (dirty.compareAndSet(false, true)) {
Log.v(TAG, "Setting DIRTY flag!");
cache.clear();
}
}
/**
* Get the Markers collection.
*
* @return Collection of Markers.
*/
public static List<Marker> getMarkers() {
// If markers we added, zero out the altitude to recompute the collision
// detection
if (dirty.compareAndSet(true, false)) {
Log.v(TAG,
"DIRTY flag found, resetting all marker heights to zero.");
for (Marker ma : markerList.values()) {
ma.getLocation().get(locationArray);
locationArray[1] = ma.getInitialY();
ma.getLocation().set(locationArray);
}
Log.v(TAG, "Populating the cache.");
List<Marker> copy = new ArrayList<Marker>();
copy.addAll(markerList.values());
Collections.sort(copy, comparator);
// The cache should be sorted from closest to farthest marker.
cache.clear();
cache.addAll(copy);
}
return Collections.unmodifiableList(cache);
}
private static final Comparator<Marker> comparator = new Comparator<Marker>() {
/**
* {@inheritDoc}
*/
@Override
public int compare(Marker arg0, Marker arg1) {
return Double.compare(arg0.getDistance(), arg1.getDistance());
}
};
/**
* Set the current Azimuth.
*
* @param azimuth
* float representing the azimuth.
*/
public static void setAzimuth(float azimuth) {
synchronized (azimuthLock) {
ARData.azimuth = azimuth;
}
}
/**
* Get the current Azimuth.
*
* @return azimuth float representing the azimuth.
*/
public static float getAzimuth() {
synchronized (azimuthLock) {
return ARData.azimuth;
}
}
/**
* Set the current Pitch.
*
* @param pitch
* float representing the pitch.
*/
public static void setPitch(float pitch) {
synchronized (pitchLock) {
ARData.pitch = pitch;
}
}
/**
* Get the current Pitch.
*
* @return pitch float representing the pitch.
*/
public static float getPitch() {
synchronized (pitchLock) {
return ARData.pitch;
}
}
/**
* Set the current Roll.
*
* @param roll
* float representing the roll.
*/
public static void setRoll(float roll) {
synchronized (rollLock) {
ARData.roll = roll;
}
}
/**
* Get the current Roll.
*
* @return roll float representing the roll.
*/
public static float getRoll() {
synchronized (rollLock) {
return ARData.roll;
}
}
}
|
[
"narate@appstack.co.th"
] |
narate@appstack.co.th
|
1c8793ea1104f17a69746d3141f892ab5431f8df
|
628e12cf1f6c5bec09e68986c2cfe814596a490c
|
/Monopoly/bin/edu/towson/cis/cosc603/project2/monopoly/src/edu/towson/cis/cosc603/project2/monopoly/gui/PropertyCellInfoFormatter.java
|
66054f6df213adbacaf79eae659b180699c02804
|
[] |
no_license
|
jpodier/cosc603-podier-bathmann-project2
|
8c7af8514aba71ac4985e89934cb81aef7f3bb25
|
668bb90589ed7b478dc3d973a61a5caa1a67cfb9
|
refs/heads/master
| 2021-01-10T09:19:49.696435
| 2016-03-07T03:00:02
| 2016-03-07T03:00:02
| 52,915,849
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,020
|
java
|
package edu.towson.cis.cosc603.project2.monopoly.gui;
import edu.towson.cis.cosc603.project2.monopoly.Cell;
import edu.towson.cis.cosc603.project2.monopoly.Player;
import edu.towson.cis.cosc603.project2.monopoly.PropertyCell;
public class PropertyCellInfoFormatter implements CellInfoFormatter {
public String format(Cell cell) {
PropertyCell c = (PropertyCell)cell;
StringBuffer buf = new StringBuffer();
Player owner = cell.getOwner();
String ownerName = "";
if(owner != null) {
ownerName = owner.getName();
}
buf.append("<html><b><font color='")
.append(c.getColorGroup())
.append("'>")
.append(cell.getName())
.append("</font></b><br>")
.append("$").append(c.getPrice())
.append("<br>Owner: ").append(ownerName)
.append("<br>* ").append(c.getNumHouses())
.append("</html>");
return buf.toString();
}
}
|
[
"jpodier0214@gmail.com"
] |
jpodier0214@gmail.com
|
b7ff1480d72d608352add8f41025532316599c04
|
9b74b819c2789a35d6bd2f9a11dd4a7fd2d84c83
|
/src/main/java/liurui/templates/searchs/SequentialSearchImpl.java
|
fd2dc0e75929addafca741efbcbd9c5be6c1474b
|
[] |
no_license
|
liu-rui/java-algorithm
|
120be6aecd80728095637619a0e41813c11cf4a7
|
5c8af3c260189178994cd05d136064669803b0a8
|
refs/heads/master
| 2021-09-08T02:54:04.982330
| 2018-03-06T08:03:50
| 2018-03-06T08:03:50
| 99,557,992
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 257
|
java
|
package liurui.templates.searchs;
import liurui.defines.searchs.SequentialSearch;
/***
* 顺序查找
*/
public class SequentialSearchImpl implements SequentialSearch {
@Override
public int find(int[] data, int item) {
return 0;
}
}
|
[
"1313475@qq.com"
] |
1313475@qq.com
|
5dea5a11c38319aa54cdef749304bff7a813bc9d
|
4b08ff7b32b1cbae7b22cf47174df08b6a04f127
|
/src/main/java/com/yundingshuyuan/website/controller/RoleController.java
|
5d65ea8d3c0259a1d7c5db7d185e696f28ce54a3
|
[] |
no_license
|
sengeiou/yunding_website2.0
|
d6189a5f3592e9e6fd9ff9e00e0bfc27784b9335
|
99ddbde16977ab82ed4cef37895ad592578add15
|
refs/heads/master
| 2022-12-03T04:17:05.981991
| 2020-08-21T10:17:00
| 2020-08-21T10:17:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,041
|
java
|
package com.yundingshuyuan.website.controller;
import com.yundingshuyuan.website.response.ServerResponse;
import com.yundingshuyuan.website.service.IRoleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yundingshuyuan.website.controller.support.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author leeyf
* @since 2019-09-02
*/
@RestController
@RequestMapping("/role")
public class RoleController extends BaseController {
private final
IRoleService roleService;
public RoleController(IRoleService roleService) {
this.roleService = roleService;
}
@ApiOperation("获取全部角色")
@GetMapping("/listRoles")
public ServerResponse listRoles(){
return ServerResponse.createBySuccess(roleService.list());
}
}
|
[
"724899612@qq.com"
] |
724899612@qq.com
|
c29d0b6d5f6ab1fbee350615e269b48400e92dc5
|
df2a736b8a651ae25f49f447a2393cb5fd1f86d8
|
/src/main/java/com/deyi/clock/config/shiro/ByteSource.java
|
0aaa343ba8c138999dd1fc80572befac80be9a6d
|
[] |
no_license
|
abangya/clock
|
762b7c04b9f333672cc3c8d3f6ad66a2207e58dd
|
b2c55c3f60642e932e8949a25646c41f26702266
|
refs/heads/master
| 2022-06-24T15:55:27.241369
| 2019-06-15T12:55:01
| 2019-06-15T12:55:01
| 189,552,823
| 1
| 0
| null | 2022-06-21T01:12:14
| 2019-05-31T07:55:51
|
Java
|
UTF-8
|
Java
| false
| false
| 3,131
|
java
|
package com.deyi.clock.config.shiro;
import org.apache.shiro.codec.Base64;
import org.apache.shiro.codec.CodecSupport;
import org.apache.shiro.codec.Hex;
import java.io.File;
import java.io.InputStream;
import java.io.Serializable;
import java.util.Arrays;
/**
* @program: xiaowantong
* @Date: 2019/3/24 11:29
* @Author: lyz
* @Description:
*/
public class ByteSource implements org.apache.shiro.util.ByteSource, Serializable {
private byte[] bytes;
private String cachedHex;
private String cachedBase64;
public ByteSource() {
}
public ByteSource(byte[] bytes) {
this.bytes = bytes;
}
public ByteSource(char[] chars) {
this.bytes = CodecSupport.toBytes(chars);
}
public ByteSource(String string) {
this.bytes = CodecSupport.toBytes(string);
}
public ByteSource(org.apache.shiro.util.ByteSource source) {
this.bytes = source.getBytes();
}
public ByteSource(File file) {
this.bytes = new ByteSource.BytesHelper().getBytes(file);
}
public ByteSource(InputStream stream) {
this.bytes = new ByteSource.BytesHelper().getBytes(stream);
}
public static boolean isCompatible(Object o) {
return o instanceof byte[] || o instanceof char[] || o instanceof String ||
o instanceof org.apache.shiro.util.ByteSource || o instanceof File || o instanceof InputStream;
}
@Override
public byte[] getBytes() {
return this.bytes;
}
@Override
public boolean isEmpty() {
return this.bytes == null || this.bytes.length == 0;
}
@Override
public String toHex() {
if ( this.cachedHex == null ) {
this.cachedHex = Hex.encodeToString(getBytes());
}
return this.cachedHex;
}
@Override
public String toBase64() {
if ( this.cachedBase64 == null ) {
this.cachedBase64 = Base64.encodeToString(getBytes());
}
return this.cachedBase64;
}
@Override
public String toString() {
return toBase64();
}
@Override
public int hashCode() {
if (this.bytes == null || this.bytes.length == 0) {
return 0;
}
return Arrays.hashCode(this.bytes);
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof org.apache.shiro.util.ByteSource) {
org.apache.shiro.util.ByteSource bs = (org.apache.shiro.util.ByteSource) o;
return Arrays.equals(getBytes(), bs.getBytes());
}
return false;
}
//will probably be removed in Shiro 2.0. See SHIRO-203:
//https://issues.apache.org/jira/browse/SHIRO-203
private static final class BytesHelper extends CodecSupport {
/**
* 嵌套类也需要提供无参构造器
*/
private BytesHelper() {
}
public byte[] getBytes(File file) {
return toBytes(file);
}
public byte[] getBytes(InputStream stream) {
return toBytes(stream);
}
}
}
|
[
"963312406@qq.com"
] |
963312406@qq.com
|
376ffe1d17a2370195a3f8537cbccbcff39d736a
|
27511a2f9b0abe76e3fcef6d70e66647dd15da96
|
/src/com/instagram/android/feed/a/a/r.java
|
85e5576272b17b08179e0563172f380c03db7a47
|
[] |
no_license
|
biaolv/com.instagram.android
|
7edde43d5a909ae2563cf104acfc6891f2a39ebe
|
3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de
|
refs/heads/master
| 2022-05-09T15:05:05.412227
| 2016-07-21T03:48:36
| 2016-07-21T03:48:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 604
|
java
|
package com.instagram.android.feed.a.a;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
final class r
implements View.OnTouchListener
{
private final GestureDetector c = new GestureDetector(b.a, new q(this));
r(y paramy, x paramx) {}
public final boolean onTouch(View paramView, MotionEvent paramMotionEvent)
{
return c.onTouchEvent(paramMotionEvent);
}
}
/* Location:
* Qualified Name: com.instagram.android.feed.a.a.r
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
fbd2348c247a001a7c78f9fb40b3486cf17f675e
|
db4850befc5a18e6fa16c45d6c3439ce8ddd7397
|
/src/main/java/com/brain/passwd/util/UnixPasswdFileReader.java
|
b5b85e99e213cfdd5377dd3573bf53f0a007deb1
|
[
"Apache-2.0"
] |
permissive
|
jjmcknight/PasswdService
|
843b1de01f87835ca736650eecd3de62604233d5
|
9222df3b96fc9b653e9a82a1c35dd0df013d5258
|
refs/heads/master
| 2020-07-19T05:46:24.128455
| 2019-09-04T18:47:37
| 2019-09-08T21:57:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,087
|
java
|
package com.brain.passwd.util;
import com.brain.passwd.model.Group;
import com.brain.passwd.model.User;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class UnixPasswdFileReader implements PasswdFileReader {
@Override
public List<User> getUserEntries(String path) throws IOException {
Stream<String> stream = Files.lines(Paths.get(path));
return stream
.filter(line -> !line.startsWith("#"))
.map(line -> new User(line.split(":")))
.collect(Collectors.toCollection(ArrayList::new));
}
@Override
public List<Group> getGroupEntries(String path) throws IOException {
Stream<String> stream = Files.lines(Paths.get(path));
return stream
.filter(line -> !line.startsWith("#"))
.map(line -> new Group(line.split(":")))
.collect(Collectors.toCollection(ArrayList::new));
}
}
|
[
"jmcknight@illumina.com"
] |
jmcknight@illumina.com
|
0185ad6508bf0c8aa166b912d4a8a6648f29b25a
|
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/tencent/mm/plugin/game/model/GameTabData$StatusBar$1.java
|
e82c1f0995dd0aee347008ba98d24fd960fe373a
|
[] |
no_license
|
0jinxing/wechat-apk-source
|
544c2d79bfc10261eb36389c1edfdf553d8f312a
|
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
|
refs/heads/master
| 2020-06-07T20:06:03.580028
| 2019-06-21T09:17:26
| 2019-06-21T09:17:26
| 193,069,132
| 9
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 415
|
java
|
package com.tencent.mm.plugin.game.model;
import android.os.Parcelable.Creator;
final class GameTabData$StatusBar$1
implements Parcelable.Creator<GameTabData.StatusBar>
{
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.game.model.GameTabData.StatusBar.1
* JD-Core Version: 0.6.2
*/
|
[
"172601673@qq.com"
] |
172601673@qq.com
|
ba18f881c46ffdc7142d046994074410bec3b5f1
|
f6ca7c003000ff7e7ca6b4e25caaa94e5a918760
|
/archieve/src/thread_basic/main.java
|
caae24bd33e1e2f0e16084211be7d3cc1accee8c
|
[] |
no_license
|
dbtmddus/messanger_git
|
7a759ec392c144650a82a6dff5197fd8e214cb77
|
45ba5e24891525738639bf37b846b6283df782ad
|
refs/heads/master
| 2020-06-16T18:01:27.702797
| 2017-02-16T20:53:37
| 2017-02-16T20:53:37
| 75,081,224
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 566
|
java
|
package thread_basic;
public class main {
public static void main(String[] args) {
thread_extends t_extends1 = new thread_extends(1); //이 자체가 이미 thread 생성임.
//t_extends1.start();
thread_extends t_extends2 = new thread_extends(2);
//t_extends2.start();
///
thread_implements t_imp1emants1 = new thread_implements(11);
thread_implements t_implements2 = new thread_implements(12);
Thread thread1=new Thread(t_imp1emants1);
thread1.start();
Thread thread2=new Thread(t_implements2);
thread2.start();
}
}
|
[
"dbtmddus128@gmail.com"
] |
dbtmddus128@gmail.com
|
9a45d1c3681a64fb719cbbb679ff402f07d437d3
|
708fa27cad11a73e6da85507be909679f9edc3e9
|
/src/test/java/com/ganimi/portfolio/PortfolioApplicationTests.java
|
257a1d24a0b85ed0267e1102bd2a9f26d1efc0b7
|
[] |
no_license
|
tganimi/portfolio-spring
|
e725f9a11f8894e1bd464484a0906bf35120eb9c
|
6db96243eca84ac780b83894266690981a48b61a
|
refs/heads/master
| 2020-04-10T19:49:43.793792
| 2018-12-10T23:16:16
| 2018-12-10T23:16:16
| 161,248,565
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 340
|
java
|
package com.ganimi.portfolio;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class PortfolioApplicationTests {
@Test
public void contextLoads() {
}
}
|
[
"tganimi@gmail.com"
] |
tganimi@gmail.com
|
b3c00708b223ebea771568562dd6090c58fa8945
|
2a78d1ef7769cc536d74ff58d62e039db1248627
|
/src/Controladores/Controlador_Imagenes.java
|
1bd23c380845c4a820a4cae700275f934b8fdaea
|
[] |
no_license
|
AColina/modofoca
|
a4df4584dbd980a1bac2b0162d0c73080de8843b
|
1bdb816a5b6630b2d73eed1efe16fbb51ab6da9c
|
refs/heads/master
| 2021-01-12T05:30:52.016623
| 2017-01-03T17:59:59
| 2017-01-03T17:59:59
| 77,940,342
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,952
|
java
|
package Controladores;
import java.awt.Image;
import javax.swing.ImageIcon;
/**
*
* @author Angel Colina
*/
public class Controlador_Imagenes {
public final Image Icono;
public static ImageIcon Salir;
public static ImageIcon Salir_Enter;
public static ImageIcon Pelicula;
public static ImageIcon Pelicula_over;
public static ImageIcon Pelicula_click;
public static ImageIcon Juego;
public static ImageIcon Juego_over;
public static ImageIcon Juego_click;
public static ImageIcon Programas;
public static ImageIcon Programas_over;
public static ImageIcon Programas_click;
public static ImageIcon Archivos;
public static ImageIcon Archivos_over;
public static ImageIcon Archivos_click;
public static ImageIcon Cargar;
public static ImageIcon Cargar_over;
public static ImageIcon Cargar_click;
public static ImageIcon Peticion;
public static ImageIcon Peticion_over;
public static ImageIcon Peticion_click;
public static ImageIcon Camara_over;
public static ImageIcon Camara_click;
public static ImageIcon Serie_over;
public static ImageIcon Serie_click;
public Controlador_Imagenes() {
System.out.println(Controlador_Principal.getRuta()+"Img/exit.png");
Icono= new ImageIcon(getClass().getResource("/Img/icono.png")).getImage();
Salir=new javax.swing.ImageIcon(Controlador_Principal.getRuta()+"Img/exit.png");
Salir_Enter= new ImageIcon(Controlador_Principal.getRuta()+"Img/exittriste.png");
Pelicula= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon1_normal.png");
Pelicula_over= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon1_over.png");
Pelicula_click= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon1_clicked.png");
Juego= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon2_normal.png");
Juego_over= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon2_over.png");
Juego_click= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon2_clicked.png");
Programas= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon3_normal.png");
Programas_over= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon3_over.png");
Programas_click= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon3_clicked.png");
Archivos= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon4_normal.png");
Archivos_over= new ImageIcon(Controlador_Principal.getRuta()+"/Img/spr_icon4_over.png");
Archivos_click= new ImageIcon(Controlador_Principal.getRuta()+"/Img/spr_icon4_clicked.png");
Cargar= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon5_normal.png");
Cargar_over= new ImageIcon(Controlador_Principal.getRuta()+"/Img/spr_icon5_over.png");
Cargar_click= new ImageIcon(Controlador_Principal.getRuta()+"/Img/spr_icon5_clicked.png");
Peticion= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon6_normal.png");
Peticion_over= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon6_over.png");
Peticion_click= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon6_clicked.png");
Camara_over= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon7_over.png");
Camara_click= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon7_clicked.png");
Serie_over= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon8_over.png");
Serie_click= new ImageIcon(Controlador_Principal.getRuta()+"Img/spr_icon8_clicked.png");
}
}
|
[
"idurdaneta@hotmail.com"
] |
idurdaneta@hotmail.com
|
caf26f6b7eb8edcc4b1c287d94b9f3e6b82a2d90
|
d938c726bced19d2d18040ab50be7c1208cce4bb
|
/src/main/java/com/mongodb/dao/impl/userBehaviorDAOImpl.java
|
3dfd385e49d6592521211cff024be2bbd2eb5ffb
|
[] |
no_license
|
FebFirst/bilibili
|
c44aac46306e80861351e964654bd96c3b2f7cd5
|
c67c2ba7ce7f7876eb31a1b0268c607438a7d18d
|
refs/heads/master
| 2021-01-20T20:53:17.669883
| 2016-08-12T06:21:45
| 2016-08-12T06:21:45
| 65,528,615
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,671
|
java
|
package com.mongodb.dao.impl;
import com.mongodb.*;
import com.mongodb.dao.userBehaviorDAO;
import com.mongodb.pojo.userBehavior;
import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import java.util.List;
/**
* Created by Admin on 2016/7/15.
*/
public class userBehaviorDAOImpl implements userBehaviorDAO {
private SessionFactory sessionFactory;
@Override
public List<userBehavior> findAllBehaviors() {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
return mongoOperations.findAll(userBehavior.class);
}
@Override
public List<userBehavior> findBehaviorsByUserId(int userId) {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
Query query = new Query(Criteria.where("userId").is(userId));
return mongoOperations.find(query, userBehavior.class);
}
@Override
public List<userBehavior> findBehaviorByVideoId(int videoId) {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
Query query = new Query(Criteria.where("videoId").is(videoId));
return mongoOperations.find(query, userBehavior.class);
}
@Override
public void createBehavior(userBehavior userBehavior) {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
mongoOperations.insert(userBehavior);
}
@Override
public void deleteBehaviorsByUserId(int userId) {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
Query query = new Query(Criteria.where("userId").is(userId));
mongoOperations.findAllAndRemove(query, userBehavior.class);
}
@Override
public void deleteBehaviorsByVideoId(int videoId) {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
Query query = new Query(Criteria.where("videoId").is(videoId));
mongoOperations.findAllAndRemove(query, userBehavior.class);
}
@Override
public void deleteBehavior(int userId, int videoId) {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
Query query = new Query(Criteria.where("userId").is(userId).and("videoId").is(videoId));
mongoOperations.findAndRemove(query, userBehavior.class);
}
@Override
public void updateBehavior(int userId, int videoId, int rating) {
ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
Query query = new Query(Criteria.where("userId").is(userId).and("videoId").is(videoId));
Update update = new Update().set("rating", rating);
mongoOperations.findAndModify(query, update, userBehavior.class);
}
@Override
public void increaseRating(int userId, int videoId, int inc) {
// ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext-mongodb.xml");
// MongoOperations mongoOperations = (MongoOperations)ctx.getBean("mongoTemplate");
// Query query = new Query(Criteria.where("userId").is(userId).and("videoId").is(videoId));
// Update update = new Update().inc("rating", inc);
// mongoOperations.upsert(query, update, userBehavior.class);
MongoClient mongoClient = new MongoClient( "localhost" , 27017 );
System.out.println("Set database successfully");
DB mongoDatabase = mongoClient.getDB("JPlay");
System.out.println("Connect to database successfully");
DBCollection collection = mongoDatabase.getCollection("userBehavior");
DBObject updateCondition = new BasicDBObject();
updateCondition.put("userId", userId);
updateCondition.put("videoId", videoId);
DBObject updatedValue = new BasicDBObject();
updatedValue.put("rating", inc);
DBObject updateSetValue = new BasicDBObject("$inc", updatedValue);
/**
* update insert_test set headers=3 and legs=4 where name='fox'
* updateCondition:更新条件
* updateSetValue:设置的新值
*/
collection.update(updateCondition, updateSetValue, true, true);
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
public SessionFactory getSessionFactory() {
return sessionFactory;
}
}
|
[
"googo@xiongguodeMacBook-Air.local"
] |
googo@xiongguodeMacBook-Air.local
|
d79c3ca1e2bdf5f4da9218e5186a0b7d85f664a6
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/org/apache/camel/spring/boot/util/HierarchicalPropertiesEvaluatorTest.java
|
17a8f1444b201395d9c1d07fe3021fb8b939a105
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 2,601
|
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.camel.spring.boot.util;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@DirtiesContext
@SpringBootApplication
@SpringBootTest(classes = { HierarchicalPropertiesEvaluatorTest.TestConfiguration.class }, properties = { "test.group1.enabled=true", "test.group1.subgroup1.enabled=false", "test.group1.subgroup2.enabled=true", "test.group2.enabled=false", "test.group2.subgroup1.enabled=false", "test.group2.subgroup2.enabled=true", "test.group2.subgroup3.enabled=false" })
public class HierarchicalPropertiesEvaluatorTest {
@Autowired
Environment environment;
@Test
public void testEvaluator() {
Assert.assertFalse(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group1", "test.group1.subgroup1"));
Assert.assertTrue(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group1", "test.group1.subgroup2"));
Assert.assertFalse(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group2", "test.group2.subgroup1"));
Assert.assertTrue(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group2", "test.group2.subgroup2"));
Assert.assertFalse(HierarchicalPropertiesEvaluator.evaluate(environment, "test.group2", "test.group2.subgroup3"));
}
@Configuration
static class TestConfiguration {}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
2e6e7322cd4d7a35dc2d111047cf207a86facc8a
|
09d0ddd512472a10bab82c912b66cbb13113fcbf
|
/TestApplications/TF-BETA-THERMATK-v5.7.1/DecompiledCode/Procyon/src/main/java/com/airbnb/lottie/parser/ContentModelParser.java
|
2041864536dfc0e0d22f9cc1b5a40bee376189f7
|
[] |
no_license
|
sgros/activity_flow_plugin
|
bde2de3745d95e8097c053795c9e990c829a88f4
|
9e59f8b3adacf078946990db9c58f4965a5ccb48
|
refs/heads/master
| 2020-06-19T02:39:13.865609
| 2019-07-08T20:17:28
| 2019-07-08T20:17:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,517
|
java
|
//
// Decompiled by Procyon v0.5.34
//
package com.airbnb.lottie.parser;
import java.io.IOException;
import com.airbnb.lottie.model.content.MergePaths;
import com.airbnb.lottie.utils.Logger;
import com.airbnb.lottie.model.content.ContentModel;
import com.airbnb.lottie.LottieComposition;
import android.util.JsonReader;
class ContentModelParser
{
static ContentModel parse(final JsonReader jsonReader, final LottieComposition lottieComposition) throws IOException {
jsonReader.beginObject();
final int n = 2;
int nextInt = 2;
ContentModel contentModel;
String nextString;
while (true) {
final boolean hasNext = jsonReader.hasNext();
contentModel = null;
if (!hasNext) {
nextString = null;
break;
}
final String nextName = jsonReader.nextName();
final int hashCode = nextName.hashCode();
int n2 = 0;
Label_0088: {
if (hashCode != 100) {
if (hashCode == 3717) {
if (nextName.equals("ty")) {
n2 = 0;
break Label_0088;
}
}
}
else if (nextName.equals("d")) {
n2 = 1;
break Label_0088;
}
n2 = -1;
}
if (n2 == 0) {
nextString = jsonReader.nextString();
break;
}
if (n2 != 1) {
jsonReader.skipValue();
}
else {
nextInt = jsonReader.nextInt();
}
}
if (nextString == null) {
return null;
}
int n3 = 0;
Label_0473: {
switch (nextString.hashCode()) {
case 3710: {
if (nextString.equals("tr")) {
n3 = 5;
break Label_0473;
}
break;
}
case 3705: {
if (nextString.equals("tm")) {
n3 = 9;
break Label_0473;
}
break;
}
case 3681: {
if (nextString.equals("st")) {
n3 = 1;
break Label_0473;
}
break;
}
case 3679: {
if (nextString.equals("sr")) {
n3 = 10;
break Label_0473;
}
break;
}
case 3669: {
if (nextString.equals("sh")) {
n3 = 6;
break Label_0473;
}
break;
}
case 3646: {
if (nextString.equals("rp")) {
n3 = 12;
break Label_0473;
}
break;
}
case 3633: {
if (nextString.equals("rc")) {
n3 = 8;
break Label_0473;
}
break;
}
case 3488: {
if (nextString.equals("mm")) {
n3 = 11;
break Label_0473;
}
break;
}
case 3308: {
if (nextString.equals("gs")) {
n3 = n;
break Label_0473;
}
break;
}
case 3307: {
if (nextString.equals("gr")) {
n3 = 0;
break Label_0473;
}
break;
}
case 3295: {
if (nextString.equals("gf")) {
n3 = 4;
break Label_0473;
}
break;
}
case 3270: {
if (nextString.equals("fl")) {
n3 = 3;
break Label_0473;
}
break;
}
case 3239: {
if (nextString.equals("el")) {
n3 = 7;
break Label_0473;
}
break;
}
}
n3 = -1;
}
ContentModel contentModel2 = null;
switch (n3) {
default: {
final StringBuilder sb = new StringBuilder();
sb.append("Unknown shape type ");
sb.append(nextString);
Logger.warning(sb.toString());
contentModel2 = contentModel;
break;
}
case 12: {
contentModel2 = RepeaterParser.parse(jsonReader, lottieComposition);
break;
}
case 11: {
final MergePaths parse = MergePathsParser.parse(jsonReader);
lottieComposition.addWarning("Animation contains merge paths. Merge paths are only supported on KitKat+ and must be manually enabled by calling enableMergePathsForKitKatAndAbove().");
contentModel2 = parse;
break;
}
case 10: {
contentModel2 = PolystarShapeParser.parse(jsonReader, lottieComposition);
break;
}
case 9: {
contentModel2 = ShapeTrimPathParser.parse(jsonReader, lottieComposition);
break;
}
case 8: {
contentModel2 = RectangleShapeParser.parse(jsonReader, lottieComposition);
break;
}
case 7: {
contentModel2 = CircleShapeParser.parse(jsonReader, lottieComposition, nextInt);
break;
}
case 6: {
contentModel2 = ShapePathParser.parse(jsonReader, lottieComposition);
break;
}
case 5: {
contentModel2 = AnimatableTransformParser.parse(jsonReader, lottieComposition);
break;
}
case 4: {
contentModel2 = GradientFillParser.parse(jsonReader, lottieComposition);
break;
}
case 3: {
contentModel2 = ShapeFillParser.parse(jsonReader, lottieComposition);
break;
}
case 2: {
contentModel2 = GradientStrokeParser.parse(jsonReader, lottieComposition);
break;
}
case 1: {
contentModel2 = ShapeStrokeParser.parse(jsonReader, lottieComposition);
break;
}
case 0: {
contentModel2 = ShapeGroupParser.parse(jsonReader, lottieComposition);
break;
}
}
while (jsonReader.hasNext()) {
jsonReader.skipValue();
}
jsonReader.endObject();
return contentModel2;
}
}
|
[
"crash@home.home.hr"
] |
crash@home.home.hr
|
21f8353b6e2219558c86bad66b0822c51d8d928f
|
8fd2e347ebff0abdb8dfef3df3f6dcc26dd7621c
|
/src/main/java/org/openstreetmap/atlas/tags/ContactEmailTag.java
|
f427d75defcd79bf9c26c45496bbbed22e2e51ac
|
[
"BSD-3-Clause"
] |
permissive
|
osmlab/atlas
|
0c38770d05f7fb3d17e85365711acf7ae3969806
|
f525a7a3f09c95b5c96562648d8901031091e752
|
refs/heads/dev
| 2023-03-30T20:27:04.162725
| 2023-03-23T22:49:14
| 2023-03-23T22:49:14
| 99,717,758
| 216
| 83
|
BSD-3-Clause
| 2022-11-21T11:44:13
| 2017-08-08T17:14:27
|
Java
|
UTF-8
|
Java
| false
| false
| 524
|
java
|
package org.openstreetmap.atlas.tags;
import org.openstreetmap.atlas.tags.annotations.Tag;
import org.openstreetmap.atlas.tags.annotations.Tag.Validation;
import org.openstreetmap.atlas.tags.annotations.TagKey;
/**
* OSM contact:email tag
*
* @author cstaylor
*/
@Tag(value = Validation.NON_EMPTY_STRING, taginfo = "http://taginfo.openstreetmap.org/keys/contact%3Aemail#values", osm = "http://wiki.openstreetmap.org/wiki/Key:contact")
public interface ContactEmailTag
{
@TagKey
String KEY = "contact:email";
}
|
[
"matthieu.nahoum@gmail.com"
] |
matthieu.nahoum@gmail.com
|
9c255e207c5ccf93b233f4cfc02ecafe584ec6b9
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/tests-without-trycatch/JacksonDatabind-104/com.fasterxml.jackson.databind.util.StdDateFormat/BBC-F0-opt-20/10/com/fasterxml/jackson/databind/util/StdDateFormat_ESTest_scaffolding.java
|
29fa512bc3fe751f2632f469f95d11afbfeaffa5
|
[
"CC-BY-4.0",
"MIT"
] |
permissive
|
pderakhshanfar/EMSE-BBC-experiment
|
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
|
fea1a92c2e7ba7080b8529e2052259c9b697bbda
|
refs/heads/main
| 2022-11-25T00:39:58.983828
| 2022-04-12T16:04:26
| 2022-04-12T16:04:26
| 309,335,889
| 0
| 1
| null | 2021-11-05T11:18:43
| 2020-11-02T10:30:38
| null |
UTF-8
|
Java
| false
| false
| 3,707
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Oct 14 01:20:09 GMT 2021
*/
package com.fasterxml.jackson.databind.util;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class StdDateFormat_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "com.fasterxml.jackson.databind.util.StdDateFormat";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(StdDateFormat_ESTest_scaffolding.class.getClassLoader() ,
"com.fasterxml.jackson.core.io.NumberInput",
"com.fasterxml.jackson.databind.util.StdDateFormat"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("java.text.Format$Field", false, StdDateFormat_ESTest_scaffolding.class.getClassLoader()));
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(StdDateFormat_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"com.fasterxml.jackson.databind.util.StdDateFormat",
"com.fasterxml.jackson.core.io.NumberInput"
);
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
6318fa09873c55d3b36b91c254f6f12bae2a2f72
|
3cbf58a3708d849b430ad4d71a53418506ed7189
|
/Neo4j/src/main/java/com/cs/repository/ActorRepository.java
|
40468d59a151f0eae66042d22be1bc004f8676b0
|
[] |
no_license
|
YAYUN123/springboot-neo4j
|
95317ec3adb63ada7a2286fea3f72fa2b45783f4
|
33c7ab4b88381b975a1eeb42722534200f7c4a4e
|
refs/heads/master
| 2020-03-28T20:33:58.433234
| 2018-09-17T07:10:05
| 2018-09-17T07:10:05
| 149,083,498
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 413
|
java
|
package com.cs.repository;
import com.cs.domain.Actor;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
@Repository
public interface ActorRepository extends Neo4jRepository<Actor, Long> {
Actor findByBorn(@Param("born") int born);
Actor findByName(@Param("name") String name);
}
|
[
"2545757723@qq.com"
] |
2545757723@qq.com
|
2b84de34cef1d750a87fbf6bfecf5f7828390c23
|
94b7a1d71ad349b97e7f7926f15cbf711bd460d1
|
/work/jspc/java/org/jivesoftware/openfire/admin/pubsub_002dform_002dtable_jsp.java
|
1d4b94fa67eb202c89123a82be29006ea313bed3
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
Bottlezn/openfire_src
|
c5a14e1c5fb61444d1d6eb3ac9dd145e02184dd1
|
e16d38c7ac565fcf6489f815c9c023e086a24ff8
|
refs/heads/master
| 2020-03-22T08:56:06.432616
| 2018-07-05T06:10:52
| 2018-07-05T06:10:52
| 139,802,048
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 68,241
|
java
|
/*
* Generated by the Jasper component of Apache Tomcat
* Version: JspC/ApacheTomcat8
* Generated at: 2018-07-05 03:25:34 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.jivesoftware.openfire.admin;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class pubsub_002dform_002dtable_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_0;
private static org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_1;
static {
_jspx_fnmap_0= org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction("fn:substringAfter", org.apache.taglibs.standard.functions.Functions.class, "substringAfter", new Class[] {java.lang.String.class, java.lang.String.class});
_jspx_fnmap_1= org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction("fn:startsWith", org.apache.taglibs.standard.functions.Functions.class, "startsWith", new Class[] {java.lang.String.class, java.lang.String.class});
}
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fchoose;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fvar_005fkey_005fnobody;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fchoose = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fvar_005fkey_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.release();
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fchoose.release();
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.release();
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.release();
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fvar_005fkey_005fnobody.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\n\n\n\n<!--\nParameters:\nfields - fields from a data form (needs to be set as request scope)\nnonDisplayFields - a list of field names that shouldn't be displayed (needs to be set as request scope)\nlistTypes - a map of field.variables to listType (user or group)\nerrors - a map of field.variable to error strings\ndetailPreFix - property prefix for additional detail to be displayed against the fields on the form\n -->\n\n<script>\n function clearSelected(id) {\n var elements = document.getElementById(id).options;\n\n for (var i = 0; i < elements.length; i++) {\n elements[i].selected = false;\n }\n }\n\n function deleteTableRow(rowId) {\n var row = document.getElementById(rowId);\n row.parentNode.removeChild(row);\n }\n\n function detect_enter_keyboard(event) {\n\n var key_board_keycode = event.which || event.keyCode;\n if (key_board_keycode == 13) {\n event.preventDefault();\n var target = event.target || event.srcElement;\n var buttonId = target.id.split('-')[0] + '-Add';\n");
out.write(" document.getElementById(buttonId).click();\n }\n }\n</script>\n");
if (_jspx_meth_c_005fif_005f0(_jspx_page_context))
return;
out.write("\n<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"1%\">\n <tbody>\n ");
if (_jspx_meth_c_005fforEach_005f1(_jspx_page_context))
return;
out.write("\n </tbody>\n</table>\n");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f0.setParent(null);
// /pubsub-form-table.jsp(39,0) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not empty errors}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag();
if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n ");
if (_jspx_meth_c_005fforEach_005f0(_jspx_th_c_005fif_005f0, _jspx_page_context))
return true;
out.write('\n');
int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f0);
// /pubsub-form-table.jsp(40,4) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("error");
// /pubsub-form-table.jsp(40,4) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems(new org.apache.jasper.el.JspValueExpression("/pubsub-form-table.jsp(40,4) '${errors}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${errors}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <div class=\"jive-error\">\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tbody>\n <tr>\n <td class=\"jive-icon\"><img src=\"images/error-16x16.gif\"\n width=\"16\" height=\"16\" border=\"0\" alt=\"\"></td>\n <td class=\"jive-icon-label\">");
if (_jspx_meth_c_005fout_005f0(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <br>\n ");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
private boolean _jspx_meth_c_005fout_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f0 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /pubsub-form-table.jsp(47,52) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${error.value}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
int _jspx_eval_c_005fout_005f0 = _jspx_th_c_005fout_005f0.doStartTag();
if (_jspx_th_c_005fout_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f1 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f1.setParent(null);
// /pubsub-form-table.jsp(58,8) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f1.setVar("field");
// /pubsub-form-table.jsp(58,8) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f1.setItems(new org.apache.jasper.el.JspValueExpression("/pubsub-form-table.jsp(58,8) '${requestScope.fields}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${requestScope.fields}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int[] _jspx_push_body_count_c_005fforEach_005f1 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f1 = _jspx_th_c_005fforEach_005f1.doStartTag();
if (_jspx_eval_c_005fforEach_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n ");
if (_jspx_meth_c_005fif_005f1(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f1[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f1.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f1.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f1);
}
return false;
}
private boolean _jspx_meth_c_005fif_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f1 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1);
// /pubsub-form-table.jsp(59,12) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not requestScope.nonDisplayFields.contains(field.variable)}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_005fif_005f1 = _jspx_th_c_005fif_005f1.doStartTag();
if (_jspx_eval_c_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <tr>\n <td nowrap style=\"min-width: 300px\"><label\n style=\"font-weight: bold\" for=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write('"');
out.write('>');
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.label}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("</label></td>\n ");
if (_jspx_meth_c_005fset_005f0(_jspx_th_c_005fif_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
if (_jspx_meth_c_005fchoose_005f0(_jspx_th_c_005fif_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n </tr>\n <tr>\n <td>");
if (_jspx_meth_fmt_005fmessage_005f4(_jspx_th_c_005fif_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
if (_jspx_meth_c_005fif_005f2(_jspx_th_c_005fif_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("</td>\n </tr>\n ");
int evalDoAfterBody = _jspx_th_c_005fif_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
return false;
}
private boolean _jspx_meth_c_005fset_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f0 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
_jspx_th_c_005fset_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fset_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f1);
// /pubsub-form-table.jsp(64,20) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setVar("isList");
// /pubsub-form-table.jsp(64,20) name = value type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setValue(new org.apache.jasper.el.JspValueExpression("/pubsub-form-table.jsp(64,20) '${field.type.name() eq 'list_multi' or field.type.name() eq 'jid_multi'}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${field.type.name() eq 'list_multi' or field.type.name() eq 'jid_multi'}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int _jspx_eval_c_005fset_005f0 = _jspx_th_c_005fset_005f0.doStartTag();
if (_jspx_th_c_005fset_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
return false;
}
private boolean _jspx_meth_c_005fchoose_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:choose
org.apache.taglibs.standard.tag.common.core.ChooseTag _jspx_th_c_005fchoose_005f0 = (org.apache.taglibs.standard.tag.common.core.ChooseTag) _005fjspx_005ftagPool_005fc_005fchoose.get(org.apache.taglibs.standard.tag.common.core.ChooseTag.class);
_jspx_th_c_005fchoose_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fchoose_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f1);
int _jspx_eval_c_005fchoose_005f0 = _jspx_th_c_005fchoose_005f0.doStartTag();
if (_jspx_eval_c_005fchoose_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n ");
if (_jspx_meth_c_005fwhen_005f0(_jspx_th_c_005fchoose_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
if (_jspx_meth_c_005fwhen_005f1(_jspx_th_c_005fchoose_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
if (_jspx_meth_c_005fwhen_005f2(_jspx_th_c_005fchoose_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
if (_jspx_meth_c_005fwhen_005f3(_jspx_th_c_005fchoose_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
if (_jspx_meth_c_005fwhen_005f4(_jspx_th_c_005fchoose_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
int evalDoAfterBody = _jspx_th_c_005fchoose_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fchoose_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fchoose.reuse(_jspx_th_c_005fchoose_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fchoose.reuse(_jspx_th_c_005fchoose_005f0);
return false;
}
private boolean _jspx_meth_c_005fwhen_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fchoose_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:when
org.apache.taglibs.standard.tag.rt.core.WhenTag _jspx_th_c_005fwhen_005f0 = (org.apache.taglibs.standard.tag.rt.core.WhenTag) _005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.WhenTag.class);
_jspx_th_c_005fwhen_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fwhen_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fchoose_005f0);
// /pubsub-form-table.jsp(67,24) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fwhen_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.type.name() eq 'boolean_type'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_005fwhen_005f0 = _jspx_th_c_005fwhen_005f0.doStartTag();
if (_jspx_eval_c_005fwhen_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <td width=\"1%\" rowspan=\"2\"><input type=\"checkbox\"\n name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\" id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"\n ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.firstValue == 1 ? 'checked=\"checked\"' : '' }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write(" /></td>\n ");
int evalDoAfterBody = _jspx_th_c_005fwhen_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fwhen_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f0);
return false;
}
private boolean _jspx_meth_c_005fwhen_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fchoose_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:when
org.apache.taglibs.standard.tag.rt.core.WhenTag _jspx_th_c_005fwhen_005f1 = (org.apache.taglibs.standard.tag.rt.core.WhenTag) _005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.WhenTag.class);
_jspx_th_c_005fwhen_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fwhen_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fchoose_005f0);
// /pubsub-form-table.jsp(72,24) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fwhen_005f1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.type.name() eq 'text_single'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_005fwhen_005f1 = _jspx_th_c_005fwhen_005f1.doStartTag();
if (_jspx_eval_c_005fwhen_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <td width=\"1%\" rowspan=\"2\"><input type=\"text\"\n name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\" id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"\n value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.firstValue}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\" style=\"width: 200px;\" /></td>\n ");
int evalDoAfterBody = _jspx_th_c_005fwhen_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fwhen_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f1);
return false;
}
private boolean _jspx_meth_c_005fwhen_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fchoose_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:when
org.apache.taglibs.standard.tag.rt.core.WhenTag _jspx_th_c_005fwhen_005f2 = (org.apache.taglibs.standard.tag.rt.core.WhenTag) _005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.WhenTag.class);
_jspx_th_c_005fwhen_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005fwhen_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fchoose_005f0);
// /pubsub-form-table.jsp(77,24) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fwhen_005f2.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.type.name() eq 'list_single'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_005fwhen_005f2 = _jspx_th_c_005fwhen_005f2.doStartTag();
if (_jspx_eval_c_005fwhen_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <td width=\"1%\" rowspan=\"2\"><select name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"\n id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\" style=\"width: 200px;\">\n ");
if (_jspx_meth_c_005fforEach_005f2(_jspx_th_c_005fwhen_005f2, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n </select></td>\n ");
int evalDoAfterBody = _jspx_th_c_005fwhen_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fwhen_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f2);
return true;
}
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f2);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fwhen_005f2, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f2 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fwhen_005f2);
// /pubsub-form-table.jsp(80,36) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f2.setVar("option");
// /pubsub-form-table.jsp(80,36) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f2.setItems(new org.apache.jasper.el.JspValueExpression("/pubsub-form-table.jsp(80,36) '${field.options}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${field.options}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int[] _jspx_push_body_count_c_005fforEach_005f2 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f2 = _jspx_th_c_005fforEach_005f2.doStartTag();
if (_jspx_eval_c_005fforEach_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <option value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${option.value}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"\n ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${option.value == field.firstValue ? 'selected' : '' }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write(">\n ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${option.label ? option.label : option.value }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\n </option>\n ");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f2[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f2.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f2.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f2);
}
return false;
}
private boolean _jspx_meth_c_005fwhen_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fchoose_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:when
org.apache.taglibs.standard.tag.rt.core.WhenTag _jspx_th_c_005fwhen_005f3 = (org.apache.taglibs.standard.tag.rt.core.WhenTag) _005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.WhenTag.class);
_jspx_th_c_005fwhen_005f3.setPageContext(_jspx_page_context);
_jspx_th_c_005fwhen_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fchoose_005f0);
// /pubsub-form-table.jsp(88,24) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fwhen_005f3.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${isList and not empty field.options}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_005fwhen_005f3 = _jspx_th_c_005fwhen_005f3.doStartTag();
if (_jspx_eval_c_005fwhen_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <td width=\"1%\" rowspan=\"2\"><select name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"\n id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\" style=\"width: 200px;\" multiple>\n ");
if (_jspx_meth_c_005fforEach_005f3(_jspx_th_c_005fwhen_005f3, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n </select>\n <button type=\"button\"\n onclick=\"clearSelected('");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("')\">\n ");
if (_jspx_meth_fmt_005fmessage_005f0(_jspx_th_c_005fwhen_005f3, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n </button></td>\n ");
int evalDoAfterBody = _jspx_th_c_005fwhen_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fwhen_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f3);
return true;
}
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f3);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fwhen_005f3, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f3 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f3.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fwhen_005f3);
// /pubsub-form-table.jsp(91,36) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f3.setVar("option");
// /pubsub-form-table.jsp(91,36) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f3.setItems(new org.apache.jasper.el.JspValueExpression("/pubsub-form-table.jsp(91,36) '${field.options}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${field.options}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int[] _jspx_push_body_count_c_005fforEach_005f3 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f3 = _jspx_th_c_005fforEach_005f3.doStartTag();
if (_jspx_eval_c_005fforEach_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <option value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${option.value}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"\n ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ field.values.contains(option.value) ? 'selected' : '' }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write(">\n ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${option.label ? option.label : option.value }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\n </option>\n ");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f3[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f3.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f3.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f3);
}
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fwhen_005f3, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f0 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f0.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fwhen_005f3);
// /pubsub-form-table.jsp(100,36) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f0.setKey("pubsub.form.clearSelection");
int _jspx_eval_fmt_005fmessage_005f0 = _jspx_th_fmt_005fmessage_005f0.doStartTag();
if (_jspx_th_fmt_005fmessage_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f0);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f0);
return false;
}
private boolean _jspx_meth_c_005fwhen_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fchoose_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:when
org.apache.taglibs.standard.tag.rt.core.WhenTag _jspx_th_c_005fwhen_005f4 = (org.apache.taglibs.standard.tag.rt.core.WhenTag) _005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.WhenTag.class);
_jspx_th_c_005fwhen_005f4.setPageContext(_jspx_page_context);
_jspx_th_c_005fwhen_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fchoose_005f0);
// /pubsub-form-table.jsp(103,24) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fwhen_005f4.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${isList and empty field.options}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_005fwhen_005f4 = _jspx_th_c_005fwhen_005f4.doStartTag();
if (_jspx_eval_c_005fwhen_005f4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <td rowspan=\"2\">\n <div class=\"jive-table\">\n <table id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\" cellpadding=\"0\" cellspacing=\"0\"\n border=\"0\" width=\"100%\">\n <thead>\n <tr>\n <th scope=\"col\">");
if (_jspx_meth_fmt_005fmessage_005f1(_jspx_th_c_005fwhen_005f4, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("</th>\n <th scope=\"col\">");
if (_jspx_meth_fmt_005fmessage_005f2(_jspx_th_c_005fwhen_005f4, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("</th>\n </tr>\n </thead>\n <tbody>\n ");
if (_jspx_meth_c_005fforEach_005f4(_jspx_th_c_005fwhen_005f4, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n <tr>\n <td><input type=\"text\" style=\"width: 200px;\"\n id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("-Additional\"\n name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("-Additional\"\n onkeypress=\"detect_enter_keyboard(event)\" /></td>\n <td><input type=\"submit\" id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("-Add\"\n name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("-Add\"\n value=\"");
if (_jspx_meth_fmt_005fmessage_005f3(_jspx_th_c_005fwhen_005f4, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\"></td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n ");
int evalDoAfterBody = _jspx_th_c_005fwhen_005f4.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fwhen_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f4);
return true;
}
_005fjspx_005ftagPool_005fc_005fwhen_0026_005ftest.reuse(_jspx_th_c_005fwhen_005f4);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fwhen_005f4, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f1 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f1.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fwhen_005f4);
// /pubsub-form-table.jsp(110,64) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f1.setKey((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("pubsub.form.${listTypes[field.variable]}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
int _jspx_eval_fmt_005fmessage_005f1 = _jspx_th_fmt_005fmessage_005f1.doStartTag();
if (_jspx_th_fmt_005fmessage_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f1);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f1);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fwhen_005f4, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f2 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f2.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fwhen_005f4);
// /pubsub-form-table.jsp(112,64) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f2.setKey("pubsub.form.action");
int _jspx_eval_fmt_005fmessage_005f2 = _jspx_th_fmt_005fmessage_005f2.doStartTag();
if (_jspx_th_fmt_005fmessage_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f2);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f2);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fwhen_005f4, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f4 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f4.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fwhen_005f4);
// /pubsub-form-table.jsp(116,44) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f4.setVar("value");
// /pubsub-form-table.jsp(116,44) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f4.setItems(new org.apache.jasper.el.JspValueExpression("/pubsub-form-table.jsp(116,44) '${field.values}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${field.values}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
// /pubsub-form-table.jsp(116,44) name = varStatus type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f4.setVarStatus("loop");
int[] _jspx_push_body_count_c_005fforEach_005f4 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f4 = _jspx_th_c_005fforEach_005f4.doStartTag();
if (_jspx_eval_c_005fforEach_005f4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n <tr id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${loop.index}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\">\n <td><input type=\"hidden\" name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"\n value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${value}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\" />");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${value}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("</td>\n <td>\n <button type=\"button\"\n onclick=\"deleteTableRow('");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${field.variable}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${loop.index}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("')\">Remove</button>\n </td>\n </tr>\n ");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f4.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f4[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f4.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f4.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f4);
}
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fwhen_005f4, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f3 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f3.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fwhen_005f4);
// /pubsub-form-table.jsp(134,59) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f3.setKey("global.add");
int _jspx_eval_fmt_005fmessage_005f3 = _jspx_th_fmt_005fmessage_005f3.doStartTag();
if (_jspx_th_fmt_005fmessage_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f3);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f3);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f4 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fvar_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f4.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f1);
// /pubsub-form-table.jsp(144,24) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f4.setVar("detail");
// /pubsub-form-table.jsp(144,24) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f4.setKey((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${param.detailPreFix}.${fn:substringAfter(field.variable, '#')}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, _jspx_fnmap_0));
int _jspx_eval_fmt_005fmessage_005f4 = _jspx_th_fmt_005fmessage_005f4.doStartTag();
if (_jspx_th_fmt_005fmessage_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fvar_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f4);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fvar_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f4);
return false;
}
private boolean _jspx_meth_c_005fif_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f2 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f1);
// /pubsub-form-table.jsp(146,24) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f2.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not fn:startsWith(detail, '???')}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, _jspx_fnmap_1)).booleanValue());
int _jspx_eval_c_005fif_005f2 = _jspx_th_c_005fif_005f2.doStartTag();
if (_jspx_eval_c_005fif_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n ");
if (_jspx_meth_c_005fout_005f1(_jspx_th_c_005fif_005f2, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\n ");
int evalDoAfterBody = _jspx_th_c_005fif_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f2);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f2);
return false;
}
private boolean _jspx_meth_c_005fout_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f2, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f1 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f2);
// /pubsub-form-table.jsp(147,28) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f1.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${detail}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
int _jspx_eval_c_005fout_005f1 = _jspx_th_c_005fout_005f1.doStartTag();
if (_jspx_th_c_005fout_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
return false;
}
}
|
[
"15116907853@163.com"
] |
15116907853@163.com
|
7999348e72d62a3b8b7c2b788235fe5bff7016e3
|
e6fdcb7ea3007f473bdd2a2a47b3b97b5a07385a
|
/src/test/java/com/cybertek/utilities/Driver.java
|
3748073b0f9ec3ac1d35d3153d7cf2c5f5c2306c
|
[] |
no_license
|
maimaitiaziguli/Cucumber_Junit_Practice1_2020
|
756c78ecb7d9474cf2c346c730d0a37cfd59521c
|
d7034cf5e4807037a574275551bdb58c82b1da4c
|
refs/heads/master
| 2023-01-23T04:39:45.381991
| 2020-11-30T07:46:12
| 2020-11-30T07:46:12
| 317,147,638
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,451
|
java
|
package com.cybertek.utilities;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.concurrent.TimeUnit;
public class Driver {
private Driver(){}
private static WebDriver driver;
public static WebDriver getDriver(){
if(driver == null){
String browser = ConfigurationReader.getProperty("browser");
switch (browser){
case "chrome":
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
break;
case "firefox":
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
break;
}
}
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
return driver;
}
public static void closeDriver(){
if(driver!=null){
driver.quit();
driver = null;
}
}
}
|
[
"arzuyum507@gmail.com"
] |
arzuyum507@gmail.com
|
21e097fb1bd1a0c1af779c1188c63b231028156a
|
45d453133df8a0049538cc3ef7c4dae6ae492169
|
/src/test/java/core/concurrent/LockManagerTest.java
|
1714d597c6afcb1c7315b56e7f16170167712cea
|
[
"Apache-2.0"
] |
permissive
|
xiafan68/socialtsquery
|
85434e2dfb034dd1fe7fa714388f3e499b9568f2
|
2088c12a1eb9d6c5df8342917895927942b51c0d
|
refs/heads/lsmo_markfile_product
| 2022-07-24T23:55:24.873987
| 2018-06-02T08:36:14
| 2018-06-02T08:36:14
| 32,961,182
| 0
| 0
|
Apache-2.0
| 2022-06-20T23:06:51
| 2015-03-27T01:23:32
|
Java
|
UTF-8
|
Java
| false
| false
| 310
|
java
|
package core.concurrent;
import org.junit.Test;
public class LockManagerTest {
@Test
public void test() {
LockManager manager = new LockManager();
// 测试lock是否可以重复加锁
manager.postReadLock(1);
manager.postReadLock(1);
manager.postReadUnLock(1);
manager.postReadUnLock(1);
}
}
|
[
"xiafan68@gmail.com"
] |
xiafan68@gmail.com
|
49e9b7f8e9912987f0560762c5e13862d8cb3019
|
19688c536e3e23d40ed58d7a5ad25dcacf80358e
|
/src/telas/Visto/FrmVisto.java
|
b12bd56ece246eca3a0883dbd9f5424e5b03deae
|
[] |
no_license
|
julioizidoro/systm
|
0a8e9817dda18d9c33cf1c78d8b120cade55b13f
|
023acf52bdcc2489f9696f4934bbc304ab55f82a
|
refs/heads/master
| 2021-01-17T13:11:40.575259
| 2016-05-17T19:36:36
| 2016-05-17T19:36:36
| 22,035,771
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 99,379
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package telas.Visto;
import com.toedter.calendar.JTextFieldDateEditor;
import controller.CambioController;
import controller.ClienteController;
import controller.ContasReceberController;
import controller.FollowupController;
import controller.FormaPagamentoController;
import controller.OrcamentoController;
import controller.ParametrosProdutosController;
import controller.ParcelamentoPagamentoController;
import controller.ProdutoOrcamentoController;
import controller.VendasComissaoController;
import controller.VendasController;
import controller.VistosController;
import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;
import model.Cambio;
import model.Cliente;
import model.Contasreceber;
import model.Controlevistos;
import model.Formapagamento;
import model.Orcamento;
import model.Orcamentoprodutosorcamento;
import model.Parametrosprodutos;
import model.Parcelamentopagamento;
import model.Produtosorcamento;
import model.Valoresvistos;
import model.Vendas;
import model.Vendascomissao;
import model.Vistos;
import telas.Cliente.FrmConsultaCliente;
import telas.Comissao.ComissaoCursos;
import telas.Comissao.ComissaoVisto;
import telas.Cursos.ConsultaParcelamentoPagamentoTableModel;
import telas.Usuarios.UsuarioLogadoBean;
import telas.Visto.Valores.FrmConsultaValoresVistos;
import util.ContasReceberBean;
import util.EnviarEmailBean;
import util.Formatacao;
import util.FrmCalculoJuros;
import util.LimiteTextoJedit;
import util.relatoriosJasper;
/**
*
* @author Wolverine
*/
public class FrmVisto extends javax.swing.JFrame implements IVistos{
private String datePattern;
private String maskPattern;
private char placeHolder;
private Cliente cliente;
private Vistos vistos;
private Vistos vistosAlterado;
private UsuarioLogadoBean usuarioLogadoBean;
private Vendas vendas;
private Vendas vendaAlterada;
private Parametrosprodutos parametrosprodutos;
private float valorTotal;
private boolean consultaCambio=false;
private Cambio cambio;
private float valorCambio=0;
private String cambioAlterado;
private List<ProdutoOrcamentoBean> listaProdutoOrcamentoBean;
private List<ProdutoOrcamentoBean> listaProdutoOrcamentoApagarBean;
private Orcamento orcamento;
private float valorJuros=0;
private float totalPagar=0;
private float valorEntrada=0;
private float valorParcelar=0;
private float valorParcela=0;
private float totalMoedaEstrangeira=0;
private float totalMoedaReal = 0;
private Formapagamento formaPagamento;
private IVistoConsulta telaConsulta;
private int idVenda = 0;
private ConsultaParcelamentoPagamentoTableModel modelParcelamento;
private List<Parcelamentopagamento> listaParcelamento;
private boolean novaFicha=false;
private Valoresvistos valoresVistos;
private String situacao="PROCESSO";
private String dadosAlterado;
private float valorVendaAlterar=0.0f;
/**
* Creates new form FrmPacotes
*/
public FrmVisto(int idVendas, UsuarioLogadoBean usuarioLogadoBean, IVistoConsulta telaConsulta) {
this.usuarioLogadoBean =usuarioLogadoBean;
datePattern = "dd/MM/yyyy";
maskPattern = "##/##/##";
placeHolder = '_';
this.telaConsulta = telaConsulta;
this.idVenda = idVendas;
initComponents();
URL url = this.getClass().getResource("/imagens/logo/logotela.png");
Image imagemTitulo = Toolkit.getDefaultToolkit().getImage(url);
this.setIconImage(imagemTitulo);
this.setLocationRelativeTo(null);
limitarJText();
carregarInicializacao(idVendas);
consultarParametrosProdutos();
carregarModelParcelamento();
this.setVisible(true);
}
/**
* 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() {
passagemAereabuttonGroup = new javax.swing.ButtonGroup();
HotelbuttonGroup = new javax.swing.ButtonGroup();
carrobuttonGroup = new javax.swing.ButtonGroup();
OutrosbuttonGroup = new javax.swing.ButtonGroup();
SegurobuttonGroup = new javax.swing.ButtonGroup();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
clientejTextField = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel36 = new javax.swing.JLabel();
paisDestinojTextField = new javax.swing.JTextField();
jLabel38 = new javax.swing.JLabel();
duracaojTextField = new javax.swing.JTextField();
dataIniciojDateChooser = new com.toedter.calendar.JDateChooser(null, null, datePattern, new JTextFieldDateEditor(datePattern,
maskPattern, placeHolder));
jLabel39 = new javax.swing.JLabel();
valorVistojTextField = new javax.swing.JTextField();
jLabel65 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
observacaojTextField = new javax.swing.JTextField();
dataEntregaDocumentosjDateChooser = new com.toedter.calendar.JDateChooser(null, null, datePattern, new JTextFieldDateEditor(datePattern,
maskPattern, placeHolder));
jLabel6 = new javax.swing.JLabel();
tipoVistojTextField = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();
jPanel5 = new javax.swing.JPanel();
jPanel19 = new javax.swing.JPanel();
condicaoPagamentojComboBox = new javax.swing.JComboBox();
jLabel53 = new javax.swing.JLabel();
valorOrcamentoFormajTextField = new javax.swing.JTextField();
jLabel54 = new javax.swing.JLabel();
possuiJurosjComboBox = new javax.swing.JComboBox();
jLabel64 = new javax.swing.JLabel();
valorJurosjTextField = new javax.swing.JTextField();
jLabel56 = new javax.swing.JLabel();
totalPagarjTextField = new javax.swing.JTextField();
jLabel68 = new javax.swing.JLabel();
jLabel29 = new javax.swing.JLabel();
saldoReceberjTextField = new javax.swing.JTextField();
jLabel30 = new javax.swing.JLabel();
saldoParcelarjTextField = new javax.swing.JTextField();
buscaBancojButton4 = new javax.swing.JButton();
matrizjCheckBox = new javax.swing.JCheckBox();
jPanel16 = new javax.swing.JPanel();
jLabel61 = new javax.swing.JLabel();
tipoParcelamentojComboBox = new javax.swing.JComboBox();
jLabel62 = new javax.swing.JLabel();
meioPagamentojComboBox = new javax.swing.JComboBox();
jLabel63 = new javax.swing.JLabel();
valorParcelamentojTextField = new javax.swing.JTextField();
jLabel58 = new javax.swing.JLabel();
jLabel59 = new javax.swing.JLabel();
numeroParcelasjComboBox = new javax.swing.JComboBox();
valorParcelajTextField = new javax.swing.JTextField();
jLabel60 = new javax.swing.JLabel();
dataVencimentojDateChooser = new com.toedter.calendar.JDateChooser(null, null, datePattern, new JTextFieldDateEditor(datePattern,
maskPattern, placeHolder));
jPanel20 = new javax.swing.JPanel();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
parcelamentojTable = new javax.swing.JTable();
jPanel2 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
observacoesjTextArea = new javax.swing.JTextArea();
jPanel21 = new javax.swing.JPanel();
jScrollPane4 = new javax.swing.JScrollPane();
obsTMjTextArea = new javax.swing.JTextArea();
jLabel32 = new javax.swing.JLabel();
jPanel18 = new javax.swing.JPanel();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Vistos");
jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
jTabbedPane1StateChanged(evt);
}
});
jLabel1.setText("Pesquisar Cliente");
clientejTextField.setEditable(false);
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/botozinhos/selecionar.png"))); // NOI18N
jButton1.setText("Selecionar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel36.setText("País de Destino");
paisDestinojTextField.setEditable(false);
jLabel38.setText("Tipo de Visto");
duracaojTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
duracaojTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
duracaojTextFieldFocusLost(evt);
}
public void focusGained(java.awt.event.FocusEvent evt) {
duracaojTextFieldFocusGained(evt);
}
});
duracaojTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
duracaojTextFieldKeyTyped(evt);
}
});
dataIniciojDateChooser.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
dataIniciojDateChooserFocusGained(evt);
}
});
jLabel39.setText("Duração");
valorVistojTextField.setEditable(false);
valorVistojTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
valorVistojTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
valorVistojTextFieldFocusLost(evt);
}
});
valorVistojTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
valorVistojTextFieldKeyTyped(evt);
}
});
jLabel65.setText("Valor do Visto");
jLabel2.setText("Início da viagem");
jLabel3.setText("Observação");
dataEntregaDocumentosjDateChooser.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
dataEntregaDocumentosjDateChooserFocusGained(evt);
}
});
jLabel6.setText("Data entrega documentos");
tipoVistojTextField.setEditable(false);
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/botozinhos/selecionar.png"))); // NOI18N
jButton2.setText("Selecionar");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(clientejTextField)
.addGap(18, 18, 18)
.addComponent(jButton1))
.addComponent(tipoVistojTextField)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(dataIniciojDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel39)
.addComponent(duracaojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel36)
.addComponent(paisDestinojTextField))
.addGap(32, 32, 32)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel65)
.addComponent(dataEntregaDocumentosjDateChooser, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(valorVistojTextField))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE)
.addComponent(jButton2))
.addComponent(observacaojTextField)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel38)
.addComponent(jLabel3))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(clientejTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(dataIniciojDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(dataEntregaDocumentosjDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(6, 6, 6)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel36)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(paisDestinojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel65)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(valorVistojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2)))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel39)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(duracaojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel38)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tipoVistojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(observacaojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(174, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Vistos", jPanel1);
jPanel19.setBorder(javax.swing.BorderFactory.createEtchedBorder());
condicaoPagamentojComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "À Vista", "Parcelado" }));
condicaoPagamentojComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
condicaoPagamentojComboBoxItemStateChanged(evt);
}
});
jLabel53.setText("Forma de Pagamento");
valorOrcamentoFormajTextField.setEditable(false);
valorOrcamentoFormajTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
valorOrcamentoFormajTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
valorOrcamentoFormajTextFieldKeyTyped(evt);
}
});
jLabel54.setText("Valor Orçamento");
possuiJurosjComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Não", "Sim" }));
possuiJurosjComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
possuiJurosjComboBoxItemStateChanged(evt);
}
});
jLabel64.setText("Acrescentar Juros");
valorJurosjTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
valorJurosjTextField.setEnabled(false);
valorJurosjTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
valorJurosjTextFieldFocusLost(evt);
}
});
valorJurosjTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
valorJurosjTextFieldKeyReleased(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
valorJurosjTextFieldKeyTyped(evt);
}
});
jLabel56.setText("Valor Juros");
totalPagarjTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
totalPagarjTextField.setEnabled(false);
jLabel68.setText("Total a Pagar");
jLabel29.setText("Saldo a Receber");
saldoReceberjTextField.setEditable(false);
saldoReceberjTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
saldoReceberjTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
saldoReceberjTextFieldKeyTyped(evt);
}
});
jLabel30.setText("Saldo a Parcelar");
saldoParcelarjTextField.setEditable(false);
saldoParcelarjTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
saldoParcelarjTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
saldoParcelarjTextFieldKeyTyped(evt);
}
});
buscaBancojButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/icones/cambio.png"))); // NOI18N
buscaBancojButton4.setToolTipText("Calculo de Juros");
buscaBancojButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buscaBancojButton4ActionPerformed(evt);
}
});
matrizjCheckBox.setSelected(true);
matrizjCheckBox.setText("Venda pela Matriz");
javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
jPanel19.setLayout(jPanel19Layout);
jPanel19Layout.setHorizontalGroup(
jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(condicaoPagamentojComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel53))
.addGap(18, 18, 18)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(valorOrcamentoFormajTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel54)))
.addComponent(matrizjCheckBox))
.addGap(18, 18, 18)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(possuiJurosjComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel64))
.addGap(28, 28, 28)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addComponent(valorJurosjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buscaBancojButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel56))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel68)
.addComponent(totalPagarjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel19Layout.createSequentialGroup()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel29)
.addComponent(saldoReceberjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(saldoParcelarjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel30))))
.addContainerGap())
);
jPanel19Layout.setVerticalGroup(
jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel53)
.addComponent(jLabel54)
.addComponent(jLabel56)
.addComponent(jLabel64)
.addComponent(jLabel68))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(condicaoPagamentojComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(valorOrcamentoFormajTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(possuiJurosjComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(valorJurosjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(totalPagarjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(buscaBancojButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addComponent(jLabel30)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saldoParcelarjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel19Layout.createSequentialGroup()
.addComponent(jLabel29)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saldoReceberjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(matrizjCheckBox))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel16.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel61.setText("Tipo de Parcelamento");
tipoParcelamentojComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Matriz", "Loja", "Fornecedor" }));
jLabel62.setText("Forma de Pagamento");
meioPagamentojComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione", "Dinheiro", "Boleto", "Cartão de crédito", "Cartão de crédito autorizado", "Cartão débito", "Cheque", "Déposito", "Financiamento banco" }));
meioPagamentojComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
meioPagamentojComboBoxItemStateChanged(evt);
}
});
jLabel63.setText("Data Primeiro Vencimento");
valorParcelamentojTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
valorParcelamentojTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
valorParcelamentojTextFieldFocusLost(evt);
}
public void focusGained(java.awt.event.FocusEvent evt) {
valorParcelamentojTextFieldFocusGained(evt);
}
});
valorParcelamentojTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
valorParcelamentojTextFieldKeyTyped(evt);
}
});
jLabel58.setText("Valor a Parcelar ");
jLabel59.setText("Nº Parcelas");
numeroParcelasjComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24" }));
numeroParcelasjComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
numeroParcelasjComboBoxItemStateChanged(evt);
}
});
valorParcelajTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
valorParcelajTextField.setEnabled(false);
valorParcelajTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
valorParcelajTextFieldFocusGained(evt);
}
});
valorParcelajTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
valorParcelajTextFieldKeyPressed(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
valorParcelajTextFieldKeyTyped(evt);
}
public void keyReleased(java.awt.event.KeyEvent evt) {
valorParcelajTextFieldKeyReleased(evt);
}
});
jLabel60.setText("Valor Parcela");
dataVencimentojDateChooser.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
dataVencimentojDateChooserFocusGained(evt);
}
});
javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
jPanel16.setLayout(jPanel16Layout);
jPanel16Layout.setHorizontalGroup(
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel62)
.addComponent(meioPagamentojComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(52, 52, 52)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tipoParcelamentojComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel61))
.addGap(63, 63, 63)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(dataVencimentojDateChooser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel16Layout.createSequentialGroup()
.addComponent(jLabel63, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18))))
.addGroup(jPanel16Layout.createSequentialGroup()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel58)
.addComponent(valorParcelamentojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(109, 109, 109)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel59)
.addComponent(numeroParcelasjComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(valorParcelajTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel60, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
jPanel16Layout.setVerticalGroup(
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addComponent(jLabel62)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(meioPagamentojComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addComponent(tipoParcelamentojComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
.addGroup(jPanel16Layout.createSequentialGroup()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel63)
.addComponent(jLabel61))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(dataVencimentojDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(11, 11, 11)))))
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addComponent(jLabel59)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(numeroParcelasjComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel16Layout.createSequentialGroup()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel58)
.addComponent(jLabel60))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(valorParcelajTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(valorParcelamentojTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
jPanel20.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/botozinhos/adicionar.png"))); // NOI18N
jButton7.setText("Adicionar");
jButton7.setToolTipText("Adicionar forma de pagamento");
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/botozinhos/excluir.png"))); // NOI18N
jButton8.setText("Excluir");
jButton8.setToolTipText("Excluir forma de pagamento");
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
jPanel20.setLayout(jPanel20Layout);
jPanel20Layout.setHorizontalGroup(
jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel20Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
.addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel20Layout.setVerticalGroup(
jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel20Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton7)
.addComponent(jButton8))
.addContainerGap())
);
parcelamentojTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null}
},
new String [] {
"Forma Pagamento", "Tipo Parcelmaneto", "Valor a Parcelar", "Nº Parcelas", "Valor Parcela"
}
) {
boolean[] canEdit = new boolean [] {
false, false, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane2.setViewportView(parcelamentojTable);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(156, 156, 156))
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jTabbedPane1.addTab("Forma de Pagto", jPanel5);
observacoesjTextArea.setColumns(20);
observacoesjTextArea.setRows(5);
jScrollPane3.setViewportView(observacoesjTextArea);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 627, Short.MAX_VALUE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
.addContainerGap())
);
jTabbedPane1.addTab("Obs", jPanel2);
obsTMjTextArea.setColumns(20);
obsTMjTextArea.setRows(5);
jScrollPane4.setViewportView(obsTMjTextArea);
jLabel32.setText("Observações que serão enviadas ao Departamento Responsável e ao Departamento Financeiro da TravelMate");
javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
jPanel21.setLayout(jPanel21Layout);
jPanel21Layout.setHorizontalGroup(
jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel21Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane4)
.addGroup(jPanel21Layout.createSequentialGroup()
.addComponent(jLabel32)
.addGap(0, 96, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel21Layout.setVerticalGroup(
jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel21Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel32)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 385, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jTabbedPane1.addTab("Obs TM", jPanel21);
jPanel18.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/botozinhos/confirmar.png"))); // NOI18N
jButton5.setText("Confirmar");
jButton5.setToolTipText("Confirma Emissão de Visto");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/botozinhos/cancel.png"))); // NOI18N
jButton6.setText("Cancelar");
jButton6.setToolTipText("Cancela Emissão de Pacote Turístico");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
jPanel18.setLayout(jPanel18Layout);
jPanel18Layout.setHorizontalGroup(
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel18Layout.createSequentialGroup()
.addContainerGap(73, Short.MAX_VALUE)
.addComponent(jButton5)
.addGap(49, 49, 49)
.addComponent(jButton6)
.addGap(86, 86, 86))
);
jPanel18Layout.setVerticalGroup(
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel18Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton5)
.addComponent(jButton6))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 652, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(132, 132, 132))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void dataIniciojDateChooserFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataIniciojDateChooserFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_dataIniciojDateChooserFocusGained
private void duracaojTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_duracaojTextFieldFocusGained
}//GEN-LAST:event_duracaojTextFieldFocusGained
private void duracaojTextFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_duracaojTextFieldFocusLost
}//GEN-LAST:event_duracaojTextFieldFocusLost
private void duracaojTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_duracaojTextFieldKeyTyped
}//GEN-LAST:event_duracaojTextFieldKeyTyped
private void valorVistojTextFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_valorVistojTextFieldFocusLost
}//GEN-LAST:event_valorVistojTextFieldFocusLost
private void valorVistojTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorVistojTextFieldKeyTyped
if (evt.getKeyChar()=='.'){
evt.setKeyChar(',');
}
String caracteres = "0987654321,";
if (evt.getKeyChar() != '\b') {
if (!caracteres.contains(evt.getKeyChar() + "")) {
evt.consume();
}
}
}//GEN-LAST:event_valorVistojTextFieldKeyTyped
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
new FrmConsultaCliente(usuarioLogadoBean, this);
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
String msg = validarDados();
String nsituacao;
if (msg.length() < 5) {
boolean resultado = false;
if (situacao.equalsIgnoreCase("PROCESSO")) {
resultado = JOptionPane.showConfirmDialog(null, "FINALIZAR FICHA? Ficha será enviada para Gerência", "Confirmar", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == 0;
if (resultado){
novaFicha=true;
}
}else {
resultado = true;
}
if (resultado) {
nsituacao="FINALIZADA";
} else {
nsituacao="PROCESSO";
}
valorTotal = Formatacao.formatarStringfloat(valorVistojTextField.getText());
ProdutoOrcamentoController produtoOrcamentoController = new ProdutoOrcamentoController();
Produtosorcamento produtosorcamento = produtoOrcamentoController.consultar(parametrosprodutos.getVistoOrcamento());
if (produtosorcamento!=null){
ProdutoOrcamentoBean pob = new ProdutoOrcamentoBean();
pob.setIdOrcamentoProdutoOrcamento(0);
pob.setDescricaoProdutoOrcamento(produtosorcamento.getDescricao());
pob.setIdProdutoOrcamento(produtosorcamento.getIdprodutosOrcamento());
pob.setValorMoedaEstrangeira(0.0f);
pob.setValorMoedaReal(valorTotal);
pob.setApagar(false);
pob.setVisto(false);
pob.setSeguro(true);
pob.setNovo(true);
if (listaProdutoOrcamentoBean==null){
listaProdutoOrcamentoApagarBean = new ArrayList<ProdutoOrcamentoBean>();
}
listaProdutoOrcamentoBean.add(pob);
}
SalvarVerndas(nsituacao);
salvarVisto();
salvarOrcamento();
salvarFormaPagamento();
salvarFollowup();
if (novaFicha){
if(nsituacao.equalsIgnoreCase("FINALIZADA")){
calcularComissao();
ContasReceberBean contasReceberBean = new ContasReceberBean(vendas, listaParcelamento, usuarioLogadoBean);
}
}else {
if (nsituacao.equalsIgnoreCase("FINALIZADA")) {
float valorVendaatual = vendas.getValor();
if (valorVendaAlterar != valorVendaatual) {
calcularComissao();
}
}
}
salvarControle();
if (this.vistos.getIdvistos()!= null) {
if (vendaAlterada != null) {
verificarDadosAlterado();
}
}
emitirEmailGerencial();
JOptionPane.showMessageDialog(rootPane, "Emissão de Visto Salva com Sucesso");
telaConsulta.setModel();
imprimirRecibo();
this.dispose();
} else {
JOptionPane.showMessageDialog(rootPane, msg);
}
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
this.dispose();
}//GEN-LAST:event_jButton6ActionPerformed
private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
if (jTabbedPane1.getSelectedIndex()==1){
calcularValorTotalOrcamento();
}
}//GEN-LAST:event_jTabbedPane1StateChanged
private void dataEntregaDocumentosjDateChooserFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataEntregaDocumentosjDateChooserFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_dataEntregaDocumentosjDateChooserFocusGained
private void condicaoPagamentojComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_condicaoPagamentojComboBoxItemStateChanged
}//GEN-LAST:event_condicaoPagamentojComboBoxItemStateChanged
private void valorOrcamentoFormajTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorOrcamentoFormajTextFieldKeyTyped
if (evt.getKeyChar()=='.'){
evt.setKeyChar(',');
}
String caracteres = "0987654321,-";
if (evt.getKeyChar() != '\b') {
if (!caracteres.contains(evt.getKeyChar() + "")) {
evt.consume();
}
}
}//GEN-LAST:event_valorOrcamentoFormajTextFieldKeyTyped
private void possuiJurosjComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_possuiJurosjComboBoxItemStateChanged
if (possuiJurosjComboBox.getSelectedItem().toString().equalsIgnoreCase("Sim")){
valorJurosjTextField.setEnabled(true);
valorJurosjTextField.setText("");
valorJurosjTextField.selectAll();
}else {
valorJurosjTextField.setText("");
valorJurosjTextField.setEnabled(false);
totalPagar = valorTotal;
totalPagarjTextField.setText(Formatacao.formatarFloatString(totalPagar));
}
}//GEN-LAST:event_possuiJurosjComboBoxItemStateChanged
private void valorJurosjTextFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_valorJurosjTextFieldFocusLost
if (possuiJurosjComboBox.getSelectedItem().toString().equalsIgnoreCase("sim")){
if (valorJurosjTextField.getText().length()>0){
valorJuros = Formatacao.formatarStringfloat(valorJurosjTextField.getText());
totalPagar = valorTotal + valorJuros;
totalPagarjTextField.setText(Formatacao.formatarFloatString(totalPagar));
saldoReceberjTextField.setText(Formatacao.formatarFloatString(totalPagar));
saldoParcelarjTextField.setText(Formatacao.formatarFloatString(totalPagar));
}
}
if (valorJurosjTextField.getText().length()>0){
float valor = Formatacao.formatarStringfloat(valorJurosjTextField.getText());
valorJurosjTextField.setText(Formatacao.formatarFloatString(valor));
}
}//GEN-LAST:event_valorJurosjTextFieldFocusLost
private void valorJurosjTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorJurosjTextFieldKeyTyped
if (evt.getKeyChar()=='.'){
evt.setKeyChar(',');
}
String caracteres = "0987654321,";
if (evt.getKeyChar() != '\b') {
if (!caracteres.contains(evt.getKeyChar() + "")) {
evt.consume();
}
}
}//GEN-LAST:event_valorJurosjTextFieldKeyTyped
private void valorJurosjTextFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorJurosjTextFieldKeyReleased
}//GEN-LAST:event_valorJurosjTextFieldKeyReleased
private void saldoReceberjTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_saldoReceberjTextFieldKeyTyped
// TODO add your handling code here:
}//GEN-LAST:event_saldoReceberjTextFieldKeyTyped
private void saldoParcelarjTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_saldoParcelarjTextFieldKeyTyped
// TODO add your handling code here:
}//GEN-LAST:event_saldoParcelarjTextFieldKeyTyped
private void meioPagamentojComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_meioPagamentojComboBoxItemStateChanged
}//GEN-LAST:event_meioPagamentojComboBoxItemStateChanged
private void valorParcelamentojTextFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_valorParcelamentojTextFieldFocusLost
if (valorParcelamentojTextField.getText().length()>0){
float valor = Formatacao.formatarStringfloat(valorParcelamentojTextField.getText());
valorParcelamentojTextField.setText(Formatacao.formatarFloatString(valor));
int numero = Integer.parseInt(numeroParcelasjComboBox.getSelectedItem().toString());
float vParcela = valor / numero;
valorParcelajTextField.setText(Formatacao.formatarFloatString(vParcela));
}
}//GEN-LAST:event_valorParcelamentojTextFieldFocusLost
private void valorParcelamentojTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_valorParcelamentojTextFieldFocusGained
}//GEN-LAST:event_valorParcelamentojTextFieldFocusGained
private void valorParcelamentojTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorParcelamentojTextFieldKeyTyped
if (evt.getKeyChar()=='.'){
evt.setKeyChar(',');
}
String caracteres = "0987654321,-";
if (evt.getKeyChar() != '\b') {
if (!caracteres.contains(evt.getKeyChar() + "")) {
evt.consume();
}
}
}//GEN-LAST:event_valorParcelamentojTextFieldKeyTyped
private void valorParcelajTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_valorParcelajTextFieldFocusGained
float saldoParcelas =0.0f;
int numeroParcelas =0;
float valorParcela = 0.0f;
numeroParcelas = Integer.parseInt(numeroParcelasjComboBox.getSelectedItem().toString());
if (valorParcelamentojTextField.getText().length()>0){
saldoParcelas = Formatacao.formatarStringfloat(valorParcelamentojTextField.getText());
}
if ((saldoParcelas>0) && (numeroParcelas>0)){
valorParcela = saldoParcelas / numeroParcelas;
valorParcelajTextField.setText(Formatacao.formatarFloatString(valorParcela));
this.valorParcela = valorParcela;
}
}//GEN-LAST:event_valorParcelajTextFieldFocusGained
private void valorParcelajTextFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorParcelajTextFieldKeyPressed
if (evt.getKeyChar()=='.'){
evt.setKeyChar(',');
}
}//GEN-LAST:event_valorParcelajTextFieldKeyPressed
private void valorParcelajTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorParcelajTextFieldKeyTyped
if (evt.getKeyChar()=='.'){
evt.setKeyChar(',');
}
String caracteres = "0987654321,-";
if (evt.getKeyChar() != '\b') {
if (!caracteres.contains(evt.getKeyChar() + "")) {
evt.consume();
}
}
}//GEN-LAST:event_valorParcelajTextFieldKeyTyped
private void valorParcelajTextFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_valorParcelajTextFieldKeyReleased
}//GEN-LAST:event_valorParcelajTextFieldKeyReleased
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
String msg = validarFormaPagamento();
if (msg.length() < 5) {
float saldoParcelar = Formatacao.formatarStringfloat(saldoParcelarjTextField.getText());
float valorParcela = Formatacao.formatarStringfloat(valorParcelamentojTextField.getText());
if (valorParcela > saldoParcelar) {
JOptionPane.showMessageDialog(rootPane, "Valor a Parcelar maior que saldo a parcelar");
valorParcelajTextField.selectAll();
valorParcelajTextField.requestFocus();
} else {
Parcelamentopagamento parcelamento = new Parcelamentopagamento();
parcelamento.setDiaVencimento(dataVencimentojDateChooser.getDate());
parcelamento.setFormaPagamento(meioPagamentojComboBox.getSelectedItem().toString());
int numeroParcelas = Integer.parseInt(numeroParcelasjComboBox.getSelectedItem().toString());
parcelamento.setNumeroParcelas(numeroParcelas);
parcelamento.setTipoParcelmaneto(tipoParcelamentojComboBox.getSelectedItem().toString());
parcelamento.setValorParcela(Formatacao.formatarStringfloat(valorParcelajTextField.getText()));
parcelamento.setValorParcelamento(Formatacao.formatarStringfloat(valorParcelamentojTextField.getText()));
if (listaParcelamento == null) {
listaParcelamento = new ArrayList<Parcelamentopagamento>();
}
listaParcelamento.add(parcelamento);
carregarModelParcelamento();
calcularParcelamentoPagamento();
valorParcelajTextField.setText("");
valorParcelamentojTextField.setText("");
numeroParcelasjComboBox.setSelectedItem("01");
dataVencimentojDateChooser.setDate(new Date());
}
} else {
JOptionPane.showMessageDialog(rootPane, msg);
}
}//GEN-LAST:event_jButton7ActionPerformed
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
int linha = parcelamentojTable.getSelectedRow();
if (linha>=0){
if (listaParcelamento.get(linha).getIdparcemlamentoPagamento()!=null){
ParcelamentoPagamentoController parcelamentoPagamentoController = new ParcelamentoPagamentoController();
parcelamentoPagamentoController.excluir(listaParcelamento.get(linha).getIdparcemlamentoPagamento());
}else {
listaParcelamento.remove(linha);
}
carregarModelParcelamento();
calcularParcelamentoPagamento();
}
}//GEN-LAST:event_jButton8ActionPerformed
private void numeroParcelasjComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_numeroParcelasjComboBoxItemStateChanged
if (valorParcelamentojTextField.getText().length()>0){
float valor = Formatacao.formatarStringfloat(valorParcelamentojTextField.getText());
valorParcelamentojTextField.setText(Formatacao.formatarFloatString(valor));
int numero = Integer.parseInt(numeroParcelasjComboBox.getSelectedItem().toString());
float vParcela = valor / numero;
valorParcelajTextField.setText(Formatacao.formatarFloatString(vParcela));
} // TODO add your handling code here:
}//GEN-LAST:event_numeroParcelasjComboBoxItemStateChanged
private void buscaBancojButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buscaBancojButton4ActionPerformed
new FrmCalculoJuros(this, valorTotal);
}//GEN-LAST:event_buscaBancojButton4ActionPerformed
private void dataVencimentojDateChooserFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataVencimentojDateChooserFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_dataVencimentojDateChooserFocusGained
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
new FrmConsultaValoresVistos(usuarioLogadoBean, this);
}//GEN-LAST:event_jButton2ActionPerformed
/**
* @param args the command line arguments
*/
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup HotelbuttonGroup;
private javax.swing.ButtonGroup OutrosbuttonGroup;
private javax.swing.ButtonGroup SegurobuttonGroup;
private javax.swing.JButton buscaBancojButton4;
private javax.swing.ButtonGroup carrobuttonGroup;
private javax.swing.JTextField clientejTextField;
private javax.swing.JComboBox condicaoPagamentojComboBox;
private com.toedter.calendar.JDateChooser dataEntregaDocumentosjDateChooser;
private com.toedter.calendar.JDateChooser dataIniciojDateChooser;
private com.toedter.calendar.JDateChooser dataVencimentojDateChooser;
private javax.swing.JTextField duracaojTextField;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel29;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel30;
private javax.swing.JLabel jLabel32;
private javax.swing.JLabel jLabel36;
private javax.swing.JLabel jLabel38;
private javax.swing.JLabel jLabel39;
private javax.swing.JLabel jLabel53;
private javax.swing.JLabel jLabel54;
private javax.swing.JLabel jLabel56;
private javax.swing.JLabel jLabel58;
private javax.swing.JLabel jLabel59;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel60;
private javax.swing.JLabel jLabel61;
private javax.swing.JLabel jLabel62;
private javax.swing.JLabel jLabel63;
private javax.swing.JLabel jLabel64;
private javax.swing.JLabel jLabel65;
private javax.swing.JLabel jLabel68;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel16;
private javax.swing.JPanel jPanel18;
private javax.swing.JPanel jPanel19;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel20;
private javax.swing.JPanel jPanel21;
private javax.swing.JPanel jPanel5;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JCheckBox matrizjCheckBox;
private javax.swing.JComboBox meioPagamentojComboBox;
private javax.swing.JComboBox numeroParcelasjComboBox;
private javax.swing.JTextArea obsTMjTextArea;
private javax.swing.JTextField observacaojTextField;
private javax.swing.JTextArea observacoesjTextArea;
private javax.swing.JTextField paisDestinojTextField;
private javax.swing.JTable parcelamentojTable;
private javax.swing.ButtonGroup passagemAereabuttonGroup;
private javax.swing.JComboBox possuiJurosjComboBox;
private javax.swing.JTextField saldoParcelarjTextField;
private javax.swing.JTextField saldoReceberjTextField;
private javax.swing.JComboBox tipoParcelamentojComboBox;
private javax.swing.JTextField tipoVistojTextField;
private javax.swing.JTextField totalPagarjTextField;
private javax.swing.JTextField valorJurosjTextField;
private javax.swing.JTextField valorOrcamentoFormajTextField;
private javax.swing.JTextField valorParcelajTextField;
private javax.swing.JTextField valorParcelamentojTextField;
private javax.swing.JTextField valorVistojTextField;
// End of variables declaration//GEN-END:variables
public void carregarInicializacao(int idVenda){
if (idVenda>0){
carregarObjetos(idVenda);
}else{
valorCambio=1;
consultaCambio=true;
}
}
public String validarDados(){
String msg ="";
if (cliente==null){
msg = msg + "Cliente não Selecionado\r\n";
}
double saldoParcelar = Formatacao.formatarStringfloat(saldoParcelarjTextField.getText());
if (saldoParcelar>0){
msg = msg + "Forma de Pagamento possui saldo a parcelar em aberto\r\n";
}
return msg;
}
public void SalvarVerndas(String situacao){
if (vendas==null){
vendas = new Vendas();
vendas.setDataVenda(new Date());
vendas.setUsuario(usuarioLogadoBean.getUsuario().getIdusuario());
vendas.setUnidadenegocio(usuarioLogadoBean.getUnidadeNegocio().getIdunidadeNegocio());
novaFicha = true;
}else{
if (vendas.getSituacao().equalsIgnoreCase("PROCESSO")){
vendas.setDataVenda(new Date());
}
}
vendas.setCliente(cliente.getIdcliente());
if (vendas.getIdvendas()==null){
vendas.setDataVenda(new Date());
}
vendas.setObstm(obsTMjTextArea.getText());
if (matrizjCheckBox.isSelected()){
vendas.setVendasMatriz("S");
}else vendas.setVendasMatriz("N");
vendas.setProdutos(parametrosprodutos.getVisto());
vendas.setUnidadenegocio(usuarioLogadoBean.getUnidadeNegocio().getIdunidadeNegocio());
vendas.setUsuario(usuarioLogadoBean.getUsuario().getIdusuario());
vendas.setValor(valorTotal);
vendas.setFornecedor(valoresVistos.getFornecedorcidade().getFornecedor().getIdfornecedor());
vendas.setFornecedorcidade(valoresVistos.getFornecedorcidade());
vendas.setSituacao(situacao);
VendasController vendasController = new VendasController();
vendas = vendasController.salvar(vendas);
}
public void salvarVisto() {
VistosController vistosController = new VistosController();
if (vistos == null) {
vistos = new Vistos();
}
vistos.setDataEntregaDocumentos(dataEntregaDocumentosjDateChooser.getDate());
vistos.setObservacao(observacaojTextField.getText());
vistos.setValorEmissao(valoresVistos.getValorgross());
vistos.setValoresvistos(valoresVistos);
vistos.setPossuiVisto("Sim");
vistos.setPaisDestino(paisDestinojTextField.getText());
vistos.setTipoVisto(tipoVistojTextField.getText());
vistos.setDataInicio(dataIniciojDateChooser.getDate());
vistos.setDuracao(duracaojTextField.getText());
vistos.setVendas(vendas.getIdvendas());
vistos.setValoresvistos(valoresVistos);
vistos = vistosController.salvar(vistos);
}
public void consultarParametrosProdutos(){
ParametrosProdutosController parametrosProditosController = new ParametrosProdutosController();
parametrosprodutos = parametrosProditosController.consultar();
}
public void salvarOrcamento(){
if (orcamento==null){
orcamento = new Orcamento();
}
orcamento.setDataCambio(cambio.getData());
orcamento.setTotalMoedaEstrangeira(totalMoedaEstrangeira);
orcamento.setTotalMoedaNacional(totalMoedaReal);
orcamento.setVendas(vendas.getIdvendas());
orcamento.setCambioAlterado("Não");
orcamento.setCambio(5);
orcamento.setValorCambio(valorCambio);
orcamento.setTaxatm(0.0f);
OrcamentoController orcamentoController = new OrcamentoController();
orcamento = orcamentoController.salvar(orcamento);
salvarOrcamentoProdutoOrcamento(orcamento);
}
public void salvarOrcamentoProdutoOrcamento(Orcamento orcamento) {
apagarOrcamentoProdutosOrcamento();
if (listaProdutoOrcamentoBean != null) {
OrcamentoController orcamentoController = new OrcamentoController();
for (int i = 0; i < listaProdutoOrcamentoBean.size(); i++) {
Orcamentoprodutosorcamento produto;
produto = new Orcamentoprodutosorcamento();
produto.setOrcamento(orcamento.getIdorcamento());
produto.setProdutosOrcamento(listaProdutoOrcamentoBean.get(i).getIdProdutoOrcamento());
produto.setValorMoedaEstrangeira(listaProdutoOrcamentoBean.get(i).getValorMoedaEstrangeira());
produto.setValorMoedaNacional(listaProdutoOrcamentoBean.get(i).getValorMoedaReal());
orcamentoController.salvar(produto);
}
}
}
public void apagarOrcamentoProdutosOrcamento() {
OrcamentoController orcamentoController = new OrcamentoController();
List<Orcamentoprodutosorcamento> listaProdutoOrcamento = orcamentoController.listarOrcamentoProdutoOrcamento(orcamento.getIdorcamento());
if (listaProdutoOrcamento != null) {
for (int i = 0; i < listaProdutoOrcamento.size(); i++) {
orcamentoController.excluirOrcamentoProdutoOrcamento(listaProdutoOrcamento.get(i).getIdorcamentoProdutosOrcamento());
}
}
}
public void salvarFormaPagamento() {
if (formaPagamento==null){
formaPagamento = new Formapagamento();
}
formaPagamento.setCondicao(condicaoPagamentojComboBox.getSelectedItem().toString());
formaPagamento.setPossuiJuros(possuiJurosjComboBox.getSelectedItem().toString());
formaPagamento.setValorJutos(valorJuros);
formaPagamento.setValorOrcamento(Formatacao.formatarStringfloat(valorOrcamentoFormajTextField.getText()));
formaPagamento.setValorTotal(formaPagamento.getValorJutos() + formaPagamento.getValorOrcamento());
formaPagamento.setObservacoes(observacoesjTextArea.getText());
formaPagamento.setVendas(this.vendas.getIdvendas());
FormaPagamentoController formaPagamentoController = new FormaPagamentoController();
formaPagamento = formaPagamentoController.salvar(formaPagamento);
ParcelamentoPagamentoController parcelamentoPagamentoController = new ParcelamentoPagamentoController();
for(int i=0;i<listaParcelamento.size();i++){
Parcelamentopagamento parcelamento = listaParcelamento.get(i);
parcelamento.setIdformapagamento(formaPagamento.getIdformaPagamento());
parcelamento = parcelamentoPagamentoController.salvar(parcelamento);
}
}
public void carregarObjetos(int idVenda){
//Vendas
VendasController vendasController = new VendasController();
this.vendas = vendasController.consultarVendas(idVenda);
if (this.vendas != null) {
valorVendaAlterar = vendas.getValor();
situacao = vendas.getSituacao();
if (vendas.getSituacao().equalsIgnoreCase("FINALIZADA")){
vendaAlterada = vendas;
}
ClienteController clienteController = new ClienteController();
this.cliente = clienteController.consultar(vendas.getCliente());
clientejTextField.setText(cliente.getNome());
VistosController vistosController = new VistosController();
vistos = vistosController.consultarVistos(idVenda);
if (vistos!=null){
valoresVistos = vistos.getValoresvistos();
carregarVistoAlteracao();
carregarVistos();
}
FormaPagamentoController formaPagamentoController = new FormaPagamentoController();
this.formaPagamento = formaPagamentoController.consultar(idVenda);
if (formaPagamento!=null){
carregarCamposFormaPagamento();
}
OrcamentoController orcamentoController = new OrcamentoController();
orcamento = orcamentoController.consultar(idVenda);
if (orcamento!=null){
carregarCambio();
carregarOrcamento();
List<Orcamentoprodutosorcamento> listaOrcametoProduto = orcamentoController.listarOrcamentoProdutoOrcamento(orcamento.getIdorcamento());
if (listaOrcametoProduto!=null){
for(int i=0;i<listaOrcametoProduto.size();i++){
Produtosorcamento prod = orcamentoController.consultarProdutoOrcamento(listaOrcametoProduto.get(i).getProdutosOrcamento());
ProdutoOrcamentoBean pob = new ProdutoOrcamentoBean();
pob.setDescricaoProdutoOrcamento(prod.getDescricao());
pob.setIdProdutoOrcamento(prod.getIdprodutosOrcamento());
pob.setValorMoedaEstrangeira(listaOrcametoProduto.get(i).getValorMoedaEstrangeira());
pob.setValorMoedaReal(listaOrcametoProduto.get(i).getValorMoedaNacional());
pob.setIdOrcamentoProdutoOrcamento(listaOrcametoProduto.get(i).getIdorcamentoProdutosOrcamento());
pob.setApagar(false);
pob.setVisto(false);
pob.setSeguro(false);
pob.setNovo(false);
if (listaProdutoOrcamentoBean==null){
listaProdutoOrcamentoBean = new ArrayList<ProdutoOrcamentoBean>();
}
listaProdutoOrcamentoBean.add(pob);
}
}
}
consultaCambio=true;
}
}
public void carregarCambio(){
CambioController cambioController = new CambioController();
cambio = cambioController.consultar(orcamento.getCambio());
}
public void carregarVistos(){
if (vendas.getVendasMatriz().equalsIgnoreCase("S")){
matrizjCheckBox.setSelected(true);
}else matrizjCheckBox.setSelected(false);
obsTMjTextArea.setText(vendas.getObstm());
valorVistojTextField.setText(Formatacao.formatarFloatString(vistos.getValorEmissao()));
paisDestinojTextField.setText(valoresVistos.getFornecedorcidade().getCidade().getPais().getNome());
dataIniciojDateChooser.setDate(vistos.getDataInicio());
dataEntregaDocumentosjDateChooser.setDate(vistos.getDataEntregaDocumentos());
duracaojTextField.setText(vistos.getDuracao());
observacaojTextField.setText(vistos.getObservacao());
tipoVistojTextField.setText(valoresVistos.getCategoria());
}
public void carregarOrcamento(){
valorCambio = orcamento.getValorCambio();
cambioAlterado = orcamento.getCambioAlterado();
}
public void carregarCamposFormaPagamento(){
condicaoPagamentojComboBox.setSelectedItem(formaPagamento.getCondicao());
possuiJurosjComboBox.setSelectedItem(formaPagamento.getPossuiJuros());
valorJuros = formaPagamento.getValorJutos();
valorJurosjTextField.setText(Formatacao.formatarFloatString(formaPagamento.getValorJutos()));
observacoesjTextArea.setText(formaPagamento.getObservacoes());
ParcelamentoPagamentoController parcelamentoPagamentoController = new ParcelamentoPagamentoController();
listaParcelamento = parcelamentoPagamentoController.listar(formaPagamento.getIdformaPagamento());
calcularParcelamentoPagamento();
carregarModelParcelamento();
}
public void calcularValorTotalOrcamento() {
valorTotal = 0.0f;
valorTotal = Formatacao.formatarStringfloat(valorVistojTextField.getText());
valorOrcamentoFormajTextField.setText(Formatacao.formatarFloatString(valorTotal));
totalPagar = valorTotal + valorJuros;
totalPagarjTextField.setText(Formatacao.formatarFloatString(totalPagar));
saldoReceberjTextField.setText(Formatacao.formatarFloatString(totalPagar));
calcularParcelamentoPagamento();
}
@Override
public void setCliente(Cliente cliente) {
if (cliente!=null){
this.cliente = cliente;
clientejTextField.setText(cliente.getNome());
}
}
public void imprimirRecibo() {
float valorRecibo = 0.0f;
String url = ("telas/Recibo/reciboPagamento.jasper");
FormaPagamentoController formaPagamentoController = new FormaPagamentoController();
Formapagamento forma = formaPagamentoController.consultar(vendas.getIdvendas());
ParcelamentoPagamentoController parcelamentoPagamentoController = new ParcelamentoPagamentoController();
List<Parcelamentopagamento> listaParcelamento = parcelamentoPagamentoController.listar(forma.getIdformaPagamento());
if (listaParcelamento != null) {
for (int i = 0; i < listaParcelamento.size(); i++) {
if (listaParcelamento.get(i).getFormaPagamento().equalsIgnoreCase("Dinheiro")) {
valorRecibo = valorRecibo + listaParcelamento.get(i).getValorParcelamento();
}
if (listaParcelamento.get(i).getFormaPagamento().equalsIgnoreCase("cheque")) {
valorRecibo = valorRecibo + listaParcelamento.get(i).getValorParcelamento();
}
if (listaParcelamento.get(i).getFormaPagamento().equalsIgnoreCase("depósito")) {
valorRecibo = valorRecibo + listaParcelamento.get(i).getValorParcelamento();
}
}
}
if (valorRecibo > 0.0f) {
Map parameters = new HashMap();
try {
parameters.put("idvendas", vendas.getIdvendas());
String valorExtenso = Formatacao.valorPorExtenso(valorRecibo);
parameters.put("valorExtenso", valorExtenso);
parameters.put("valorRecibo", valorRecibo);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, "Não foi possível gerar o relatório " + ex);
ex.printStackTrace();
}
new relatoriosJasper(url, parameters);
} else {
JOptionPane.showMessageDialog(rootPane, "Sem recibo para imprimir");
}
}
public void emitirEmailGerencial() {
EnviarEmailBean email = new EnviarEmailBean();
if (novaFicha) {
email.setTitulo("Nova Ficha de Visto");
email.setTipoAviso("Inclusão");
email.setDataInclusao(Formatacao.ConvercaoDataPadrao(vendas.getDataVenda()));
email.setValor(Formatacao.formatarFloatString(vendas.getValor()));
if (cambio==null){
email.setCambio("0,00");
}else email.setCambio(Formatacao.formatarFloatString(cambio.getValor()));
email.setSiglaCambio("R$");
} else {
email.setTitulo("Ficha de Visto Alterada");
email.setTipoAviso("Alteração");
email.setDataAlteracao(Formatacao.ConvercaoDataPadrao(new Date()));
email.setDadosAlterados(dadosAlterado);
}
if (vendas.getVendasMatriz().equalsIgnoreCase("S")){
email.setTipoVenda("Venda pela Matriz");
}else email.setTipoVenda("Venda pela Loja");
if (vendas.getFornecedorcidade().getFornecedor()!=null){
email.setNomeEscola(vendas.getFornecedorcidade().getFornecedor().getNome());
}
email.setUnidadeNegocio(usuarioLogadoBean.getUnidadeNegocio().getNomeFantasia());
email.setNomeCliente(cliente.getNome());
email.setDatainicio(Formatacao.ConvercaoDataPadrao(vistos.getDataInicio()));
email.setConsultor(usuarioLogadoBean.getUsuario().getNome());
email.setObsTM(vendas.getObstm());
email.setIdProduto(usuarioLogadoBean.getParametrosprodutos().getVisto());
if (novaFicha){
email.criarCorpoEmailInclusao();
}else email.criarCorpoEmailAteracao();
email.enviarEmail();
}
public void calcularParcelamentoPagamento() {
if (listaParcelamento != null) {
Float valorParcelado = 0.0f;
for (int i = 0; i < listaParcelamento.size(); i++) {
valorParcelado = valorParcelado + listaParcelamento.get(i).getValorParcelamento();
}
Float saldo = (valorTotal + valorJuros) - valorParcelado;
saldoParcelarjTextField.setText(Formatacao.formatarFloatString(saldo));
}
}
public void carregarModelParcelamento(){
List<Parcelamentopagamento> listanova=null;
listanova = listaParcelamento;
if (formaPagamento != null) {
ParcelamentoPagamentoController parcelamentoPagamentoController = new ParcelamentoPagamentoController();
listaParcelamento = parcelamentoPagamentoController.listar(formaPagamento.getIdformaPagamento());
if (listaParcelamento == null) {
listaParcelamento = new ArrayList<Parcelamentopagamento>();
}
}else {
listaParcelamento = new ArrayList<Parcelamentopagamento>();
}
if (listanova != null) {
for (int i = 0; i < listanova.size(); i++) {
if (listanova.get(i).getIdparcemlamentoPagamento() == null) {
listaParcelamento.add(listanova.get(i));
}
}
}
modelParcelamento = new ConsultaParcelamentoPagamentoTableModel(listaParcelamento);
parcelamentojTable.setModel(modelParcelamento);
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setHorizontalAlignment(SwingConstants.RIGHT);
parcelamentojTable.getColumnModel().getColumn(0).setPreferredWidth(100);
parcelamentojTable.getColumnModel().getColumn(1).setPreferredWidth(100);
parcelamentojTable.getColumnModel().getColumn(2).setCellRenderer(renderer);
parcelamentojTable.getColumnModel().getColumn(2).setPreferredWidth(50);
parcelamentojTable.getColumnModel().getColumn(3).setCellRenderer(renderer);
parcelamentojTable.getColumnModel().getColumn(3).setPreferredWidth(20);
parcelamentojTable.getColumnModel().getColumn(4).setCellRenderer(renderer);
parcelamentojTable.getColumnModel().getColumn(4).setPreferredWidth(50);
parcelamentojTable.repaint();
}
public void salvarFollowup(){
FollowupController followupController = new FollowupController();
followupController.fecharFollowUpCliente(cliente.getIdcliente());
}
public void salvarControle() {
VistosController vistosController = new VistosController();
Controlevistos controle = vistosController.consultarControleVistos(this.vendas.getIdvendas());
if (controle == null) {
controle = new Controlevistos();
controle.setVendas(vendas.getIdvendas());
controle.setEmailOrientacao("Não");
controle.setConfirmacaoMatricula("Não");
controle.setRascunhoFormularios("Não");
controle.setPreenchimentoFormularios("Não");
controle.setConferenciaDocumentos("Não");
controle.setEnvioProcessamento("Não");
controle.setProtocolo("Não");
controle.setVistoLiberado("Não");
controle.setPaisVisto(" ");
controle.setCategoria(" ");
controle.setObservacao(" ");
controle.setFinalizado("Processo");
controle.setSituacao("Processo");
controle = vistosController.salvar(controle);
}
}
@Override
public void setValorJuros(Float valorJuros) {
valorJurosjTextField.setText(Formatacao.formatarFloatString(valorJuros));
valorJurosjTextField.requestFocus();
}
public void limitarJText(){
duracaojTextField.setDocument(new LimiteTextoJedit(50));
paisDestinojTextField.setDocument(new LimiteTextoJedit(50));
tipoVistojTextField.setDocument(new LimiteTextoJedit(30));
observacaojTextField.setDocument(new LimiteTextoJedit(100));
}
public String validarFormaPagamento(){
String msg = "";
if (dataVencimentojDateChooser.getDate()==null){
msg = msg + "Data primeiro vencimento obrigatória";
}
if (meioPagamentojComboBox.getSelectedItem().toString().equalsIgnoreCase("Selecione")){
msg = msg + "Campo forma de pagamento obrigatório";
}
return msg;
}
@Override
public void setValores(Valoresvistos valoresVistos) {
if (valoresVistos!=null){
this.valoresVistos = valoresVistos;
paisDestinojTextField.setText(valoresVistos.getFornecedorcidade().getCidade().getPais().getNome());
valorVistojTextField.setText(Formatacao.formatarFloatString(valoresVistos.getValorgross()));
tipoVistojTextField.setText(valoresVistos.getCategoria());
}else JOptionPane.showMessageDialog(rootPane, "Valor do Visto não Localizado");
}
public void calcularComissao() {
VendasComissaoController vendasComissaoController = new VendasComissaoController();
Vendascomissao vendasComissao = vendasComissaoController.getVendaComissao(vendas.getIdvendas(), usuarioLogadoBean.getParametrosprodutos().getCursos());
if (vendasComissao != null) {
if (vendasComissao.getPaga().equalsIgnoreCase("Não")) {
try {
ComissaoVisto cc = new ComissaoVisto(usuarioLogadoBean, vendas, valoresVistos, listaParcelamento, vistos.getDataInicio(), 0, 0, Formatacao.SomarDiasDatas(vendas.getDataVenda(), 30), vendasComissao);
} catch (Exception ex) {
Logger.getLogger(FrmVisto.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
public boolean excluirComissao(){
boolean validar = true;
VendasComissaoController vendasComissaoController = new VendasComissaoController();
Vendascomissao vendasComissao = vendasComissaoController.getVendaComissao(vendas.getIdvendas(), vendas.getProdutos());
if (vendasComissao!=null){
if (vendasComissao.getPaga().equalsIgnoreCase("Não")){
vendasComissaoController.excluir(vendasComissao.getIdvendascomissao());
validar=true;
}else {
validar = false;
}
}
return validar;
}
public boolean excluirContasReceber(){
ContasReceberController contasReceberCotroller = new ContasReceberController();
List<Contasreceber> listaContas = contasReceberCotroller.listar(vendas.getIdvendas());
boolean validar=true;
if (listaContas!=null){
for(int i=0;i<listaContas.size();i++){
if (listaContas.get(i).getDatapagamento()!=null){
validar=false;
i=10000;
}
}
if (validar){
for(int i=0;i<listaContas.size();i++){
contasReceberCotroller.excluir(listaContas.get(i).getIdcontasreceber());
}
}
}
return validar;
}
public void carregarVistoAlteracao(){
vistosAlterado = new Vistos();
vistosAlterado.setControle(vistos.getControle());
vistosAlterado.setDataEntregaDocumentos(vistos.getDataEntregaDocumentos());
vistosAlterado.setDataInicio(vistos.getDataInicio());
vistosAlterado.setDuracao(vistos.getDuracao());
vistosAlterado.setIdvistos(vistos.getIdvistos());
vistosAlterado.setObservacao(vistos.getObservacao());
vistosAlterado.setObstm(vistos.getObstm());
vistosAlterado.setPaisDestino(vistos.getPaisDestino());
vistosAlterado.setPossuiVisto(vistos.getPossuiVisto());
vistosAlterado.setTipoVisto(vistos.getTipoVisto());
vistosAlterado.setValorEmissao(vistos.getValorEmissao());
vistosAlterado.setValoresvistos(vistos.getValoresvistos());
vistosAlterado.setVendas(vistos.getVendas());
}
public void verificarDadosAlterado() {
dadosAlterado="";
if (vistos.getControle()!= null) {
if (!vistos.getControle().equalsIgnoreCase(vistosAlterado.getControle())) {
dadosAlterado = "Controle : " + vistos.getControle() + " | " + vistosAlterado.getControle() + "<br></br>";
}
}
if (vistos.getDuracao()!= null) {
if (!vistos.getDuracao().equals(vistosAlterado.getDuracao())) {
dadosAlterado = dadosAlterado + "Duração : " + vistos.getDuracao() + " | " + vistosAlterado.getDuracao() + "<br></br>";
}
}
if (vistos.getObservacao()!= null) {
if (!vistos.getObservacao().equalsIgnoreCase(vistosAlterado.getObservacao())) {
dadosAlterado = dadosAlterado + "Observações : " + vistos.getObservacao() + " | " + vistosAlterado.getObservacao() + "<br></br>";
}
}
if (vistos.getObstm()!= null) {
if (!vistos.getObstm().equalsIgnoreCase(vistosAlterado.getObstm())) {
dadosAlterado = dadosAlterado + "Obs TM : " + vistos.getObstm() + " | " + vistosAlterado.getObstm() + "<br></br>";
}
}
if (vistos.getPaisDestino()!= null) {
if (!vistos.getPaisDestino().equalsIgnoreCase(vistosAlterado.getPaisDestino())) {
dadosAlterado = dadosAlterado + "País Destino : " + vistos.getPaisDestino() + " | " + vistosAlterado.getPaisDestino() + "<br></br>";
}
}
if (vistos.getPossuiVisto()!= null) {
if (!vistos.getPossuiVisto().equalsIgnoreCase(vistosAlterado.getPossuiVisto())) {
dadosAlterado = dadosAlterado + "Possuí Visto : " + vistos.getPossuiVisto() + " | " + vistosAlterado.getPossuiVisto() + "<br></br>";
}
}
if (vistos.getTipoVisto()!= null) {
if (!vistos.getTipoVisto().equalsIgnoreCase(vistosAlterado.getTipoVisto())) {
dadosAlterado = dadosAlterado + "Tipo Visto : " + vistos.getTipoVisto() + " | " + vistosAlterado.getTipoVisto() + "<br></br>";
}
}
if (vistos.getDataEntregaDocumentos()!= null) {
if (!vistos.getDataEntregaDocumentos().equals(vistosAlterado.getDataEntregaDocumentos())) {
dadosAlterado = dadosAlterado + "Data Entrega dos Documentos : " + Formatacao.ConvercaoDataPadrao(vistos.getDataEntregaDocumentos()) + " | " + Formatacao.ConvercaoDataPadrao(vistosAlterado.getDataEntregaDocumentos()) + "<br></br>";
}
}
if (vistos.getDataInicio()!= null) {
if (!vistos.getDataInicio().equals(vistosAlterado.getDataInicio())) {
dadosAlterado = dadosAlterado + "Data de Início : " + Formatacao.ConvercaoDataPadrao(vistos.getDataInicio()) + " | " + Formatacao.ConvercaoDataPadrao(vistosAlterado.getDataInicio()) + "<br></br>";
}
}
if (valorVendaAlterar != vendas.getValor()) {
dadosAlterado = dadosAlterado + "Valor Total : " + Formatacao.formatarFloatString(vendas.getValor()) + " | " + Formatacao.formatarFloatString(valorVendaAlterar) + "<br></br>";
}
}
}
|
[
"jizidoro@globo.com"
] |
jizidoro@globo.com
|
5d08566ab7b8bc1891bf35d0ef7116dadc881e6f
|
50d7fd3f1995a386ec7b5bb4cd9d4e110dbdb0e9
|
/Sorting/QuickSort3Ways.java
|
78b9b0928dbd4069530342fdeae7f24e82d19a99
|
[] |
no_license
|
aRrtTist/Data-structures
|
b20153586e658a1c1f040eb3d637497298335084
|
d08d46ea4c87d30895a584c3e668500baa975b86
|
refs/heads/master
| 2020-04-23T20:42:39.562262
| 2019-03-04T08:04:32
| 2019-03-04T08:04:32
| 171,448,880
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,184
|
java
|
import java.util.Arrays;
public class QuickSort3Ways {
private QuickSort3Ways(){}
private static void swap(Object[] arr, int i, int j) {
Object t = arr[i];
arr[i] = arr[j];
arr[j] = t;
}
private static void insertionSort(Comparable[] arr, int l, int r){
for(int i = l + 1; i <= r; i++){
Comparable v = arr[i];
int j;
for(j = i; j > l; j--){
if(arr[j - 1].compareTo(v) > 0)
arr[j] = arr[ j - 1];
else
break;
}
arr[j] = v;
}
}
private static void quickSort3Ways(Comparable[] arr, int l, int r){
if(r - l <= 15){
insertionSort(arr, l, r);
return;
}
swap( arr, l , (int)(Math.random()*(r-l+1))+l );
Comparable v = arr[l];
int lt = l;
int gt = r + 1;
int i = l + 1;
while( i < gt){
if(arr[i].compareTo(v) == 0)
i++;
else if(arr[i].compareTo(v) < 0){
swap(arr, i, lt + 1);
lt++;
i++;
}
else {
swap(arr, gt - 1, i);
gt--;
}
}
swap(arr, l, lt);
quickSort3Ways(arr, l, lt - 1);
quickSort3Ways(arr, gt, r);
}
public static void sort(Comparable[] arr){
quickSort3Ways(arr, 0, arr.length - 1);
}
public static void main(String[] args) {
// 测试排序算法辅助函数
int N = 10000;
// 存在大量相同元素时三路快排明显快于普通快排
// Integer[] arr1 = SortTestHelper.generateRandomArray(N, 0, 0);
Integer[] arr1 = SortTestHelper.generateRandomArray(N, 0, Integer.MAX_VALUE);
Integer[] arr2 = Arrays.copyOf(arr1, arr1.length);
Integer[] arr3 = Arrays.copyOf(arr1, arr1.length);
SortTestHelper.testSort("MergeSort", arr1);
SortTestHelper.testSort("QuickSort", arr2);
SortTestHelper.testSort("QuickSort3Ways", arr3);
}
}
|
[
"noreply@github.com"
] |
aRrtTist.noreply@github.com
|
6b6c9d019908e93fe35fb694873a011100fc64ec
|
873c18d03aa90fc9261ee0496a4b94bf1a432013
|
/src/Cars.java
|
fcef939666ad8ea66c2779ab0d04cbdb9ef45deb
|
[] |
no_license
|
Ibirocay/CarDemo
|
ad8b5c48061e5b8f2bde050886136fa0c9ffe40c
|
3a44f3dee7db27ef92ee982ce396c06d2820b0d2
|
refs/heads/master
| 2023-01-01T14:03:09.709493
| 2020-10-23T10:08:18
| 2020-10-23T10:08:18
| 306,598,438
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 68
|
java
|
public class Cars {
int year;
String model;
int price;
}
|
[
"ibirocay@gmail.com"
] |
ibirocay@gmail.com
|
65f8038eceaae5aa39884bf1062d6fda91c6a6f1
|
5ec06dab1409d790496ce082dacb321392b32fe9
|
/clients/java-play-framework/generated/app/Module.java
|
c7df5dc81747c8bc8ceefece7f33bd1c32be9133
|
[
"Apache-2.0"
] |
permissive
|
shinesolutions/swagger-aem-osgi
|
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
|
c2f6e076971d2592c1cbd3f70695c679e807396b
|
refs/heads/master
| 2022-10-29T13:07:40.422092
| 2021-04-09T07:46:03
| 2021-04-09T07:46:03
| 190,217,155
| 3
| 3
|
Apache-2.0
| 2022-10-05T03:26:20
| 2019-06-04T14:23:28
| null |
UTF-8
|
Java
| false
| false
| 257
|
java
|
import com.google.inject.AbstractModule;
import controllers.*;
public class Module extends AbstractModule {
@Override
protected void configure() {
bind(ConfigmgrApiControllerImpInterface.class).to(ConfigmgrApiControllerImp.class);
}
}
|
[
"cliffano@gmail.com"
] |
cliffano@gmail.com
|
a1c3bac52af0534863a124bb3dc8e15f47c765fb
|
3bd5a26397d8b1976dbb3d28c9d36aa872779fbb
|
/level13/lesson02/task02/Solution.java
|
aae4ba4df673057904f5fd6a68171303584df8f3
|
[] |
no_license
|
tumaykin/javarush_tasks
|
f18452cddb5e49bbc0e8b9acb7900e285ff03235
|
9a7c32ee8f50d5dc727c91f564c864090f737ab5
|
refs/heads/master
| 2020-09-24T00:19:32.266064
| 2016-08-30T16:12:16
| 2016-08-30T16:12:16
| 66,955,572
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 895
|
java
|
package com.javarush.test.level13.lesson02.task02;
/* Пиво: возвращение
Добавь к классу AlcoholicBeer интерфейс Drink и реализуй все нереализованные методы.
*/
public class Solution
{
public static void main(String[] args) throws Exception
{
Drink beer = new AlcoholicBeer();
System.out.println(beer.toString());
}
public interface Drink
{
boolean isAlcoholic();
}
public static class AlcoholicBeer implements Drink
{
public boolean isAlcoholic(){return true;};
@Override
public String toString()
{
if (isAlcoholic()) {
return "Напиток алкогольный";
}
else {
return "Напиток безалкогольный";
}
}
}
}
|
[
"noreply@github.com"
] |
tumaykin.noreply@github.com
|
76cadce5ecdab31e501dee28d74c7d6bb09536b9
|
16ecdbd00c590a44f811abf265d3ac09a4917d7f
|
/Programs/Exercise 3 - Interface/src/model/entities/Contract.java
|
4f30138f0b2a2282a8f218c5a411f639569416d7
|
[] |
no_license
|
DanielMaranhao/project-java-reference
|
107ba9ba0baf20ffea440a6fb6ade7213ec028d5
|
9d0350a40b930379cdfcbc93a8755497b93cd0bc
|
refs/heads/main
| 2023-07-19T23:45:14.729440
| 2021-08-27T22:28:57
| 2021-08-27T22:28:57
| 391,248,714
| 11
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,041
|
java
|
package model.entities;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Contract {
private Integer number;
private Date date;
private Double totalValue;
private List<Installment> installments = new ArrayList<>();
public Contract(Integer number, Date date, Double totalValue) {
this.number = number;
this.date = date;
this.totalValue = totalValue;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Double getTotalValue() {
return totalValue;
}
public void setTotalValue(Double totalValue) {
this.totalValue = totalValue;
}
public List<Installment> getInstallments() {
return installments;
}
public void addInstallment(Installment installment) {
installments.add(installment);
}
public void removeInstallment(Installment installment) {
installments.remove(installment);
}
}
|
[
"danielmarquesmaranhao@gmail.com"
] |
danielmarquesmaranhao@gmail.com
|
5391e7c0d4536ad3e8f620fb5493032b2b4abcb8
|
21b757c6815f3928f5dfb8e4d2bad8ce6575a7bb
|
/src/main/java/bStat/oms/com/bootstrap/OMSManagedService.java
|
a12ebf8fdf9e44b7081dc5a9584432944c5faa79
|
[] |
no_license
|
YashiAgarwal/bStat-oms
|
f5dbe3dd9bee6144a67e09b4cf0e2853aec9deb4
|
b21febd4dc285eedbd0759341394aab231777595
|
refs/heads/master
| 2021-01-22T05:28:33.607168
| 2017-09-10T07:09:30
| 2017-09-10T07:09:30
| 92,474,669
| 0
| 0
| null | 2017-09-10T07:09:30
| 2017-05-26T05:13:21
|
Java
|
UTF-8
|
Java
| false
| false
| 832
|
java
|
package bStat.oms.com.bootstrap;
import bStat.oms.com.common.utils.GuiceInjector;
import io.dropwizard.lifecycle.Managed;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by prashant170392 on 01/05/2017
*/
public class OMSManagedService implements Managed {
private static final Logger logger = LoggerFactory.getLogger(OMSManagedService.class);
public OMSManagedService() {
GuiceInjector.getInjector().injectMembers(this);
}
public void start() throws Exception {
logger.info("<<<<<<<<<<============= Starting IMSApplication ===========>>>>>>>>>>");
logger.info("Initializing all the prerequisites");
}
public void stop() throws Exception {
logger.info("<<<<<<<<<<============= Stopping IMSApplication Gracefully ===========>>>>>>>>>>");
}
}
|
[
"agarwalyashi1992.ya@gmail.com"
] |
agarwalyashi1992.ya@gmail.com
|
5ae327999ff2963a4f4f6865a971a84aa0ca1fd2
|
aacba326c2e3cbc64a0b371b2dfe8e9396f2c968
|
/src/main/java/com/kundi/kundi/web/rest/TopicResource.java
|
9db228f55f210379f14981bbd617c4439aac1673
|
[] |
no_license
|
jeremykuria/kundi
|
0ca554caa9bdd4659b1898dc2ff0cd929b4034e6
|
45501e73a2b44c077e835cf3c5c9990919fc7983
|
refs/heads/master
| 2023-06-19T15:09:36.855797
| 2021-01-09T11:13:41
| 2021-01-09T11:13:41
| 324,133,488
| 0
| 0
| null | 2021-01-09T11:13:42
| 2020-12-24T10:49:24
|
Java
|
UTF-8
|
Java
| false
| false
| 621
|
java
|
package com.kundi.kundi.web.rest;
import com.kundi.kundi.domain.Topic;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
@RestController
public class TopicResource {
@RequestMapping("/topics")
public List<Topic> getAllTopics(){
return Arrays.asList(
new Topic("Spring","SPring FRamewaork", "spring unit"),
new Topic("Angular web","Angular 10+ web", "Angular mobile"),
new Topic("CSS","css", "css, scss,sass")
);
}
}
|
[
"jkaranja@meliora.tech"
] |
jkaranja@meliora.tech
|
d954d01bcead8324f72ecd1c3a1b01897ac1c761
|
71a75cdf8a965109e0034c3b100465f23103d2f6
|
/Project_Web3/src/com/member/db/MemberBean.java
|
1c498698edcb5d076dc3f08ac46e07482a893623
|
[] |
no_license
|
jda1208/project
|
70388e3ece439cc7daf61c9bbee6f7102a9ea70c
|
3f9fad9d55ec1a2e8e359e1e189c5062a9e992b0
|
refs/heads/master
| 2021-01-19T01:12:59.776579
| 2015-04-27T09:20:27
| 2015-04-27T09:20:27
| 34,427,460
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,228
|
java
|
package com.member.db;
public class MemberBean {
private String user_id;
private String user_email;
private String user_name;
private String user_password;
private String user_phonenum;
private String user_menu;
private String gradenum;
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getUser_email() {
return user_email;
}
public void setUser_email(String user_email) {
this.user_email = user_email;
}
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;
}
public String getUser_password() {
return user_password;
}
public void setUser_password(String user_password) {
this.user_password = user_password;
}
public String getUser_phonenum() {
return user_phonenum;
}
public void setUser_phonenum(String user_phonenum) {
this.user_phonenum = user_phonenum;
}
public String getUser_menu() {
return user_menu;
}
public void setUser_menu(String user_menu) {
this.user_menu = user_menu;
}
public String getGradenum() {
return gradenum;
}
public void setGradenum(String gradenum) {
this.gradenum = gradenum;
}
}
|
[
"ekdo6226@naver.com"
] |
ekdo6226@naver.com
|
72a93fb7c11b622e1ef99410e964e429661e0b58
|
5a7feba243ffe724f2cbd2e9f5ce9db11b0d63cc
|
/app/src/main/java/com/example/adminapp/DriverRegisterActivityA.java
|
8c9d3106c0d0a103268e4c093bc850bf3a51f6a3
|
[] |
no_license
|
osamaJadoon/app
|
c47ea4c9677154735454fa59a30c2022ada90a8b
|
7165a1ede7c975008df07078afe114129c02754e
|
refs/heads/master
| 2020-09-06T14:45:00.066618
| 2019-11-08T11:41:45
| 2019-11-08T11:41:45
| 220,455,174
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 14,898
|
java
|
package com.example.adminapp;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.text.InputType;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.util.Patterns;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.util.List;
import java.util.regex.Pattern;
import es.dmoral.toasty.Toasty;
import maes.tech.intentanim.CustomIntent;
public class DriverRegisterActivityA extends AppCompatActivity {
private static final Pattern PASSWORD_PATTERN =
Pattern.compile("^" +
"(?=.*[0-9])" + //at least 1 digit
// "(?=.*[a-z])" + //at least 1 lower case letter
// "(?=.*[A-Z])" + //at least 1 upper case letter
"(?=.*[a-zA-Z])" + //any letter
// "(?=.*[@#$%^&+=])" + //at least 1 special character
"(?=\\S+$)" + //no white spaces
".{6,}" + //at least 6 characters
"$");
private EditText nameInput;
private EditText emailInput;
private EditText passwordInput;
private EditText busNumberInput;
private EditText confirm_passwordInput;
private CheckBox show_hide_password;
private Button registerDriverBtn;
private ProgressDialog loadingBar;
AlertDialog.Builder alertDialoge;
private LinearLayout linearLayout;
private FirebaseAuth mAuth;
boolean doubleTap = false;
DriverData driverData;
DatabaseReference driverDataRef;
Animation shakeAnimation;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_driver_registera);
shakeAnimation = AnimationUtils.loadAnimation(this,R.anim.shake);
linearLayout = findViewById(R.id.linear_layout_id4);
alertDialoge = new AlertDialog.Builder(this);
alertDialoge.setTitle("Register Driver");
alertDialoge.setMessage("Driver Register Successfully");
alertDialoge.setCancelable(false);
alertDialoge.setIcon(R.drawable.emoji);
alertDialoge.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialoge.create();
nameInput = findViewById(R.id.name_input_id);
emailInput = findViewById(R.id.email_input_id);
busNumberInput = findViewById(R.id.busNumber_input_id);
passwordInput = findViewById(R.id.password_input_id);
confirm_passwordInput = findViewById(R.id.confirm_password_id);
show_hide_password = findViewById(R.id.show_hide_pass_admin_id);
show_hide_password.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (b) {
show_hide_password.setText("Hide Password");
passwordInput.setInputType(InputType.TYPE_CLASS_TEXT);
confirm_passwordInput.setInputType(InputType.TYPE_CLASS_TEXT);
passwordInput.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
confirm_passwordInput.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
show_hide_password.setText("Show Password");
passwordInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
confirm_passwordInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
passwordInput.setTransformationMethod(PasswordTransformationMethod.getInstance());
confirm_passwordInput.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
}
});
registerDriverBtn = findViewById(R.id.register_driver_button_id);
registerDriverBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RegisterDriverFunction();
}
});
loadingBar = new ProgressDialog(this);
// Initialize Firebase Auth
mAuth = FirebaseAuth.getInstance();
driverData = new DriverData();
driverDataRef = FirebaseDatabase.getInstance().getReference().child("DriverData");
}
private void saveDataToFirebase(){
String Name = nameInput.getText().toString().trim();
int BusNumber = Integer.parseInt(busNumberInput.getText().toString().trim());
String Email = emailInput.getText().toString();
String Password = passwordInput.getText().toString();
driverData.setDriverName(Name);
driverData.setDriverBusNumber(BusNumber);
driverData.setDriverEmail(Email);
driverData.setDriverPassword(Password);
driverData.setStatus("Driver");
driverDataRef.push().setValue(driverData);
// Toast.makeText(this, "data saved...", Toast.LENGTH_SHORT).show();
}
private boolean validateEmail(){
String Email = emailInput.getText().toString().trim();
if (Email.isEmpty())
{
Toasty.info(this, "Field can't be Empty", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else if (!Patterns.EMAIL_ADDRESS.matcher(Email).matches())
{
Toasty.info(this, "Please Enter a valid Email Address", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else
{
return true;
}
}
private boolean validatePassword(){
String Password = passwordInput.getText().toString().trim();
if (Password.isEmpty())
{
Toasty.info(this, "Field can't be Empty", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else if (!PASSWORD_PATTERN.matcher(Password).matches())
{
Toasty.warning(this, "Password too weak!", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else
{
return true;
}
}
private boolean validateName(){
String Name = nameInput.getText().toString().trim();
if (Name.isEmpty())
{
Toasty.info(this, "Field can't be Empty", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else
{
return true;
}
}
private boolean validateBusNumber(){
String BusNumber = busNumberInput.getText().toString().trim();
if (BusNumber.isEmpty())
{
Toasty.info(this, "Field can't be Empty", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else
{
return true;
}
}
private boolean validateConfirmPassword(){
String ConfirmPassword = confirm_passwordInput.getText().toString().trim();
if (ConfirmPassword.isEmpty())
{
Toasty.info(this, "Field can't be Empty", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else
{
return true;
}
}
private boolean validatePasswordMatch(){
String Password = passwordInput.getText().toString().trim();
String ConfirmPassword = confirm_passwordInput.getText().toString().trim();
if (!Password.equals(ConfirmPassword))
{
Toasty.error(this, "Password do not match!", Toast.LENGTH_SHORT).show();
linearLayout.startAnimation(shakeAnimation);
return false;
}
else
{
return true;
}
}
private void RegisterDriverFunction() {
if (!validateEmail() | !validatePassword() | !validateName()
| !validateBusNumber() | !validateConfirmPassword() | !validatePasswordMatch())
{
return;
}
loadingBar.setTitle("Register Driver");
loadingBar.setMessage("Please wait! while we register your data");
loadingBar.show();
loadingBar.setCanceledOnTouchOutside(false);
registerDriverBtn.setEnabled(false);
String Email = emailInput.getText().toString().trim();
String Password = passwordInput.getText().toString().trim();
mAuth.createUserWithEmailAndPassword(Email,Password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful())
{
Toasty.success(DriverRegisterActivityA.this, "Driver Registered Successfully", Toast.LENGTH_LONG).show();
loadingBar.dismiss();
saveDataToFirebase();
registerDriverBtn.setEnabled(true);
nameInput.setText("");
busNumberInput.setText("");
emailInput.setText("");
passwordInput.setText("");
confirm_passwordInput.setText("");
alertDialoge.show();
} else
{
Toasty.info(DriverRegisterActivityA.this, "Failed to Register Driver", Toast.LENGTH_LONG).show();
loadingBar.dismiss();
registerDriverBtn.setEnabled(true);
linearLayout.startAnimation(shakeAnimation);
new AlertDialog.Builder(DriverRegisterActivityA.this)
.setTitle("Register Driver")
.setIcon(R.drawable.emojisad)
.setMessage("Error Registering your Driver")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
})
.create().show();
}
}
});
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.aoptions, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Change the map type based on the user's selection.
switch (item.getItemId()) {
case R.id.register_students:
Intent intent = new Intent(DriverRegisterActivityA.this, StudentRegisterActivityA.class);
startActivity(intent);
return true;
case R.id.register_drivers:
Toast.makeText(this, "You are already in Register Driver Activity", Toast.LENGTH_LONG).show();
return true;
case R.id.track_bus:
if (!gpsEnabled())
{
return false;
}
Intent intent1 = new Intent(DriverRegisterActivityA.this, MapsActivityA.class);
startActivity(intent1);
CustomIntent.customType(this,"left-to-right");
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private boolean gpsEnabled(){
//***********************GPS start*************
this.setFinishOnTouchOutside(true);
// Todo Location Already on ... start
final LocationManager manager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
if (manager.isProviderEnabled(LocationManager.GPS_PROVIDER) && hasGPSDevice(this)) {
//Toast.makeText(SignInActivity.this,"Gps already enabled",Toast.LENGTH_SHORT).show();
return true;
}
// Todo Location Already on ... end
if(!hasGPSDevice(this)){
Toasty.warning(this, "Gps not Supported", Toast.LENGTH_SHORT).show();
}
if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER) && hasGPSDevice(this)) {
Toasty.info(this, "Please Enable your GPS", Toast.LENGTH_SHORT).show();
return false;
}else{
// Toast.makeText(SignInActivity.this,"Gps already enabled",Toast.LENGTH_SHORT).show();
return true;
}
//*************GPS ENDS******************
}
//*********code for on the gps if its off***************************
private boolean hasGPSDevice(Context context) {
final LocationManager mgr = (LocationManager) context
.getSystemService(Context.LOCATION_SERVICE);
if (mgr == null)
return false;
final List<String> providers = mgr.getAllProviders();
if (providers == null)
return false;
return providers.contains(LocationManager.GPS_PROVIDER);
}
}
|
[
"zsukhban@gmail.com"
] |
zsukhban@gmail.com
|
18f6fc4f8e1b339bececb69502ad1b26a36e6dbe
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_4a4ffbd28afc3bddf79bf3786bd257d9a116e963/WhislEncoding/2_4a4ffbd28afc3bddf79bf3786bd257d9a116e963_WhislEncoding_s.java
|
0f62491764fa7b55b3f448ba5262bb319b71d6d2
|
[] |
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
| 6,471
|
java
|
/*
* $Id$
*
* Copyright 2003-2005 Wanadoo Nederland B.V.
* See the COPYRIGHT file for redistribution and use restrictions.
*/
package org.xins.common.text;
import org.xins.common.MandatoryArgumentChecker;
/**
* Whisl encoding utility functions. This class currently only supports
* encoding.
*
* <p>The Whisl encoding is similar to URL encoding, but specifically meant to
* support the complete Unicode character set.
*
* <p>The following transformations should be applied when decoding:
*
* <ul>
* <li>a plus sign (<code>'+'</code>) converts to a space character;
* <li>a percent sign (<code>'%'</code>) must be followed by a 2-digit hex
* number that indicate the Unicode value of a single character;
* <li>a dollar sign (<code>'$'</code>) must be followed by a 4-digit hex
* number that indicate the Unicode value of a single character;
* </ul>
*
* @version $Revision$ $Date$
* @author Ernst de Haan (<a href="mailto:ernst.dehaan@nl.wanadoo.com">ernst.dehaan@nl.wanadoo.com</a>)
*
* @since XINS 1.0.0
*/
public final class WhislEncoding extends Object {
//-------------------------------------------------------------------------
// Class fields
//-------------------------------------------------------------------------
/**
* Mappings from unencoded (array index) to encoded values (array
* elements) for characters that can be encoded using the percent sign. The
* size of this array is 128.
*/
private static final char[][] UNENCODED_TO_ENCODED;
//-------------------------------------------------------------------------
// Class functions
//-------------------------------------------------------------------------
static {
// Fill 128 array elements
UNENCODED_TO_ENCODED = new char[128][];
for (char c = 0; c < 128; c++) {
// Some characters can be output unmodified
if ((c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
(c == '-') ||
(c == '_') ||
(c == '.') ||
(c == '*')) {
UNENCODED_TO_ENCODED[c] = null;
// A space is converted to a plus-sign
} else if (c == ' ') {
char[] plus = {'+'};
UNENCODED_TO_ENCODED[c] = plus;
// All other characters are URL-encoded in the form "%hex", where
// "hex" is the hexadecimal value of the character
} else {
char[] data = new char[3];
data[0] = '%';
data[1] = Character.forDigit((c >> 4) & 0xF, 16);
data[2] = Character.forDigit( c & 0xF, 16);
data[1] = Character.toUpperCase(data[1]);
data[2] = Character.toUpperCase(data[2]);
UNENCODED_TO_ENCODED[c] = data;
}
}
// XXX: Allow test coverage analysis tools to report 100% coverage
new WhislEncoding();
}
/**
* Whisl-encodes the specified character string.
*
* @param s
* the string to Whisl-encode, not <code>null</code>.
*
* @return
* Whisl-encoded version of the specified character string, never
* <code>null</code>.
*
* @throws IllegalArgumentException
* if <code>s == null</code>
*/
public static String encode(String s)
throws IllegalArgumentException {
// Check preconditions
MandatoryArgumentChecker.check("s", s);
// Short-circuit if the string is empty
int length = s.length();
if (length < 1) {
return "";
}
// Construct a buffer
char[] string = s.toCharArray();
FastStringBuffer buffer = null;
// Loop through the string. If the character is less than 128 then get
// from the cache array, otherwise convert escape with a dollar sign
int lastAppendPos = 0;
for (int i = 0; i < length; i++) {
int c = (int) string[i];
if (c < 128) {
char[] encoded = UNENCODED_TO_ENCODED[c];
if (encoded != null) {
if (buffer == null) {
buffer = new FastStringBuffer(length * 2);
}
buffer.append(string, lastAppendPos, i - lastAppendPos);
buffer.append(encoded);
lastAppendPos = i + 1;
}
} else {
if (buffer == null) {
buffer = new FastStringBuffer(length * 2);
}
buffer.append(string, lastAppendPos, i - lastAppendPos);
buffer.append('$');
HexConverter.toHexString(buffer, (short) c);
lastAppendPos = i + 1;
}
}
if (buffer == null) {
return s;
} else if (lastAppendPos != length) {
buffer.append(string, lastAppendPos, length - lastAppendPos);
}
return buffer.toString();
}
/**
* Decodes the specified Whisl-encoded character string.
*
* @param s
* the string to decode, not <code>null</code>.
*
* @return
* the decoded string, not <code>null</code>.
*
* @throws IllegalArgumentException
* if <code>s == null</code>
*
* @throws ParseException
* if the string cannot be decoded.
*/
public static String encode(String s)
throws IllegalArgumentException {
// Check preconditions
MandatoryArgumentChecker.check("s", s);
// Short-circuit if the string is empty
int length = s.length();
if (length < 1) {
return "";
}
return null; // FIXME TODO
}
//-------------------------------------------------------------------------
// Constructors
//-------------------------------------------------------------------------
/**
* Constructs a new <code>WhislEncoding</code> object.
*/
private WhislEncoding() {
// empty
}
//-------------------------------------------------------------------------
// Fields
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Methods
//-------------------------------------------------------------------------
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
e846c04e77817f52a8f7b33a76b30d13092bf204
|
edc139b0268d5568df88255df03585b5c340b8ca
|
/projects/org.activebpel.rt.bpel.server/src/org/activebpel/rt/bpel/server/admin/AeProcessDeploymentDetail.java
|
0f8c0a011c0fcbafb9f2990a285373a3a80bf6a7
|
[] |
no_license
|
wangzm05/provenancesys
|
61bad1933b2ff5398137fbbeb930a77086e8660b
|
031c84095c2a7afc4873bd6ef97012831f88e5a8
|
refs/heads/master
| 2020-03-27T19:50:15.067788
| 2009-05-08T06:02:31
| 2009-05-08T06:02:31
| 32,144,610
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,373
|
java
|
// $Header: /Development/AEDevelopment/projects/org.activebpel.rt.bpel.server/src/org/activebpel/rt/bpel/server/admin/AeProcessDeploymentDetail.java,v 1.6 2004/10/29 21:14:13 PCollins Exp $
/////////////////////////////////////////////////////////////////////////////
// PROPRIETARY RIGHTS STATEMENT
// The contents of this file represent confidential information that is the
// proprietary property of Active Endpoints, Inc. Viewing or use of
// this information is prohibited without the express written consent of
// Active Endpoints, Inc. Removal of this PROPRIETARY RIGHTS STATEMENT
// is strictly forbidden. Copyright (c) 2002-2004 All rights reserved.
/////////////////////////////////////////////////////////////////////////////
package org.activebpel.rt.bpel.server.admin;
import javax.xml.namespace.QName;
/**
* JavaBean for holding some data for a deployed process. It includes the
* name of the process as well as any process ids for running instances.
*/
public class AeProcessDeploymentDetail
{
/** Name of the deployed process */
private QName mName;
/** Deployment xml for this process */
private String mSourceXml;
/** The src bpel for the deployed process */
private String mBpelSourceXml;
/**
* Default Ctor
*/
public AeProcessDeploymentDetail()
{
}
/**
* Getter for the process name
*/
public QName getName()
{
return mName;
}
/**
* Accessor for process deployment qname local part.
*/
public String getLocalName()
{
return getName().getLocalPart();
}
/**
* Sets the name of the deployed process
* @param aName
*/
public void setName(QName aName)
{
mName = aName;
}
/**
* Setter for the source xml
* @param sourceXml
*/
public void setSourceXml(String sourceXml)
{
mSourceXml = sourceXml;
}
/**
* Getter for the source xml
*/
public String getSourceXml()
{
return mSourceXml;
}
/**
* @param aBpelSourceXml
*/
public void setBpelSourceXml(String aBpelSourceXml)
{
mBpelSourceXml = aBpelSourceXml;
}
/**
* Getter for bpel source xml.
*/
public String getBpelSourceXml()
{
return mBpelSourceXml;
}
}
|
[
"wangzm05@ca528a1e-3b83-11de-a81c-fde7d73ceb89"
] |
wangzm05@ca528a1e-3b83-11de-a81c-fde7d73ceb89
|
b2bd8b5f1f3e4936310cff3def06ef0ed5e30ad0
|
af21031d62c1ceb5a84f54b4410f0840edf20048
|
/src/main/java/ar/edu/unju/fi/service/EquipoServiceImp.java
|
937b00d19cd0585b8f12c4efd609c6c1e7f17259
|
[] |
no_license
|
3215U/tp5_
|
45ff449700e79770b46b65046e5863ca5e7d61d7
|
a22b763d63c2af68bfbd2918cdb7665cd61e9902
|
refs/heads/master
| 2022-09-30T10:59:36.326437
| 2020-06-02T00:23:25
| 2020-06-02T00:23:25
| 268,431,499
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 711
|
java
|
/**
*
*/
package ar.edu.unju.fi.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import ar.edu.unju.fi.model.Equipo;
import ar.edu.unju.fi.repository.IEquipo;
/**
* @author Benicio Roxana
*
*/
@Repository
public class EquipoServiceImp implements IEquipoService {
@Autowired
private IEquipo iequipo;
@Override
public void guardar() {
iequipo.guardar();
}
@Override
public Equipo mostrar() {
Equipo equipo = iequipo.mostrar();
return equipo;
}
@Override
public void eliminar() {
iequipo.eliminar();
}
@Override
public Equipo modificar() {
Equipo equipo = iequipo.modificar();
return equipo;
}
}
|
[
"homecuenta8gmail.com"
] |
homecuenta8gmail.com
|
b03a8350add21bf11eb1b23c96becdac76825181
|
c197c797f56100646aff1c416a5c70a86291de99
|
/src/test/java/com/mvas/admin/SpringbootAdminApplicationTests.java
|
a6176b4e47b99ed8cb96a93b73caa8def6d6d9f8
|
[] |
no_license
|
mvas-test/springboot-admin
|
88a761535282038757910635c5726b276f233b4e
|
787abab4e77cd5d4a49da69dc0d635bab8e4e446
|
refs/heads/master
| 2022-06-20T08:08:23.402596
| 2020-05-12T20:51:12
| 2020-05-12T20:51:12
| 263,449,218
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 215
|
java
|
package com.mvas.admin;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringbootAdminApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"bouzouki2015@gmail.com"
] |
bouzouki2015@gmail.com
|
8cc9bf7dcca7770c0e53f7940cd78521e12ea56e
|
ceb1d121f9564228d7d01309c2be6e5d22953cf1
|
/movies/build/generated/src/org/apache/jsp/include/header_jsp.java
|
5108cd402e7b3e411ad593c12543ef1035bf6949
|
[] |
no_license
|
MuShehta/Movie
|
8a5ec4e468775e282a26a4fbf2490a5921563601
|
0513caecb3c867c808a6b593d96ac43d2475c9f8
|
refs/heads/main
| 2023-04-10T18:10:15.078504
| 2021-04-23T21:07:48
| 2021-04-23T21:07:48
| 361,002,575
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,607
|
java
|
package org.apache.jsp.include;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class header_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("<!DOCTYPE html>\n");
out.write("<html lang=\"en\">\n");
out.write("<head>\n");
out.write(" <meta charset=\"UTF-8\">\n");
out.write(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n");
out.write("<!-- <link rel=\"stylesheet\" href=\"admin/layout/css/bootstrap.min.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"admin/layout/css/all.min.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"layout/css/owen.css\">-->\n");
out.write(" <title>Movie</title>\n");
out.write("</head>\n");
out.write("<body>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
|
[
"noreply@github.com"
] |
MuShehta.noreply@github.com
|
eb82ff74fbe1cae5de6e8bf3e156eec57f1c8cbc
|
f23b9858a949ebe03d846ac330acc71b00aac9e3
|
/src/com/battlearena/handlers/entity/shopkeeper/BlueShopkeeper.java
|
83e148aff842372521774d22d1fdc55f28f43711
|
[] |
no_license
|
MattyBainy97/BattleArena
|
b3f59e5603cb6d285610a61a9b9bd8717dba9444
|
bdbec92622a9e83cb2156624234d36d4d3c1526a
|
refs/heads/master
| 2021-01-22T05:38:49.142404
| 2017-04-18T08:55:21
| 2017-04-18T08:55:21
| 81,687,978
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 434
|
java
|
package com.battlearena.handlers.entity.shopkeeper;
import net.minecraft.server.v1_11_R1.EntityHuman;
import net.minecraft.server.v1_11_R1.PathfinderGoalLookAtPlayer;
import net.minecraft.server.v1_11_R1.World;
import org.bukkit.ChatColor;
public class BlueShopkeeper extends Shopkeeper {
public BlueShopkeeper(World world){
super(world);
this.setCustomName(ChatColor.BLUE + "Rathnar the Terrible");
}
}
|
[
"mattybainy97@gmail.com"
] |
mattybainy97@gmail.com
|
b30f67df61d2ff04264dd0649a295520a6e48c5c
|
597f3ccf5f8fd6ef9a8e0768f2d9463003b67bc3
|
/src/main/java/cl/reyesrubio/SpringFoxConfig.java
|
5eaa5ccd78be86ffe3eefd11476ee359212c459b
|
[] |
no_license
|
rreyescl/Excel2Json
|
467e382acab3560dedb52d243802eafa5036c861
|
c6ff699bdef062dfe46a86184678dccc7ea47c83
|
refs/heads/master
| 2023-08-17T19:20:06.306361
| 2021-10-08T22:36:05
| 2021-10-08T22:36:05
| 415,123,607
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,673
|
java
|
package cl.reyesrubio;
import static com.google.common.collect.Lists.newArrayList;
import java.util.Collections;
import java.util.Locale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMethod;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.builders.ResponseMessageBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SpringFoxConfig {
@Autowired
private MessageSource messages;
@Value("${http.status.code.200}")
private String STATUS_CODE_200;
@Value("${http.status.code.401}")
private String STATUS_CODE_401;
@Value("${http.status.code.403}")
private String STATUS_CODE_403;
@Value("${http.status.code.404}")
private String STATUS_CODE_404;
@Value("${http.status.code.500}")
private String STATUS_CODE_500;
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("cl.reyesrubio"))
.paths(PathSelectors.ant("/api/**"))
.build()
.apiInfo(apiInfo()).useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
newArrayList(
new ResponseMessageBuilder().code(200).message(messages.getMessage(STATUS_CODE_200, null, Locale.getDefault())).build()
, new ResponseMessageBuilder().code(401).message(messages.getMessage(STATUS_CODE_401, null, Locale.getDefault())).build()
, new ResponseMessageBuilder().code(403).message(messages.getMessage(STATUS_CODE_403, null, Locale.getDefault())).build()
, new ResponseMessageBuilder().code(404).message(messages.getMessage(STATUS_CODE_404, null, Locale.getDefault())).build()
, new ResponseMessageBuilder().code(500).message(messages.getMessage(STATUS_CODE_500, null, Locale.getDefault())).build()));
}
private ApiInfo apiInfo() {
return new ApiInfo(" REST API", "API para realizar cualquier cosa ajja.", "API V1",
"Terms of service",
new Contact("Ricardo Reyes", "", "ricardo.reyesr@protonmail.com"), "License of API",
"API license URL", Collections.emptyList());
}
}
|
[
"bassricky@gmail.com"
] |
bassricky@gmail.com
|
79286e50bae2eda5283af3fb5251a35bf36fc4be
|
c46315ef19bf7736f23934fadf32f47f1e08630e
|
/app/src/androidTest/java/com/mahesh_location_tracking/ExampleInstrumentedTest.java
|
01b1c48fc676006cc402963cbd5e3ca4f1d7d585
|
[] |
no_license
|
MaheshKumarPrajapati/LocationTracking
|
555a8468634e6180445493f99836358ed39800f7
|
b62d5f91918e9360c1f62231ee3305cffc1be9b3
|
refs/heads/main
| 2023-07-30T07:59:05.358152
| 2021-10-02T12:29:56
| 2021-10-02T12:29:56
| 411,674,832
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 766
|
java
|
package com.mahesh_location_tracking;
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.trackmeinfoiconankit", appContext.getPackageName());
}
}
|
[
"maheshprajapati1990@gmail.com"
] |
maheshprajapati1990@gmail.com
|
d452af78c16f50c8a32ce7e151ffaca7a2542fb5
|
20b379e6f63fd0c68b995ef42e87c9434c051505
|
/homeworkDay5.1.eCommerce/src/dataAccess/concretes/HibernateUserDao.java
|
48cb6efa9f4f66c268a78863ee956aca42861bb0
|
[] |
no_license
|
ibrahimGZR/kodlamaioJava
|
2f1250208c7928ce10887f1f5d999fcddb5f79de
|
87ea40c74137650f4043b6faddb283e18817bf62
|
refs/heads/master
| 2023-07-18T16:27:28.351238
| 2021-09-08T20:41:04
| 2021-09-08T20:41:04
| 396,272,914
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 904
|
java
|
package dataAccess.concretes;
import java.util.ArrayList;
import java.util.List;
import dataAccess.abstracts.UserDao;
import entities.concretes.User;
public class HibernateUserDao implements UserDao {
private List<User> users = new ArrayList<User>();
@Override
public void add(User user) {
users.add(user);
}
@Override
public void update(User user) {
// TODO Auto-generated method stub
}
@Override
public void delete(User user) {
// TODO Auto-generated method stub
}
@Override
public User getById(int id) {
// TODO Auto-generated method stub
return null;
}
@Override
public User getByEmail(String email) {
for (User user : users) {
if (user.getEmail()==email) {
return user;
}
}
return null;
}
@Override
public List<User> getAll() {
// TODO Auto-generated method stub
return users;
}
}
|
[
"ibrahim.gezer@IBRAHIMGEZER.etiyacorp.local"
] |
ibrahim.gezer@IBRAHIMGEZER.etiyacorp.local
|
d422c20b20631b1fa031051e22e07b13812f55d8
|
e038650afd8780b4668560a7704816642d5eff48
|
/src/main/java/com/tryeverything/service/SysUserService.java
|
f4658a7ebf6c22a4e3ad3493ccfd7b6db0a40499
|
[] |
no_license
|
EducationActivity/Activity
|
efae0fcdd6908d7e9b640bcbb78fe3c67f26807c
|
67e7ba6d6b72d95f013c471da12f222a446f1f4b
|
refs/heads/master
| 2020-04-23T15:44:00.878643
| 2019-03-07T14:55:14
| 2019-03-07T14:55:14
| 171,274,914
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 333
|
java
|
package com.tryeverything.service;
import com.tryeverything.entity.SysUser;
public interface SysUserService extends BaseService{
public SysUser findUserBase(SysUser sysUserBase) throws Exception;
public void updateUserPws(SysUser sysUserBase) throws Exception;
public SysUser queryUser(String phone,String userPassword);
}
|
[
"858751460@qq.com"
] |
858751460@qq.com
|
4041f5285545b91060f61f748ace04569c13ef8b
|
381035be11973cfaf445b35e187608071aa4bd91
|
/backend/src/main/java/interview/nokia/test/game/GameImplOneToOne.java
|
f2180b304876fbfb78afde90336bf11c624ef6bc
|
[] |
no_license
|
tomahawk69/rock-paper-scissors
|
1dea78702e270e0a398d7979450ef4501c4a7e54
|
af427bffc99d498a5f305b5b7a66ef6337561889
|
refs/heads/master
| 2021-04-26T00:56:56.101658
| 2017-10-17T22:33:59
| 2017-10-17T22:33:59
| 107,329,434
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 530
|
java
|
package interview.nokia.test.game;
import interview.nokia.test.statistics.GameStatistic;
import interview.nokia.test.strategy.GameStrategy;
import interview.nokia.test.types.GameType;
public class GameImplOneToOne extends AbstractGameImpl {
private static final String NAME = "One-2-One";
public GameImplOneToOne(GameType gameType, GameStatistic gameStatistic, GameStrategy gameStrategy) {
super(gameType, gameStatistic, gameStrategy);
super.isGeneratedMove = false;
super.name = NAME;
}
}
|
[
"iovchynnikov@ngoar.net"
] |
iovchynnikov@ngoar.net
|
1643a8efb0e0b0686d474ccea9786b33a23a15ac
|
b7e20a87fdc1de493d592af0f427549566669ae2
|
/javarush/test/level08/lesson08/task04/Solution.java
|
639abfcda5493236f08611ead2b526a10b8541ef
|
[] |
no_license
|
D1version/JavaRush
|
462184e98a08c3c0d37c2c783512100520132aad
|
7e5de2bda12454f4503ac83bc0041fa3b614cfbc
|
refs/heads/master
| 2021-01-10T17:38:07.663972
| 2015-09-28T08:41:17
| 2015-09-28T08:41:17
| 43,008,963
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,803
|
java
|
package com.javarush.test.level08.lesson08.task04;
import com.sun.org.apache.bcel.internal.generic.RET;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/* Удалить всех людей, родившихся летом
Создать словарь (Map<String, Date>) и занести в него десять записей по принципу: «фамилия» - «дата рождения».
Удалить из словаря всех людей, родившихся летом.
*/
public class Solution
{
public static HashMap<String, Date> createMap()
{
HashMap<String, Date> map = new HashMap<String, Date>();
map.put("Stallone", new Date("JUNE 1 1980"));
map.put("Stallonee", new Date("OCTOBER 1 1980"));
map.put("Stalloneee", new Date("MAY 1 1980"));
map.put("Stallone33", new Date("AUGUST 1 1980"));
map.put("Stallone3", new Date("JULY 1 1980"));
map.put("Stallone2", new Date("DECEMBER 1 1980"));
map.put("Stallone1", new Date("NOVEMBER 1 1980"));
map.put("Stallone11", new Date("AUGUST 1 1980"));
map.put("Stallone111", new Date("JUNE 1 1980"));
map.put("Stallon", new Date("SEPTEMBER 1 1980"));
return map;
//напишите тут ваш код
}
public static void removeAllSummerPeople(HashMap<String, Date> map)
{
for(Iterator<Map.Entry<String, Date>> it = map.entrySet().iterator(); it.hasNext(); ) {
Map.Entry<String, Date> pair = it.next();
if(pair.getValue().getMonth() == 5 || pair.getValue().getMonth() == 6 || pair.getValue().getMonth() == 7) {
it.remove();
}
}
}
}
|
[
"True7210@gmail.com"
] |
True7210@gmail.com
|
6e94e0987fc0f622bffc1e1a5e5b97320cd9ae95
|
ceeacb5157b67b43d40615daf5f017ae345816db
|
/generated/sdk/applicationinsights/azure-resourcemanager-applicationinsights-generated/src/main/java/com/azure/resourcemanager/applicationinsights/generated/models/AnnotationError.java
|
f6c639f795495c42942d216a565405f55b3da987
|
[
"LicenseRef-scancode-generic-cla"
] |
no_license
|
ChenTanyi/autorest.java
|
1dd9418566d6b932a407bf8db34b755fe536ed72
|
175f41c76955759ed42b1599241ecd876b87851f
|
refs/heads/ci
| 2021-12-25T20:39:30.473917
| 2021-11-07T17:23:04
| 2021-11-07T17:23:04
| 218,717,967
| 0
| 0
| null | 2020-11-18T14:14:34
| 2019-10-31T08:24:24
|
Java
|
UTF-8
|
Java
| false
| false
| 1,337
|
java
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.applicationinsights.generated.models;
import com.azure.core.annotation.Immutable;
import com.azure.core.management.exception.ManagementError;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** Error associated with trying to create annotation with Id that already exist. */
@Immutable
public final class AnnotationError extends ManagementError {
@JsonIgnore private final ClientLogger logger = new ClientLogger(AnnotationError.class);
/*
* Inner error
*/
@JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY)
private InnerError innererror;
/**
* Get the innererror property: Inner error.
*
* @return the innererror value.
*/
public InnerError getInnererror() {
return this.innererror;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (getInnererror() != null) {
getInnererror().validate();
}
}
}
|
[
"actions@github.com"
] |
actions@github.com
|
cbe454c51e519622aafc4c1a97554479dba4bba2
|
3f083e2da22932daabb5f6ac53d9968f2cb0ac6c
|
/src/sistema/punto/de/ventas/SistemaPuntoDeVentas.java
|
99102b197f5a1caeb015d5000025746a34ee6817
|
[] |
no_license
|
llStrevensll/SistemaVentas----Java
|
0ea6748916a77d42200918b43bce9e0d8b31f197
|
200099a6562498e230784ba381dd89d71be746c6
|
refs/heads/master
| 2020-08-22T13:11:00.900806
| 2019-10-20T19:28:41
| 2019-10-20T19:28:41
| 216,402,180
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 784
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sistema.punto.de.ventas;
import Views.Sistema;
import static java.awt.Frame.MAXIMIZED_BOTH;
import javax.swing.UIManager;
/**
*
* @author angue
*/
public class SistemaPuntoDeVentas {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch (Exception e) {
}
Sistema sistema = new Sistema();
sistema.setExtendedState(MAXIMIZED_BOTH);
sistema.setVisible(true);
}
}
|
[
"anguelr12@hotmail.com"
] |
anguelr12@hotmail.com
|
237055789b9e62d43e71087e2e756412c008020f
|
222b05380fc65f03d0fff387ae77a16b890c24fb
|
/src/geeksforgeeks/_01AmazonInterview_09_07.java
|
ecbe9de50b07d83718d5826e2125685580e4ad31
|
[] |
no_license
|
MHenry-Mit/Interview-Prep
|
c5a47ebc1cf55f85faf420f401953f2321b4112e
|
f5614bdbb8aeacab7a50cf7ec28a866fd9d0cffa
|
refs/heads/master
| 2020-12-26T02:51:03.665180
| 2015-10-05T16:20:35
| 2015-10-05T16:20:35
| null | 0
| 0
| null | null | null | null |
WINDOWS-1250
|
Java
| false
| false
| 1,502
|
java
|
package geeksforgeeks;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
/*
* http://www.geeksforgeeks.org/amazon-interview-set-8-2/
* Given an array of strings, find the string which is made up of maximum number of other strings contained in the same array.
* e.g. “rat”, ”cat”, “abc”, “xyz”, “abcxyz”, “ratcatabc”, “xyzcatratabc”
* Answer: “xyzcatratabc”
* “abcxyz” contains 2 other strings,
* “ratcatabc” contains 3 other strings,
* “xyzcatratabc” contains 4 other strings
*/;
public class _01AmazonInterview_09_07 {
public static void main(String[] args) {
Scanner scanner=new Scanner(new InputStreamReader(System.in));
Integer noOfStrings=Integer.parseInt(scanner.nextLine());
ArrayList<String> inputList=new ArrayList<String>();
for (int i = 0; i < noOfStrings; i++) {
inputList.add(scanner.nextLine());
}
scanner.close();
System.out.println("Max String is : "+findMaxString(inputList));
}
private static String findMaxString(ArrayList<String> inputList) {
int maxCount=0;
String outputString="";
for (int i = 0; i < inputList.size(); i++) {
String input=inputList.get(i);
int count=0;
for (int j = 0; j < inputList.size(); j++) {
if(i==j)
continue;
else{
if(input.contains(inputList.get(j))){
count++;
}
}
}
if(count>maxCount){
maxCount=count;
outputString=input;
}
}
return outputString;
}
}
|
[
"navaneethbv@gmail.com"
] |
navaneethbv@gmail.com
|
592a3f4f44d34e634ec5b553d4686986eca428ae
|
d1f5612898d7f09c799357c474ad5af0509dd2ce
|
/app/src/main/java/com/doubletapp/hermitage/hermitage/ui/views/TimePickerData.java
|
fab1801dfd783ed70aff216dec7296ad6a60531e
|
[] |
no_license
|
onthecrow/vk-ermitazh-android
|
41d4119e04993d40ca49d00956d012d2fd6e98d2
|
7cddf073e64ad078da279cc3e26edecf87bffedb
|
refs/heads/master
| 2021-05-01T21:06:04.167427
| 2017-10-22T06:29:09
| 2017-10-22T06:29:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,370
|
java
|
package com.doubletapp.hermitage.hermitage.ui.views;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.ArrayList;
/**
* Created by onthecrow on 21.10.2017.
*/
public class TimePickerData {
@Nullable
private ArrayList<String> mDays;
@Nullable
private ArrayList<String> mStartTimes;
@Nullable
private ArrayList<String> mEndTimes;
@NonNull
private ArrayList<Float> mPercentages;
public TimePickerData(@Nullable ArrayList<String> mDays,
@NonNull ArrayList<Float> mPercentages) {
this.mDays = mDays;
this.mPercentages = mPercentages;
}
public TimePickerData(@Nullable ArrayList<String> mStartTimes,
@Nullable ArrayList<String> mEndTimes,
@NonNull ArrayList<Float> mPercentages) {
this.mStartTimes = mStartTimes;
this.mEndTimes = mEndTimes;
this.mPercentages = mPercentages;
}
@Nullable
public ArrayList<String> getDays() {
return mDays;
}
@Nullable
public ArrayList<String> getStartTimes() {
return mStartTimes;
}
@Nullable
public ArrayList<String> getEndTimes() {
return mEndTimes;
}
@NonNull
public ArrayList<Float> getPercentages() {
return mPercentages;
}
}
|
[
"voronov@xaker.ru"
] |
voronov@xaker.ru
|
a1b23666330459245630a2c842779cdcdc71a9b3
|
ddbb70f9e2caa272c05a8fa54c5358e2aeb507ad
|
/rimlog/src/main/java/com/rimdev/rimlog/entities/ComponentInput.java
|
909419c0f3ff13b4441e18a94c3ca284199c33a0
|
[] |
no_license
|
ahmedhamed105/rimdev
|
1e1aad2c4266dd20e402c566836b9db1f75d4643
|
c5737a7463f0b80b49896a52f93acbb1e1823509
|
refs/heads/master
| 2023-02-05T15:18:20.829487
| 2021-04-04T08:10:19
| 2021-04-04T08:10:19
| 228,478,954
| 1
| 0
| null | 2023-01-11T19:57:52
| 2019-12-16T21:27:44
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 8,015
|
java
|
package com.rimdev.rimlog.entities;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
*
* @author ahmed.elemam
*/
@Entity
@Table(name = "component_input", catalog = "rim_user", schema = "rim_user")
@XmlRootElement
@JsonInclude(JsonInclude.Include.NON_NULL) // ignore all null fields
@DynamicUpdate
@NamedQueries({
@NamedQuery(name = "ComponentInput.findAll", query = "SELECT c FROM ComponentInput c")
, @NamedQuery(name = "ComponentInput.findById", query = "SELECT c FROM ComponentInput c WHERE c.id = :id")
, @NamedQuery(name = "ComponentInput.findByInputActions", query = "SELECT c FROM ComponentInput c WHERE c.inputActions = :inputActions")})
public class ComponentInput implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "ID", nullable = false)
private Integer id;
@Basic(optional = false)
@Column(name = "input_Actions", nullable = false, length = 45)
private String inputActions;
@JoinColumn(name = "Component_ID", referencedColumnName = "ID", nullable = false)
@ManyToOne(optional = false)
private Component componentID;
@JoinColumn(name = "input_type_ID", referencedColumnName = "ID", nullable = false)
@ManyToOne(optional = false)
private InputType inputtypeID;
@Column(name = "date_modify", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date dateModify;
@Basic(optional = false)
@Column(name = "date_create", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date dateCreate;
@Column(name = "insert_serv", length = 450)
private String insertServ;
@Column(name = "delete_serv", length = 450)
private String deleteServ;
@Column(name = "insert_parameter", length = 450)
private String insertParameter;
@Column(name = "delete_parameter", length = 450)
private String deleteParameter;
@Column(name = "file_count")
private Integer fileCount;
@Column(name = "file_size")
private Integer fileSize;
@Column(name = "file_counterr", length = 450)
private String fileCounterr;
@Column(name = "file_sizeerr", length = 450)
private String fileSizeerr;
@Column(name = "file_typeerror", length = 450)
private String fileTypeerror;
@Column(name = "insert_ip", length = 450)
private String insertIp;
@Column(name = "insert_port", length = 45)
private String insertPort;
@Column(name = "delete_ip", length = 450)
private String deleteIp;
@Column(name = "delete_port", length = 45)
private String deletePort;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "componentinputID")
private Collection<ComponentFile> componentFileCollection;
public ComponentInput() {
}
public ComponentInput(Integer id) {
this.id = id;
}
public String getInsertIp() {
return insertIp;
}
public void setInsertIp(String insertIp) {
this.insertIp = insertIp;
}
public String getInsertPort() {
return insertPort;
}
public void setInsertPort(String insertPort) {
this.insertPort = insertPort;
}
public String getDeleteIp() {
return deleteIp;
}
public void setDeleteIp(String deleteIp) {
this.deleteIp = deleteIp;
}
public String getDeletePort() {
return deletePort;
}
public void setDeletePort(String deletePort) {
this.deletePort = deletePort;
}
public String getFileTypeerror() {
return fileTypeerror;
}
public void setFileTypeerror(String fileTypeerror) {
this.fileTypeerror = fileTypeerror;
}
@XmlTransient
@JsonIgnore
public Collection<ComponentFile> getComponentFileCollection() {
return componentFileCollection;
}
public void setComponentFileCollection(Collection<ComponentFile> componentFileCollection) {
this.componentFileCollection = componentFileCollection;
}
public String getFileCounterr() {
return fileCounterr;
}
public void setFileCounterr(String fileCounterr) {
this.fileCounterr = fileCounterr;
}
public String getFileSizeerr() {
return fileSizeerr;
}
public void setFileSizeerr(String fileSizeerr) {
this.fileSizeerr = fileSizeerr;
}
public Integer getFileSize() {
return fileSize;
}
public void setFileSize(Integer fileSize) {
this.fileSize = fileSize;
}
public ComponentInput(Integer id, String inputActions) {
this.id = id;
this.inputActions = inputActions;
}
public String getInsertServ() {
return insertServ;
}
public void setInsertServ(String insertServ) {
this.insertServ = insertServ;
}
public String getDeleteServ() {
return deleteServ;
}
public void setDeleteServ(String deleteServ) {
this.deleteServ = deleteServ;
}
public String getInsertParameter() {
return insertParameter;
}
public void setInsertParameter(String insertParameter) {
this.insertParameter = insertParameter;
}
public String getDeleteParameter() {
return deleteParameter;
}
public void setDeleteParameter(String deleteParameter) {
this.deleteParameter = deleteParameter;
}
@XmlTransient
@JsonIgnore
public Date getDateModify() {
return dateModify;
}
public void setDateModify(Date dateModify) {
this.dateModify = dateModify;
}
@XmlTransient
@JsonIgnore
public Date getDateCreate() {
return dateCreate;
}
public void setDateCreate(Date dateCreate) {
this.dateCreate = dateCreate;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getFileCount() {
return fileCount;
}
public void setFileCount(Integer fileCount) {
this.fileCount = fileCount;
}
public String getInputActions() {
return inputActions;
}
public void setInputActions(String inputActions) {
this.inputActions = inputActions;
}
@XmlTransient
@JsonIgnore
public Component getComponentID() {
return componentID;
}
public void setComponentID(Component componentID) {
this.componentID = componentID;
}
public InputType getInputtypeID() {
return inputtypeID;
}
public void setInputtypeID(InputType inputtypeID) {
this.inputtypeID = inputtypeID;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ComponentInput)) {
return false;
}
ComponentInput other = (ComponentInput) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entity.ComponentInput[ id=" + id + " ]";
}
}
|
[
"ahmed.elemam@its.ws"
] |
ahmed.elemam@its.ws
|
d2818ee073506bd60ddbe4e28af43eab818d0c09
|
6bab2a05297bc6ad47420bdd71696b97791d4d24
|
/javagoftest/src/main/java/github/ybqdren/gof/javagoftest/intertor/BookShelf.java
|
d19ac908815687eed07eeb9ca126e141a8734943
|
[] |
no_license
|
ybqdren/AboutJavaForMe
|
2adad9508f05d3227e48641fb761a723cb360f94
|
9ae81e56e8f1387bdc7b452d1797a93dc8d0d7d2
|
refs/heads/master
| 2023-03-02T22:25:43.539442
| 2021-02-07T04:05:27
| 2021-02-07T04:05:27
| 259,233,154
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 603
|
java
|
package github.ybqdren.gof.javagoftest.intertor;
/**
* Created by Zhao Wen on 2021/1/21
*/
public class BookShelf implements Aggregate{
private Book[] books;
private int last = 0;
public BookShelf(int maxsize) {
this.books = new Book[maxsize];
}
public Book getBookAt(int index){
return books[index];
}
public void appendBook(Book book){
this.books[last] = book;
last++;
}
public int getLength(){
return last;
}
@Override
public Iterator iterator() {
return new BookShelfIterator(this);
}
}
|
[
"withzhaowen@126.com"
] |
withzhaowen@126.com
|
1704b54dcc7f5381d1316c4ecf17e92a273860b5
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/20/20_2476f0cd8b72c9662daec05d758ecbeefe66bdfa/PhoneNumberListAdapter/20_2476f0cd8b72c9662daec05d758ecbeefe66bdfa_PhoneNumberListAdapter_s.java
|
749b5e948bbb3134e35d7712f996e76daf0faae1
|
[] |
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
| 13,228
|
java
|
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.contacts.list;
import android.content.ContentUris;
import android.content.Context;
import android.content.CursorLoader;
import android.database.Cursor;
import android.net.Uri;
import android.net.Uri.Builder;
import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.ContactCounts;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.Directory;
import android.provider.ContactsContract.RawContacts;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
/**
* A cursor adapter for the {@link Phone#CONTENT_TYPE} content type.
*/
public class PhoneNumberListAdapter extends ContactEntryListAdapter {
private static final String TAG = PhoneNumberListAdapter.class.getSimpleName();
protected static class PhoneQuery {
private static final String[] PROJECTION_PRIMARY = new String[] {
Phone._ID, // 0
Phone.TYPE, // 1
Phone.LABEL, // 2
Phone.NUMBER, // 3
Phone.CONTACT_ID, // 4
Phone.LOOKUP_KEY, // 5
Phone.PHOTO_ID, // 6
Phone.DISPLAY_NAME_PRIMARY, // 7
};
private static final String[] PROJECTION_ALTERNATIVE = new String[] {
Phone._ID, // 0
Phone.TYPE, // 1
Phone.LABEL, // 2
Phone.NUMBER, // 3
Phone.CONTACT_ID, // 4
Phone.LOOKUP_KEY, // 5
Phone.PHOTO_ID, // 6
Phone.DISPLAY_NAME_ALTERNATIVE, // 7
};
public static final int PHONE_ID = 0;
public static final int PHONE_TYPE = 1;
public static final int PHONE_LABEL = 2;
public static final int PHONE_NUMBER = 3;
public static final int PHONE_CONTACT_ID = 4;
public static final int PHONE_LOOKUP_KEY = 5;
public static final int PHONE_PHOTO_ID = 6;
public static final int PHONE_DISPLAY_NAME = 7;
}
private final CharSequence mUnknownNameText;
private ContactListItemView.PhotoPosition mPhotoPosition;
public PhoneNumberListAdapter(Context context) {
super(context);
mUnknownNameText = context.getText(android.R.string.unknownName);
}
protected CharSequence getUnknownNameText() {
return mUnknownNameText;
}
@Override
public void configureLoader(CursorLoader loader, long directoryId) {
Uri uri;
if (directoryId != Directory.DEFAULT) {
Log.w(TAG, "PhoneNumberListAdapter is not ready for non-default directory ID ("
+ "directoryId: " + directoryId + ")");
}
if (isSearchMode()) {
String query = getQueryString();
Builder builder = Phone.CONTENT_FILTER_URI.buildUpon();
if (TextUtils.isEmpty(query)) {
builder.appendPath("");
} else {
builder.appendPath(query); // Builder will encode the query
}
builder.appendQueryParameter(ContactsContract.DIRECTORY_PARAM_KEY,
String.valueOf(directoryId));
uri = builder.build();
} else {
uri = Phone.CONTENT_URI.buildUpon().appendQueryParameter(
ContactsContract.DIRECTORY_PARAM_KEY, String.valueOf(Directory.DEFAULT))
.build();
if (isSectionHeaderDisplayEnabled()) {
uri = buildSectionIndexerUri(uri);
}
configureSelection(loader, directoryId, getFilter());
}
loader.setUri(uri);
// TODO a projection that includes the search snippet
if (getContactNameDisplayOrder() == ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY) {
loader.setProjection(PhoneQuery.PROJECTION_PRIMARY);
} else {
loader.setProjection(PhoneQuery.PROJECTION_ALTERNATIVE);
}
if (getSortOrder() == ContactsContract.Preferences.SORT_ORDER_PRIMARY) {
loader.setSortOrder(Phone.SORT_KEY_PRIMARY);
} else {
loader.setSortOrder(Phone.SORT_KEY_ALTERNATIVE);
}
}
private void configureSelection(
CursorLoader loader, long directoryId, ContactListFilter filter) {
if (filter == null || directoryId != Directory.DEFAULT) {
return;
}
final StringBuilder selection = new StringBuilder();
final List<String> selectionArgs = new ArrayList<String>();
switch (filter.filterType) {
case ContactListFilter.FILTER_TYPE_CUSTOM: {
selection.append(Contacts.IN_VISIBLE_GROUP + "=1");
selection.append(" AND " + Contacts.HAS_PHONE_NUMBER + "=1");
break;
}
case ContactListFilter.FILTER_TYPE_ACCOUNT: {
selection.append("(");
selection.append(RawContacts.ACCOUNT_TYPE + "=?"
+ " AND " + RawContacts.ACCOUNT_NAME + "=?");
selectionArgs.add(filter.accountType);
selectionArgs.add(filter.accountName);
if (filter.dataSet != null) {
selection.append(" AND " + RawContacts.DATA_SET + "=?");
selectionArgs.add(filter.dataSet);
} else {
selection.append(" AND " + RawContacts.DATA_SET + " IS NULL");
}
selection.append(")");
break;
}
case ContactListFilter.FILTER_TYPE_ALL_ACCOUNTS:
case ContactListFilter.FILTER_TYPE_DEFAULT:
break; // No selection needed.
case ContactListFilter.FILTER_TYPE_WITH_PHONE_NUMBERS_ONLY:
break; // This adapter is always "phone only", so no selection needed either.
default:
Log.w(TAG, "Unsupported filter type came " +
"(type: " + filter.filterType + ", toString: " + filter + ")" +
" showing all contacts.");
// No selection.
break;
}
loader.setSelection(selection.toString());
loader.setSelectionArgs(selectionArgs.toArray(new String[0]));
}
protected static Uri buildSectionIndexerUri(Uri uri) {
return uri.buildUpon()
.appendQueryParameter(ContactCounts.ADDRESS_BOOK_INDEX_EXTRAS, "true").build();
}
@Override
public String getContactDisplayName(int position) {
return ((Cursor) getItem(position)).getString(PhoneQuery.PHONE_DISPLAY_NAME);
}
/**
* Builds a {@link Data#CONTENT_URI} for the given cursor position.
*
* @return Uri for the data. may be null if the cursor is not ready.
*/
public Uri getDataUri(int position) {
Cursor cursor = ((Cursor)getItem(position));
if (cursor != null) {
long id = cursor.getLong(PhoneQuery.PHONE_ID);
return ContentUris.withAppendedId(Data.CONTENT_URI, id);
} else {
Log.w(TAG, "Cursor was null in getDataUri() call. Returning null instead.");
return null;
}
}
@Override
protected View newView(Context context, int partition, Cursor cursor, int position,
ViewGroup parent) {
final ContactListItemView view = new ContactListItemView(context, null);
view.setUnknownNameText(mUnknownNameText);
view.setQuickContactEnabled(isQuickContactEnabled());
view.setPhotoPosition(mPhotoPosition);
return view;
}
@Override
protected void bindView(View itemView, int partition, Cursor cursor, int position) {
ContactListItemView view = (ContactListItemView)itemView;
// Look at elements before and after this position, checking if contact IDs are same.
// If they have one same contact ID, it means they can be grouped.
//
// In one group, only the first entry will show its photo and its name, and the other
// entries in the group show just their data (e.g. phone number, email address).
cursor.moveToPosition(position);
boolean isFirstEntry = true;
boolean showBottomDivider = true;
final long currentContactId = cursor.getLong(PhoneQuery.PHONE_CONTACT_ID);
if (cursor.moveToPrevious() && !cursor.isBeforeFirst()) {
final long previousContactId = cursor.getLong(PhoneQuery.PHONE_CONTACT_ID);
if (currentContactId == previousContactId) {
isFirstEntry = false;
}
}
cursor.moveToPosition(position);
if (cursor.moveToNext() && !cursor.isAfterLast()) {
final long nextContactId = cursor.getLong(PhoneQuery.PHONE_CONTACT_ID);
if (currentContactId == nextContactId) {
// The following entry should be in the same group, which means we don't want a
// divider between them.
// TODO: we want a different divider than the divider between groups. Just hiding
// this divider won't be enough.
showBottomDivider = false;
}
}
cursor.moveToPosition(position);
bindSectionHeaderAndDivider(view, position);
if (isFirstEntry) {
bindName(view, cursor);
if (isQuickContactEnabled()) {
bindQuickContact(view, partition, cursor, PhoneQuery.PHONE_PHOTO_ID,
PhoneQuery.PHONE_CONTACT_ID, PhoneQuery.PHONE_LOOKUP_KEY);
} else {
bindPhoto(view, cursor);
}
} else {
unbindName(view);
view.removePhotoView(true, false);
}
bindPhoneNumber(view, cursor);
view.setDividerVisible(showBottomDivider);
}
protected void bindPhoneNumber(ContactListItemView view, Cursor cursor) {
CharSequence label = null;
if (!cursor.isNull(PhoneQuery.PHONE_TYPE)) {
final int type = cursor.getInt(PhoneQuery.PHONE_TYPE);
final String customLabel = cursor.getString(PhoneQuery.PHONE_LABEL);
// TODO cache
label = Phone.getTypeLabel(getContext().getResources(), type, customLabel);
}
view.setLabel(label);
view.showData(cursor, PhoneQuery.PHONE_NUMBER);
}
protected void bindSectionHeaderAndDivider(final ContactListItemView view, int position) {
if (isSectionHeaderDisplayEnabled()) {
Placement placement = getItemPlacementInSection(position);
view.setSectionHeader(placement.firstInSection ? placement.sectionHeader : null);
view.setDividerVisible(!placement.lastInSection);
} else {
view.setSectionHeader(null);
view.setDividerVisible(true);
}
}
protected void bindName(final ContactListItemView view, Cursor cursor) {
view.showDisplayName(cursor, PhoneQuery.PHONE_DISPLAY_NAME, getContactNameDisplayOrder());
// Note: we don't show phonetic names any more (see issue 5265330)
}
protected void unbindName(final ContactListItemView view) {
view.hideDisplayName();
}
protected void bindPhoto(final ContactListItemView view, Cursor cursor) {
long photoId = 0;
if (!cursor.isNull(PhoneQuery.PHONE_PHOTO_ID)) {
photoId = cursor.getLong(PhoneQuery.PHONE_PHOTO_ID);
}
getPhotoLoader().loadPhoto(view.getPhotoView(), photoId, false, false);
}
public void setPhotoPosition(ContactListItemView.PhotoPosition photoPosition) {
mPhotoPosition = photoPosition;
}
public ContactListItemView.PhotoPosition getPhotoPosition() {
return mPhotoPosition;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
9c2fd12e8506101138ee8f174aeb1c592507aa59
|
2e1a17b36e0ea310ece51adde5afeb3a8e03d309
|
/Chapter13/SortedArrayToMinBinarySearchTree/src/main/java/coding/challenge/BinarySearchTree.java
|
68ea9beee068e58ffbca1655392e7a3d35dc338f
|
[
"MIT"
] |
permissive
|
copley/The-Complete-Coding-Interview-Guide-in-Java
|
59cb808d87f1f99bfa30a6631837c1637d2ee573
|
1f589772a205368ec6634e0fcae6fe58e1130aee
|
refs/heads/master
| 2023-03-16T08:40:14.877164
| 2023-01-18T09:01:28
| 2023-01-18T09:01:28
| 257,846,324
| 0
| 0
| null | 2020-04-22T08:56:35
| 2020-04-22T08:56:34
| null |
UTF-8
|
Java
| false
| false
| 3,436
|
java
|
package coding.challenge;
import java.util.ArrayDeque;
import java.util.Queue;
public class BinarySearchTree<T extends Comparable<T>> {
private int nodeCount;
private Node root = null;
private class Node {
private final T element;
private Node left;
private Node right;
public Node(T element) {
this.element = element;
this.left = null;
this.right = null;
}
public Node(Node left, Node right, T element) {
this.element = element;
this.left = left;
this.right = right;
}
}
public enum TraversalOrder {
PRE,
IN,
POST,
LEVEL
}
public void minimalBst(T m[]) {
if (m == null) {
throw new IllegalArgumentException("The given array cannot be null");
}
root = minimalBst(m, 0, m.length - 1);
}
private Node minimalBst(T m[], int start, int end) {
if (end < start) {
return null;
}
int middle = (start + end) / 2;
Node node = new Node(m[middle]);
nodeCount++;
node.left = minimalBst(m, start, middle - 1);
node.right = minimalBst(m, middle + 1, end);
return node;
}
public int size() {
return nodeCount;
}
public T root() {
if (root == null) {
return null;
}
return root.element;
}
public int height() {
return height(root);
}
private int height(Node node) {
if (node == null) {
return 0;
}
return Math.max(height(node.left), height(node.right)) + 1;
}
public void print(TraversalOrder to) {
if (size() == 0) {
System.out.println("empty");
return;
}
switch (to) {
case IN:
printInOrder(root);
break;
case PRE:
printPreOrder(root);
break;
case POST:
printPostOrder(root);
break;
case LEVEL:
printLevelOrder(root);
break;
default:
throw new IllegalArgumentException("Unrecognized traversal order");
}
}
private void printInOrder(Node node) {
if (node != null) {
printInOrder(node.left);
System.out.print(" " + node.element);
printInOrder(node.right);
}
}
private void printPreOrder(Node node) {
if (node != null) {
System.out.print(" " + node.element);
printPreOrder(node.left);
printPreOrder(node.right);
}
}
private void printPostOrder(Node node) {
if (node != null) {
printPostOrder(node.left);
printPostOrder(node.right);
System.out.print(" " + node.element);
}
}
private void printLevelOrder(Node node) {
Queue<Node> queue = new ArrayDeque<>();
queue.add(node);
while (!queue.isEmpty()) {
Node current = queue.poll();
System.out.print(" " + current.element);
if (current.left != null) {
queue.add(current.left);
}
if (current.right != null) {
queue.add(current.right);
}
}
}
}
|
[
"leoprivacy@yahoo.com"
] |
leoprivacy@yahoo.com
|
4a79cb02d81394d4d949055eb1869420d684f2ee
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/12/12_9909ac876f16740d882d79b67bcba528e193c14e/OpenLogPhaseListener/12_9909ac876f16740d882d79b67bcba528e193c14e_OpenLogPhaseListener_s.java
|
fb8b5b39cf7da8c13bbe7b7e9089e3d606e4c7b0
|
[] |
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
| 8,391
|
java
|
package com.paulwithers.openLog;
/*
<!--
Copyright 2013 Paul Withers
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
-->
*/
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.logging.Level;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import javax.faces.el.PropertyNotFoundException;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import lotus.domino.Database;
import lotus.domino.Document;
import com.ibm.jscript.InterpretException;
import com.ibm.xsp.exception.EvaluationExceptionEx;
import com.ibm.xsp.extlib.util.ExtLibUtil;
import com.paulwithers.openLog.OpenLogErrorHolder.EventError;
/**
* @author withersp
* @since 1.0.0
*
*/
public class OpenLogPhaseListener implements PhaseListener {
private static final long serialVersionUID = 1L;
private static final int RENDER_RESPONSE = 6;
public void beforePhase(PhaseEvent event) {
// Add FacesContext messages for anything captured so far
if (RENDER_RESPONSE == event.getPhaseId().getOrdinal()) {
Map<String, Object> r = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
if (null == r.get("error")) {
OpenLogItem.setThisAgent(true);
}
if (null != r.get("openLogBean")) {
// requestScope.openLogBean is not null, the developer has called openLogBean.addError(e,this)
OpenLogErrorHolder errList = (OpenLogErrorHolder) r.get("openLogBean");
errList.setLoggedErrors(new LinkedHashSet<EventError>());
// loop through the ArrayList of EventError objects and add any errors already captured as a facesMessage
if (null != errList.getErrors()) {
for (EventError error : errList.getErrors()) {
errList.addFacesMessageForError(error);
}
}
}
}
}
/*
* (non-Javadoc)
*
* @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
*/
@SuppressWarnings("unchecked")
public void afterPhase(PhaseEvent event) {
try {
if (RENDER_RESPONSE == event.getPhaseId().getOrdinal()) {
Map<String, Object> r = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
if (null != r.get("error")) {
// requestScope.error is not null, we're on the custom error page.
Object error = r.get("error");
// Set the agent (page we're on) to the *previous* page
OpenLogItem.setThisAgent(false);
if ("com.ibm.xsp.exception.EvaluationExceptionEx".equals(error.getClass().getName())) {
// EvaluationExceptionEx, so error is on a component property
EvaluationExceptionEx ee = (EvaluationExceptionEx) error;
InterpretException ie = (InterpretException) ee.getCause();
String msg = "";
msg = "Error on " + ee.getErrorComponentId() + " " + ee.getErrorPropertyId()
+ " property/event, line " + Integer.toString(ie.getErrorLine()) + ":\n\n"
+ ie.getLocalizedMessage() + "\n\n" + ie.getExpressionText();
OpenLogItem.logErrorEx(ee, msg, null, null);
} else if ("javax.faces.FacesException".equals(error.getClass().getName())) {
// FacesException, so error is on event
FacesException fe = (FacesException) error;
EvaluationExceptionEx ee = (EvaluationExceptionEx) fe.getCause();
InterpretException ie = (InterpretException) ee.getCause();
String msg = "";
msg = "Error on " + ee.getErrorComponentId() + " " + ee.getErrorPropertyId()
+ " property/event:\n\n" + Integer.toString(ie.getErrorLine()) + ":\n\n"
+ ie.getLocalizedMessage() + "\n\n" + ie.getExpressionText();
OpenLogItem.logErrorEx(ee, msg, null, null);
} else if ("javax.faces.el.PropertyNotFoundException".equals(error.getClass().getName())) {
// Property not found exception, so error is on a component property
PropertyNotFoundException pe = (PropertyNotFoundException) error;
String msg = "";
msg = "PropertyNotFounException Error, cannot locate component:\n\n" + pe.getLocalizedMessage();
OpenLogItem.logErrorEx(pe, msg, null, null);
} else {
try {
System.out.println("Error type not found:" + error.getClass().getName());
String msg = "";
msg = error.toString();
OpenLogItem.logErrorEx((Throwable) error, msg, null, null);
} catch (Throwable t) {
t.printStackTrace();
}
}
} else if (null != r.get("openLogBean")) {
// requestScope.openLogBean is not null, the developer has called openLogBean.addError(e,this)
OpenLogErrorHolder errList = (OpenLogErrorHolder) r.get("openLogBean");
// loop through the ArrayList of EventError objects
if (null != errList.getErrors()) {
for (EventError error : errList.getErrors()) {
String msg = "";
if (!"".equals(error.getMsg())) msg = msg + error.getMsg();
msg = msg + "Error on ";
if (null != error.getControl()) {
msg = msg + error.getControl().getId();
}
if (null != error.getError()) {
msg = msg + ":\n\n" + error.getError().getLocalizedMessage() + "\n\n"
+ error.getError().getExpressionText();
}
Level severity = convertSeverity(error.getSeverity());
Document passedDoc = null;
if (!"".equals(error.getUnid())) {
try {
Database currDb = ExtLibUtil.getCurrentDatabase();
passedDoc = currDb.getDocumentByUNID(error.getUnid());
} catch (Exception e) {
msg = msg + "\n\nCould not retrieve document but UNID was passed: "
+ error.getUnid();
}
}
OpenLogItem.logErrorEx(error.getError(), msg, severity, passedDoc);
try {
passedDoc.recycle();
} catch (Throwable e) {
// nothing to recycle here, move along
}
}
}
// loop through the ArrayList of EventError objects
if (null != errList.getEvents()) {
for (EventError eventObj : errList.getEvents()) {
String msg = "Event logged for ";
if (null != eventObj.getControl()) {
msg = msg + eventObj.getControl().getId();
}
msg = msg + " " + eventObj.getMsg();
Level severity = convertSeverity(eventObj.getSeverity());
Document passedDoc = null;
if (!"".equals(eventObj.getUnid())) {
try {
Database currDb = ExtLibUtil.getCurrentDatabase();
passedDoc = currDb.getDocumentByUNID(eventObj.getUnid());
} catch (Exception e) {
msg = msg + "\n\nCould not retrieve document but UNID was passed: "
+ eventObj.getUnid();
}
}
OpenLogItem.logEvent(null, msg, severity, passedDoc);
try {
passedDoc.recycle();
} catch (Throwable e) {
// nothing to recycle here, move along
}
}
}
}
}
} catch (Throwable e) {
// We've hit an error in our code here, log the error
OpenLogItem.logError(e);
}
}
private Level convertSeverity(int severity) {
Level internalLevel = null;
switch (severity) {
case 1:
internalLevel = Level.SEVERE;
break;
case 2:
internalLevel = Level.WARNING;
break;
case 3:
internalLevel = Level.INFO;
break;
case 5:
internalLevel = Level.FINE;
break;
case 6:
internalLevel = Level.FINER;
break;
case 7:
internalLevel = Level.FINEST;
break;
default:
internalLevel = Level.CONFIG;
}
return internalLevel;
}
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
bcff545691aeccd024f261c0349e98578eaa361e
|
c8db9f7f8e514543f95484fc1453f6763324757d
|
/src/com/example/view/engine/YDLayoutInflate.java
|
87e7911a00196f37ea6a1c26e3ccabca457505d0
|
[] |
no_license
|
tdxtxt/TestViewTree
|
9a79cd02331483f7c448490438089a8480184367
|
b86e49875c04338f85507d4bc5c4bd3b18ea1272
|
refs/heads/master
| 2020-12-30T11:15:05.218979
| 2014-12-26T01:52:33
| 2014-12-26T01:52:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 30,269
|
java
|
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.view.engine;
/**
* @author Codefarmer@sina.com
*/
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import com.example.view.YDRelativeLayout;
import android.content.Context;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.text.Layout;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Xml;
import android.view.ContextThemeWrapper;
import android.view.InflateException;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
/**
* This class is used to instantiate layout XML file into its corresponding View
* objects. It is never be used directly -- use
* {@link android.app.Activity#getLayoutInflater()} or
* {@link Context#getSystemService} to retrieve a standard LayoutInflater
* instance that is already hooked up to the current context and correctly
* configured for the device you are running on. For example:
*
* <pre>
* LayoutInflater inflater = (LayoutInflater)context.getSystemService
* Context.LAYOUT_INFLATER_SERVICE);
* </pre>
*
* <p>
* To create a new LayoutInflater with an additional {@link Factory} for your
* own views, you can use {@link #cloneInContext} to clone an existing
* ViewFactory, and then call {@link #setFactory} on it to include your Factory.
*
* <p>
* For performance reasons, view inflation relies heavily on pre-processing of
* XML files that is done at build time. Therefore, it is not currently possible
* to use LayoutInflater with an XmlPullParser over a plain XML file at runtime;
* it only works with an XmlPullParser returned from a compiled resource (R.
* <em>something</em> file.)
*
* @see Context#getSystemService
*/
public class YDLayoutInflate {
private final boolean DEBUG = true;
/**
* This field should be made private, so it is hidden from the SDK. {@hide
*
* }
*/
protected final Context mContext;
// these are optional, set by the caller
private boolean mFactorySet;
private Factory mFactory;
private Filter mFilter;
private final Object[] mConstructorArgs = new Object[2];
private static final Class[] mConstructorSignature = new Class[] {
Context.class, AttributeSet.class };
/*
* private static final Class[] mConstructorSignature = new Class[] {
* Context.class};
*/
private static final HashMap<String, Constructor> sConstructorMap = new HashMap<String, Constructor>();
private HashMap<String, Boolean> mFilterMap;
private static final String TAG_MERGE = "merge";
private static final String TAG_INCLUDE = "include";
private static final String TAG_REQUEST_FOCUS = "requestFocus";
private static final String TAG = "Engine";
private long start;
/**
* Hook to allow clients of the LayoutInflater to restrict the set of Views
* that are allowed to be inflated.
*
*/
public interface Filter {
/**
* Hook to allow clients of the LayoutInflater to restrict the set of
* Views that are allowed to be inflated.
*
* @param clazz
* The class object for the View that is about to be inflated
*
* @return True if this class is allowed to be inflated, or false
* otherwise
*/
boolean onLoadClass(Class clazz);
}
public interface Factory {
/**
* Hook you can supply that is called when inflating from a
* LayoutInflater. You can use this to customize the tag names available
* in your XML layout files.
*
* <p>
* Note that it is good practice to prefix these custom names with your
* package (i.e., com.coolcompany.apps) to avoid conflicts with system
* names.
*
* @param name
* Tag name to be inflated.
* @param context
* The context the view is being created in.
* @param attrs
* Inflation attributes as specified in XML file.
*
* @return View Newly created view. Return null for the default
* behavior.
*/
public View onCreateView(String name, Context context,
AttributeSet attrs);
}
private static class FactoryMerger implements Factory {
private final Factory mF1, mF2;
FactoryMerger(Factory f1, Factory f2) {
mF1 = f1;
mF2 = f2;
}
public View onCreateView(String name, Context context,
AttributeSet attrs) {
View v = mF1.onCreateView(name, context, attrs);
if (v != null)
return v;
return mF2.onCreateView(name, context, attrs);
}
}
/**
* Create a new LayoutInflater instance associated with a particular
* Context. Applications will almost always want to use
* {@link Context#getSystemService Context.getSystemService()} to retrieve
* the standard {@link Context#LAYOUT_INFLATER_SERVICE
* Context.INFLATER_SERVICE}.
*
* @param context
* The Context in which this LayoutInflater will create its
* Views; most importantly, this supplies the theme from which
* the default values for their attributes are retrieved.
*/
public YDLayoutInflate(Context context) {
mContext = context;
}
/**
* Create a new LayoutInflater instance that is a copy of an existing
* LayoutInflater, optionally with its Context changed. For use in
* implementing {@link #cloneInContext}.
*
* @param original
* The original LayoutInflater to copy.
* @param newContext
* The new Context to use.
*
* protected Engine(LayoutInflater original, Context newContext)
* { mContext = newContext; mFactory = original.mFactory; mFilter
* = original.mFilter; }
*/
/**
* Obtains the LayoutInflater from the given context.
*
* public static LayoutInflater from(Context context) { LayoutInflater
* LayoutInflater = (LayoutInflater)
* context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if
* (LayoutInflater == null) { throw new
* AssertionError("LayoutInflater not found."); } return LayoutInflater; }
*/
/**
* Create a copy of the existing LayoutInflater object, with the copy
* pointing to a different Context than the original. This is used by
* {@link ContextThemeWrapper} to create a new LayoutInflater to go along
* with the new Context theme.
*
* @param newContext
* The new Context to associate with the new LayoutInflater. May
* be the same as the original Context if desired.
*
* @return Returns a brand spanking new LayoutInflater object associated
* with the given Context.
*
* public abstract LayoutInflater cloneInContext(Context
* newContext);
*/
/**
* Return the context we are running in, for access to resources, class
* loader, etc.
*/
public Context getContext() {
return mContext;
}
/**
* Return the current factory (or null). This is called on each element
* name. If the factory returns a View, add that to the hierarchy. If it
* returns null, proceed to call onCreateView(name).
*
* public final Factory getFactory() { return mFactory; }
*/
/**
* Attach a custom Factory interface for creating views while using this
* LayoutInflater. This must not be null, and can only be set once; after
* setting, you can not change the factory. This is called on each element
* name as the xml is parsed. If the factory returns a View, that is added
* to the hierarchy. If it returns null, the next factory default
* {@link #onCreateView} method is called.
*
* <p>
* If you have an existing LayoutInflater and want to add your own factory
* to it, use {@link #cloneInContext} to clone the existing instance and
* then you can use this function (once) on the returned new instance. This
* will merge your own factory with whatever factory the original instance
* is using.
*/
public void setFactory(Factory factory) {
if (mFactorySet) {
throw new IllegalStateException(
"A factory has already been set on this LayoutInflater");
}
if (factory == null) {
throw new NullPointerException("Given factory can not be null");
}
mFactorySet = true;
if (mFactory == null) {
mFactory = factory;
} else {
mFactory = new FactoryMerger(factory, mFactory);
}
}
/**
* @return The {@link Filter} currently used by this LayoutInflater to
* restrict the set of Views that are allowed to be inflated.
*/
public Filter getFilter() {
return mFilter;
}
/**
* Sets the {@link Filter} to by this LayoutInflater. If a view is attempted
* to be inflated which is not allowed by the {@link Filter}, the
* {@link #inflate(int, ViewGroup)} call will throw an
* {@link InflateException}. This filter will replace any previous filter
* set on this LayoutInflater.
*
* @param filter
* The Filter which restricts the set of Views that are allowed
* to be inflated. This filter will replace any previous filter
* set on this LayoutInflater.
*/
public void setFilter(Filter filter) {
mFilter = filter;
if (filter != null) {
mFilterMap = new HashMap<String, Boolean>();
}
}
/**
* Inflate a new view hierarchy from the specified xml resource. Throws
* {@link InflateException} if there is an error.
*
* @param resource
* ID for an XML layout resource to load (e.g.,
* <code>R.layout.main_page</code>)
* @param root
* Optional view to be the parent of the generated hierarchy.
* @return The root View of the inflated hierarchy. If root was supplied,
* this is the root View; otherwise it is the root of the inflated
* XML file.
*/
public View inflate(String resource, ViewGroup root) {
return inflate(resource, root, root != null);
}
/**
* Inflate a new view hierarchy from the specified xml node. Throws
* {@link InflateException} if there is an error. *
* <p>
* <em><strong>Important</strong></em> For performance
* reasons, view inflation relies heavily on pre-processing of XML files
* that is done at build time. Therefore, it is not currently possible to
* use LayoutInflater with an XmlPullParser over a plain XML file at
* runtime.
*
* @param parser
* XML dom node containing the description of the view hierarchy.
* @param root
* Optional view to be the parent of the generated hierarchy.
* @return The root View of the inflated hierarchy. If root was supplied,
* this is the root View; otherwise it is the root of the inflated
* XML file.
*/
public View inflate(XmlPullParser parser, ViewGroup root) {
return inflate(parser, root, root != null);
}
/**
* Inflate a new view hierarchy from the specified xml resource. Throws
* {@link InflateException} if there is an error.
*
* @param resource
* ID for an XML layout resource to load (e.g.,
* <code>R.layout.main_page</code>)
* @param root
* Optional view to be the parent of the generated hierarchy (if
* <em>attachToRoot</em> is true), or else simply an object that
* provides a set of LayoutParams values for root of the returned
* hierarchy (if <em>attachToRoot</em> is false.)
* @param attachToRoot
* Whether the inflated hierarchy should be attached to the root
* parameter? If false, root is only used to create the correct
* subclass of LayoutParams for the root view in the XML.
* @return The root View of the inflated hierarchy. If root was supplied and
* attachToRoot is true, this is root; otherwise it is the root of
* the inflated XML file.
*/
public View inflate(String resource, ViewGroup root, boolean attachToRoot) {
start = System.currentTimeMillis();
if (DEBUG)
System.out.println("INFLATING from resource: " + resource);
/*
* 可以看到通过resource id返回了一个XmlResourceParser,通过类名就可以猜测
* 这是一个xml的解析类。但点进去一看,发现它只是一个接口,它继承自
* XmlPullParser用于pull方式解析xml的接口。和AttributeSet用于获取此view的所有属性。
* 那么需要能找到它的实现类。先看下面resource类。
*/
XmlPullParser parser = getXmlPullParser(resource);
// try {
return inflate(parser, root, attachToRoot);
// } finally {
// parser.close();
// }
}
public XmlPullParser getXmlPullParser(String resource) {
// XmlResourceParser parser=new
// XmlPullAttributesParser(Xml.newPullParser());
XmlPullParser parser = Xml.newPullParser();
try {
// InputStream is=mContext.getAssets().open("transfer_main.xml");
FileInputStream is = new FileInputStream(resource);
parser.setInput(is, "utf-8");
} catch (Exception e) {
e.printStackTrace();
}
return parser;
}
/**
* Inflate a new view hierarchy from the specified XML node. Throws
* {@link InflateException} if there is an error.
* <p>
* <em><strong>Important</strong></em> For performance
* reasons, view inflation relies heavily on pre-processing of XML files
* that is done at build time. Therefore, it is not currently possible to
* use LayoutInflater with an XmlPullParser over a plain XML file at
* runtime.
*
* @param parser
* XML dom node containing the description of the view hierarchy.
* @param root
* Optional view to be the parent of the generated hierarchy (if
* <em>attachToRoot</em> is true), or else simply an object that
* provides a set of LayoutParams values for root of the returned
* hierarchy (if <em>attachToRoot</em> is false.)
* @param attachToRoot
* Whether the inflated hierarchy should be attached to the root
* parameter? If false, root is only used to create the correct
* subclass of LayoutParams for the root view in the XML.
* @return The root View of the inflated hierarchy. If root was supplied and
* attachToRoot is true, this is root; otherwise it is the root of
* the inflated XML file.
* 终于到了重点,获取一个这个View的实例
*/
public View inflate(XmlPullParser parser, ViewGroup root,
boolean attachToRoot) {
synchronized (mConstructorArgs) {
final AttributeSet attrs = Xml.asAttributeSet(parser);
// final AttributeSet attrs =new XmlPullAttributes(parser);
mConstructorArgs[0] = mContext;// 该mConstructorArgs属性最后会作为参数传递给View的构造函数
View result = root;// 根View
try {
// Look for the root node.
int type;
while ((type = parser.next()) != XmlPullParser.START_TAG
&& type != XmlPullParser.END_DOCUMENT) {
// Empty
}
if (type != XmlPullParser.START_TAG) {
throw new InflateException(parser.getPositionDescription()
+ ": No start tag found!");
}
final String name = parser.getName();// 节点名,即API中的控件或者自定义View完整限定名。
System.out.println("布局=======================>" + name);
if (DEBUG) {
System.out.println("**************************");
System.out.println("Creating root view: " + name);
System.out.println("**************************");
}
if (TAG_MERGE.equals(name)) {// 处理<merge />标签
if (root == null || !attachToRoot) {
throw new InflateException(
"<merge /> can be used only with a valid "
+ "ViewGroup root and attachToRoot=true");
}
// 将<merge />标签的View树添加至root中,该函数稍后讲到。
rInflate(parser, root, attrs);
} else {
// 创建该xml布局文件所对应的根View。
View temp = createViewFromTag(name, attrs);
ViewGroup.LayoutParams params = null;
if (root != null) {
if (DEBUG) {
System.out.println("Creating params from root: "
+ root);
}
// 根据AttributeSet属性获得一个LayoutParams实例,记住调用者为root。
params = root.generateLayoutParams(attrs);
if (!attachToRoot) {// 重新设置temp的LayoutParams
temp.setLayoutParams(params);
}
}
if (DEBUG) {
System.out.println("-----> start inflating children");
}
// 添加所有其子节点,即添加所有子View
rInflate(parser, temp, attrs);
if (DEBUG) {
System.out.println("-----> done inflating children");
}
//如果给出了root,则把此view添加到root中去
if (root != null && attachToRoot) {
root.addView(temp, params);
}
// Decide whether to return the root that was passed in or
// the
// top view found in xml.
if (root == null || !attachToRoot) {
result = temp;
}
}
} catch (XmlPullParserException e) {
InflateException ex = new InflateException(e.getMessage());
ex.initCause(e);
throw ex;
} catch (IOException e) {
InflateException ex = new InflateException(
parser.getPositionDescription() + ": " + e.getMessage());
ex.initCause(e);
throw ex;
}
Log.i("简历View 树 耗时:", "" + (System.currentTimeMillis() - start));
return result;
}
}
/**
* Low-level function for instantiating a view by name. This attempts to
* instantiate a view class of the given <var>name</var> found in this
* LayoutInflater's ClassLoader. 利用反射技术获取控件的实例
* <p>
* There are two things that can happen in an error case: either the
* exception describing the error will be thrown, or a null will be
* returned. You must deal with both possibilities -- the former will happen
* the first time createView() is called for a class of a particular name,
* the latter every time there-after for that class name.
*
* @param name
* The full name of the class to be instantiated.
* @param attrs
* The XML attributes supplied for this instance.
*
* @return View The newly instantied view, or null.
*/
public final View createView(String name, String prefix, AttributeSet attrs)
throws ClassNotFoundException, InflateException {
Constructor constructor = sConstructorMap.get(name);
Class clazz = null;
System.out.println("反射包名:================>" + prefix + name);
try {
if (constructor == null) {
// Class not found in the cache, see if it's real, and try to
// add it
Log.e(TAG, prefix != null ? (prefix + name) : name);
clazz = mContext.getClassLoader().loadClass(
prefix != null ? (prefix + name) : name);
// clazz=Class.forName(prefix != null ? (prefix + name) : name);
if (mFilter != null && clazz != null) {
boolean allowed = mFilter.onLoadClass(clazz);
if (!allowed) {
failNotAllowed(name, prefix, attrs);
}
}
constructor = clazz.getConstructor(mConstructorSignature);
sConstructorMap.put(name, constructor);
} else {
// If we have a filter, apply it to cached constructor
if (mFilter != null) {
// Have we seen this name before?
Boolean allowedState = mFilterMap.get(name);
if (allowedState == null) {
// New class -- remember whether it is allowed
clazz = mContext.getClassLoader().loadClass(
prefix != null ? (prefix + name) : name);
boolean allowed = clazz != null
&& mFilter.onLoadClass(clazz);
mFilterMap.put(name, allowed);
if (!allowed) {
failNotAllowed(name, prefix, attrs);
}
} else if (allowedState.equals(Boolean.FALSE)) {
failNotAllowed(name, prefix, attrs);
}
}
}
Object[] args = mConstructorArgs;
args[1] = attrs;
return (View) constructor.newInstance(args);
} catch (NoSuchMethodException e) {
InflateException ie = new InflateException(
attrs.getPositionDescription() + ": Error inflating class "
+ (prefix != null ? (prefix + name) : name));
ie.initCause(e);
throw ie;
} catch (ClassNotFoundException e) {
// If loadClass fails, we should propagate the exception.
throw e;
} catch (Exception e) {
InflateException ie = new InflateException(
attrs.getPositionDescription() + ": Error inflating class "
+ (clazz == null ? "<unknown>" : clazz.getName()));
ie.initCause(e);
throw ie;
}
}
/**
* Throw an excpetion because the specified class is not allowed to be
* inflated.
*/
private void failNotAllowed(String name, String prefix, AttributeSet attrs) {
InflateException ie = new InflateException(
attrs.getPositionDescription()
+ ": Class not allowed to be inflated "
+ (prefix != null ? (prefix + name) : name));
throw ie;
}
/**
* This routine is responsible for creating the correct subclass of View
* given the xml element name. Override it to handle custom view objects. If
* you override this in your subclass be sure to call through to
* super.onCreateView(name) for names you do not recognize.
*
* @param name
* The fully qualified class name of the View to be create.
* @param attrs
* An AttributeSet of attributes to apply to the View.
*
* @return View The View created.
*/
protected View onCreateView(String name, AttributeSet attrs)
throws ClassNotFoundException {
// return createView(name, "android.view.", attrs);
return createView(name, "com.example.view.YD", attrs);
}
/*
* default visibility so the BridgeInflater can override it.
*/
View createViewFromTag(String name, AttributeSet attrs) {
if (name.equals("view")) {
name = attrs.getAttributeValue(null, "class");
}
if (DEBUG)
System.out.println("******** Creating view: " + name);
try {
View view = (mFactory == null) ? null : mFactory.onCreateView(name,
mContext, attrs);
if (view == null) {
if (-1 == name.indexOf('.')) {
view = onCreateView(name, attrs);
} else {
view = createView(name, null, attrs);
}
}
if (DEBUG)
System.out.println("Created view is: " + view);
return view;
} catch (InflateException e) {
throw e;
} catch (ClassNotFoundException e) {
InflateException ie = new InflateException(
attrs.getPositionDescription() + ": Error inflating class "
+ name);
ie.initCause(e);
throw ie;
} catch (Exception e) {
InflateException ie = new InflateException(
attrs.getPositionDescription() + ": Error inflating class "
+ name);
ie.initCause(e);
throw ie;
}
}
/**
* Recursive method used to descend down the xml hierarchy and instantiate
* views, instantiate their children, and then call onFinishInflate().
* 添加布局中的子控件
*/
private void rInflate(XmlPullParser parser, View parent,
final AttributeSet attrs) throws XmlPullParserException,
IOException {
final int depth = parser.getDepth();
int type;
while (((type = parser.next()) != XmlPullParser.END_TAG || parser
.getDepth() > depth) && type != XmlPullParser.END_DOCUMENT) {
if (type != XmlPullParser.START_TAG) {
continue;
}
final String name = parser.getName();
if (TAG_REQUEST_FOCUS.equals(name)) {// 处理<requestFocus />标签
parseRequestFocus(parser, parent);
} else if (TAG_INCLUDE.equals(name)) {// 处理<include />标签
if (parser.getDepth() == 0) {
throw new InflateException(
"<include /> cannot be the root element");
}
parseInclude(parser, parent, attrs);// 解析<include />节点
} else if (TAG_MERGE.equals(name)) { // 处理<merge />标签
throw new InflateException("<merge /> must be the root element");
} else { //看这里,创建view的方法。而且这里已经重新获得了它的
// 根据节点名构建一个View实例对象
final View view = createViewFromTag(name, attrs);
final ViewGroup viewGroup = (ViewGroup) parent;
// 调用generateLayoutParams()方法返回一个LayoutParams实例对象
final ViewGroup.LayoutParams params = viewGroup.generateLayoutParams(attrs);
for (int i = 0; i < attrs.getAttributeCount(); i++) {
System.out.println(name + "控件的属性==============>"
+ attrs.getAttributeName(i) + ":"
+ attrs.getAttributeValue(i));
}
rInflate(parser, view, attrs);// 继续递归调用
viewGroup.addView(view, params);// OK,将该View以特定LayoutParams值添加至父View中
Log.i(TAG, "相对父控件的宽度:" + params.width + "<===>" + "相对父控件的高度:"+params.height);
}
}
// parent.onFinishInflate();
}
private void parseRequestFocus(XmlPullParser parser, View parent)
throws XmlPullParserException, IOException {
int type;
parent.requestFocus();
final int currentDepth = parser.getDepth();
while (((type = parser.next()) != XmlPullParser.END_TAG || parser
.getDepth() > currentDepth)
&& type != XmlPullParser.END_DOCUMENT) {
// Empty
}
}
private void parseInclude(XmlPullParser parser, View parent,
AttributeSet attrs) throws XmlPullParserException, IOException {
int type;
if (parent instanceof ViewGroup) {
final int layout = attrs.getAttributeResourceValue(null, "layout",
0);
if (layout == 0) {
final String value = attrs.getAttributeValue(null, "layout");
if (value == null) {
throw new InflateException(
"You must specifiy a layout in the"
+ " include tag: <include layout=\"@layout/layoutID\" />");
} else {
throw new InflateException(
"You must specifiy a valid layout "
+ "reference. The layout ID " + value
+ " is not valid.");
}
} else {
final XmlResourceParser childParser = getContext()
.getResources().getLayout(layout);
try {
final AttributeSet childAttrs = Xml
.asAttributeSet(childParser);
while ((type = childParser.next()) != XmlPullParser.START_TAG
&& type != XmlPullParser.END_DOCUMENT) {
// Empty.
}
if (type != XmlPullParser.START_TAG) {
throw new InflateException(
childParser.getPositionDescription()
+ ": No start tag found!");
}
final String childName = childParser.getName();
if (TAG_MERGE.equals(childName)) {
// Inflate all children.
rInflate(childParser, parent, childAttrs);
} else {
final View view = createViewFromTag(childName,
childAttrs);
final ViewGroup group = (ViewGroup) parent;
// We try to load the layout params set in the <include
// /> tag. If
// they don't exist, we will rely on the layout params
// set in the
// included XML file.
// During a layoutparams generation, a runtime exception
// is thrown
// if either layout_width or layout_height is missing.
// We catch
// this exception and set localParams accordingly: true
// means we
// successfully loaded layout params from the <include
// /> tag,
// false means we need to rely on the included layout
// params.
ViewGroup.LayoutParams params = null;
try {
params = group.generateLayoutParams(attrs);
} catch (RuntimeException e) {
params = group.generateLayoutParams(childAttrs);
} finally {
if (params != null) {
view.setLayoutParams(params);
}
}
// Inflate all children.
rInflate(childParser, view, childAttrs);
// Attempt to override the included layout's android:id
// with the
// one set on the <include /> tag itself.
/*
* TypedArray a = mContext.obtainStyledAttributes(attrs,
* com.android.internal.R.styleable.View, 0, 0); int id
* =
* a.getResourceId(com.android.internal.R.styleable.View_id
* , View.NO_ID); // While we're at it, let's try to
* override android:visibility. int visibility =
* a.getInt
* (com.android.internal.R.styleable.View_visibility,
* -1); a.recycle();
*
* if (id != View.NO_ID) { view.setId(id); }
*
* switch (visibility) { case 0:
* view.setVisibility(View.VISIBLE); break; case 1:
* view.setVisibility(View.INVISIBLE); break; case 2:
* view.setVisibility(View.GONE); break; }
*/
group.addView(view);
}
} finally {
childParser.close();
}
}
} else {
throw new InflateException(
"<include /> can only be used inside of a ViewGroup");
}
final int currentDepth = parser.getDepth();
while (((type = parser.next()) != XmlPullParser.END_TAG || parser
.getDepth() > currentDepth)
&& type != XmlPullParser.END_DOCUMENT) {
// Empty
}
}
}
|
[
"admin@admin-PC"
] |
admin@admin-PC
|
27808d38fca2cb634ae3e9fea62cc54f5a004fec
|
f10dc8fb4181c4865cd4797de9d5a79f2c98af7a
|
/src/yh/core/esb/client/update/logic/YHUpdateClientLogic.java
|
d820425015bb918f005cffedcb7af76aa8606af5
|
[] |
no_license
|
DennisAZ/NewtouchOA
|
b9c41cc1f4caac53b453c56952af0f5156b6c4fa
|
881d72d80c83e1f2ad578c92e37a3241498499fc
|
refs/heads/master
| 2020-03-30T05:37:21.900004
| 2018-09-29T02:11:34
| 2018-09-29T02:11:34
| 150,809,685
| 0
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 16,872
|
java
|
package yh.core.esb.client.update.logic;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import org.apache.axis.MessageContext;
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.log4j.Logger;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import yh.core.data.YHPageDataList;
import yh.core.data.YHPageQueryParam;
import yh.core.esb.client.data.YHEsbClientConfig;
import yh.core.esb.client.data.YHEsbConst;
import yh.core.esb.client.data.YHExtDept;
import yh.core.esb.client.logic.YHDeptTreeLogic;
import yh.core.esb.client.service.YHWSCaller;
import yh.core.esb.client.update.data.YHUpdateClientLog;
import yh.core.esb.frontend.services.YHEsbService;
import yh.core.esb.server.update.data.YHUpdateLogDetl;
import yh.core.funcs.diary.logic.YHDiaryUtil;
import yh.core.funcs.person.data.YHPerson;
import yh.core.funcs.system.syslog.logic.YHSysLogLogic;
import yh.core.global.YHSysProps;
import yh.core.install.YHInstallConfig;
import yh.core.load.YHPageLoader;
import yh.core.util.YHGuid;
import yh.core.util.YHUtility;
import yh.core.util.db.YHDBUtility;
import yh.core.util.db.YHORM;
import yh.core.util.file.YHFileUtility;
import yh.core.util.file.YHZipFileUtility;
import yh.core.util.form.YHFOM;
import yh.subsys.jtgwjh.docSend.data.YHJhDocsendTasks;
import yh.subsys.jtgwjh.docSend.logic.YHDocSendLogic;
import yh.subsys.jtgwjh.util.YHDocUtil;
import yh.user.api.core.db.YHDbconnWrap;
import com.agile.zip.CZipInputStream;
import com.agile.zip.ZipEntry;
public class YHUpdateClientLogic{
private static Logger log = Logger .getLogger("yh.core.esb.client.update.logic.YHUpdateClientLogic");
public static void unZipFileXml(String filePath, String fromUnit,String guid) throws Exception {
String savePath = YHSysProps.getRootPath() + "/update/deploy";//接收附件存放路径
Connection dbConn = null;
YHDbconnWrap dbUtil = new YHDbconnWrap();
dbConn = dbUtil.getSysDbConn();
File file = new File(filePath);
InputStream rarFile = new FileInputStream(file);
if (rarFile == null) {
return ;
}
CZipInputStream zip = new CZipInputStream(rarFile);// 支持中文目录
ZipEntry entry;
String xmlFile = "";//系统更新描述文件
String upXMLPath = filePath;
while ((entry = zip.getNextEntry()) != null) {// 循环zip下的所有文件和目录
String fileName = entry.getName();
if (YHUtility.isNullorEmpty(fileName)) {
continue;
}
File outFile = new File(savePath + "/" + fileName);
File outPath = outFile.getParentFile();
if (!outPath.exists()) {
outPath.mkdirs();
}
if(fileName.endsWith("desc.xml")){
xmlFile = fileName;
upXMLPath = savePath + File.separator + fileName;
}
if (!entry.isDirectory()) {
try {
outFile = new File(savePath + File.separator + fileName);
outFile.createNewFile();
FileOutputStream out = new FileOutputStream(outFile);
int len = 0;
byte[] buff = new byte[4096];
while ((len = zip.read(buff)) != -1) {
out.write(buff, 0, len);
}
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(entry.isDirectory()){
File zipFolder = new File(savePath + File.separator + fileName);
if (!zipFolder.exists()) {
zipFolder.mkdirs();
}
}
}
zip.closeEntry();
if (!YHUtility.isNullorEmpty(xmlFile)) {//解析xml文件
parseXML(upXMLPath, dbConn, fromUnit, guid);
}
System.out.println(xmlFile);
}
/**
* 只支持ZIP附件
*
* @param filePath:公文发送附件ZIP
* @param savePath : 将解压的附件保存路径
* 文件元素名称
fromUnit:发送单位 guid:ESB数据交互平台发送的唯一表示
* @param attachStrArrys : 公文XML返回的数据数组
* guid : ESB 唯一标识
* @throws Exception
*/
public static void unZipFile(String filePath, String savePath, Connection dbConn,String fromUnit,String guid) throws Exception{
File file = new File(filePath);
InputStream rarFile = new FileInputStream(file);
String upXMLPath = filePath;
if(rarFile == null){//如果没有文件跳出
return ;
}
CZipInputStream zip=new CZipInputStream(rarFile);//支持中文目录
ZipEntry entry;
while ((entry = zip.getNextEntry()) != null) {//循环zip下的所有文件和目录
String fileName=entry.getName();
if(YHUtility.isNullorEmpty(fileName)){
continue;
}
File outFile = new File(savePath + "/" + fileName);
if(entry.isDirectory()){
File zipFolder = new File(savePath + File.separator + fileName);
if (!zipFolder.exists()) {
zipFolder.mkdirs();
}
} else{
try {
outFile = new File(savePath + File.separator + fileName);
outFile.createNewFile();
FileOutputStream out = new FileOutputStream(outFile);
int len = 0;
byte[] buff = new byte[4096];
while ((len = zip.read(buff)) != -1) {
out.write(buff, 0, len);
}
zip.closeEntry();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
*
* 解析公告XML、并新建收文记录
* upXMLPath: 临时公文XML存放路径
* @param savePath
* :保存文件路径
* @param fromUnit
* :发送单位
* @param dbConn
* :数据库 fromUnit:发送单位 * guid:ESB数据交互平台发送的唯一标识
* @throws Exception
*/
public static void parseXML(String upXMLPath, Connection dbConn, String fromUnit, String guid) throws Exception {
//String updateUser = YHUpdateServerLogic.getUser();
SAXReader saxReader = new SAXReader();
File XMLFile = new File(upXMLPath);
Document document = saxReader.read(XMLFile);
Element root = document.getRootElement();
YHUpdateClientLog clientLog = null;
if (!YHUtility.isNullorEmpty(root.getName()) && root.getName().equals("body")) {
clientLog = new YHUpdateClientLog();
List<Element> elements = root.elements();
for (Element el : elements) {
String elName = el.getName();
String elData = (String) el.getData() == null ? "" : (String) el.getData();
elData = elData.trim();
if (elName.equalsIgnoreCase("desc")) {
clientLog.setUpdateDesc(elData);
}
else if (elName.equalsIgnoreCase("toVersion")) {
clientLog.setToVersion(Integer.parseInt(elData));
}
}
}
if (clientLog != null) {
clientLog.setUpdateStatus("1");
clientLog.setReseiveTime(YHUtility.parseDate(YHUtility.getCurDateTimeStr()));
YHPerson person = new YHPerson();
clientLog.setGuid(guid);
//新建系统升级
add(dbConn, clientLog);
//获取request
HttpServletRequest request = getWebserviceHttp();
String IP = "";
if(request != null ){
IP = request.getRemoteAddr();
}
YHPerson user = new YHPerson();
user.setSeqId(0);
user.setUserName("系统");
//系统日志
YHSysLogLogic.addSysLog(dbConn, "62", "系统成功接收日志:" + clientLog.toString() ,0, IP);
}
}
//获取客户端更新信息
public String getJsonLogic(Connection dbConn, Map parameterMap,YHPerson person, HttpServletRequest request)throws Exception {
try {
String sql = "select SEQ_ID,UPDATE_DESC,TO_VERSION,UPDATE_USER,DONE_TIME,UPDATE_STATUS from update_client_log order by DONE_TIME desc ";
YHPageQueryParam queryParam = (YHPageQueryParam) YHFOM.build(parameterMap);
YHPageDataList pageDataList = YHPageLoader.loadPageList(dbConn, queryParam, sql);
return pageDataList.toJson();
} catch (Exception e) {
throw e;
}
}
public String deleteFileLogic(Connection dbConn, String seqIdStr)throws Exception {
YHORM orm = new YHORM();
if (YHUtility.isNullorEmpty(seqIdStr)) {
seqIdStr = "";
}
String tempReturn = "";
try {
String seqIdArry[] = seqIdStr.split(",");
if (!"".equals(seqIdArry) && seqIdArry.length > 0) {
for (String seqId : seqIdArry) {
YHUpdateClientLog clientLog = (YHUpdateClientLog) orm.loadObjSingle(dbConn, YHUpdateClientLog.class, Integer.parseInt(seqId));
// 删除数据库信息
orm.deleteSingle(dbConn, clientLog);
tempReturn += clientLog.getUpdateDesc()+",";
}
}
if(tempReturn.length() > 1 && tempReturn.endsWith(",")){
tempReturn = tempReturn.substring(0, tempReturn.length() - 1);
}
return tempReturn;
} catch (Exception e) {
throw e;
}
}
public static void add(Connection conn, YHUpdateClientLog clientLog) throws Exception{
YHORM orm = new YHORM();
orm.saveSingle(conn, clientLog);
conn.commit();
}
public static HttpServletRequest getWebserviceHttp(){
MessageContext mc = (MessageContext) org.apache.axis.MessageContext.getCurrentContext();;
HttpServletRequest request = (HttpServletRequest) mc.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
return request;
}
/*
* 更新系统
* 属性文件,数据库,一般源文件
*/
public boolean updateSystem(String filePath) throws Exception { //更新系统
YHInstallConfig config = new YHInstallConfig();
String updateDir=YHSysProps.getRootPath() + "\\update\\deploy\\";
String historyDir = YHSysProps.getRootPath() + "\\update\\history";
try{
String installPath=YHSysProps.getRootPath();
String contextPath="yh";
String dest="";
File file= new File(filePath);
if (!file.isDirectory()) {
System.out.println(file.getName());
} else if (file.isDirectory()) {
String[] filelist = file.list();
for (int i = 0; i < filelist.length; i++) {
File readfile = new File(filePath + "\\" + filelist[i]);
if (!readfile.isDirectory()) {
String extName = YHFileUtility.getFileExtName(readfile.getName());
String abspath=readfile.getPath();
String abspath2= abspath.substring(0, abspath.length()-readfile.getName().length()-1);
if("sql".equals(extName)){
try{
config.exeSql(abspath);
}catch(Exception e){
e.printStackTrace();
}
}else if("properties".equals(extName)){
try{
if("update".equals(readfile.getParent().substring(49))){
config.updateSysConfByFileName(installPath, contextPath, abspath,readfile.getName());
}else if("delete".equals(readfile.getParent().substring(49))){
config.deleteSysConfByFileName(installPath, contextPath, abspath,readfile.getName());
}
}catch(Exception e){
e.printStackTrace();
}
}else if("desc.xml".equals(readfile.getName())){
continue;
}
else {
try{
String destPath = installPath +"\\webroot\\" + contextPath + abspath2.substring(46) ;
YHFileUtility.copyDir(abspath2, destPath);
}catch(Exception e){
e.printStackTrace();
}
}
} else if (readfile.isDirectory()) {
updateSystem(filePath + "\\" + filelist[i]);
}
}
}
YHFileUtility.copyDir(updateDir,historyDir);
YHFileUtility.deleteAll(filePath);
return true;
} catch (FileNotFoundException e) {
System.out.println("readfile() Exception:" + e.getMessage());
}
return false;
}
/*
* 更新客户端更新状态
*
*/
public void updateClientStatus(Connection dbConn,int seqId,String updateUser) throws Exception{
int versionNum=this.getVersionNum(dbConn, seqId);
String doneTime=YHUtility.getCurDateTimeStr();
Date time=YHUtility.parseDate(doneTime);
YHUpdateClientLog clientLog=new YHUpdateClientLog();
YHORM orm = new YHORM();
try {
clientLog.setSeqId(seqId);
clientLog.setDoneTime(time);
clientLog.setUpdateStatus("2");
clientLog.setUpdateUser(updateUser);
clientLog.setToVersion(versionNum);
orm.updateSingle(dbConn, clientLog);
} catch (Exception ex) {
throw ex;
}
this.updateVersion(dbConn, versionNum);
}
/*
*
* 获取版本号
*/
public int getVersionNum(Connection dbConn,int seqId)throws Exception{ //获取版本号
Statement stmt = null;
ResultSet rs = null;
int versionNum=0;
String sql="select TO_VERSION from update_client_log where SEQ_ID = "+seqId;
try{
stmt = dbConn.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
versionNum=rs.getInt(1);
}
return versionNum;
}catch(Exception e){
e.printStackTrace();
}
return 0;
}
/*
*
* 更新版本号
*/
public void updateVersion(Connection dbConn,int versionNum)throws Exception{
Statement stmt = null;
ResultSet rs = null;
String sql="update version set VERSION_NUM="+versionNum+" where VER='2.2.110412.1'";
try{
stmt=dbConn.createStatement();
stmt.executeUpdate(sql);
}catch(Exception e){
e.printStackTrace();
}
}
/*
*
* 获取客户端更新状态
*/
public String getStatus(Connection dbConn,int seqId)throws Exception{
Statement stmt=null;
ResultSet rs = null;
String status=null;
String sql="select UPDATE_STATUS from update_client_log where SEQ_ID = "+seqId;
try{
stmt=dbConn.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
status=rs.getString(1);
}
return status;
}catch(Exception e){
e.printStackTrace();
}
return null;
}
/*
* 升级成功,生成XML文件
*/
public static String toXML(String clientGuid, int logSeqId, String updateStatus,String clientName) {
String str = "<?xml version='1.0' encoding='UTF-8'?>" + "<body>" + "<guid>"
+ clientGuid + "</guid>" + "<logSeqId>" + logSeqId + "</logSeqId>"
+ "<updateStatus>" + updateStatus + "</updateStatus>"
+ "<clientName>" + clientName + "</clientName>"
+ "</body>";
return str;
}
/*
* 成功升级,返回信息
*/
public void backSuccessInfo(YHUpdateClientLog clientLog,String webroot , Connection dbConn)throws Exception {
if(!YHUtility.isNullorEmpty(clientLog.getUpdateUser())){
String xml = toXML(clientLog.getGuid(),clientLog.getLogSeqId(),clientLog.getUpdateStatus(),clientLog.getUpdateUser());
//此次打包任务名称
String taskName = YHGuid.getRawGuid();
String path = YHSysProps.getAttachPath() + File.separator + "uploadJTGW"
+ File.separator + taskName ;
String FileName = "JH_UPDATE_" + YHGuid.getRawGuid() + ".xml";
while (YHDocUtil.getExist(path, FileName)) {
FileName = "JH_UPDATE_" + YHGuid.getRawGuid() + ".xml";
}
YHEsbClientConfig config = YHEsbClientConfig.builder(webroot + YHEsbConst.CONFIG_PATH) ;
YHEsbService esbService = new YHEsbService();
String fileName =path + File.separator + FileName;
YHFileUtility.storeString2File(fileName, xml);
esbService.send (fileName, "client", config.getToken(),"JHupdate", "");
}
}
}
|
[
"hao.duan@newtouch.cn"
] |
hao.duan@newtouch.cn
|
9d78777afca4332901330f608513ffd430a9115b
|
77b3f1e463521a13398bb0b0ac7cfb4f95076669
|
/src/DesignPattern/SingletonPattern/Singleton3.java
|
e3be90a01a23961bebd4833cecd84b95577c6805
|
[] |
no_license
|
Pisceslau/Algorithm
|
f4279f81aead1e42e9a465dc07bfc1c45843381c
|
0a440b3479e6ef74a42f869391f314c3b252233a
|
refs/heads/master
| 2021-01-10T16:01:15.754624
| 2016-10-21T15:49:44
| 2016-10-21T15:49:44
| 54,631,074
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 858
|
java
|
package DesignPattern.SingletonPattern;
/**
* Created by Lunar on 2016/4/3.
* Head First设计模式:单例模式的经典实现
* 延迟实例化。没有公有的构造器
* 单例模式确保一个类只有一个实例,并提供一个全局访问点。
* 缺点:不能处理多线程。
*/
public class Singleton3 {
private static Singleton3 instance;
private Singleton3() {
}
//加上synchronized处理多线程情况
/*只有第一次调用此方法才真正需要同步,一旦设置好,就不在需要同步这个方法了,同步每一次都是一个累赘(性能问题)*/
public static synchronized Singleton3 getInstance() {
//instance 拥有一个实例,因为是静态变量 ,公有
if (instance == null)
instance = new Singleton3();
return instance;
}
}
|
[
"liuwenyueno2@gmail.com"
] |
liuwenyueno2@gmail.com
|
dc52c91f3e5fb5b94e9bf93fac8f31b6760820a0
|
a93b02d93e2dcfc477ca4850b3167fdc2eaa9c87
|
/pushinginertia-wicket-core/src/main/java/com/pushinginertia/wicket/core/behavior/PreventDoubleSubmission.java
|
ca88df874b805fa5ffee0186b248a1aaa418a6d4
|
[] |
no_license
|
pushinginertia/pushinginertia-wicket
|
2fa87923850fac9e8b9d88d1b1ba79e87f92ee48
|
a55b704f4df54277c7ee70542d8b41128dba7c15
|
refs/heads/master
| 2021-11-01T06:32:11.101862
| 2021-10-03T21:48:22
| 2021-10-03T21:48:22
| 8,836,438
| 0
| 0
| null | 2021-08-19T23:18:04
| 2013-03-17T15:31:00
|
Java
|
UTF-8
|
Java
| false
| false
| 1,751
|
java
|
/* Copyright (c) 2011-2013 Pushing Inertia
* All rights reserved. http://pushinginertia.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.pushinginertia.wicket.core.behavior;
import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.html.IHeaderResponse;
/**
* Prevents a user from double clicking a form's submit button by setting a data element on the form the first time
* the submit button is pushed and ignoring all further clicks on the button. Requires the jquery plugin
* preventDoubleSubmission.
* @see <a href="http://stackoverflow.com/questions/2830542/prevent-double-submission-of-forms-in-jquery">http://stackoverflow.com/questions/2830542/prevent-double-submission-of-forms-in-jquery</a>
*/
public class PreventDoubleSubmission extends Behavior {
private static final long serialVersionUID = 1L;
public PreventDoubleSubmission() {
}
@Override
public void renderHead(final Component component, final IHeaderResponse response) {
super.renderHead(component, response);
response.renderJavaScript(
"$(document).ready(function(){\n" +
"\t$('form').preventDoubleSubmission();\n" +
"});",
"PreventDoubleSubmission");
}
}
|
[
"dan.traczynski@gmail.com"
] |
dan.traczynski@gmail.com
|
b8aaed2d1918c2a19e6f361ec37b6cbc55aa5293
|
fe158ebad9fe274ecb0ba5b655cfc4e5cc4df55b
|
/server/src/main/java/io/litmusblox/server/service/JobAnalytics/InterviewDetailBean.java
|
14ec595ab17d773a5d0fbd3f70a6c35ee30c238a
|
[] |
no_license
|
bhumi2007shah/hexagonsearch
|
484383594f3d0ceb89a0e8724935299b7ffa33a6
|
71d96bdd262a68f558eb36cc57b681f7b3302c8d
|
refs/heads/master
| 2023-03-21T07:19:11.218865
| 2021-02-24T04:40:46
| 2021-02-24T04:40:46
| 349,019,024
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 514
|
java
|
/*
* Copyright © Litmusblox 2019. All rights reserved.
*/
package io.litmusblox.server.service.JobAnalytics;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* @author : Sumit
* Date : 31/07/20
* Time : 12:50 PM
* Class Name : InterviewDetailBean
* Project Name : server
*/
@Entity
@Data
public class InterviewDetailBean {
@Id
private Long id;
String candidateName;
String jobTitle;
Long jobId;
String interviewTime;
String status;
}
|
[
"sumit@litmusblox.io"
] |
sumit@litmusblox.io
|
518d42eeb2e4a16fbea7fe7b1fdf7441d70e8f2c
|
245683a33575e536bdc1c823b73a8ea993ce6e8e
|
/app/src/main/java/com/a2017002/optimustechproject/optimus_tech_project_2017002/Interface/StepListener.java
|
5015fc8e56a1195a28869091915ab7b0dc8b524d
|
[] |
no_license
|
satyamkiet/fitnessApp
|
3f385e2165b1d27bbdac9906d315c772f1702e86
|
3955a3d37f0663070909498e6ea4711da4b10a33
|
refs/heads/master
| 2021-04-25T18:52:30.701999
| 2019-10-02T07:15:06
| 2019-10-02T07:15:06
| 108,668,427
| 0
| 2
| null | 2019-10-02T07:15:07
| 2017-10-28T17:12:47
|
Java
|
UTF-8
|
Java
| false
| false
| 324
|
java
|
package com.a2017002.optimustechproject.optimus_tech_project_2017002.Interface;
/**
* Created by satyam on 26/6/17.
*/
public interface StepListener {
/**
* Called when a step has been detected. Given the time in nanoseconds at
* which the step was detected.
*/
public void step(long timeNs);
}
|
[
"satyamg025@gmail.com"
] |
satyamg025@gmail.com
|
2721607a21cdc7e1e8b2f54418a2438063ebce49
|
a08f7c05703f5a589c24d07515a3582b1f98cfbd
|
/src/main/java/com/jky/verify/common/aspect/SignatureAspect.java
|
06e217c4622606ca39f606d489d0e041a4e6482c
|
[] |
no_license
|
youzhian/jky-verify
|
8b824cca6a71779668747f57a545f3ca685d369a
|
354a5905063dd3c06ce8fba521e396bdd6131a87
|
refs/heads/main
| 2023-08-25T11:33:22.135844
| 2021-09-30T01:27:39
| 2021-09-30T01:27:39
| 407,048,147
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 12,417
|
java
|
package com.jky.verify.common.aspect;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jky.verify.common.annotation.Signature;
import com.jky.verify.common.enums.StatusEnum;
import com.jky.verify.common.exception.VerifyErrorException;
import com.jky.verify.common.properties.AppSignProperties;
import com.jky.verify.common.util.AESUtil;
import com.jky.verify.common.util.Constant;
import com.jky.verify.common.util.DateUtils;
import com.jky.verify.common.util.SignatureUtil;
import com.jky.verify.modules.common.bean.SysAccount;
import com.jky.verify.modules.common.mapper.SysAccountMapper;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.*;
/**
* 签名注解的切面
* @author youzhian
*/
@Aspect
@Component
public class SignatureAspect {
@Resource
SysAccountMapper sysAccountMapper;
@Autowired
AppSignProperties appSignProperties;
/**
* 日志
*/
private static Logger logger = LoggerFactory.getLogger(SignatureAspect.class);
/**
* 切入点
*/
@Pointcut("@annotation(com.jky.verify.common.annotation.Signature)")
public void signaturePoint(){
}
/**
* 请求之前
* @param joinPoint
* @return
*/
@Before(value="signaturePoint() && @annotation(signature)")
public Object before(JoinPoint joinPoint, Signature signature){
//获取request对象
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//是否启用简单模式
boolean isSimple = signature.isSimple();
//从请求头中获取验签的必要参数
String appId = request.getHeader(Constant.APPID_KEY);
String nonce = request.getHeader(Constant.NONCE_KEY);
String timestamp = request.getHeader(Constant.TIMESTAMP_KEY);
String sign = request.getHeader(Constant.SIGN_KEY);
//开启简单模式
if(isSimple){
//验证签名
boolean verifyResult = verifySignBySimple(appId,sign);
if(!verifyResult){
throw new VerifyErrorException("签名验证不通过");
}
return null;
}
//要进行验签的map
Map<String,String> params = new HashMap<>();
params.put(Constant.APPID_KEY,appId);
params.put(Constant.NONCE_KEY,nonce);
params.put(Constant.TIMESTAMP_KEY,timestamp);
params.put(Constant.SIGN_KEY,sign);
//若开启非默认模式
if(!signature.isDefault()){
//验证签名
boolean verifyResult = verifySign(appId,params);
if(!verifyResult){
throw new VerifyErrorException("签名验证不通过");
}
return null;
}
//1.这里获取到所有的参数值的数组
Object[] args = joinPoint.getArgs();
org.aspectj.lang.Signature signature2 = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature2;
//要验证的字段
List<String> keys = Arrays.asList(signature.validFieldNames());
//需要校验的keys的前缀集合
Set<String> keysOver = getOverflow(keys);
//要排除验证的字段
List<String> excludes = Arrays.asList(signature.excludeFieldNames());
//非展开的对象
List<String> unSpread = Arrays.asList(signature.unSpread());
//要排除的前缀
Set<String> excludesOver = getOverflow(excludes);
//2.最关键的一步:通过这获取到方法的所有参数名称的字符串数组
String[] parameterNames = methodSignature.getParameterNames();
if(parameterNames != null){
for(int i=0;i<parameterNames.length;i++){
//参数名
String name = parameterNames[i];
//如果是自定要排除的字段
if(excludes.contains(name)){
continue;
}
//若指定了参与签名的key,则判断当前参数名是否在keys集合内
if(!keys.isEmpty() && !(keys.contains(name) || keysOver.contains(name))){
continue;
}
//参数值
Object value = args[i];
if(value != null){
String valueStr = null;
//如果是String类型
if(value instanceof String){
if(StringUtils.isNotBlank(String.valueOf(value))){
valueStr = String.valueOf(value);
}
}else if(value instanceof Date){
valueStr = DateUtils.format((Date)value,DateUtils.DATE_TIME_PATTERN);
}else if(isBaseType(value)){
valueStr = String.valueOf(value);
}else if(value.getClass().isArray()){
//若是数组
Object[] array = (Object[]) value;
valueStr = new JSONArray(Arrays.asList(array)).toJSONString();
}else {
JSONObject json = (JSONObject) JSONObject.toJSON(value);
if(!json.isEmpty()){
JSONObject json2 = new JSONObject();
for(String k : json.keySet()){
String qname = name + "." + k;
//若在排除的列表内
if(excludesOver.contains(name) && excludes.contains(qname)){
continue;
}
if(!keys.isEmpty() && !keys.contains(qname)){
continue;
}
if(json.get(k) == null || StringUtils.isBlank(json.getString(k))){
continue;
}
if(json.get(k) instanceof Date){
json.put(k, DateUtils.format(json.getDate(k),DateUtils.DATE_TIME_PATTERN));
}
//名字在非展开项时
if(unSpread.contains(name)){
json2.put(k,json.get(k));
}else{
if(json.get(k).getClass().isArray()){
json.put(k,json.getJSONArray(k).toJSONString());
}
params.put(k,json.getString(k));
}
}
if(!json2.isEmpty()){
valueStr = json2.toJSONString();
}
}
}
if(StringUtils.isNotBlank(valueStr)){
params.put(name,valueStr);
}
}
}
}
//验证签名
boolean veifyResult = verifySign(appId,params);
if(!veifyResult){
throw new VerifyErrorException("签名验证不通过");
}
return null;
}
/**
* 判断是否是基本数据类型
* @param value
* @return
*/
private boolean isBaseType(Object value){
if(value != null){
if(value instanceof Integer
|| value instanceof Long
|| value instanceof Double
|| value instanceof Float
|| value instanceof BigDecimal
|| value instanceof Character
|| value instanceof Boolean
|| value instanceof Short
|| value instanceof Byte){
return true;
}
}
return false;
}
/**
* 获取前缀的key
* @param keys
* @return
*/
public Set<String> getOverflow(List<String> keys){
Set<String> over = new HashSet<>();
if(keys != null && !keys.isEmpty()){
for(String key:keys){
if(StringUtils.isBlank(key)){
continue;
}
//如果存在.则认为是有对象的属性
if(key.indexOf(".") >-1){
String prefix = key.split(".")[0];
over.add(prefix);
}
}
}
return over;
}
/**
* 验证签名信息,通过返回true
*
* @param appId appId
* @param params 参与了签名加密的参数和sign,params中应该有appId、nonce、timestamp、sign
* @return 验证通过返回true
*/
public boolean verifySign(String appId, Map<String, String> params) {
if(StringUtils.isNotBlank(appId) && params != null && !params.isEmpty()){
if(!params.containsKey(Constant.APPID_KEY)
|| !params.containsKey(Constant.NONCE_KEY)
||!params.containsKey(Constant.TIMESTAMP_KEY) || !params.containsKey(Constant.SIGN_KEY)){
throw new VerifyErrorException("参数不正确,params中必须包含appId、nonce、timestamp、sign");
}
//根据appId查询相应的账号信息
SysAccount sysAccount = sysAccountMapper.selectOne(new QueryWrapper<SysAccount>().lambda()
.eq(SysAccount::getAppId,appId));
if(sysAccount == null){
throw new VerifyErrorException("账号不存在,appId["+appId+"]");
}else if(!StatusEnum.Available.getKey().equals(sysAccount.getStatus())){
throw new VerifyErrorException("当前账号不可用,appId["+appId+"]");
}
//验证签名
return SignatureUtil.verify(params, AESUtil.decrypt(sysAccount.getAppId(),sysAccount.getAppSecret()));
}
return false;
}
/**
* 简单模式验证签名,通过返回true
*
* @param appId appId
* @param sign 需验证的签名
* @return 验证通过返回true
*/
public boolean verifySignBySimple(String appId, String sign) {
if(StringUtils.isNotBlank(appId) && StringUtils.isNotBlank(sign)){
//直接从配置文件中读取,减少数据库查询
if(appSignProperties.getAppSigns() != null){
if(sign.equals(appSignProperties.getAppSigns().get(appId))){
return true;
}else if(appSignProperties.getAppSigns().containsKey(appId)){
return false;
}
}
//根据appId查询相应的账号信息
SysAccount sysAccount = sysAccountMapper.selectOne(new QueryWrapper<SysAccount>().lambda()
.eq(SysAccount::getAppId,appId));
if(sysAccount == null){
throw new VerifyErrorException("账号不存在,appId["+appId+"]");
}else if(!StatusEnum.Available.getKey().equals(sysAccount.getStatus())){
throw new VerifyErrorException("当前账号不可用,appId["+appId+"]");
}
Map<String,String> params = new HashMap<>();
params.put("appId",appId);
params.put("sign",sign);
//验证签名
return SignatureUtil.verify(params, AESUtil.decrypt(sysAccount.getAppId(),sysAccount.getAppSecret()));
}
return false;
}
}
|
[
"youzhian@aliyun.com"
] |
youzhian@aliyun.com
|
731d09636e43cd2f12870747864d357d9a3f1423
|
8559328d598f5088591cf53865760166a8df921e
|
/src/main/java/com/hdw/mccable/service/ZoneService.java
|
31f9157f4efc93924b979ee4ea424aebfab048f4
|
[] |
no_license
|
handywings/tutorial_hdw_mc
|
e8f67ac74e981cce0ad69b8e2bf9e5a6ad3cd161
|
a1dceae1b243b0c79dda5c73218e3a9ff84c259c
|
refs/heads/master
| 2021-04-09T10:39:57.959615
| 2018-04-03T04:58:27
| 2018-04-03T04:58:27
| 125,454,687
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 394
|
java
|
package com.hdw.mccable.service;
import java.util.List;
import com.hdw.mccable.entity.Zone;
public interface ZoneService {
public Zone getZoneById(Long id);
public List<Zone> findAll();
public void update(Zone zone) throws Exception;
public Long save(Zone zone) throws Exception;
public void delete(Zone zone) throws Exception;
public Zone getZoneByZoneDetail(String zoneDetail);
}
|
[
"tonpai.nait@gmail.com"
] |
tonpai.nait@gmail.com
|
56600e54f5c11b62aef2afbf79d3e4e253447f57
|
8078f03988a99620ba84912076de7a77f411bcf1
|
/supernova_project/src/test/java/supernova_project/WritedataintodatabaseTest.java
|
2829159b28c70adde3ffc27deed000e3b6379a94
|
[] |
no_license
|
gauravsrai/vtiger_practice_repo
|
e56e6b0a68269a3914d63ad36938827aa98e24b1
|
eaff1a5bb2485344bbb89c15fd491a00c778381c
|
refs/heads/main
| 2023-04-20T01:35:15.242953
| 2021-05-07T19:29:53
| 2021-05-07T19:29:53
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 985
|
java
|
package supernova_project;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import org.testng.annotations.Test;
import com.mysql.cj.jdbc.Driver;
public class WritedataintodatabaseTest
{
@Test
public void writeintodatabse() throws SQLException
{
Connection con =null;
try
{
Driver datadriver=new Driver();
DriverManager.registerDriver(datadriver);
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/customer", "root", "root");
Statement statement=con.createStatement();
int result=statement.executeUpdate("insert into customer values('puranjoy bose','kulabhusan bose','kolkata','kolkata',456987,'india')");
if(result==1)
{
System.out.println("success");
}
else
{
System.out.println("not success");
}
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
con.close();
System.out.println("connection closed");
}
}
}
|
[
"shraeyakbasu@LAPTOP-52IM29O2"
] |
shraeyakbasu@LAPTOP-52IM29O2
|
d2c2a33d5f39a5ec94379ca9b0f586c7de912f56
|
1ca18baa92f1a579285123554cb0e7673c5bda3f
|
/googlemap/app/src/test/java/com/bhagya/googlemap/ExampleUnitTest.java
|
2a931082b817b8bff5bf99d14049dc11ee5703cf
|
[] |
no_license
|
iamishan9/All-ExampleAndroid
|
10a298111d518c42f7776462c5abd18932925433
|
2363d816125f51d9289c4b51c06439d6f136734c
|
refs/heads/master
| 2021-06-18T05:31:33.604611
| 2017-06-27T10:22:58
| 2017-06-27T10:22:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 398
|
java
|
package com.bhagya.googlemap;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"bhagyasah4u@gmail.com"
] |
bhagyasah4u@gmail.com
|
51f27b71ec6d134e46ad575173bfb36b1fa778b2
|
47ba94b48c095fd0633f946f35f4b131a1da2e2e
|
/src/com/johnmarkese/se450/networksvc/shortestpath/Edge.java
|
2ba72422bdeb13ad8b14028b683f965a0d2c6a75
|
[] |
no_license
|
jmarkese/OOJava
|
6abd6416d2c908028175ab570da4421c8b1c14ac
|
2ed8e89d0dcdeec4fdb82d48ce8927ae6b9e687f
|
refs/heads/master
| 2020-12-25T14:57:42.027173
| 2016-09-02T02:14:50
| 2016-09-02T02:14:50
| 67,177,954
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 191
|
java
|
package com.johnmarkese.se450.networksvc.shortestpath;
public interface Edge {
public Vertex to();
public double getWeight();
public double getWeightModified();
public String getTo();
}
|
[
"john@Johns-MacBook-Pro.local"
] |
john@Johns-MacBook-Pro.local
|
15000b31c77a714e04fed52fdf3d311017fa7ad4
|
e26471561731d58aa2f38ec1921902e0692521eb
|
/src/main/java/datatypes/operators/Example5.java
|
cf8707f81c0dbcac7148f5bda1a0bb4c1d8d1884
|
[] |
no_license
|
PopoPenguin/java_book_source
|
69a31131ac5997226eaa3a589a66effbb36f6486
|
1557595670a43eeca45f1610d06d937d68c9f2c6
|
refs/heads/master
| 2021-08-08T06:55:29.367587
| 2017-11-09T20:07:51
| 2017-11-09T20:07:51
| 105,192,454
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 365
|
java
|
package main.java.datatypes.operators;
/*
Try This 2-1
Compute the distance to a lightening
strke whose sound takes 7.2 seconds
to reach you.
*/
class Sound {
public static void main(String args[]) {
double dist;
dist = 7.2 * 1100;
System.out.println("The lightening is " + dist +
" feet away.");
}
}
|
[
"radesmond@gmail.com"
] |
radesmond@gmail.com
|
7adc3c387b9e31dfddd10a73e47942911701cecf
|
3802210088dac1806aa21e3af212b5a00b01141f
|
/src/test/java/edu/cmu/cs/vbc/prog/prevayler/demos/jxpath/model/Project.java
|
72b165c9e287ea0327d52fa46f0ffa548d0515ff
|
[] |
no_license
|
chupanw/vbc
|
5618f8fd9fcfc4f9dda06826f925cddfb2d3191c
|
1221ef110e2b46951ab01319e97fa5d7dd84a724
|
refs/heads/master
| 2020-12-25T01:44:30.531879
| 2020-11-20T02:31:17
| 2020-11-20T02:31:17
| 50,115,858
| 5
| 1
| null | 2016-04-05T01:06:21
| 2016-01-21T15:17:05
|
Java
|
UTF-8
|
Java
| false
| false
| 2,158
|
java
|
/*
* Created on 24/08/2002
*
* Prevayler(TM) - The Open-Source Prevalence Layer.
* Copyright (C) 2001 Carlos Villela.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
package edu.cmu.cs.vbc.prog.prevayler.demos.jxpath.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Represents a simple software project.
*
* @author Carlos Villela
*/
public class Project
implements Serializable {
private int id;
private String name;
private List tasks;
/**
* Creates a new Project object.
*/
public Project() {
tasks = new ArrayList();
}
/**
* Returns the name.
* @return String
*/
public String getName() {
return name;
}
/**
* Returns the tasks.
* @return Task[]
*/
public List getTasks() {
return tasks;
}
/**
* Sets the name.
* @param name The name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* Sets the tasks.
* @param tasks The tasks to set
*/
public void setTasks(List tasks) {
this.tasks = tasks;
}
/**
* Returns the id.
* @return int
*/
public int getId() {
return id;
}
/**
* Sets the id.
* @param id The id to set
*/
public void setId(int id) {
this.id = id;
}
public String toString() {
return "Project Id: " + id
+ "\n Name: " + name
+ "\n Tasks:...\n" + tasks;
}
}
|
[
"chupanw@cs.cmu.edu"
] |
chupanw@cs.cmu.edu
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.