blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
44068968818f1da5476766f23aa0e632647fc69d
8c8b2c512c0bb2149a8c15b5968c57f83b028f1b
/TowerDefence/src/Block.java
df1c733a7af1516c318de6b7c9ac74a299ae1b35
[]
no_license
BetaQQ/TowerDefence
57b6e93e40b5cee462c89d0b1f2626cd509f056b
49230a7c3b7e1d6013e0164a3befbdb4f18b377a
refs/heads/master
2023-02-25T06:14:49.199640
2021-01-31T09:13:18
2021-01-31T09:13:18
334,612,813
0
0
null
null
null
null
UTF-8
Java
false
false
365
java
import java.awt.Image; import java.awt.Graphics; import java.awt.Rectangle; public class Block extends Rectangle{ // Constructor public Block(int x, int y, int width, int height){ super(x, y, width, height); } public void drawBlock(Graphics g, Image img){ g.drawImage(img, x, y, width, height, null); } }
[ "serhat.yokusoglu@tedu.edu.tr" ]
serhat.yokusoglu@tedu.edu.tr
68946c44d386d1c3c8cb60a452d5926cf583cdec
867a6a80536c6283f5a2ad865a66740e33300228
/src/test/java/com/basic1/basic/compareEntireJson/RunCompareJsonTest.java
b480c66e4dac0f54b37160951bf76d8046a87944
[]
no_license
namratac339/CuCuRestAssuredRepo
bdd7ecef8da418fbde68c5daf012a7db75772ebb
c69018af03ebf52dc61478ddb28ac54a9b1285ce
refs/heads/master
2020-05-19T05:38:02.829123
2019-05-05T04:43:35
2019-05-05T04:43:35
184,853,713
0
0
null
null
null
null
UTF-8
Java
false
false
461
java
package com.basic1.basic.compareEntireJson; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( plugin={"pretty", "html:target/cucumber-htmlreport", "json:target/cucumber-report105.json", "com.cucumber.listener.ExtentCucumberFormatter:target/ExtentReport1.html" } ) public class RunCompareJsonTest { }
[ "sujeet@Ved" ]
sujeet@Ved
84517831a484feeaa3af6a1363e32c2bb30ef536
bb5ad4935bdebf95d511a0b0a2089cdca35b5274
/Homework10/BinomialHeap/BinomialTreeNode.java
214244c642ef76a06790e034dd18b8e690539ce7
[]
no_license
Svilen-Stefanov/Algorithms-and-data-structures-course
a0151d56ac0afec6aa9785ca43b398c3ce566204
400b41cc64cb3c10b479e0fa3c9ed072db73cd64
refs/heads/master
2020-03-09T07:27:55.117757
2018-04-08T17:30:18
2018-04-08T17:30:18
128,665,210
0
0
null
null
null
null
UTF-8
Java
false
false
1,938
java
package com.svilenstefanov.blatt10.a6; import java.util.Arrays; import com.svilenstefanov.blatt7b.BinomiliaTest; /** * Homework 10 * @author Svilen Stefanov */ public class BinomialTreeNode<T extends Comparable<T>>{ private T root; private BinomialTreeNode<T>[] children; public BinomialTreeNode(T root){ this.root = root; children = new BinomialTreeNode[0]; } /** * Ermittelt das minimale Element im Teilbaum. * * @return das minimale Element */ public T min() { return (T)root; } /** * Gibt den Rang des Teilbaumes zurueck. * * @return der Rang des Teilbaumes */ public int rank() { return children.length; } /** * Gibt eine Menge von Teilbaeumen zurueck, in die der * aktuelle Baum zerfaellt, wenn man den Knoten des minimalen * Elements entfernt. * * @return die Menge von Teilbaeumen */ public BinomialTreeNode[] deleteMin() { return children; } public void siftUp(){ //TODO } /** * Diese Methode vereint zwei Baeume des gleichen Ranges. * * @param a der erste Baum * @param b der zweite Baum * @return denjenigen der beiden Baeume, an den der andere angehaengt wurde */ public BinomialTreeNode merge(BinomialTreeNode<T> a,BinomialTreeNode<T> b) { BinomialTreeNode[] newChildren; if (((Comparable<T>)a.min()).compareTo(b.min()) < 0) { newChildren = new BinomialTreeNode[b.children.length + 1]; for (int i = 0; i < b.children.length; i++) newChildren[i] = b.children[i]; newChildren[b.children.length] = a; b.children = newChildren; return b; } else { newChildren = new BinomialTreeNode[a.children.length + 1]; for (int i = 0; i < a.children.length; i++) newChildren[i] = a.children[i]; newChildren[a.children.length] = b; a.children = newChildren; return a; } } public void decreaseKey(T key){ this.root = key; siftUp(); } }
[ "svilen.ks@gmail.com" ]
svilen.ks@gmail.com
e0e638c924ebb5f368d770e7415a345857bbfa65
045d58477ba23f9c909e6c68bdf62c7bdbf5e346
/sdk/src/main/java/org/ovirt/engine/sdk/entities/DetailedLink.java
f7f4ec32d7f4832d83edd7e4a4af114f09eb2618
[ "Apache-2.0" ]
permissive
dennischen/ovirt-engine-sdk-java
091304a4a4b3008b68822e22c0a0fdafeaebdd6f
e9a42126e5001ec934d851ff0c8efea4bf6a436f
refs/heads/master
2021-01-14T12:58:20.224170
2015-06-23T11:22:10
2015-06-23T14:51:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,407
java
// // Copyright (c) 2012 Red Hat, Inc. // // 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. // // ********************************************************************* // ********************* GENERATED CODE - DO NOT MODIFY **************** // ********************************************************************* package org.ovirt.engine.sdk.entities; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for DetailedLink complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DetailedLink"> * &lt;complexContent> * &lt;extension base="{}Link"> * &lt;sequence> * &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element ref="{}request" minOccurs="0"/> * &lt;element ref="{}response" minOccurs="0"/> * &lt;element ref="{}linkCapabilities" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DetailedLink", propOrder = { "description", "request", "response", "linkCapabilities" }) @XmlSeeAlso({ GeneralMetadata.class }) public class DetailedLink extends Link { protected String description; protected Request request; protected Response response; protected LinkCapabilities linkCapabilities; /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } public boolean isSetDescription() { return (this.description!= null); } /** * Gets the value of the request property. * * @return * possible object is * {@link Request } * */ public Request getRequest() { return request; } /** * Sets the value of the request property. * * @param value * allowed object is * {@link Request } * */ public void setRequest(Request value) { this.request = value; } public boolean isSetRequest() { return (this.request!= null); } /** * Gets the value of the response property. * * @return * possible object is * {@link Response } * */ public Response getResponse() { return response; } /** * Sets the value of the response property. * * @param value * allowed object is * {@link Response } * */ public void setResponse(Response value) { this.response = value; } public boolean isSetResponse() { return (this.response!= null); } /** * Gets the value of the linkCapabilities property. * * @return * possible object is * {@link LinkCapabilities } * */ public LinkCapabilities getLinkCapabilities() { return linkCapabilities; } /** * Sets the value of the linkCapabilities property. * * @param value * allowed object is * {@link LinkCapabilities } * */ public void setLinkCapabilities(LinkCapabilities value) { this.linkCapabilities = value; } public boolean isSetLinkCapabilities() { return (this.linkCapabilities!= null); } }
[ "mpastern@redhat.com" ]
mpastern@redhat.com
49ea8a1343351dfd3c22119911bee0b120cdc95f
03a2e0a30587609397d2621e737ca93f1bf5977e
/src/org/nrnb/noa/settings/MFNodeAppearanceCalculator.java
14ca69e593897de2fb937b45ba8518cd38042489
[]
no_license
nrnb/gsoc2012chao
dc82cc803c88a67df4291dd06a96ca5c8ecb7832
51d50815e15e7759c1a11d2fc25ba0091cb31aa7
refs/heads/master
2016-09-15T19:03:51.562762
2015-03-17T00:06:30
2015-03-17T00:06:30
32,360,590
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
/******************************************************************************* * Copyright 2010 Alexander Pico * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package org.nrnb.noa.settings; import giny.model.Node; import cytoscape.CyNetwork; import cytoscape.visual.NodeAppearance; import cytoscape.visual.NodeAppearanceCalculator; public class MFNodeAppearanceCalculator extends NodeAppearanceCalculator { public static int FEATURE_NODE_WIDTH = 60; public static int FEATURE_NODE_HEIGHT = 30; public MFNodeAppearanceCalculator() { } public void calculateNodeAppearance(NodeAppearance appr, Node node, CyNetwork network) { super.calculateNodeAppearance(appr, node, network); } }
[ "apico@gladstone.ucsf.edu" ]
apico@gladstone.ucsf.edu
42fc541a3ebd9f2143243b08afb5ff4c9c34d62a
6d72b6be2d7d3df51ca3e18f0c8bbbd2e3c4c18b
/google-cloudevent-types/src/main/java/com/google/events/cloud/vmmigration/v1/UtilizationReport.java
1e0e59bcda9208e55a80100d46302f67e839de0e
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
googleapis/google-cloudevents-java
cbdbd218eb473f90ca9294b85bfe90e552654abe
2308afc7de22697122fa2c46ec73f2cf5145d5e5
refs/heads/main
2023-07-20T19:09:26.548860
2023-07-20T16:17:59
2023-07-20T16:17:59
273,051,100
14
8
Apache-2.0
2023-07-20T16:18:01
2020-06-17T18:33:37
Java
UTF-8
Java
false
false
97,750
java
/* * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/events/cloud/vmmigration/v1/data.proto package com.google.events.cloud.vmmigration.v1; /** * * * <pre> * Utilization report details the utilization (CPU, memory, etc.) of selected * source VMs. * </pre> * * Protobuf type {@code google.events.cloud.vmmigration.v1.UtilizationReport} */ public final class UtilizationReport extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.events.cloud.vmmigration.v1.UtilizationReport) UtilizationReportOrBuilder { private static final long serialVersionUID = 0L; // Use UtilizationReport.newBuilder() to construct. private UtilizationReport(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private UtilizationReport() { name_ = ""; displayName_ = ""; state_ = 0; timeFrame_ = 0; vms_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new UtilizationReport(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.events.cloud.vmmigration.v1.Data .internal_static_google_events_cloud_vmmigration_v1_UtilizationReport_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.events.cloud.vmmigration.v1.Data .internal_static_google_events_cloud_vmmigration_v1_UtilizationReport_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.events.cloud.vmmigration.v1.UtilizationReport.class, com.google.events.cloud.vmmigration.v1.UtilizationReport.Builder.class); } /** * * * <pre> * Utilization report state. * </pre> * * Protobuf enum {@code google.events.cloud.vmmigration.v1.UtilizationReport.State} */ public enum State implements com.google.protobuf.ProtocolMessageEnum { /** * * * <pre> * The state is unknown. This value is not in use. * </pre> * * <code>STATE_UNSPECIFIED = 0;</code> */ STATE_UNSPECIFIED(0), /** * * * <pre> * The report is in the making. * </pre> * * <code>CREATING = 1;</code> */ CREATING(1), /** * * * <pre> * Report creation completed successfully. * </pre> * * <code>SUCCEEDED = 2;</code> */ SUCCEEDED(2), /** * * * <pre> * Report creation failed. * </pre> * * <code>FAILED = 3;</code> */ FAILED(3), UNRECOGNIZED(-1), ; /** * * * <pre> * The state is unknown. This value is not in use. * </pre> * * <code>STATE_UNSPECIFIED = 0;</code> */ public static final int STATE_UNSPECIFIED_VALUE = 0; /** * * * <pre> * The report is in the making. * </pre> * * <code>CREATING = 1;</code> */ public static final int CREATING_VALUE = 1; /** * * * <pre> * Report creation completed successfully. * </pre> * * <code>SUCCEEDED = 2;</code> */ public static final int SUCCEEDED_VALUE = 2; /** * * * <pre> * Report creation failed. * </pre> * * <code>FAILED = 3;</code> */ public static final int FAILED_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static State valueOf(int value) { return forNumber(value); } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ public static State forNumber(int value) { switch (value) { case 0: return STATE_UNSPECIFIED; case 1: return CREATING; case 2: return SUCCEEDED; case 3: return FAILED; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<State> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap<State> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<State>() { public State findValueByNumber(int number) { return State.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalStateException( "Can't get the descriptor of an unrecognized enum value."); } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.events.cloud.vmmigration.v1.UtilizationReport.getDescriptor() .getEnumTypes() .get(0); } private static final State[] VALUES = values(); public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); } if (desc.getIndex() == -1) { return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } private final int value; private State(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:google.events.cloud.vmmigration.v1.UtilizationReport.State) } /** * * * <pre> * Report time frame options. * </pre> * * Protobuf enum {@code google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame} */ public enum TimeFrame implements com.google.protobuf.ProtocolMessageEnum { /** * * * <pre> * The time frame was not specified and will default to WEEK. * </pre> * * <code>TIME_FRAME_UNSPECIFIED = 0;</code> */ TIME_FRAME_UNSPECIFIED(0), /** * * * <pre> * One week. * </pre> * * <code>WEEK = 1;</code> */ WEEK(1), /** * * * <pre> * One month. * </pre> * * <code>MONTH = 2;</code> */ MONTH(2), /** * * * <pre> * One year. * </pre> * * <code>YEAR = 3;</code> */ YEAR(3), UNRECOGNIZED(-1), ; /** * * * <pre> * The time frame was not specified and will default to WEEK. * </pre> * * <code>TIME_FRAME_UNSPECIFIED = 0;</code> */ public static final int TIME_FRAME_UNSPECIFIED_VALUE = 0; /** * * * <pre> * One week. * </pre> * * <code>WEEK = 1;</code> */ public static final int WEEK_VALUE = 1; /** * * * <pre> * One month. * </pre> * * <code>MONTH = 2;</code> */ public static final int MONTH_VALUE = 2; /** * * * <pre> * One year. * </pre> * * <code>YEAR = 3;</code> */ public static final int YEAR_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static TimeFrame valueOf(int value) { return forNumber(value); } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ public static TimeFrame forNumber(int value) { switch (value) { case 0: return TIME_FRAME_UNSPECIFIED; case 1: return WEEK; case 2: return MONTH; case 3: return YEAR; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<TimeFrame> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap<TimeFrame> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<TimeFrame>() { public TimeFrame findValueByNumber(int number) { return TimeFrame.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalStateException( "Can't get the descriptor of an unrecognized enum value."); } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.events.cloud.vmmigration.v1.UtilizationReport.getDescriptor() .getEnumTypes() .get(1); } private static final TimeFrame[] VALUES = values(); public static TimeFrame valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); } if (desc.getIndex() == -1) { return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } private final int value; private TimeFrame(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame) } public static final int NAME_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object name_ = ""; /** * * * <pre> * Output only. The report unique name. * </pre> * * <code>string name = 1;</code> * * @return The name. */ @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * * * <pre> * Output only. The report unique name. * </pre> * * <code>string name = 1;</code> * * @return The bytes for name. */ @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DISPLAY_NAME_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object displayName_ = ""; /** * * * <pre> * The report display name, as assigned by the user. * </pre> * * <code>string display_name = 2;</code> * * @return The displayName. */ @java.lang.Override public java.lang.String getDisplayName() { java.lang.Object ref = displayName_; 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(); displayName_ = s; return s; } } /** * * * <pre> * The report display name, as assigned by the user. * </pre> * * <code>string display_name = 2;</code> * * @return The bytes for displayName. */ @java.lang.Override public com.google.protobuf.ByteString getDisplayNameBytes() { java.lang.Object ref = displayName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); displayName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int STATE_FIELD_NUMBER = 3; private int state_ = 0; /** * * * <pre> * Output only. Current state of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.State state = 3;</code> * * @return The enum numeric value on the wire for state. */ @java.lang.Override public int getStateValue() { return state_; } /** * * * <pre> * Output only. Current state of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.State state = 3;</code> * * @return The state. */ @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport.State getState() { com.google.events.cloud.vmmigration.v1.UtilizationReport.State result = com.google.events.cloud.vmmigration.v1.UtilizationReport.State.forNumber(state_); return result == null ? com.google.events.cloud.vmmigration.v1.UtilizationReport.State.UNRECOGNIZED : result; } public static final int STATE_TIME_FIELD_NUMBER = 4; private com.google.protobuf.Timestamp stateTime_; /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> * * @return Whether the stateTime field is set. */ @java.lang.Override public boolean hasStateTime() { return stateTime_ != null; } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> * * @return The stateTime. */ @java.lang.Override public com.google.protobuf.Timestamp getStateTime() { return stateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stateTime_; } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStateTimeOrBuilder() { return stateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stateTime_; } public static final int ERROR_FIELD_NUMBER = 5; private com.google.rpc.Status error_; /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> * * @return Whether the error field is set. */ @java.lang.Override public boolean hasError() { return error_ != null; } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> * * @return The error. */ @java.lang.Override public com.google.rpc.Status getError() { return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ @java.lang.Override public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; } public static final int CREATE_TIME_FIELD_NUMBER = 6; private com.google.protobuf.Timestamp createTime_; /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> * * @return Whether the createTime field is set. */ @java.lang.Override public boolean hasCreateTime() { return createTime_ != null; } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> * * @return The createTime. */ @java.lang.Override public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } public static final int TIME_FRAME_FIELD_NUMBER = 7; private int timeFrame_ = 0; /** * * * <pre> * Time frame of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7;</code> * * @return The enum numeric value on the wire for timeFrame. */ @java.lang.Override public int getTimeFrameValue() { return timeFrame_; } /** * * * <pre> * Time frame of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7;</code> * * @return The timeFrame. */ @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame getTimeFrame() { com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame result = com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame.forNumber(timeFrame_); return result == null ? com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame.UNRECOGNIZED : result; } public static final int FRAME_END_TIME_FIELD_NUMBER = 8; private com.google.protobuf.Timestamp frameEndTime_; /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> * * @return Whether the frameEndTime field is set. */ @java.lang.Override public boolean hasFrameEndTime() { return frameEndTime_ != null; } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> * * @return The frameEndTime. */ @java.lang.Override public com.google.protobuf.Timestamp getFrameEndTime() { return frameEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : frameEndTime_; } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getFrameEndTimeOrBuilder() { return frameEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : frameEndTime_; } public static final int VM_COUNT_FIELD_NUMBER = 9; private int vmCount_ = 0; /** * * * <pre> * Output only. Total number of VMs included in the report. * </pre> * * <code>int32 vm_count = 9;</code> * * @return The vmCount. */ @java.lang.Override public int getVmCount() { return vmCount_; } public static final int VMS_FIELD_NUMBER = 10; @SuppressWarnings("serial") private java.util.List<com.google.events.cloud.vmmigration.v1.VmUtilizationInfo> vms_; /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ @java.lang.Override public java.util.List<com.google.events.cloud.vmmigration.v1.VmUtilizationInfo> getVmsList() { return vms_; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ @java.lang.Override public java.util.List<? extends com.google.events.cloud.vmmigration.v1.VmUtilizationInfoOrBuilder> getVmsOrBuilderList() { return vms_; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ @java.lang.Override public int getVmsCount() { return vms_.size(); } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ @java.lang.Override public com.google.events.cloud.vmmigration.v1.VmUtilizationInfo getVms(int index) { return vms_.get(index); } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ @java.lang.Override public com.google.events.cloud.vmmigration.v1.VmUtilizationInfoOrBuilder getVmsOrBuilder( int index) { return vms_.get(index); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); } if (state_ != com.google.events.cloud.vmmigration.v1.UtilizationReport.State.STATE_UNSPECIFIED .getNumber()) { output.writeEnum(3, state_); } if (stateTime_ != null) { output.writeMessage(4, getStateTime()); } if (error_ != null) { output.writeMessage(5, getError()); } if (createTime_ != null) { output.writeMessage(6, getCreateTime()); } if (timeFrame_ != com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame.TIME_FRAME_UNSPECIFIED .getNumber()) { output.writeEnum(7, timeFrame_); } if (frameEndTime_ != null) { output.writeMessage(8, getFrameEndTime()); } if (vmCount_ != 0) { output.writeInt32(9, vmCount_); } for (int i = 0; i < vms_.size(); i++) { output.writeMessage(10, vms_.get(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); } if (state_ != com.google.events.cloud.vmmigration.v1.UtilizationReport.State.STATE_UNSPECIFIED .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); } if (stateTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStateTime()); } if (error_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getError()); } if (createTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); } if (timeFrame_ != com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame.TIME_FRAME_UNSPECIFIED .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, timeFrame_); } if (frameEndTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getFrameEndTime()); } if (vmCount_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, vmCount_); } for (int i = 0; i < vms_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, vms_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.events.cloud.vmmigration.v1.UtilizationReport)) { return super.equals(obj); } com.google.events.cloud.vmmigration.v1.UtilizationReport other = (com.google.events.cloud.vmmigration.v1.UtilizationReport) obj; if (!getName().equals(other.getName())) return false; if (!getDisplayName().equals(other.getDisplayName())) return false; if (state_ != other.state_) return false; if (hasStateTime() != other.hasStateTime()) return false; if (hasStateTime()) { if (!getStateTime().equals(other.getStateTime())) return false; } if (hasError() != other.hasError()) return false; if (hasError()) { if (!getError().equals(other.getError())) return false; } if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; } if (timeFrame_ != other.timeFrame_) return false; if (hasFrameEndTime() != other.hasFrameEndTime()) return false; if (hasFrameEndTime()) { if (!getFrameEndTime().equals(other.getFrameEndTime())) return false; } if (getVmCount() != other.getVmCount()) return false; if (!getVmsList().equals(other.getVmsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DISPLAY_NAME_FIELD_NUMBER; hash = (53 * hash) + getDisplayName().hashCode(); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; if (hasStateTime()) { hash = (37 * hash) + STATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getStateTime().hashCode(); } if (hasError()) { hash = (37 * hash) + ERROR_FIELD_NUMBER; hash = (53 * hash) + getError().hashCode(); } if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); } hash = (37 * hash) + TIME_FRAME_FIELD_NUMBER; hash = (53 * hash) + timeFrame_; if (hasFrameEndTime()) { hash = (37 * hash) + FRAME_END_TIME_FIELD_NUMBER; hash = (53 * hash) + getFrameEndTime().hashCode(); } hash = (37 * hash) + VM_COUNT_FIELD_NUMBER; hash = (53 * hash) + getVmCount(); if (getVmsCount() > 0) { hash = (37 * hash) + VMS_FIELD_NUMBER; hash = (53 * hash) + getVmsList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.events.cloud.vmmigration.v1.UtilizationReport prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * * <pre> * Utilization report details the utilization (CPU, memory, etc.) of selected * source VMs. * </pre> * * Protobuf type {@code google.events.cloud.vmmigration.v1.UtilizationReport} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.events.cloud.vmmigration.v1.UtilizationReport) com.google.events.cloud.vmmigration.v1.UtilizationReportOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.events.cloud.vmmigration.v1.Data .internal_static_google_events_cloud_vmmigration_v1_UtilizationReport_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.events.cloud.vmmigration.v1.Data .internal_static_google_events_cloud_vmmigration_v1_UtilizationReport_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.events.cloud.vmmigration.v1.UtilizationReport.class, com.google.events.cloud.vmmigration.v1.UtilizationReport.Builder.class); } // Construct using com.google.events.cloud.vmmigration.v1.UtilizationReport.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; name_ = ""; displayName_ = ""; state_ = 0; stateTime_ = null; if (stateTimeBuilder_ != null) { stateTimeBuilder_.dispose(); stateTimeBuilder_ = null; } error_ = null; if (errorBuilder_ != null) { errorBuilder_.dispose(); errorBuilder_ = null; } createTime_ = null; if (createTimeBuilder_ != null) { createTimeBuilder_.dispose(); createTimeBuilder_ = null; } timeFrame_ = 0; frameEndTime_ = null; if (frameEndTimeBuilder_ != null) { frameEndTimeBuilder_.dispose(); frameEndTimeBuilder_ = null; } vmCount_ = 0; if (vmsBuilder_ == null) { vms_ = java.util.Collections.emptyList(); } else { vms_ = null; vmsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000200); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.events.cloud.vmmigration.v1.Data .internal_static_google_events_cloud_vmmigration_v1_UtilizationReport_descriptor; } @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport getDefaultInstanceForType() { return com.google.events.cloud.vmmigration.v1.UtilizationReport.getDefaultInstance(); } @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport build() { com.google.events.cloud.vmmigration.v1.UtilizationReport result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport buildPartial() { com.google.events.cloud.vmmigration.v1.UtilizationReport result = new com.google.events.cloud.vmmigration.v1.UtilizationReport(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.events.cloud.vmmigration.v1.UtilizationReport result) { if (vmsBuilder_ == null) { if (((bitField0_ & 0x00000200) != 0)) { vms_ = java.util.Collections.unmodifiableList(vms_); bitField0_ = (bitField0_ & ~0x00000200); } result.vms_ = vms_; } else { result.vms_ = vmsBuilder_.build(); } } private void buildPartial0(com.google.events.cloud.vmmigration.v1.UtilizationReport result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.name_ = name_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.displayName_ = displayName_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.state_ = state_; } if (((from_bitField0_ & 0x00000008) != 0)) { result.stateTime_ = stateTimeBuilder_ == null ? stateTime_ : stateTimeBuilder_.build(); } if (((from_bitField0_ & 0x00000010) != 0)) { result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); } if (((from_bitField0_ & 0x00000020) != 0)) { result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); } if (((from_bitField0_ & 0x00000040) != 0)) { result.timeFrame_ = timeFrame_; } if (((from_bitField0_ & 0x00000080) != 0)) { result.frameEndTime_ = frameEndTimeBuilder_ == null ? frameEndTime_ : frameEndTimeBuilder_.build(); } if (((from_bitField0_ & 0x00000100) != 0)) { result.vmCount_ = vmCount_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.events.cloud.vmmigration.v1.UtilizationReport) { return mergeFrom((com.google.events.cloud.vmmigration.v1.UtilizationReport) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.events.cloud.vmmigration.v1.UtilizationReport other) { if (other == com.google.events.cloud.vmmigration.v1.UtilizationReport.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; bitField0_ |= 0x00000002; onChanged(); } if (other.state_ != 0) { setStateValue(other.getStateValue()); } if (other.hasStateTime()) { mergeStateTime(other.getStateTime()); } if (other.hasError()) { mergeError(other.getError()); } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } if (other.timeFrame_ != 0) { setTimeFrameValue(other.getTimeFrameValue()); } if (other.hasFrameEndTime()) { mergeFrameEndTime(other.getFrameEndTime()); } if (other.getVmCount() != 0) { setVmCount(other.getVmCount()); } if (vmsBuilder_ == null) { if (!other.vms_.isEmpty()) { if (vms_.isEmpty()) { vms_ = other.vms_; bitField0_ = (bitField0_ & ~0x00000200); } else { ensureVmsIsMutable(); vms_.addAll(other.vms_); } onChanged(); } } else { if (!other.vms_.isEmpty()) { if (vmsBuilder_.isEmpty()) { vmsBuilder_.dispose(); vmsBuilder_ = null; vms_ = other.vms_; bitField0_ = (bitField0_ & ~0x00000200); vmsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getVmsFieldBuilder() : null; } else { vmsBuilder_.addAllMessages(other.vms_); } } } this.mergeUnknownFields(other.getUnknownFields()); 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 { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { name_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { displayName_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 24: { state_ = input.readEnum(); bitField0_ |= 0x00000004; break; } // case 24 case 34: { input.readMessage(getStateTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000008; break; } // case 34 case 42: { input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000010; break; } // case 42 case 50: { input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000020; break; } // case 50 case 56: { timeFrame_ = input.readEnum(); bitField0_ |= 0x00000040; break; } // case 56 case 66: { input.readMessage(getFrameEndTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000080; break; } // case 66 case 72: { vmCount_ = input.readInt32(); bitField0_ |= 0x00000100; break; } // case 72 case 82: { com.google.events.cloud.vmmigration.v1.VmUtilizationInfo m = input.readMessage( com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.parser(), extensionRegistry); if (vmsBuilder_ == null) { ensureVmsIsMutable(); vms_.add(m); } else { vmsBuilder_.addMessage(m); } break; } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object name_ = ""; /** * * * <pre> * Output only. The report unique name. * </pre> * * <code>string name = 1;</code> * * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * * * <pre> * Output only. The report unique name. * </pre> * * <code>string name = 1;</code> * * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * * <pre> * Output only. The report unique name. * </pre> * * <code>string name = 1;</code> * * @param value The name to set. * @return This builder for chaining. */ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * * <pre> * Output only. The report unique name. * </pre> * * <code>string name = 1;</code> * * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * * <pre> * Output only. The report unique name. * </pre> * * <code>string name = 1;</code> * * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object displayName_ = ""; /** * * * <pre> * The report display name, as assigned by the user. * </pre> * * <code>string display_name = 2;</code> * * @return The displayName. */ public java.lang.String getDisplayName() { java.lang.Object ref = displayName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); displayName_ = s; return s; } else { return (java.lang.String) ref; } } /** * * * <pre> * The report display name, as assigned by the user. * </pre> * * <code>string display_name = 2;</code> * * @return The bytes for displayName. */ public com.google.protobuf.ByteString getDisplayNameBytes() { java.lang.Object ref = displayName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); displayName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * * <pre> * The report display name, as assigned by the user. * </pre> * * <code>string display_name = 2;</code> * * @param value The displayName to set. * @return This builder for chaining. */ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } displayName_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * * * <pre> * The report display name, as assigned by the user. * </pre> * * <code>string display_name = 2;</code> * * @return This builder for chaining. */ public Builder clearDisplayName() { displayName_ = getDefaultInstance().getDisplayName(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * * * <pre> * The report display name, as assigned by the user. * </pre> * * <code>string display_name = 2;</code> * * @param value The bytes for displayName to set. * @return This builder for chaining. */ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); displayName_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private int state_ = 0; /** * * * <pre> * Output only. Current state of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.State state = 3;</code> * * @return The enum numeric value on the wire for state. */ @java.lang.Override public int getStateValue() { return state_; } /** * * * <pre> * Output only. Current state of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.State state = 3;</code> * * @param value The enum numeric value on the wire for state to set. * @return This builder for chaining. */ public Builder setStateValue(int value) { state_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * * * <pre> * Output only. Current state of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.State state = 3;</code> * * @return The state. */ @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport.State getState() { com.google.events.cloud.vmmigration.v1.UtilizationReport.State result = com.google.events.cloud.vmmigration.v1.UtilizationReport.State.forNumber(state_); return result == null ? com.google.events.cloud.vmmigration.v1.UtilizationReport.State.UNRECOGNIZED : result; } /** * * * <pre> * Output only. Current state of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.State state = 3;</code> * * @param value The state to set. * @return This builder for chaining. */ public Builder setState(com.google.events.cloud.vmmigration.v1.UtilizationReport.State value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; state_ = value.getNumber(); onChanged(); return this; } /** * * * <pre> * Output only. Current state of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.State state = 3;</code> * * @return This builder for chaining. */ public Builder clearState() { bitField0_ = (bitField0_ & ~0x00000004); state_ = 0; onChanged(); return this; } private com.google.protobuf.Timestamp stateTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> stateTimeBuilder_; /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> * * @return Whether the stateTime field is set. */ public boolean hasStateTime() { return ((bitField0_ & 0x00000008) != 0); } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> * * @return The stateTime. */ public com.google.protobuf.Timestamp getStateTime() { if (stateTimeBuilder_ == null) { return stateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stateTime_; } else { return stateTimeBuilder_.getMessage(); } } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ public Builder setStateTime(com.google.protobuf.Timestamp value) { if (stateTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } stateTime_ = value; } else { stateTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ public Builder setStateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (stateTimeBuilder_ == null) { stateTime_ = builderForValue.build(); } else { stateTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ public Builder mergeStateTime(com.google.protobuf.Timestamp value) { if (stateTimeBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0) && stateTime_ != null && stateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getStateTimeBuilder().mergeFrom(value); } else { stateTime_ = value; } } else { stateTimeBuilder_.mergeFrom(value); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ public Builder clearStateTime() { bitField0_ = (bitField0_ & ~0x00000008); stateTime_ = null; if (stateTimeBuilder_ != null) { stateTimeBuilder_.dispose(); stateTimeBuilder_ = null; } onChanged(); return this; } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ public com.google.protobuf.Timestamp.Builder getStateTimeBuilder() { bitField0_ |= 0x00000008; onChanged(); return getStateTimeFieldBuilder().getBuilder(); } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ public com.google.protobuf.TimestampOrBuilder getStateTimeOrBuilder() { if (stateTimeBuilder_ != null) { return stateTimeBuilder_.getMessageOrBuilder(); } else { return stateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : stateTime_; } } /** * * * <pre> * Output only. The time the state was last set. * </pre> * * <code>.google.protobuf.Timestamp state_time = 4;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getStateTimeFieldBuilder() { if (stateTimeBuilder_ == null) { stateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getStateTime(), getParentForChildren(), isClean()); stateTime_ = null; } return stateTimeBuilder_; } private com.google.rpc.Status error_; private com.google.protobuf.SingleFieldBuilderV3< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> * * @return Whether the error field is set. */ public boolean hasError() { return ((bitField0_ & 0x00000010) != 0); } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> * * @return The error. */ public com.google.rpc.Status getError() { if (errorBuilder_ == null) { return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; } else { return errorBuilder_.getMessage(); } } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ public Builder setError(com.google.rpc.Status value) { if (errorBuilder_ == null) { if (value == null) { throw new NullPointerException(); } error_ = value; } else { errorBuilder_.setMessage(value); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ public Builder setError(com.google.rpc.Status.Builder builderForValue) { if (errorBuilder_ == null) { error_ = builderForValue.build(); } else { errorBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ public Builder mergeError(com.google.rpc.Status value) { if (errorBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0) && error_ != null && error_ != com.google.rpc.Status.getDefaultInstance()) { getErrorBuilder().mergeFrom(value); } else { error_ = value; } } else { errorBuilder_.mergeFrom(value); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ public Builder clearError() { bitField0_ = (bitField0_ & ~0x00000010); error_ = null; if (errorBuilder_ != null) { errorBuilder_.dispose(); errorBuilder_ = null; } onChanged(); return this; } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ public com.google.rpc.Status.Builder getErrorBuilder() { bitField0_ |= 0x00000010; onChanged(); return getErrorFieldBuilder().getBuilder(); } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { if (errorBuilder_ != null) { return errorBuilder_.getMessageOrBuilder(); } else { return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; } } /** * * * <pre> * Output only. Provides details on the state of the report in case of an * error. * </pre> * * <code>.google.rpc.Status error = 5;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> getErrorFieldBuilder() { if (errorBuilder_ == null) { errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); error_ = null; } return errorBuilder_; } private com.google.protobuf.Timestamp createTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> * * @return Whether the createTime field is set. */ public boolean hasCreateTime() { return ((bitField0_ & 0x00000020) != 0); } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> * * @return The createTime. */ public com.google.protobuf.Timestamp getCreateTime() { if (createTimeBuilder_ == null) { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } else { return createTimeBuilder_.getMessage(); } } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public Builder setCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } createTime_ = value; } else { createTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000020; onChanged(); return this; } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { createTime_ = builderForValue.build(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000020; onChanged(); return this; } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { if (((bitField0_ & 0x00000020) != 0) && createTime_ != null && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } } else { createTimeBuilder_.mergeFrom(value); } bitField0_ |= 0x00000020; onChanged(); return this; } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public Builder clearCreateTime() { bitField0_ = (bitField0_ & ~0x00000020); createTime_ = null; if (createTimeBuilder_ != null) { createTimeBuilder_.dispose(); createTimeBuilder_ = null; } onChanged(); return this; } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { bitField0_ |= 0x00000020; onChanged(); return getCreateTimeFieldBuilder().getBuilder(); } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { if (createTimeBuilder_ != null) { return createTimeBuilder_.getMessageOrBuilder(); } else { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } } /** * * * <pre> * Output only. The time the report was created (this refers to the time of * the request, not the time the report creation completed). * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getCreateTimeFieldBuilder() { if (createTimeBuilder_ == null) { createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getCreateTime(), getParentForChildren(), isClean()); createTime_ = null; } return createTimeBuilder_; } private int timeFrame_ = 0; /** * * * <pre> * Time frame of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7;</code> * * @return The enum numeric value on the wire for timeFrame. */ @java.lang.Override public int getTimeFrameValue() { return timeFrame_; } /** * * * <pre> * Time frame of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7;</code> * * @param value The enum numeric value on the wire for timeFrame to set. * @return This builder for chaining. */ public Builder setTimeFrameValue(int value) { timeFrame_ = value; bitField0_ |= 0x00000040; onChanged(); return this; } /** * * * <pre> * Time frame of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7;</code> * * @return The timeFrame. */ @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame getTimeFrame() { com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame result = com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame.forNumber(timeFrame_); return result == null ? com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame.UNRECOGNIZED : result; } /** * * * <pre> * Time frame of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7;</code> * * @param value The timeFrame to set. * @return This builder for chaining. */ public Builder setTimeFrame( com.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000040; timeFrame_ = value.getNumber(); onChanged(); return this; } /** * * * <pre> * Time frame of the report. * </pre> * * <code>.google.events.cloud.vmmigration.v1.UtilizationReport.TimeFrame time_frame = 7;</code> * * @return This builder for chaining. */ public Builder clearTimeFrame() { bitField0_ = (bitField0_ & ~0x00000040); timeFrame_ = 0; onChanged(); return this; } private com.google.protobuf.Timestamp frameEndTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> frameEndTimeBuilder_; /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> * * @return Whether the frameEndTime field is set. */ public boolean hasFrameEndTime() { return ((bitField0_ & 0x00000080) != 0); } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> * * @return The frameEndTime. */ public com.google.protobuf.Timestamp getFrameEndTime() { if (frameEndTimeBuilder_ == null) { return frameEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : frameEndTime_; } else { return frameEndTimeBuilder_.getMessage(); } } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ public Builder setFrameEndTime(com.google.protobuf.Timestamp value) { if (frameEndTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } frameEndTime_ = value; } else { frameEndTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000080; onChanged(); return this; } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ public Builder setFrameEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (frameEndTimeBuilder_ == null) { frameEndTime_ = builderForValue.build(); } else { frameEndTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000080; onChanged(); return this; } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ public Builder mergeFrameEndTime(com.google.protobuf.Timestamp value) { if (frameEndTimeBuilder_ == null) { if (((bitField0_ & 0x00000080) != 0) && frameEndTime_ != null && frameEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getFrameEndTimeBuilder().mergeFrom(value); } else { frameEndTime_ = value; } } else { frameEndTimeBuilder_.mergeFrom(value); } bitField0_ |= 0x00000080; onChanged(); return this; } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ public Builder clearFrameEndTime() { bitField0_ = (bitField0_ & ~0x00000080); frameEndTime_ = null; if (frameEndTimeBuilder_ != null) { frameEndTimeBuilder_.dispose(); frameEndTimeBuilder_ = null; } onChanged(); return this; } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ public com.google.protobuf.Timestamp.Builder getFrameEndTimeBuilder() { bitField0_ |= 0x00000080; onChanged(); return getFrameEndTimeFieldBuilder().getBuilder(); } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ public com.google.protobuf.TimestampOrBuilder getFrameEndTimeOrBuilder() { if (frameEndTimeBuilder_ != null) { return frameEndTimeBuilder_.getMessageOrBuilder(); } else { return frameEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : frameEndTime_; } } /** * * * <pre> * Output only. The point in time when the time frame ends. Notice that the * time frame is counted backwards. For instance if the "frame_end_time" value * is 2021/01/20 and the time frame is WEEK then the report covers the week * between 2021/01/20 and 2021/01/14. * </pre> * * <code>.google.protobuf.Timestamp frame_end_time = 8;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getFrameEndTimeFieldBuilder() { if (frameEndTimeBuilder_ == null) { frameEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getFrameEndTime(), getParentForChildren(), isClean()); frameEndTime_ = null; } return frameEndTimeBuilder_; } private int vmCount_; /** * * * <pre> * Output only. Total number of VMs included in the report. * </pre> * * <code>int32 vm_count = 9;</code> * * @return The vmCount. */ @java.lang.Override public int getVmCount() { return vmCount_; } /** * * * <pre> * Output only. Total number of VMs included in the report. * </pre> * * <code>int32 vm_count = 9;</code> * * @param value The vmCount to set. * @return This builder for chaining. */ public Builder setVmCount(int value) { vmCount_ = value; bitField0_ |= 0x00000100; onChanged(); return this; } /** * * * <pre> * Output only. Total number of VMs included in the report. * </pre> * * <code>int32 vm_count = 9;</code> * * @return This builder for chaining. */ public Builder clearVmCount() { bitField0_ = (bitField0_ & ~0x00000100); vmCount_ = 0; onChanged(); return this; } private java.util.List<com.google.events.cloud.vmmigration.v1.VmUtilizationInfo> vms_ = java.util.Collections.emptyList(); private void ensureVmsIsMutable() { if (!((bitField0_ & 0x00000200) != 0)) { vms_ = new java.util.ArrayList<com.google.events.cloud.vmmigration.v1.VmUtilizationInfo>(vms_); bitField0_ |= 0x00000200; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.events.cloud.vmmigration.v1.VmUtilizationInfo, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder, com.google.events.cloud.vmmigration.v1.VmUtilizationInfoOrBuilder> vmsBuilder_; /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public java.util.List<com.google.events.cloud.vmmigration.v1.VmUtilizationInfo> getVmsList() { if (vmsBuilder_ == null) { return java.util.Collections.unmodifiableList(vms_); } else { return vmsBuilder_.getMessageList(); } } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public int getVmsCount() { if (vmsBuilder_ == null) { return vms_.size(); } else { return vmsBuilder_.getCount(); } } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public com.google.events.cloud.vmmigration.v1.VmUtilizationInfo getVms(int index) { if (vmsBuilder_ == null) { return vms_.get(index); } else { return vmsBuilder_.getMessage(index); } } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder setVms( int index, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo value) { if (vmsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureVmsIsMutable(); vms_.set(index, value); onChanged(); } else { vmsBuilder_.setMessage(index, value); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder setVms( int index, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder builderForValue) { if (vmsBuilder_ == null) { ensureVmsIsMutable(); vms_.set(index, builderForValue.build()); onChanged(); } else { vmsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder addVms(com.google.events.cloud.vmmigration.v1.VmUtilizationInfo value) { if (vmsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureVmsIsMutable(); vms_.add(value); onChanged(); } else { vmsBuilder_.addMessage(value); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder addVms( int index, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo value) { if (vmsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureVmsIsMutable(); vms_.add(index, value); onChanged(); } else { vmsBuilder_.addMessage(index, value); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder addVms( com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder builderForValue) { if (vmsBuilder_ == null) { ensureVmsIsMutable(); vms_.add(builderForValue.build()); onChanged(); } else { vmsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder addVms( int index, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder builderForValue) { if (vmsBuilder_ == null) { ensureVmsIsMutable(); vms_.add(index, builderForValue.build()); onChanged(); } else { vmsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder addAllVms( java.lang.Iterable<? extends com.google.events.cloud.vmmigration.v1.VmUtilizationInfo> values) { if (vmsBuilder_ == null) { ensureVmsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vms_); onChanged(); } else { vmsBuilder_.addAllMessages(values); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder clearVms() { if (vmsBuilder_ == null) { vms_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000200); onChanged(); } else { vmsBuilder_.clear(); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public Builder removeVms(int index) { if (vmsBuilder_ == null) { ensureVmsIsMutable(); vms_.remove(index); onChanged(); } else { vmsBuilder_.remove(index); } return this; } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder getVmsBuilder( int index) { return getVmsFieldBuilder().getBuilder(index); } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public com.google.events.cloud.vmmigration.v1.VmUtilizationInfoOrBuilder getVmsOrBuilder( int index) { if (vmsBuilder_ == null) { return vms_.get(index); } else { return vmsBuilder_.getMessageOrBuilder(index); } } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public java.util.List< ? extends com.google.events.cloud.vmmigration.v1.VmUtilizationInfoOrBuilder> getVmsOrBuilderList() { if (vmsBuilder_ != null) { return vmsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(vms_); } } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder addVmsBuilder() { return getVmsFieldBuilder() .addBuilder( com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.getDefaultInstance()); } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder addVmsBuilder( int index) { return getVmsFieldBuilder() .addBuilder( index, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.getDefaultInstance()); } /** * * * <pre> * List of utilization information per VM. * When sent as part of the request, the "vm_id" field is used in order to * specify which VMs to include in the report. In that case all other fields * are ignored. * </pre> * * <code>repeated .google.events.cloud.vmmigration.v1.VmUtilizationInfo vms = 10;</code> */ public java.util.List<com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder> getVmsBuilderList() { return getVmsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.events.cloud.vmmigration.v1.VmUtilizationInfo, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder, com.google.events.cloud.vmmigration.v1.VmUtilizationInfoOrBuilder> getVmsFieldBuilder() { if (vmsBuilder_ == null) { vmsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.events.cloud.vmmigration.v1.VmUtilizationInfo, com.google.events.cloud.vmmigration.v1.VmUtilizationInfo.Builder, com.google.events.cloud.vmmigration.v1.VmUtilizationInfoOrBuilder>( vms_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); vms_ = null; } return vmsBuilder_; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.events.cloud.vmmigration.v1.UtilizationReport) } // @@protoc_insertion_point(class_scope:google.events.cloud.vmmigration.v1.UtilizationReport) private static final com.google.events.cloud.vmmigration.v1.UtilizationReport DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.events.cloud.vmmigration.v1.UtilizationReport(); } public static com.google.events.cloud.vmmigration.v1.UtilizationReport getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<UtilizationReport> PARSER = new com.google.protobuf.AbstractParser<UtilizationReport>() { @java.lang.Override public UtilizationReport parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<UtilizationReport> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<UtilizationReport> getParserForType() { return PARSER; } @java.lang.Override public com.google.events.cloud.vmmigration.v1.UtilizationReport getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "noreply@github.com" ]
noreply@github.com
301762394f9242de2c29fc469fec38b08da02276
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project84/src/test/java/org/gradle/test/performance84_2/Test84_139.java
2a847b5203d4f8bbde4e541650c8d0d1223cf9ed
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
292
java
package org.gradle.test.performance84_2; import static org.junit.Assert.*; public class Test84_139 { private final Production84_139 production = new Production84_139("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
b0a70ed4861d47e3b33bea34d42ef3a50342233d
05814a95b94d66f1c5e19d088b5c8ca7ba972c4e
/MTA2/src/MovieTestDrive.java
ae08d63dab7c8bb39a242e6d6fa7078ab9c64694
[]
no_license
Dannylost/Ejercicios
08037c28f9b2bcd39ccf7fab6ff3da1e8bf82b1f
9bc7bd0113e1c92b2a90c9b6226c3a55cc95883b
refs/heads/master
2021-01-22T07:10:30.650117
2012-07-12T10:22:13
2012-07-12T10:22:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
461
java
public class MovieTestDrive { public static void main(String[] args) { Movie one = new Movie(); one.title = "Gone with the stock"; one.genere = "Tragic"; one.rating = -2; Movie two = new Movie(); two.title = "Lost in the Cibicle Space"; two.genere = "Comedy"; two.rating = 5; two.playIt(); Movie three = new Movie(); three.title = "Byte club"; three.genere = "Tragic but ultimately uplifting"; three.rating = 127; } }
[ "dannylost_13@hotmail.com" ]
dannylost_13@hotmail.com
4367d54ff12ae3dc2c7c91663148baadc03eb8af
ff4c7126d9b77d3e1b6e6e45a2565d44ba39bf12
/mobile/src/main/java/service/ManualLoggingService.java
d372c6888dfce265b68fbecfc8c5e757edd4af74
[ "Apache-2.0" ]
permissive
flowolf86/OnTheJob
22ad6fc8420dd98ccc29e46c8638e80af6d8b0bf
866b9a216b91ee9b1ebc5f157cd9f4f057574289
refs/heads/master
2021-01-10T11:41:46.721175
2015-12-21T14:24:39
2015-12-21T14:24:39
46,287,608
0
0
null
null
null
null
UTF-8
Java
false
false
2,456
java
package service; import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.IBinder; import android.support.annotation.Nullable; import com.florianwolf.onthejob.R; import cache.DataCacheHelper; import data.WorkBlock; import data.WorkEntry; import data.factory.WorkEntryFactory; import data.helper.WorkItemHelper; import static listing.ManualLoggingState.IManualLoggingState; import static listing.ManualLoggingState.STARTED; import static listing.ManualLoggingState.STOPPED; /** * Author: Florian Wolf * Email: flowolf86@gmail.com * on 15/12/15. */ public class ManualLoggingService extends Service { @IManualLoggingState static int mStatus = STOPPED; private static long loggingStartedAt = 0L; private final IBinder mBinder = new LocalBinder(); @Nullable @Override public IBinder onBind(Intent intent) { return mBinder; } public class LocalBinder extends Binder { public ManualLoggingService getService() { return ManualLoggingService.this; } } public @IManualLoggingState int getStatus(){ return mStatus; } public long getLoggingStartedAt(){ return loggingStartedAt; } public long getTimeBetweenStartOfLoggingAndNow(){ return System.currentTimeMillis() - loggingStartedAt; } public synchronized void startLogging(){ loggingStartedAt = System.currentTimeMillis(); mStatus = STARTED; } public synchronized void stopLoggingAndStoreEntry(){ DataCacheHelper dataCacheHelper = new DataCacheHelper(getApplicationContext()); WorkEntry workEntry = dataCacheHelper.getWorkEntryForTimestampDay(loggingStartedAt); if(workEntry == null){ workEntry = WorkEntryFactory.buildNewEmptyManualWorkEntry(); workEntry.setDate(loggingStartedAt); workEntry.setTitle(getString(R.string.manual_widget_entry_title)); } WorkBlock workBlock = WorkItemHelper.generateManuallyStartStoppedWorkBlock(workEntry, loggingStartedAt, loggingStartedAt + (System.currentTimeMillis() - loggingStartedAt), getApplicationContext()); workEntry.addWorkBlock(workBlock); dataCacheHelper.addNewEntry(workEntry, null); loggingStartedAt = 0L; mStatus = STOPPED; } public synchronized void stopLogging(){ loggingStartedAt = 0L; mStatus = STOPPED; } }
[ "florian.wolf@maibornwolff.de" ]
florian.wolf@maibornwolff.de
d3ea77df5b6d9b34e2caf2a88a28071a352116dc
0d320180c0b7d05bad581ea2fd4edbd37b4d8322
/src/me/legofreak107/rollercoaster/objects/Receiver.java
bb8b8db033a3a0e364772e817aa27f768f0094a9
[]
no_license
GustaveHooghmoed/RollercoasterClean
94ae57ba09c1a502e0636222aff2cb03b700c20e
10ff6b30a1ed27d90d412e94b051b0a44becbf56
refs/heads/master
2020-03-12T01:50:08.707189
2018-04-20T16:16:11
2018-04-20T16:16:11
130,385,652
2
0
null
null
null
null
UTF-8
Java
false
false
192
java
package me.legofreak107.rollercoaster.objects; import org.bukkit.Location; public class Receiver { public Integer id; public Location loc; public String name; public Boolean active; }
[ "bart.kouwenberg@hotmail.com" ]
bart.kouwenberg@hotmail.com
2157093bb9d074dab86b22f402524f8c03abf5ac
ab59a443936b130512bf268d70a4024eb905e26f
/base-client/src/main/java/com/cyc/baseclient/datatype/AbstractTimeInterval.java
b40240183b869b66437ac528bc4ffe1682084f24
[ "Apache-2.0" ]
permissive
nwinant/api-clients
3b8e3e956562e8284e57ff04aa1ef16fc304591e
a890afc35f5c72e607c671a226abb19e697d7615
refs/heads/master
2021-05-21T03:07:15.044237
2018-01-17T19:12:47
2018-01-17T19:12:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,566
java
package com.cyc.baseclient.datatype; /* * #%L * File: AbstractTimeInterval.java * Project: Base Client * %% * Copyright (C) 2013 - 2018 Cycorp, Inc. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import com.cyc.baseclient.datatype.ContinuousTimeInterval; import java.util.Date; /** * Implementation of high-level time interval methods. * @author baxter */ public abstract class AbstractTimeInterval implements TimeInterval { /** * Do this interval and the specified interval start simultaneously? * * @param interval * @return true iff this interval and the specified interval start * simultaneously. */ public boolean cooriginatesWith(AbstractTimeInterval interval) { return !startsBeforeStartingOf(interval) && !startsAfterStartingOf(interval); } /** * Do this interval and the specified interval end simultaneously? * * @param interval * @return true iff this interval and the specified interval end * simultaneously. */ public boolean coterminatesWith(AbstractTimeInterval interval) { return !endsBeforeEndingOf(interval) && !endsAfterEndingOf(interval); } /** * Does this interval end after the specified date? * * @param date * @return true iff this interval ends after date. */ public boolean endsAfter(Date date) { return getEnd().after(date); } /** * Does this interval end after the specified interval ends? * * @param interval * @return true iff this interval ends after the specified interval ends. */ public boolean endsAfterEndingOf(AbstractTimeInterval interval) { return endsAfter(interval.getEnd()) || (endsOn(interval.getEnd()) && !interval.getIncludesEnd()); } /** * Does this interval end after the specified interval starts? * * @param interval * @return true iff this interval ends after the specified interval starts. */ public boolean endsAfterStartingOf(AbstractTimeInterval interval) { return endsAfter(interval.getStart()); } /** * Does this interval end before the specified date? * * @param date * @return true iff this interval ends before date. */ public boolean endsBefore(Date date) { return !endsAfter(date) && !endsOn(date); } /** * Does this interval end before the specified interval ends? * * @param interval * @return true iff this interval ends before the specified interval ends. */ public boolean endsBeforeEndingOf(AbstractTimeInterval interval) { if (this.getEnd().before(interval.getEnd())) { return true; } else if (this.getEnd().equals(interval.getEnd())) { return !this.getIncludesEnd() && interval.getIncludesEnd(); } else { return false; } } /** * Does this interval end before the specified interval starts? * * @param interval * @return true iff this interval ends before the specified interval starts. */ public boolean endsBeforeStartingOf(AbstractTimeInterval interval) { return endsBefore(interval.getStart()) || (endsOn(interval.getStart()) && !this.getIncludesEnd()); } /** * Does this interval end during the specified interval? * * @param interval * @return true iff this interval's end is subsumed by interval. */ public boolean endsDuring(AbstractTimeInterval interval) { return interval.subsumes(getEnd()) || coterminatesWith(interval); } /** * Does this interval end on the specified date? * * @param date * @return true iff this interval ends on date. */ public boolean endsOn(Date date) { return getEnd().equals(date) && getIncludesEnd(); } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ContinuousTimeInterval other = (ContinuousTimeInterval) obj; return this.cooriginatesWith(other) && this.coterminatesWith(other); } /** * Does this interval start after the specified date? * * @param date * @return true iff this interval starts after date. */ public boolean startsAfter(Date date) { return !startsBefore(date) && !startsOn(date); } /** * Does this interval start after the specified interval ends? * * @param interval * @return true iff this interval starts after the specified interval ends. */ public boolean startsAfterEndingOf(AbstractTimeInterval interval) { return startsAfter(interval.getEnd()) || (startsOn(interval.getEnd()) && !interval.getIncludesEnd()); } /** * Does this interval start after the specified interval starts? * * @param interval * @return true iff this interval starts after the specified interval starts. */ public boolean startsAfterStartingOf(AbstractTimeInterval interval) { if (this.getStart().after(interval.getStart())) { return true; } else if (this.getStart().equals(interval.getStart())) { return !this.getIncludesStart() && interval.getIncludesStart(); } else { return false; } } /** * Does this interval start before the specified date? * * @param date * @return true iff this interval starts before date. */ public boolean startsBefore(Date date) { return getStart().before(date); } /** * Does this interval start before the specified interval ends? * * @param interval * @return true iff this interval starts before the specified interval ends. */ public boolean startsBeforeEndingOf(AbstractTimeInterval interval) { return startsBefore(interval.getEnd()); } /** * Does this interval start before the specified interval starts? * * @param interval * @return true iff this interval starts before the specified interval starts. */ public boolean startsBeforeStartingOf(AbstractTimeInterval interval) { return startsBefore(interval.getStart()) || (startsOn(interval.getStart()) && !interval.getIncludesStart()); } /** * Does this interval start during the specified interval? * * @param interval * @return true iff this interval's start is subsumed by interval. */ public boolean startsDuring(AbstractTimeInterval interval) { return interval.subsumes(getStart()) || cooriginatesWith(interval); } /** * Does this interval start on the specified date? * * @param date * @return true iff this interval starts on date. */ public boolean startsOn(Date date) { return getStart().equals(date) && getIncludesStart(); } /** * Does this interval subsume the specified date? * * @param date * @return true iff date falls within this interval. */ public boolean subsumes(Date date) { return !startsAfter(date) && !endsBefore(date); } /** * Does this interval subsume the specified interval? * * @param interval * @return true iff interval starts and ends during this interval. */ public boolean subsumes(AbstractTimeInterval interval) { return interval.startsDuring(this) && interval.endsDuring(this); } }
[ "nw@exegetic.net" ]
nw@exegetic.net
074a3d4993691a6a5ceb90e592ae5f49e3e61ece
1a9086944399c374672a87b3da13ccc088452f7a
/cengle_generate/src/com/cg/service/RoleService.java
69859b909cdc19d56c6fb6c840396c15858db58c
[]
no_license
wy243808263/Spring-action
115761a20b105a528c5adc81339161ae86417519
3eb2f5f6c3e3556a1dcb6ea86d8f5fb2f0d03d0d
refs/heads/master
2021-01-01T04:27:58.310629
2017-07-14T01:11:33
2017-07-14T01:11:33
97,178,680
1
0
null
null
null
null
UTF-8
Java
false
false
171
java
package com.cg.service; import com.base.service.BaseService; /** * * <br> * <b>功能:</b>RoleService<br> */ public interface RoleService extends BaseService { }
[ "wangyongh49@163.com" ]
wangyongh49@163.com
aebadbee8044cbe32024ee134c3f554eb198d77f
956ab6b48e41b53499b80b1fe1d5b586ee1e5ad5
/src/main/java/com/demo/rsademo/consts/SessionKeyType.java
b202e388eb097c9b66a54556bb30403830096089
[]
no_license
ZengYuming/rsa-demo
c8efcb0fc827f05cdc1f55880a455c956e9767b0
dc569314ab5b92a62c1f71da9208a967f3c45502
refs/heads/master
2020-04-11T02:33:02.838307
2019-01-04T03:44:28
2019-01-04T03:44:28
161,448,072
0
0
null
null
null
null
UTF-8
Java
false
false
292
java
package com.demo.rsademo.consts; /** * Session key */ public class SessionKeyType { /** * 服公钥(base64字符串) */ public static String PUBLIC_KEY = "PUBLIC_KEY"; /** * 私钥(base64字符串) */ public static String PRIVATE_KEY = "PRIVATE_KEY"; }
[ "605975553@qq.com" ]
605975553@qq.com
7e4df9f74db52a879214d4a2a80773b521ef5fb5
bb4c542c3dd730ab7a3a2e7591dd0b1647831912
/src/main/java/com/weather/model/Forecast.java
bce71f59df416d5a1ec330a71d480ef1fbc4318f
[]
no_license
satishjs2297/standalone-weather-api
23df8fb295d7cf2ffd69ba93cec77a40b9c12187
93aa1b0cc926fcfd118ae2d412f7b162e1f1a0b3
refs/heads/master
2022-09-23T21:34:03.997778
2020-06-05T15:10:56
2020-06-05T15:10:56
268,862,814
0
0
null
null
null
null
UTF-8
Java
false
false
1,057
java
package com.weather.model; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import java.util.ArrayList; import java.util.List; import java.util.Objects; @JsonIgnoreProperties(ignoreUnknown = true) public class Forecast { @JsonProperty("periods") private List<Period> periodList = new ArrayList<>(); public List<Period> getPeriodList() { return periodList; } public void setPeriodList(List<Period> periodList) { this.periodList = periodList; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Forecast forecast = (Forecast) o; return Objects.equals(periodList, forecast.periodList); } @Override public int hashCode() { return Objects.hash(periodList); } @Override public String toString() { return "Forecast{" + "periodList=" + periodList + '}'; } }
[ "satishjs2297@gmail.com" ]
satishjs2297@gmail.com
17ea6b069e5bd6bbace3c9680a5b178dfbe85a8d
b5315139049b3201091a3fa66c68b5ee61446d42
/app/src/test/java/com/example/ichanghyeon/application02/ExampleUnitTest.java
cfafbea2e7306be08dfa4199a008489722b981d1
[]
no_license
changhyeon743/Fragment_practice
77c79f7a954f838a6ff071ab59e2e54f103f1c74
3556c87757868a81bf7644925489a9b2c6069bbb
refs/heads/master
2020-03-19T20:54:22.386615
2018-06-11T13:25:04
2018-06-11T13:25:04
136,921,980
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.example.ichanghyeon.application02; 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); } }
[ "changhyeon743@gmail.com" ]
changhyeon743@gmail.com
9ca9da106b9a90da009e7342dd013ea39f942390
c4bf53c591d57c6b949266ce7db1ea8d6c95646c
/clientname/gui/cosmetic/CosmeticComponent.java
e4bc6104a74649e7210737c57a5d41e23373cb67
[]
no_license
ClientPlayground/Juice-Client
80d0b051812c289dc868cb8ed540c2a6c18008fd
a298ecd154000b9ac435362234301b46404e836a
refs/heads/master
2023-04-04T04:44:15.169324
2021-04-28T15:55:49
2021-04-28T15:55:49
362,526,187
10
1
null
null
null
null
UTF-8
Java
false
false
2,134
java
package clientname.gui.cosmetic; import java.awt.Color; import clientname.cosmetics.CosmeticBase; import clientname.util.render.DrawUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; public class CosmeticComponent { Minecraft mc = Minecraft.getMinecraft(); FontRenderer font = mc.fontRendererObj; CosmeticBase cos; int x, y; public static int buttonX; public static int buttonY; public static int buttonW; public static int buttonH; public static int buttonId; public CosmeticComponent(int mouseX, int mouseY, int x, int y, CosmeticBase c, int buttonId) { this.cos = c; this.x = x; this.y = y; this.buttonX = x; this.buttonY = y + 120; this.buttonW = x + 110; this.buttonH = y + 150; this.buttonId = buttonId; DrawUtil.drawRoundedRect(x, y, x + 110, y + 150, 10, new Color(0, 0, 0, 160).getRGB()); //DrawUtil.drawRoundedRect(x, y + 120, x + 110, y + 150, 10, c.wearing ? new Color(0, 255, 0, 255).getRGB() : new Color(255, 0, 0, 255).getRGB()); //Gui.drawRect(x, y + 120, x + 110, y + 150, getWearingColor(c)); Gui.drawRect(buttonX, buttonY, buttonW, buttonH, getWearingColor(c)); font.drawString(c.name, x + 36, y + 5, -1); font.drawString(getWearingString(c), getWearingTextPos(c), y + 130, -1); /*this.buttonX = x; this.buttonY = y + 120; this.buttonW = x + 110; this.buttonH = y + 150;*/ } private String getWearingString(CosmeticBase c) { if(c.wearing) { return "Wearing"; } else { return "Not Wearing"; } } private int getWearingColor(CosmeticBase c) { if(c.wearing) { return new Color(0, 255, 0, 255).getRGB(); } else { return new Color(255, 0, 0, 255).getRGB(); } } private int getWearingTextPos(CosmeticBase c) { if(c.wearing) { return x + 36; } else { return x + 29; } } public static void toggleWearing(CosmeticBase c) { c.toggleWearing(); } public void onClick(int mouseX, int mouseY) { if(mouseX >= buttonX && mouseX <= buttonX + buttonW && mouseY >= buttonY && mouseY <= buttonY + buttonH) { toggleWearing(cos); } } }
[ "paymentstdm@gmail.com" ]
paymentstdm@gmail.com
3e2b5411f3f7baf0846024dcd57b944c5d86368f
2da8a347a4316e59e5a3f749d80832ecf1d4aebc
/app/src/test/java/io/github/mikeborodin/neurochrome/ExampleUnitTest.java
c942bea2cd5c2260a652f3220005a05d04a03c97
[]
no_license
Romik9415/NeiroChrome
b564a14655e12134991c16c240214404999b3acb
e8dcc19f3c85fcb1e756f965b2c3238c30db7d7c
refs/heads/master
2021-01-18T18:34:18.097880
2017-02-20T22:04:25
2017-02-20T22:04:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package io.github.mikeborodin.neurochrome; 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); } }
[ "streamofbee@gmail.com" ]
streamofbee@gmail.com
34d08273606c29f68646b47649ab9d17a5f3e5d8
0925e1fa1a6ca3e42ec5cb6f9612ad3a39172618
/src/main/java/com/marsss/marsss_will_do/utils/date/MyDateUtil.java
519796adcefb1c8a7cc12ca70e950d5dab952355
[ "Apache-2.0" ]
permissive
lanlandetiankong/marsss_will_do
c924123f1d5788ebe56b35e07d8cac739df36230
2b5fd4ed5b190cc19352367ef568132c977092e2
refs/heads/master
2022-07-03T15:06:09.518287
2019-08-26T16:06:02
2019-08-26T16:06:02
200,342,349
0
0
Apache-2.0
2021-08-02T17:18:08
2019-08-03T06:46:24
Java
UTF-8
Java
false
false
24,964
java
package com.marsss.marsss_will_do.utils.date; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.*; /** * * 日期工具 * * @author 段 * */ public class MyDateUtil { private static final ThreadLocal<SimpleDateFormat> threadLocal = new ThreadLocal<SimpleDateFormat>(); private static final Object object = new Object(); /** * 获取SimpleDateFormat * * @param pattern * 日期格式 * @return SimpleDateFormat对象 * @throws RuntimeException * 异常:非法日期格式 */ private static SimpleDateFormat getDateFormat(String pattern) throws RuntimeException { SimpleDateFormat dateFormat = threadLocal.get(); if (dateFormat == null) { synchronized (object) { if (dateFormat == null) { dateFormat = new SimpleDateFormat(pattern); dateFormat.setLenient(false); threadLocal.set(dateFormat); } } } dateFormat.applyPattern(pattern); return dateFormat; } /** * 获取日期中的某数值。如获取月份 * * @param date * 日期 * @param dateType * 日期格式 * @return 数值 */ private static int getInteger(Date date, int dateType) { int num = 0; Calendar calendar = Calendar.getInstance(); if (date != null) { calendar.setTime(date); num = calendar.get(dateType); } return num; } /** * 增加日期中某类型的某数值。如增加日期 * * @param date * 日期字符串 * @param dateType * 类型 * @param amount * 数值 * @return 计算后日期字符串 */ private static String addInteger(String date, int dateType, int amount) { String dateString = null; MyDateStyle myDateStyle = getDateStyle(date); if (myDateStyle != null) { Date myDate = StringToDate(date, myDateStyle); myDate = addInteger(myDate, dateType, amount); dateString = DateToString(myDate, myDateStyle); } return dateString; } /** * 增加日期中某类型的某数值。如增加日期 * * @param date * 日期 * @param dateType * 类型 * @param amount * 数值 * @return 计算后日期 */ private static Date addInteger(Date date, int dateType, int amount) { Date myDate = null; if (date != null) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(dateType, amount); myDate = calendar.getTime(); } return myDate; } /** * 获取精确的日期 * * @param timestamps * 时间long集合 * @return 日期 */ private static Date getAccurateDate(List<Long> timestamps) { Date date = null; long timestamp = 0; Map<Long, long[]> map = new HashMap<Long, long[]>(); List<Long> absoluteValues = new ArrayList<Long>(); if (timestamps != null && timestamps.size() > 0) { if (timestamps.size() > 1) { for (int i = 0; i < timestamps.size(); i++) { for (int j = i + 1; j < timestamps.size(); j++) { long absoluteValue = Math.abs(timestamps.get(i) - timestamps.get(j)); absoluteValues.add(absoluteValue); long[] timestampTmp = { timestamps.get(i), timestamps.get(j) }; map.put(absoluteValue, timestampTmp); } } // 有可能有相等的情况。如2012-11和2012-11-01。时间戳是相等的。此时minAbsoluteValue为0 // 因此不能将minAbsoluteValue取默认值0 long minAbsoluteValue = -1; if (!absoluteValues.isEmpty()) { minAbsoluteValue = absoluteValues.get(0); for (int i = 1; i < absoluteValues.size(); i++) { if (minAbsoluteValue > absoluteValues.get(i)) { minAbsoluteValue = absoluteValues.get(i); } } } if (minAbsoluteValue != -1) { long[] timestampsLastTmp = map.get(minAbsoluteValue); long dateOne = timestampsLastTmp[0]; long dateTwo = timestampsLastTmp[1]; if (absoluteValues.size() > 1) { timestamp = Math.abs(dateOne) > Math.abs(dateTwo) ? dateOne : dateTwo; } } } else { timestamp = timestamps.get(0); } } if (timestamp != 0) { date = new Date(timestamp); } return date; } /** * 判断字符串是否为日期字符串 * * @param date * 日期字符串 * @return true or false */ public static boolean isDate(String date) { boolean isDate = false; if (date != null) { if (getDateStyle(date) != null) { isDate = true; } } return isDate; } /** * 获取日期字符串的日期风格。失敗返回null。 * * @param date * 日期字符串 * @return 日期风格 */ public static MyDateStyle getDateStyle(String date) { MyDateStyle myDateStyle = null; Map<Long, MyDateStyle> map = new HashMap<Long, MyDateStyle>(); List<Long> timestamps = new ArrayList<Long>(); for (MyDateStyle style : MyDateStyle.values()) { if (style.isShowOnly()) { continue; } Date dateTmp = null; if (date != null) { try { ParsePosition pos = new ParsePosition(0); dateTmp = getDateFormat(style.getValue()).parse(date, pos); if (pos.getIndex() != date.length()) { dateTmp = null; } } catch (Exception e) { } } if (dateTmp != null) { timestamps.add(dateTmp.getTime()); map.put(dateTmp.getTime(), style); } } Date accurateDate = getAccurateDate(timestamps); if (accurateDate != null) { myDateStyle = map.get(accurateDate.getTime()); } return myDateStyle; } /** * 将日期字符串转化为日期。失败返回null。 * * @param date * 日期字符串 * @return 日期 */ public static Date StringToDate(String date) { MyDateStyle myDateStyle = getDateStyle(date); return StringToDate(date, myDateStyle); } /** * 将日期字符串转化为日期。失败返回null。 * * @param date * 日期字符串 * @param pattern * 日期格式 * @return 日期 */ public static Date StringToDate(String date, String pattern) { Date myDate = null; if (date != null) { try { myDate = getDateFormat(pattern).parse(date); } catch (Exception e) { } } return myDate; } /** * 将日期字符串转化为日期。失败返回null。 * * @param date * 日期字符串 * @param myDateStyle * 日期风格 * @return 日期 */ public static Date StringToDate(String date, MyDateStyle myDateStyle) { Date myDate = null; if (myDateStyle != null) { myDate = StringToDate(date, myDateStyle.getValue()); } return myDate; } /** * 将日期转化为日期字符串。失败返回null。 * * @param date * 日期 * @param pattern * 日期格式 * @return 日期字符串 */ public static String DateToString(Date date, String pattern) { String dateString = null; if (date != null) { try { dateString = getDateFormat(pattern).format(date); } catch (Exception e) { } } return dateString; } /** * 将日期转化为日期字符串。失败返回null。 * * @param date * 日期 * @param myDateStyle * 日期风格 * @return 日期字符串 */ public static String DateToString(Date date, MyDateStyle myDateStyle) { String dateString = null; if (myDateStyle != null) { dateString = DateToString(date, myDateStyle.getValue()); } return dateString; } /** * 将日期字符串转化为另一日期字符串。失败返回null。 * * @param date * 旧日期字符串 * @param newPattern * 新日期格式 * @return 新日期字符串 */ public static String StringToString(String date, String newPattern) { MyDateStyle oldMyDateStyle = getDateStyle(date); return StringToString(date, oldMyDateStyle, newPattern); } /** * 将日期字符串转化为另一日期字符串。失败返回null。 * * @param date * 旧日期字符串 * @param newMyDateStyle * 新日期风格 * @return 新日期字符串 */ public static String StringToString(String date, MyDateStyle newMyDateStyle) { MyDateStyle oldMyDateStyle = getDateStyle(date); return StringToString(date, oldMyDateStyle, newMyDateStyle); } /** * 将日期字符串转化为另一日期字符串。失败返回null。 * * @param date * 旧日期字符串 * @param olddPattern * 旧日期格式 * @param newPattern * 新日期格式 * @return 新日期字符串 */ public static String StringToString(String date, String olddPattern, String newPattern) { return DateToString(StringToDate(date, olddPattern), newPattern); } /** * 将日期字符串转化为另一日期字符串。失败返回null。 * * @param date * 旧日期字符串 * @param olddDteStyle * 旧日期风格 * @param newParttern * 新日期格式 * @return 新日期字符串 */ public static String StringToString(String date, MyDateStyle olddDteStyle, String newParttern) { String dateString = null; if (olddDteStyle != null) { dateString = StringToString(date, olddDteStyle.getValue(), newParttern); } return dateString; } /** * 将日期字符串转化为另一日期字符串。失败返回null。 * * @param date * 旧日期字符串 * @param olddPattern * 旧日期格式 * @param newMyDateStyle * 新日期风格 * @return 新日期字符串 */ public static String StringToString(String date, String olddPattern, MyDateStyle newMyDateStyle) { String dateString = null; if (newMyDateStyle != null) { dateString = StringToString(date, olddPattern, newMyDateStyle.getValue()); } return dateString; } /** * 将日期字符串转化为另一日期字符串。失败返回null。 * * @param date * 旧日期字符串 * @param olddDteStyle * 旧日期风格 * @param newMyDateStyle * 新日期风格 * @return 新日期字符串 */ public static String StringToString(String date, MyDateStyle olddDteStyle, MyDateStyle newMyDateStyle) { String dateString = null; if (olddDteStyle != null && newMyDateStyle != null) { dateString = StringToString(date, olddDteStyle.getValue(), newMyDateStyle.getValue()); } return dateString; } /** * 增加日期的年份。失败返回null。 * * @param date * 日期 * @param yearAmount * 增加数量。可为负数 * @return 增加年份后的日期字符串 */ public static String addYear(String date, int yearAmount) { return addInteger(date, Calendar.YEAR, yearAmount); } /** * 增加日期的年份。失败返回null。 * * @param date * 日期 * @param yearAmount * 增加数量。可为负数 * @return 增加年份后的日期 */ public static Date addYear(Date date, int yearAmount) { return addInteger(date, Calendar.YEAR, yearAmount); } /** * 增加日期的月份。失败返回null。 * * @param date * 日期 * @param monthAmount * 增加数量。可为负数 * @return 增加月份后的日期字符串 */ public static String addMonth(String date, int monthAmount) { return addInteger(date, Calendar.MONTH, monthAmount); } /** * 增加日期的月份。失败返回null。 * * @param date * 日期 * @param monthAmount * 增加数量。可为负数 * @return 增加月份后的日期 */ public static Date addMonth(Date date, int monthAmount) { return addInteger(date, Calendar.MONTH, monthAmount); } /** * 增加日期的天数。失败返回null。 * * @param date * 日期字符串 * @param dayAmount * 增加数量。可为负数 * @return 增加天数后的日期字符串 */ public static String addDay(String date, int dayAmount) { return addInteger(date, Calendar.DATE, dayAmount); } /** * 增加日期的天数。失败返回null。 * * @param date * 日期 * @param dayAmount * 增加数量。可为负数 * @return 增加天数后的日期 */ public static Date addDay(Date date, int dayAmount) { return addInteger(date, Calendar.DATE, dayAmount); } /** * 增加日期的小时。失败返回null。 * * @param date * 日期字符串 * @param hourAmount * 增加数量。可为负数 * @return 增加小时后的日期字符串 */ public static String addHour(String date, int hourAmount) { return addInteger(date, Calendar.HOUR_OF_DAY, hourAmount); } /** * 增加日期的小时。失败返回null。 * * @param date * 日期 * @param hourAmount * 增加数量。可为负数 * @return 增加小时后的日期 */ public static Date addHour(Date date, int hourAmount) { return addInteger(date, Calendar.HOUR_OF_DAY, hourAmount); } /** * 增加日期的分钟。失败返回null。 * * @param date * 日期字符串 * @param minuteAmount * 增加数量。可为负数 * @return 增加分钟后的日期字符串 */ public static String addMinute(String date, int minuteAmount) { return addInteger(date, Calendar.MINUTE, minuteAmount); } /** * 增加日期的分钟。失败返回null。 * * @param date * 日期 * @param dayAmount * 增加数量。可为负数 * @return 增加分钟后的日期 */ public static Date addMinute(Date date, int minuteAmount) { return addInteger(date, Calendar.MINUTE, minuteAmount); } /** * 增加日期的秒钟。失败返回null。 * * @param date * 日期字符串 * @param dayAmount * 增加数量。可为负数 * @return 增加秒钟后的日期字符串 */ public static String addSecond(String date, int secondAmount) { return addInteger(date, Calendar.SECOND, secondAmount); } /** * 增加日期的秒钟。失败返回null。 * * @param date * 日期 * @param dayAmount * 增加数量。可为负数 * @return 增加秒钟后的日期 */ public static Date addSecond(Date date, int secondAmount) { return addInteger(date, Calendar.SECOND, secondAmount); } /** * 获取日期的年份。失败返回0。 * * @param date * 日期字符串 * @return 年份 */ public static int getYear(String date) { return getYear(StringToDate(date)); } /** * 获取日期的年份。失败返回0。 * * @param date * 日期 * @return 年份 */ public static int getYear(Date date) { return getInteger(date, Calendar.YEAR); } /** * 获取日期的月份。失败返回0。 * * @param date * 日期字符串 * @return 月份 */ public static int getMonth(String date) { return getMonth(StringToDate(date)); } /** * 获取日期的月份。失败返回0。 * * @param date * 日期 * @return 月份 */ public static int getMonth(Date date) { return getInteger(date, Calendar.MONTH) + 1; } /** * 获取日期的天数。失败返回0。 * * @param date * 日期字符串 * @return 天 */ public static int getDay(String date) { return getDay(StringToDate(date)); } /** * 获取日期的天数。失败返回0。 * * @param date * 日期 * @return 天 */ public static int getDay(Date date) { return getInteger(date, Calendar.DATE); } /** * 获取日期的小时。失败返回0。 * * @param date * 日期字符串 * @return 小时 */ public static int getHour(String date) { return getHour(StringToDate(date)); } /** * 获取日期的小时。失败返回0。 * * @param date * 日期 * @return 小时 */ public static int getHour(Date date) { return getInteger(date, Calendar.HOUR_OF_DAY); } /** * 获取日期的分钟。失败返回0。 * * @param date * 日期字符串 * @return 分钟 */ public static int getMinute(String date) { return getMinute(StringToDate(date)); } /** * 获取日期的分钟。失败返回0。 * * @param date * 日期 * @return 分钟 */ public static int getMinute(Date date) { return getInteger(date, Calendar.MINUTE); } /** * 获取日期的秒钟。失败返回0。 * * @param date * 日期字符串 * @return 秒钟 */ public static int getSecond(String date) { return getSecond(StringToDate(date)); } /** * 获取日期的秒钟。失败返回0。 * * @param date * 日期 * @return 秒钟 */ public static int getSecond(Date date) { return getInteger(date, Calendar.SECOND); } /** * 获取日期 。默认yyyy-MM-dd格式。失败返回null。 * * @param date * 日期字符串 * @return 日期 */ public static String getDate(String date) { return StringToString(date, MyDateStyle.YYYY_MM_DD); } /** * 获取日期。默认yyyy-MM-dd格式。失败返回null。 * * @param date * 日期 * @return 日期 */ public static String getDate(Date date) { return DateToString(date, MyDateStyle.YYYY_MM_DD); } /** * 获取日期的时间。默认HH:mm:ss格式。失败返回null。 * * @param date * 日期字符串 * @return 时间 */ public static String getTime(String date) { return StringToString(date, MyDateStyle.HH_MM_SS); } /** * 获取日期的时间。默认HH:mm:ss格式。失败返回null。 * * @param date * 日期 * @return 时间 */ public static String getTime(Date date) { return DateToString(date, MyDateStyle.HH_MM_SS); } /** * 获取日期的时间。默认yyyy-MM-dd HH:mm:ss格式。失败返回null。 * * @param date * 日期字符串 * @return 时间 */ public static String getDateTime(String date) { return StringToString(date, MyDateStyle.YYYY_MM_DD_HH_MM_SS); } /** * 获取日期的时间。默认yyyy-MM-dd HH:mm:ss格式。失败返回null。 * * @param date * 日期 * @return 时间 */ public static String getDateTime(Date date) { return DateToString(date, MyDateStyle.YYYY_MM_DD_HH_MM_SS); } /** * 获取日期的星期。失败返回null。 * * @param date * 日期字符串 * @return 星期 */ public static MyDateWeek getMyDateWeek(String date) { MyDateWeek week = null; MyDateStyle myDateStyle = getDateStyle(date); if (myDateStyle != null) { Date myDate = StringToDate(date, myDateStyle); week = getMyDateWeek(myDate); } return week; } /** * 获取日期的星期。失败返回null。 * * @param date * 日期 * @return 星期 */ public static MyDateWeek getMyDateWeek(Date date) { MyDateWeek week = null; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int weekNumber = calendar.get(Calendar.DAY_OF_WEEK) - 1; switch (weekNumber) { case 0: week = MyDateWeek.SUNDAY; break; case 1: week = MyDateWeek.MONDAY; break; case 2: week = MyDateWeek.TUESDAY; break; case 3: week = MyDateWeek.WEDNESDAY; break; case 4: week = MyDateWeek.THURSDAY; break; case 5: week = MyDateWeek.FRIDAY; break; case 6: week = MyDateWeek.SATURDAY; break; } return week; } /** * 获取两个日期相差的天数 * * @param date * 日期字符串 * @param otherDate * 另一个日期字符串 * @return 相差天数。如果失败则返回-1 */ public static int getIntervalDays(String date, String otherDate) { return getIntervalDays(StringToDate(date), StringToDate(otherDate)); } /** * @param date * 日期 * @param otherDate * 另一个日期 * @return 相差天数。如果失败则返回-1 */ public static int getIntervalDays(Date date, Date otherDate) { int num = -1; Date dateTmp = MyDateUtil.StringToDate(MyDateUtil.getDate(date), MyDateStyle.YYYY_MM_DD); Date otherDateTmp = MyDateUtil.StringToDate(MyDateUtil.getDate(otherDate), MyDateStyle.YYYY_MM_DD); if (dateTmp != null && otherDateTmp != null) { long time = Math.abs(dateTmp.getTime() - otherDateTmp.getTime()); num = (int) (time / (24 * 60 * 60 * 1000)); } return num; } /** * 获取期间的年龄 * * @param date * @param otherDate * @return * * 2014-12-2 下午06:45:02 段 * * @return String */ public static String getAge(Date date, Date otherDate) { int dis = MyDateUtil.getIntervalDays(new Date(), otherDate); int year = dis / 365; int month = dis % 365 / 30; int day = dis % 365 % 31; String age = (year > 0 ? year + "岁" : "") + (month > 0 ? month + "个月" : "") + (day + "天"); return age; } }
[ "695605813@qq.com" ]
695605813@qq.com
8698b7ee2b8177598a144cf49dc9c23ef59f1c51
af402cb9675c566b2ba4bfc2324b09b397869ec8
/EthanDriver.java
ebd60c202a59853a28216b60280397f50b4ca63c
[]
no_license
kaitlynduong21/MKS21X-OrderedArrayList
757e1bc7ef4e516539ecaccd8d3307570156bc76
60ef81ec3d6932f84c52f3dff71f6c7ea1515af0
refs/heads/master
2020-04-04T03:51:18.853501
2018-11-03T22:42:24
2018-11-03T22:42:24
155,728,507
0
0
null
null
null
null
UTF-8
Java
false
false
4,942
java
public class EthanDriver { public static void main(String[] args) { int c = 0; NoNullArrayList<String> array = new NoNullArrayList<>(); try { array.add("x"); if (!(""+array).equals("[x]")) System.out.println(++c+". You aren't adding properly when NoNullArrayList.add(T) is called."); array.add(0,"y"); if (!(""+array).equals("[y, x]")) System.out.println(++c+". You aren't adding properly when NoNullArrayList.add(index, T) is called."); array.set(1,"z"); if (!(""+array).equals("[y, z]")) System.out.println(++c+". You aren't setting properly when NoNullArrayList.set(index, T) is called."); } catch (Exception e) { System.out.println(++c+". You are producing a "+e.getClass().getCanonicalName()+" when adding/setting to a NoNullArrayList."); } try { try { array.add(null); System.out.println(++c+". You aren't catching nulls properly when NoNullArrayList.add(T) is called."); } catch (IllegalArgumentException e) {} if (!(""+array).equals("[y, z]")) System.out.println(++c+". You are modifying the array when NoNullArrayList.add(null) is called."); try { array.add(0,null); System.out.println(++c+". You aren't catching nulls when NoNullArrayList.add(index, T) is called."); } catch (IllegalArgumentException e) {} if (!(""+array).equals("[y, z]")) System.out.println(++c+". You are modifying the array when NoNullArrayList.add(index, null) is called."); try { array.set(1,null); System.out.println(++c+". You aren't catching nulls when NoNullArrayList.set(index, T) is called."); } catch (IllegalArgumentException e) {} if (!(""+array).equals("[y, z]")) System.out.println(++c+". You are modifying the array when NoNullArrayList.set(index, null) is called."); } catch (Exception e) { System.out.println(++c+". You are producing a "+e.getClass().getCanonicalName()+" when adding/setting a null value to a NoNullArrayList. You should be throwing IllegalArgumentException instead."); } /* array = new OrderedArrayList<>(); try { array.add("z"); array.add("x"); array.add("y"); if (!(""+array).equals("[x, y, z]")) System.out.println(++c+". You aren't adding properly when OrderedArrayList.add(T) is called."); array.add(2,"c"); array.add(1,"a"); array.add(0,"b"); if (!(""+array).equals("[a, b, c, x, y, z]")) { System.out.print(++c+". You aren't adding properly when OrderedArrayList.add(index, T) is called. "); if (array.size() == 6) System.out.println("Your elements are out of order. :("); else System.out.println("Some elements aren't getting added. They feel left out :("); } array.set(2,"r"); array.set(1,"p"); array.set(0,"q"); if (!(""+array).equals("[p, q, r, x, y, z]")) { System.out.print(++c+". You aren't adding properly when OrderedArrayList.set(index, T) is called. "); if (array.size() > 6) System.out.println("You aren't removing elements properly!"); else if (array.size() < 6) System.out.println("Some elements aren't getting added. They feel left out :("); else if ((""+array).contains("a") || (""+array).contains("b") || (""+array).contains("c")) System.out.println("You aren't removing elements properly!"); else System.out.println("Your elements are out of order. :("); } } catch (Exception e) { System.out.println(++c+". You are producing a "+e.getClass().getCanonicalName()+" when adding/setting to an OrderedArrayList."); } try { try { array.add(null); System.out.println(++c+". You aren't catching nulls properly when OrderedArrayList.add(T) is called."); } catch (IllegalArgumentException e) {} if (!(""+array).equals("[p, q, r, x, y, z]")) System.out.println(++c+". You are modifying the array when OrderedArrayList.add(null) is called."); try { array.add(0,null); System.out.println(++c+". You aren't catching nulls when OrderedArrayList.add(index, T) is called."); } catch (IllegalArgumentException e) {} if (!(""+array).equals("[p, q, r, x, y, z]")) System.out.println(++c+". You are modifying the array when OrderedArrayList.add(index, null) is called."); try { array.set(1,null); System.out.println(++c+". You aren't catching nulls when OrderedArrayList.set(index, T) is called."); } catch (IllegalArgumentException e) {} if (!(""+array).equals("[p, q, r, x, y, z]")) System.out.println(++c+". You are modifying the array when OrderedArrayList.set(index, null) is called."); } catch (Exception e) { System.out.println(++c+". You are producing a "+e.getClass().getCanonicalName()+" when adding/setting a null value to an OrderedArrayList. You should be throwing IllegalArgumentException instead."); } if (c == 0) System.out.println("Your code passed every test. Nice work."); else System.out.println("\nYou produced "+c+" unexpected results. Keep debugging!");*/ } }
[ "kduong@stuy.edu" ]
kduong@stuy.edu
df6d586882967b25869efeafb8d35c486e26a62e
1c70dd4d2c33fe1e917c576d9b30667d8cfd701f
/src/fileio/DirectoryTools.java
e434ac5c618e01a835a79f17e9caf13b94cee232
[]
no_license
Carrotlord/graph-diagram
2761e3215fd4c8c123da3efd1af59a38e638e441
30a1bb1fbe408888953142cea49244d9936cb8ff
refs/heads/master
2020-12-02T06:34:48.890278
2017-09-02T08:12:59
2017-09-02T08:12:59
96,858,611
0
0
null
null
null
null
UTF-8
Java
false
false
687
java
package fileio; import java.io.File; import java.util.ArrayList; /** * * @author Oliver Chu */ public class DirectoryTools { public static String getCurrentDirectory() { return System.getProperty("user.dir"); } public static String[] listFilepaths(String path) { File[] files = (new File(path)).listFiles(); ArrayList<String> filenames = new ArrayList<>(); for (File file : files) { if (file.isFile()) { filenames.add(file.getPath()); } } String[] filenamesArray = new String[filenames.size()]; filenames.toArray(filenamesArray); return filenamesArray; } }
[ "j.oliverchu@berkeley.edu" ]
j.oliverchu@berkeley.edu
f142bde03e827a9ae2e9d2f52bdf84b31d3ed7f5
713258f52219c66c6f521d41fb9b85fcbb3ec175
/FavouriteToys/app/src/androidTest/java/com/example/rhyde/favouritetoys/ExampleInstrumentedTest.java
cc74d39d370aafe2ed6c1bcc076606c1781a97c0
[]
no_license
rhyderQuinlan/AndroidStudioProjects
b77b646630db259300f919437d0cd8cfa3c0d79c
8d6252728d4ce907f472e928759a440690f8a7d3
refs/heads/master
2020-03-17T12:07:35.340942
2018-05-15T21:39:39
2018-05-15T21:39:39
133,575,397
0
0
null
null
null
null
UTF-8
Java
false
false
746
java
package com.example.rhyde.favouritetoys; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * 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.getTargetContext(); assertEquals("com.example.rhyde.favouritetoys", appContext.getPackageName()); } }
[ "rhyderquinlan@gmail.com" ]
rhyderquinlan@gmail.com
2875f20185285d7b9e2de1395ca379b74eee1d39
97fd02f71b45aa235f917e79dd68b61c62b56c1c
/src/main/java/com/tencentcloudapi/dcdb/v20180411/models/ViewPrivileges.java
7914dad11269a8cefa49b7d2e1eb9af881481dbc
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java
7df922f7c5826732e35edeab3320035e0cdfba05
09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec
refs/heads/master
2023-09-04T10:51:57.854153
2023-09-01T03:21:09
2023-09-01T03:21:09
129,837,505
537
317
Apache-2.0
2023-09-13T02:42:03
2018-04-17T02:58:16
Java
UTF-8
Java
false
false
3,332
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.dcdb.v20180411.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class ViewPrivileges extends AbstractModel{ /** * 数据库名 */ @SerializedName("Database") @Expose private String Database; /** * 数据库视图名 */ @SerializedName("View") @Expose private String View; /** * 权限信息 */ @SerializedName("Privileges") @Expose private String [] Privileges; /** * Get 数据库名 * @return Database 数据库名 */ public String getDatabase() { return this.Database; } /** * Set 数据库名 * @param Database 数据库名 */ public void setDatabase(String Database) { this.Database = Database; } /** * Get 数据库视图名 * @return View 数据库视图名 */ public String getView() { return this.View; } /** * Set 数据库视图名 * @param View 数据库视图名 */ public void setView(String View) { this.View = View; } /** * Get 权限信息 * @return Privileges 权限信息 */ public String [] getPrivileges() { return this.Privileges; } /** * Set 权限信息 * @param Privileges 权限信息 */ public void setPrivileges(String [] Privileges) { this.Privileges = Privileges; } public ViewPrivileges() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public ViewPrivileges(ViewPrivileges source) { if (source.Database != null) { this.Database = new String(source.Database); } if (source.View != null) { this.View = new String(source.View); } if (source.Privileges != null) { this.Privileges = new String[source.Privileges.length]; for (int i = 0; i < source.Privileges.length; i++) { this.Privileges[i] = new String(source.Privileges[i]); } } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "Database", this.Database); this.setParamSimple(map, prefix + "View", this.View); this.setParamArraySimple(map, prefix + "Privileges.", this.Privileges); } }
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
fb1eee8f49cb44cd3760795aadf79217e4419e88
d75ff958fb1f81adb68d64c2bb466cd321f13064
/src/main/java/UnderSpire/Patches/InventoryGroup.java
d638382f05c89740bc8aaf7631b77a0bff2d5e2e
[]
no_license
Alchyr/Underspire
8d5165ed676a419615f0a6471f0cde9121bd17a6
1970cfd6eae29e28e5fea9a76b01f58e6a59b78e
refs/heads/master
2020-04-29T19:26:04.499862
2019-03-18T19:20:31
2019-03-18T19:20:31
176,354,347
0
0
null
null
null
null
UTF-8
Java
false
false
497
java
package UnderSpire.Patches; import com.evacipated.cardcrawl.modthespire.lib.SpireField; import com.evacipated.cardcrawl.modthespire.lib.SpirePatch; import com.megacrit.cardcrawl.cards.CardGroup; import com.megacrit.cardcrawl.characters.AbstractPlayer; @SpirePatch( clz = AbstractPlayer.class, method = SpirePatch.CLASS ) public class InventoryGroup { public static SpireField<CardGroup> Inventory = new SpireField<>(()->new CardGroup(CardGroup.CardGroupType.UNSPECIFIED)); }
[ "IsithAlchyr@gmail.com" ]
IsithAlchyr@gmail.com
11e7db5c35f83b8d89901ea20b2ecd95a22405f8
acd9b11687fd0b5d536823daf4183a596d4502b2
/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/shard_stores/ShardStoreWrapper.java
482359d9f4cfbc5d2f340f2779f7103239dc0806
[ "Apache-2.0" ]
permissive
szabosteve/elasticsearch-java
75be71df80a4e010abe334a5288b53fa4a2d6d5e
79a1249ae77be2ce9ebd5075c1719f3c8be49013
refs/heads/main
2023-08-24T15:36:51.047105
2021-10-01T14:23:34
2021-10-01T14:23:34
399,091,850
0
0
Apache-2.0
2021-08-23T12:15:19
2021-08-23T12:15:19
null
UTF-8
Java
false
false
4,868
java
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. 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. */ //---------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------- package co.elastic.clients.elasticsearch.indices.shard_stores; import co.elastic.clients.json.DelegatingDeserializer; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.json.JsonpSerializable; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ModelTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; // typedef: indices.shard_stores.ShardStoreWrapper @JsonpDeserializable public final class ShardStoreWrapper implements JsonpSerializable { private final List<ShardStore> stores; // --------------------------------------------------------------------------------------------- public ShardStoreWrapper(Builder builder) { this.stores = ModelTypeHelper.unmodifiableNonNull(builder.stores, "stores"); } public ShardStoreWrapper(Function<Builder, Builder> fn) { this(fn.apply(new Builder())); } /** * API name: {@code stores} */ public List<ShardStore> stores() { return this.stores; } /** * Serialize this object to JSON. */ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); generator.writeEnd(); } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("stores"); generator.writeStartArray(); for (ShardStore item0 : this.stores) { item0.serialize(generator, mapper); } generator.writeEnd(); } // --------------------------------------------------------------------------------------------- /** * Builder for {@link ShardStoreWrapper}. */ public static class Builder implements ObjectBuilder<ShardStoreWrapper> { private List<ShardStore> stores; /** * API name: {@code stores} */ public Builder stores(List<ShardStore> value) { this.stores = value; return this; } /** * API name: {@code stores} */ public Builder stores(ShardStore... value) { this.stores = Arrays.asList(value); return this; } /** * Add a value to {@link #stores(List)}, creating the list if needed. 4 */ public Builder addStores(ShardStore value) { if (this.stores == null) { this.stores = new ArrayList<>(); } this.stores.add(value); return this; } /** * Set {@link #stores(List)} to a singleton list. */ public Builder stores(Function<ShardStore.Builder, ObjectBuilder<ShardStore>> fn) { return this.stores(fn.apply(new ShardStore.Builder()).build()); } /** * Add a value to {@link #stores(List)}, creating the list if needed. 5 */ public Builder addStores(Function<ShardStore.Builder, ObjectBuilder<ShardStore>> fn) { return this.addStores(fn.apply(new ShardStore.Builder()).build()); } /** * Builds a {@link ShardStoreWrapper}. * * @throws NullPointerException * if some of the required fields are null. */ public ShardStoreWrapper build() { return new ShardStoreWrapper(this); } } // --------------------------------------------------------------------------------------------- /** * Json deserializer for {@link ShardStoreWrapper} */ public static final JsonpDeserializer<ShardStoreWrapper> _DESERIALIZER = ObjectBuilderDeserializer .lazy(Builder::new, ShardStoreWrapper::setupShardStoreWrapperDeserializer, Builder::build); protected static void setupShardStoreWrapperDeserializer(DelegatingDeserializer<ShardStoreWrapper.Builder> op) { op.add(Builder::stores, JsonpDeserializer.arrayDeserializer(ShardStore._DESERIALIZER), "stores"); } }
[ "sylvain@elastic.co" ]
sylvain@elastic.co
6fd4ab0652f293341b52bcc9d919f596d7c268fe
79642f37c08311bdb977bae1243cc9a3870692f6
/mingrui-shop-basics/mingrui-shop-basics-upload-server/src/main/java/com/baidu/config/FastClientImporter.java
43be00adb41733936c6830e91eba207445ee6846
[]
no_license
fuguanglong/mingrui-shop-parent2
18981dc11fcb4ce22c9566189df4ded6dac79442
6996de7d399246063c7c9a24dd96319480c7e1e9
refs/heads/master
2023-02-23T01:36:34.779439
2021-01-23T08:26:48
2021-01-23T08:26:48
332,162,239
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
package com.baidu.config; import com.github.tobato.fastdfs.FdfsClientConfig; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableMBeanExport; import org.springframework.context.annotation.Import; import org.springframework.jmx.support.RegistrationPolicy; /** * @ClassName TestSpringBootApplication * @Description: TODO * @Author fuguanglong * @Date 2021/1/5 * @Version V1.0 **/ @Configuration @Import(FdfsClientConfig.class) @EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING) public class FastClientImporter { }
[ "fglone@163.com" ]
fglone@163.com
4a387101aba79a057cb2732eee2ba397b3870f2b
c27a1d02af09be824c71e01e744b918f91a2b1f4
/Spring3_myspring/src/main/java/com/yc/Test.java
165ecb40b6e9faa2c3dba7152d8b5cb3d3e32805
[]
no_license
ouyang2086/springLearningStepbyStep
e86917874b7bead773805de7d84d7cd9df32e4e4
cbc6473694826f59e48ac0b390706e05bfff384c
refs/heads/main
2023-03-30T13:09:00.178931
2021-04-10T10:22:39
2021-04-10T10:22:39
356,521,248
0
0
null
null
null
null
UTF-8
Java
false
false
454
java
package com.yc; import com.yc.MyAppConfig; import com.yc.bean.HelloWorld; import com.yc.springframework.context.MyAnnotationConfigApplicationContext; import com.yc.springframework.context.MyApplicationContext; public class Test { public static void main(String[] args){ MyApplicationContext ac = new MyAnnotationConfigApplicationContext(MyAppConfig.class); HelloWorld hw = (HelloWorld) ac.getBean("hw"); hw.show(); } }
[ "2086773714@qq.com" ]
2086773714@qq.com
afaa5e173f1f5cdafa133c35dd1093c71d223b86
657ca677b6c6dc786db1b36aaa0b94802fc3e5e7
/src/com/tastyplanner/objects/ShoppingCategory.java
1eb82cf9697bd7f38692dceb41272599a8dde367
[ "MIT" ]
permissive
satoukum/TastyPlanner
ceda0161572d21de1085ebbb0272b4ac4e0c9b53
8ff74f21c4f4958e0d46dc182b9b330149e4cf02
refs/heads/master
2020-03-27T21:58:08.988460
2013-09-07T22:26:09
2013-09-07T22:26:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,416
java
package com.tastyplanner.objects; import java.io.Serializable; import java.util.ArrayList; public class ShoppingCategory implements Serializable { private static final long serialVersionUID = 5543500557655301047L; public String Name; // Category Name public int number; public ArrayList<Ingredient> ingredientList = new ArrayList<Ingredient>(); public boolean bottom = false; public ShoppingCategory(){ super(); } public ShoppingCategory(String title) { super(); this.Name = title; } public Boolean getBottom() { return bottom; } public void setBottom(boolean bottom) { this.bottom = bottom; } public String getName() { return Name; } public void setName(String name) { Name = name; } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } public ArrayList<Ingredient> getIngredientList() { return ingredientList; } public void setIngredientList(ArrayList<Ingredient> ingredientList) { this.ingredientList = ingredientList; } public boolean addIngredient(Ingredient ingredient){ return ingredientList.add(ingredient); } public boolean removeIngredient(Ingredient ingredient) { //ingredientList.remove(ingredient); return ingredientList.remove(ingredient); } public String toString() { return getName(); } }
[ "nielsen.marissa@gmail.com" ]
nielsen.marissa@gmail.com
bdee2668ebbfae970f18c8e3b7238645c1bfcd01
4f771249ad995e71fd038633a3d8e55a4ab963de
/app/src/main/java/com/example/smmousavi/maktab_hw82_remindemelater/mvc/controller/fragments/UserLoginFragment.java
e10db82a2f4629729d2ac71fcd5d3b2b225664d7
[]
no_license
smmousavi8872/Maktab_HW8_RemindeMeLater
d3fb8428a49d80c7cd3ff18720454d36e06991ef
48a93d5a37eb64e03535fd0dbd6e3d78b5a55a7b
refs/heads/master
2020-03-25T16:06:20.530136
2018-08-07T18:54:43
2018-08-07T18:54:43
143,914,761
0
0
null
null
null
null
UTF-8
Java
false
false
2,470
java
package com.example.smmousavi.maktab_hw82_remindemelater.mvc.controller.fragments; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import com.example.smmousavi.maktab_hw82_remindemelater.R; import com.example.smmousavi.maktab_hw82_remindemelater.mvc.controller.activities.TabLayoutActivity; import com.example.smmousavi.maktab_hw82_remindemelater.mvc.model.UserList; import java.util.UUID; /** * A simple {@link Fragment} subclass. */ public class UserLoginFragment extends Fragment { EditText mUsernameEdt; EditText mPasswordEdt; Button mLoginBtn; public static UserLoginFragment newInstance() { Bundle args = new Bundle(); UserLoginFragment fragment = new UserLoginFragment(); fragment.setArguments(args); return fragment; } public UserLoginFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_user_login, container, false); mUsernameEdt = view.findViewById(R.id.edt_login_username); mPasswordEdt = view.findViewById(R.id.edt_login_password); mLoginBtn = view.findViewById(R.id.login_button); mLoginBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String username = mUsernameEdt.getText().toString(); String passowrd = mPasswordEdt.getText().toString(); if (!username.equals("") && !passowrd.equals("")) { UUID loggedInUserId = UserList.getInstance(getActivity()).getUser(username, passowrd); if (loggedInUserId != null) { UserList.getInstance(getActivity()).setLoggedInUserId(loggedInUserId); Intent intent = TabLayoutActivity.newIntent(getActivity()); startActivity(intent); } else { Snackbar.make(getView(), "Wrong Username Or Password", Snackbar.LENGTH_SHORT).show(); } } else { Snackbar.make(getView(), "Enter Username and Password Both", Snackbar.LENGTH_SHORT).show(); } } }); return view; } }
[ "smmousavi.developer@gmail.com" ]
smmousavi.developer@gmail.com
0687515bbbe29b5927fd9e56327e5d284d8672c5
99a8722d0d16e123b69e345df7aadad409649f6c
/jpa/deferred/src/main/java/example/repo/Customer721Repository.java
4e2223d3c0d52b31e8752f86f6e9865a87680177
[ "Apache-2.0" ]
permissive
spring-projects/spring-data-examples
9c69a0e9f3e2e73c4533dbbab00deae77b2aacd7
c4d1ca270fcf32a93c2a5e9d7e91a5592b7720ff
refs/heads/main
2023-09-01T14:17:56.622729
2023-08-22T16:51:10
2023-08-24T19:48:04
16,381,571
5,331
3,985
Apache-2.0
2023-08-25T09:02:19
2014-01-30T15:42:43
Java
UTF-8
Java
false
false
280
java
package example.repo; import example.model.Customer721; import java.util.List; import org.springframework.data.repository.CrudRepository; public interface Customer721Repository extends CrudRepository<Customer721, Long> { List<Customer721> findByLastName(String lastName); }
[ "ogierke@pivotal.io" ]
ogierke@pivotal.io
dce85fe7ce3f19654c224b4d6bf4267b10fd9693
500c6c4a9cbb1dce692ddd471f035f0c2efd1d6e
/Codeeval/easy/SimpleSorting/Main.java
6df6da674bf79be0711d08278fc3267a903f010a
[]
no_license
ayemos/algorithm
c31a0ac7ad3ee18aa626ff0d99f95f797b32fe68
a68eb1bd3941a4809fdf417c0a082a1869782004
refs/heads/master
2021-01-21T13:25:42.648835
2016-06-03T06:16:49
2016-06-03T06:16:49
30,368,227
0
0
null
null
null
null
UTF-8
Java
false
false
2,228
java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.List; import java.util.ArrayList; import java.util.Arrays; public class Main { final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); final String LINE_SPR = System.getProperty("line.separator"); void run() throws Exception { String line; while((line = br.readLine()) != null) { String[] nums = line.split(" "); double[] ds = new double[nums.length]; for(int i = 0; i < nums.length; i++) ds[i] = Double.parseDouble(nums[i]); Arrays.sort(ds); String res = ""; for(int i = 0; i < nums.length; i++) res += String.format("%.3f", ds[i]) + " "; System.out.println(res.substring(0, res.length() - 1)); } } /* * Templates */ void dumpArray1(Object[] arr, int n) { for(int i = 0; i < n; i++) { System.out.print(arr[i]); if(i < n - 1) System.out.print(" "); } } void dumpArray2(Object[][] arr, int m, int n) { for(int j = 0; j < n; j++) { for(int i = 0; i < m; i++) { System.out.print(arr[i][j]); if (i < m - 1) System.out.print(" "); } System.out.println(" "); } } boolean isPrime(int n) { for(int i=2;i<n;i++) { if(n%i==0) return false; } return true; } int getPrime(int n) { List<Integer> primes = new ArrayList<Integer>(); primes.add(2); int count = 1; int x = 1; while(primes.size() < n) { x+=2; int m = (int)Math.sqrt(x); for(int p : primes) { if(p > m) { primes.add(x); break; } if(x % p == 0) break; } } return primes.get(primes.size() - 1); } public static void main(String[] args) throws Exception { new Main().run(); } }
[ "ayemos.y@gmail.com" ]
ayemos.y@gmail.com
43e49410098063cf3fd21ea45b20e34763d815b1
d00ade2c3b51771c4bc722039283dc8ee88b8c76
/src/main/java/com/allmsi/flow/model/ovo/FlowInstanceLogOVO.java
0f7d90519fc3371f3cd517255a7f51ef99ae611d
[]
no_license
nannan07/im-flow-spring-boot
e21eaeab6b5ba17a8e4e089b7681078790a1e2b1
7c1295920d638c2851b78970986fc509c14f080d
refs/heads/master
2020-04-26T17:22:05.128842
2019-03-04T09:07:48
2019-03-04T09:07:48
173,710,741
0
0
null
null
null
null
UTF-8
Java
false
false
1,226
java
package com.allmsi.flow.model.ovo; import java.util.Date; import com.allmsi.flow.model.FlowInstanceLog; import com.allmsi.flow.model.external.FlowUserModel; public class FlowInstanceLogOVO { private String id; private String instanceId; private String remark; private Date cTime; private FlowUserModel user; public FlowInstanceLogOVO() { } public FlowInstanceLogOVO(FlowInstanceLog flowInstanceLog) { if (flowInstanceLog != null) { this.id = flowInstanceLog.getId(); this.instanceId = flowInstanceLog.getInstanceId(); this.cTime = flowInstanceLog.getcTime(); this.remark = flowInstanceLog.getRemark(); } } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getInstanceId() { return instanceId; } public void setInstanceId(String instanceId) { this.instanceId = instanceId; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public Date getcTime() { return cTime; } public void setcTime(Date cTime) { this.cTime = cTime; } public FlowUserModel getUser() { return user; } public void setUser(FlowUserModel user) { this.user = user; } }
[ "15711021520@163.com" ]
15711021520@163.com
80a9f8b0494ee95d7be951e03db1805dced64d52
ae01ce410b3f0b539e7707d9b2c0b789f6038d5c
/BitsandPizzas/app/src/main/java/com/example/kien/bitsandpizzas/StoresFragment.java
cbfb51799e9cdf2a343ad0e52f774cd55bc65b84
[]
no_license
kxdang/Android-Development
42a7b439b8cb3ccb07b46685688deedbf43a2426
d9e81efb1f6e6ff5692ea13c8250842d6e86a186
refs/heads/master
2020-04-14T22:15:06.123536
2019-04-21T22:11:57
2019-04-21T22:11:57
164,156,054
0
0
null
null
null
null
UTF-8
Java
false
false
845
java
package com.example.kien.bitsandpizzas; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.ListFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; public class StoresFragment extends ListFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ArrayAdapter<String> adapter = new ArrayAdapter<>( inflater.getContext(), android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.stores)); setListAdapter(adapter); return super.onCreateView(inflater, container, savedInstanceState); } }
[ "ikien.dang@gmail.com" ]
ikien.dang@gmail.com
146ed7669a4665e163248a9bad50972c1f0b8d2a
d0fd19b62f95c7df76ba14ef94a559b550076f27
/src/test/java/com/codepandablog/core/test/junit/TestJunit2.java
7f6b2f2194dfbb5fb6c0163613e46ab7386be166
[ "Apache-2.0" ]
permissive
beercafeguy/junit-testing
337a1fd58d98588619cab452883b7ae19e6d4124
de9e926dfd2cacb977c9f9f7c4beb8a56d3be7aa
refs/heads/master
2021-05-09T17:48:38.393925
2018-01-27T09:03:04
2018-01-27T09:03:04
119,148,785
0
0
null
null
null
null
UTF-8
Java
false
false
807
java
package com.codepandablog.core.test.junit; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import org.junit.After; import org.junit.Before; import org.junit.Test; import junit.framework.TestCase; public class TestJunit2 extends TestCase { protected double fValue1; protected double fValue2; @Before protected void setUp() throws Exception { fValue1=2.0; fValue2=3.0; } @Test public void testAdd(){ System.out.println("No of test Cases:"+this.countTestCases()); System.out.println("Test case name:"+this.getName()); this.setName("my Add test case"); System.out.println("New Test case Name:"+this.getName()); } @After public void tearDown(){ System.out.println("cleaning obj."); } }
[ "hemchandra@outlook.com" ]
hemchandra@outlook.com
5651188e3ad38d495529596970934532af614a1b
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes9.dex_source_from_JADX/com/facebook/messaging/composershortcuts/Boolean_IsPlatformSampleContentEnabledGatekeeperAutoProvider.java
0d599b234c83f04e3553362682367ae70ea50ea8
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
442
java
package com.facebook.messaging.composershortcuts; import com.facebook.gk.GatekeeperStoreImplMethodAutoProvider; import com.facebook.inject.AbstractProvider; /* compiled from: messenger_composer_order */ public class Boolean_IsPlatformSampleContentEnabledGatekeeperAutoProvider extends AbstractProvider<Boolean> { public Object get() { return Boolean.valueOf(GatekeeperStoreImplMethodAutoProvider.a(this).a(289, false)); } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
af1ebe707a12129951c33eb429fc053be5d35fca
3a42f7c7dd05d4caa114eda775d61dc44bc17bd5
/src/main/java/service/Bank.java
c61509cee386eec04334953df0cc8dc33c509063
[]
no_license
natka853/junit5-test-examples
84cef4cf489b39a4cdc502b86e7d880ac249d55c
663c88c6668087699bcf0e3b0938c1e5afa4b848
refs/heads/master
2023-03-28T21:03:55.196826
2021-03-28T20:07:28
2021-03-28T20:07:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,171
java
package service; import model.AccountOperation; import java.math.BigDecimal; import java.util.List; public interface Bank { /** * Tworzy nowe lub zwraca id istniejącego konta. * * @param name imie i nazwisko własciciela * @param address adres własciciela * @return id utworzonego lub istniejacego konta. */ Long createAccount(String name, String address); /** * Znajduje identyfikator konta. * * @param name imię i nazwisko właściciela * @param address adres właściciela * @return id konta lub null gdy brak konta o podanych parametrach */ Long findAccount(String name, String address); /** * Dodaje srodki do konta. * * @param id * @param amount srodki * @throws AccountIdException gdy id konta jest nieprawidlowe */ void deposit(Long id, BigDecimal amount); /** * Zwraca ilosc srodkow na koncie. * * @param id * @return srodki * @throws AccountIdException gdy id konta jest nieprawidlowe */ BigDecimal getBalance(Long id); /** * Pobiera srodki z konta. * * @param id * @param amount srodki * @throws AccountIdException gdy id konta jest nieprawidlowe * @throws InsufficientFundsException gdy srodki na koncie nie sa * wystarczajace do wykonania operacji */ void withdraw(Long id, BigDecimal amount); /** * Przelewa srodki miedzy kontami. * * @param idSource * @param idDestination * @param amount srodki * @throws AccountIdException , gdy id konta jest nieprawidlowe * @throws InsufficientFundsException gdy srodki na koncie nie sa * wystarczajace do wykonania operacji */ void transfer(Long idSource, Long idDestination, BigDecimal amount); AccountOperation getLastOperation(Long accountId); List<AccountOperation> getOperations(Long accountId); class InsufficientFundsException extends RuntimeException { } class AccountIdException extends RuntimeException { } }
[ "mivchal@hotmail.com" ]
mivchal@hotmail.com
e5865072168d650f28d08671d72e9f850324c756
b770ab8994ed2d7e2020d2ae1081dec253aff761
/gulimall-ware/src/main/java/com/atguigu/gulimall/ware/entity/WareOrderTaskEntity.java
808bd9f33a2aaadfe508897544af25d77cd93774
[]
no_license
gcq9527/gulimall
d555975cd0dd2801e5051ce4607ee550b6cc3821
12701078fbbd81cb56b3a880872982e768187227
refs/heads/master
2022-12-02T19:34:03.897870
2020-08-19T12:51:44
2020-08-19T12:51:44
288,726,354
1
0
null
null
null
null
UTF-8
Java
false
false
1,262
java
package com.atguigu.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * 库存工作单 * * @author Guo * @email sunlightcs@gmail.com * @date 2020-07-10 13:41:33 */ @Data @TableName("wms_ware_order_task") public class WareOrderTaskEntity implements Serializable { private static final long serialVersionUID = 1L; /** * id */ @TableId private Long id; /** * order_id */ private Long orderId; /** * order_sn */ private String orderSn; /** * 收货人 */ private String consignee; /** * 收货人电话 */ private String consigneeTel; /** * 配送地址 */ private String deliveryAddress; /** * 订单备注 */ private String orderComment; /** * 付款方式【 1:在线付款 2:货到付款】 */ private Integer paymentWay; /** * 任务状态 */ private Integer taskStatus; /** * 订单描述 */ private String orderBody; /** * 物流单号 */ private String trackingNo; /** * create_time */ private Date createTime; /** * 仓库id */ private Long wareId; /** * 工作单备注 */ private String taskComment; }
[ "1950105527@qq.com" ]
1950105527@qq.com
691588673f71852f82fc79832745dcb626d2972b
00732208063676d399de54bd3a9c4188fa61fc41
/slideshowfx-app/src/integrationTest/java/com/twasyl/slideshowfx/ui/InformationSceneTest.java
4e977ea65509870a10e87255aa644a1b32470f7d
[ "Apache-2.0" ]
permissive
twasyl/SlideshowFX
ef3731ee5023b35ddbce6f930f07f0e801c08314
c24ea95aed8a050a79cddfd1809a5013c16c25cd
refs/heads/master
2021-07-06T00:12:08.096559
2021-06-03T11:31:20
2021-06-03T11:31:20
30,044,052
48
8
NOASSERTION
2020-06-11T06:34:00
2015-01-29T22:16:34
Java
UTF-8
Java
false
false
1,247
java
package com.twasyl.slideshowfx.ui; import com.twasyl.slideshowfx.controls.slideshow.Context; import com.twasyl.slideshowfx.controls.slideshow.InformationPane; import com.twasyl.slideshowfx.engine.presentation.PresentationEngine; import javafx.application.Application; import javafx.scene.Scene; import javafx.stage.Stage; import java.io.File; /** * @author Thierry Wasylczenko */ public class InformationSceneTest extends Application { @Override public void start(Stage primaryStage) throws Exception { final PresentationEngine presentationEngine = new PresentationEngine(); presentationEngine.loadArchive(new File("examples/presentations/SlideshowFX.sfx")); final Context context = new Context(); context.setPresentation(presentationEngine); context.setStartAtSlideId("slide-1427809422878"); final InformationPane root = new InformationPane(context); final Scene scene = new Scene(root); primaryStage.setScene(scene); primaryStage.setMaximized(true); primaryStage.setWidth(500); primaryStage.setHeight(500); primaryStage.show(); } public static void main(String[] args) { InformationSceneTest.launch(args); } }
[ "thierry.wasylczenko@gmail.com" ]
thierry.wasylczenko@gmail.com
a03d628c7e10e34a23fafe66bdf89ad92633d60d
aef6b7c29e439827900b7dca675b3579d5460036
/src/stonesPuzzle/consoleui/ConsoleUI.java
757c3d5f5863fe2853154206b43b133a1e34d193
[]
no_license
PeterDobes/Kamene
0b9f9f159b7c742736a942bf184126f05072eeea
d5c5df9103557d8c04c282510a64d1aaa50d7c34
refs/heads/master
2020-03-16T15:28:22.780863
2018-05-09T11:11:02
2018-05-09T11:11:02
132,744,842
0
0
null
null
null
null
UTF-8
Java
false
false
4,656
java
package stonesPuzzle.consoleui; import stonesPuzzle.BestTimes; import stonesPuzzle.StonesPuzzle; import stonesPuzzle.UserInterface; import stonesPuzzle.engine.Field; import stonesPuzzle.engine.Space; import stonesPuzzle.engine.Stone; import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ConsoleUI implements UserInterface { private Field field; private BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); private String readLine() { try { return input.readLine(); } catch (IOException e) { return null; } } public void newGame(Field field) { this.field = field; StonesPuzzle.getInstance().restartMillis(); field.setTime(0); do { update(); processInput(); if (field.isSolved()) { update(); System.out.println("Solved! Enter your name:"); field.getBestTimes().addPlayerTime(readLine(), (int) field.getTime()); field.scramble(); field.setTime(0); saveField(); System.exit(0); } } while(true); } public void update() { System.out.println((StonesPuzzle.getInstance().getPlayingTime() + field.getTime())+" seconds"); System.out.println(); for (int i = 0; i < field.getRowCount(); i++) { for (int j = 0; j < field.getColumnCount(); j++) { if (field.getStone(i,j).getValue() < field.getStoneCount()) { int value = field.getStone(i,j).getValue(); if (value < 10) { System.out.print(" " + value + " "); } else { System.out.print(" " + value + " "); } } else { System.out.print(" "); } } System.out.println(); } } private void processInput() { System.out.println(); System.out.println("Command: Move~<W, A, S, D>; Exit~<exit>; Scramble~<New>"); try { handleInput(readLine()); } catch (WrongFormatException e) { System.err.println(e.getMessage()); } } private void handleInput(String input) throws WrongFormatException { boolean inNok = true; while (inNok) { Pattern p = Pattern.compile("(?i)(exit)?(new)?([wasd]?)"); Matcher m = p.matcher(input.toLowerCase()); int sRow = field.getSpace().getRow(); int sCol = field.getSpace().getCol(); if (m.matches()) { inNok = false; switch (m.group(0)) { case "exit": field.setTime(StonesPuzzle.getInstance().getPlayingTime() + field.getTime()); saveField(); System.exit(0); break; case "new": field.scramble(); newGame(field); break; case "w": move(sRow, sCol, sRow +1, sCol); break; case "a": move(sRow, sCol, sRow, sCol +1); break; case "s": move(sRow, sCol, sRow -1, sCol); break; case "d": move(sRow, sCol, sRow, sCol -1); default: break; } } else { throw new WrongFormatException("Wrong input"); } } } private void saveField() { try (FileOutputStream os = new FileOutputStream(field.getFILENAME()); ObjectOutputStream oos = new ObjectOutputStream(os)) { oos.writeObject(field); System.out.println("Game saved successfully"); } catch (IOException e) { System.err.println(e.getMessage()+"Saving failed"); } } private void move(int sRow, int sCol, int mRow, int mCol) { if (mRow > -1 && mRow < field.getRowCount() && mCol > -1 && mCol < field.getColumnCount()) { Stone space = field.getStone(sRow, sCol); int moved = field.getStone(mRow, mCol).getValue(); field.getStone(mRow, mCol).setValue(field.getStoneCount()); space.setValue(moved); field.setSpace(new Space(mRow, mCol)); } } }
[ "peter.dobes@fpt.sk" ]
peter.dobes@fpt.sk
d482451771ca5ef4c6c8623ecb3b591401f93c81
25b41784406eb1e86c27f72293e6d3b859f3bad4
/org.insightech.er/src/org/insightech/er/editor/model/testdata/RepeatTestDataDef.java
1bf323786e75e1b5ab8a4e1bbed7b4b80ac64240
[]
no_license
crow-misia/ermaster
6caa6aeda315ce8b613f6a795576dba4fec799aa
b95eb3924aebd8b15614e3fb315fda05ac093284
refs/heads/master
2021-01-10T21:13:29.980161
2013-12-15T00:45:31
2013-12-15T00:45:31
9,947,601
1
0
null
null
null
null
UTF-8
Java
false
false
2,725
java
package org.insightech.er.editor.model.testdata; import java.util.HashMap; import java.util.Map; import org.insightech.er.ResourceString; public class RepeatTestDataDef implements Cloneable { public static final String TYPE_FORMAT = ResourceString .getResourceString("label.testdata.repeat.type.format"); public static final String TYPE_FOREIGNKEY = ResourceString .getResourceString("label.testdata.repeat.type.foreign.key"); public static final String TYPE_ENUM = ResourceString .getResourceString("label.testdata.repeat.type.enum"); public static final String TYPE_NULL = ResourceString .getResourceString("label.testdata.repeat.type.null"); private String type; private int repeatNum; private String template; private String from; private String to; private String increment; private String[] selects; private Map<Integer, String> modifiedValues; public RepeatTestDataDef() { this.modifiedValues = new HashMap<Integer, String>(); } public String getType() { return type; } public void setType(String type) { this.type = type; } public int getRepeatNum() { return repeatNum; } public void setRepeatNum(int repeatNum) { this.repeatNum = repeatNum; } public String getTemplate() { return template; } public void setTemplate(String template) { this.template = template; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getTo() { return to; } public void setTo(String to) { this.to = to; } public String getIncrement() { return increment; } public void setIncrement(String increment) { this.increment = increment; } public String[] getSelects() { return selects; } public void setSelects(String[] selects) { this.selects = selects; } public void setModifiedValue(Integer row, String value) { this.modifiedValues.put(row, value); } public void removeModifiedValue(Integer row) { this.modifiedValues.remove(row); } public Map<Integer, String> getModifiedValues() { return this.modifiedValues; } @Override public RepeatTestDataDef clone() { try { RepeatTestDataDef clone = (RepeatTestDataDef) super.clone(); if (this.selects != null) { clone.selects = new String[this.selects.length]; for (int i = 0; i < clone.selects.length; i++) { clone.selects[i] = this.selects[i]; } } clone.modifiedValues = new HashMap<Integer, String>(); clone.modifiedValues.putAll(this.modifiedValues); return clone; } catch (CloneNotSupportedException e) { return null; } } }
[ "h_nakajima@262b1df3-3705-4e7d-84bc-ae5d46f3fe09" ]
h_nakajima@262b1df3-3705-4e7d-84bc-ae5d46f3fe09
88d8357cc79937d6abcdd18cafc44ecfaed114a5
065206cbb3e40c9c6912f8febd88fd9dd1396295
/app/src/main/java/ru/pavlenty/roomexample/room/Task.java
0d0506440d25f7c781db5a4fbcc9c4758957603e
[]
no_license
pavlentytest/RoomExample_toFix
45660db3535655edc8e5ae279fb7741b5171935a
daa8fa6f65694ba63b18023004ce29127e9620c0
refs/heads/master
2022-03-03T13:56:54.377659
2022-02-24T15:23:17
2022-02-24T15:23:17
241,806,177
0
1
null
null
null
null
UTF-8
Java
false
false
1,227
java
package ru.pavlenty.roomexample.room; import java.io.Serializable; import java.util.Date; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.PrimaryKey; @Entity public class Task implements Serializable { @PrimaryKey(autoGenerate = true) private int id; @ColumnInfo(name = "task") private String task; @ColumnInfo(name = "desc") private String desc; @ColumnInfo(name = "finishBy") private String finishBy; @ColumnInfo(name = "finished") private boolean finished; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTask() { return task; } public void setTask(String task) { this.task = task; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getFinishBy() { return finishBy; } public void setFinishBy(String finishBy) { this.finishBy = finishBy; } public boolean isFinished() { return finished; } public void setFinished(boolean finished) { this.finished = finished; } }
[ "impetus@yandex.ru" ]
impetus@yandex.ru
cb346ec4ada3a91cdf07111d32e331b3ecd720a6
9b4321001a61cef8874b19edc8acd2044ba5a772
/app/src/main/java/edu/columbia/ee/catmouseelephant/GameActivity.java
14473b864dfbe3c9bbd6382c830625832292f271
[ "MIT" ]
permissive
shf0328/CatMouseElephant
489b476a1e81ee9636248334da0c985191b172dc
472c40182d9c76867f01785db78eb145f9b927b9
refs/heads/master
2021-01-20T12:55:47.649980
2017-05-06T01:04:30
2017-05-06T01:04:30
90,427,798
0
0
null
null
null
null
UTF-8
Java
false
false
4,407
java
package edu.columbia.ee.catmouseelephant; import android.content.SharedPreferences; import android.media.MediaPlayer; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; public class GameActivity extends AppCompatActivity { private ImageView playerImgView, computerImgView; private Button mouseBtn, catBtn, elephantBtn; private TextView resultTextView, roundTextView; int count = 0; // initialize the count //intialize a listener to monitoring the three buttons MyOnClickListener myOnClickListener = new MyOnClickListener(); private MediaPlayer mp_background; private MediaPlayer mp_button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_game); //initialize button mouseBtn = (Button) findViewById(R.id.mouseBtn); catBtn = (Button) findViewById(R.id.catBtn); elephantBtn = (Button) findViewById(R.id.elephantBtn); //set click listener mouseBtn.setOnClickListener(myOnClickListener); catBtn.setOnClickListener(myOnClickListener); elephantBtn.setOnClickListener(myOnClickListener); //initialize imgView playerImgView = (ImageView) findViewById(R.id.playerImgView); computerImgView = (ImageView) findViewById(R.id.computerImgView); //initialize result and count TextView resultTextView = (TextView) findViewById(R.id.resultTextView); roundTextView = (TextView) findViewById(R.id.roundTextView); //declare the audio resource to these two MediaPlayer objects mp_background = MediaPlayer.create(this, R.raw.main); mp_button = MediaPlayer.create(this, R.raw.blaster); //play background music here mp_background.start(); } @Override protected void onDestroy() { mp_background.stop(); super.onDestroy(); } private class MyOnClickListener implements View.OnClickListener { @Override public void onClick(View v) { //play button sound here mp_button.start(); // get a random number form 1 to 3 int computer = (int) (Math.random() * 3); count++;// int player = 0; switch(v.getId()){ case R.id.mouseBtn: player = 0; playerImgView.setImageResource(R.drawable.mouse); break; case R.id.catBtn: player = 1; playerImgView.setImageResource(R.drawable.cat); break; case R.id.elephantBtn: player = 2; playerImgView.setImageResource(R.drawable.elephant); break; } switch(computer){ case 0: computerImgView.setImageResource(R.drawable.mouse); break; case 1: computerImgView.setImageResource(R.drawable.cat); break; case 2: computerImgView.setImageResource(R.drawable.elephant); break; } if(computer == player){ resultTextView.setText("Result: " + "Tied!"); roundTextView.setText("Round: " + count); this.putToRecord("tied"); } else if(computer == player + 1 || computer == player -2){ resultTextView.setText("Result: " + "Lose!"); roundTextView.setText("Round: " + count); this.putToRecord("lose"); } else{ resultTextView.setText("Result: " + "Win!"); roundTextView.setText("Round: " + count); this.putToRecord("win"); } } private void putToRecord(String res) { SharedPreferences pref = getSharedPreferences("dataPref", MODE_PRIVATE); // create SharedPreferences.Editor to modify data SharedPreferences.Editor editor = pref.edit(); editor.putInt(res, pref.getInt(res, 0)+1); editor.apply(); } } }
[ "hs2917@columbia.edu" ]
hs2917@columbia.edu
ea0c58244fc4671f0c1e24bc010075083c4f153c
7d499b424b4c2a7ba9c2e8de7d680dd719745190
/app/src/main/java/com/example/aditya/shareit/Server.java
f67fd461843f128edb3410832b0a041bf622e38d
[]
no_license
o0aditya0o/File-Share-Android-
64cb2ea1157f456ed56a0da72696e3e74b8be230
fb589c9b8b1388e3a7b64b5919518bc5634ba837
refs/heads/master
2020-04-02T13:36:01.064536
2016-07-31T18:51:22
2016-07-31T18:51:22
64,609,761
0
0
null
null
null
null
UTF-8
Java
false
false
3,078
java
package com.example.aditya.shareit; import android.content.Context; import android.net.Uri; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.AsyncTask; import android.text.format.Formatter; import android.widget.TextView; import java.io.BufferedInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; import java.net.ServerSocket; import java.net.Socket; /** * Created by aditya on 25/6/16. */ public class Server extends AsyncTask<String,Integer,Void> { TextView deviceIP,progress; Context context; String ipaddress; ServerSocket server = null; Socket sock = null; File newfile ; BufferedInputStream bis = null; DataOutputStream dos = null; String path =null; static InputStream in; Server(Context context,TextView a,TextView b){ deviceIP = a; progress = b; this.context = context; } @Override protected Void doInBackground(String... params) { WifiManager wifiMan = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInf = wifiMan.getConnectionInfo(); int ipAddress = wifiInf.getIpAddress(); ipaddress = String.format("%d.%d.%d.%d", (ipAddress & 0xff),(ipAddress >> 8 & 0xff),(ipAddress >> 16 & 0xff),(ipAddress >> 24 & 0xff)); publishProgress(1); try { server = new ServerSocket(3128); } catch (IOException e) { e.printStackTrace(); } try { sock = server.accept(); publishProgress(2); } catch (IOException e) { e.printStackTrace(); } publishProgress(4); bis = new BufferedInputStream(in); byte[] data = new byte[4076]; try { dos = new DataOutputStream(sock.getOutputStream()); } catch (IOException e) { e.printStackTrace(); } int read; /*try { dos.writeUTF(newfile.getName()); } catch (IOException e) { e.printStackTrace(); } */ try { while((read = bis.read(data))>0){ dos.write(data); publishProgress(3); } } catch (IOException e) { e.printStackTrace(); } publishProgress(4); return null; } @Override protected void onProgressUpdate(Integer... val) { int k=0; if(val[0]==1) { deviceIP.setText(ipaddress); } else if(val[0]==2) progress.setText("Connection Established"); else if(val[0]==3){ if(k%5==0) progress.setText("Sending File"); else{ String temp=progress.getText().toString(); progress.setText(temp+"."); } } else progress.setText("File Send"); } }
[ "aditya.mnnit@gmail.com" ]
aditya.mnnit@gmail.com
0d6cacbfdb1fd69f58aa3292e539172a8e9acf0c
6f753d093310a5e0c0081dceb6ba73f1f8ede1b4
/org.eclipse.emf.refactor.comrel.diagram/src/comrel/diagram/edit/policies/ParallelQueuedUnit4ItemSemanticEditPolicy.java
c114bec9d8bb4dc2978d2a95a1fe0b65fb336b25
[]
no_license
ambrusthomas/MeDeR.refactor.refactoring
fc69a9ba3000833f9bc781c6b321cebe325a7e0e
6cdace0efe8453050437b0e2b61a2409d163fe00
refs/heads/master
2021-01-22T19:09:40.966554
2017-03-29T16:21:41
2017-03-29T16:21:41
85,172,883
0
0
null
null
null
null
UTF-8
Java
false
false
12,425
java
/* * */ package comrel.diagram.edit.policies; import java.util.Iterator; import org.eclipse.emf.ecore.EAnnotation; import org.eclipse.gef.commands.Command; import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand; import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand; import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.View; import comrel.diagram.edit.commands.MultiInputPort2CreateCommand; import comrel.diagram.edit.commands.SingleInputPort3CreateCommand; import comrel.diagram.edit.parts.AtomicUnit3EditPart; import comrel.diagram.edit.parts.CartesianQueuedUnit3EditPart; import comrel.diagram.edit.parts.ConditionalUnit3EditPart; import comrel.diagram.edit.parts.MultiFeatureUnit2EditPart; import comrel.diagram.edit.parts.MultiFilterUnit2EditPart; import comrel.diagram.edit.parts.MultiInputPort2EditPart; import comrel.diagram.edit.parts.MultiPortMappingEditPart; import comrel.diagram.edit.parts.MultiSinglePortMappingEditPart; import comrel.diagram.edit.parts.ParallelQueuedUnit4EditPart; import comrel.diagram.edit.parts.ParallelQueuedUnitParallelQueuedUnitHelperUnitsCompartment3EditPart; import comrel.diagram.edit.parts.ParallelQueuedUnitParallelQueuedUnitRefactoringUnitsCompartment3EditPart; import comrel.diagram.edit.parts.SequentialUnit3EditPart; import comrel.diagram.edit.parts.SingleFeatureUnit2EditPart; import comrel.diagram.edit.parts.SingleFilterUnit2EditPart; import comrel.diagram.edit.parts.SingleInputPort3EditPart; import comrel.diagram.edit.parts.SinglePortMappingEditPart; import comrel.diagram.edit.parts.SingleQueuedUnit3EditPart; import comrel.diagram.part.ComrelVisualIDRegistry; import comrel.diagram.providers.ComrelElementTypes; /** * @generated */ public class ParallelQueuedUnit4ItemSemanticEditPolicy extends ComrelBaseItemSemanticEditPolicy { /** * @generated */ public ParallelQueuedUnit4ItemSemanticEditPolicy() { super(ComrelElementTypes.ParallelQueuedUnit_3037); } /** * @generated */ protected Command getCreateCommand(CreateElementRequest req) { if (ComrelElementTypes.SingleInputPort_3005 == req.getElementType()) { return getGEFWrapper(new SingleInputPort3CreateCommand(req)); } if (ComrelElementTypes.MultiInputPort_3006 == req.getElementType()) { return getGEFWrapper(new MultiInputPort2CreateCommand(req)); } return super.getCreateCommand(req); } /** * @generated */ protected Command getDestroyElementCommand(DestroyElementRequest req) { View view = (View) getHost().getModel(); CompositeTransactionalCommand cmd = new CompositeTransactionalCommand( getEditingDomain(), null); cmd.setTransactionNestingEnabled(false); EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ if (annotation == null) { // there are indirectly referenced children, need extra commands: false addDestroyChildNodesCommand(cmd); addDestroyShortcutsCommand(cmd, view); // delete host element cmd.add(new DestroyElementCommand(req)); } else { cmd.add(new DeleteCommand(getEditingDomain(), view)); } return getGEFWrapper(cmd.reduce()); } /** * @generated */ private void addDestroyChildNodesCommand(ICompositeCommand cmd) { View view = (View) getHost().getModel(); for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) { Node node = (Node) nit.next(); switch (ComrelVisualIDRegistry.getVisualID(node)) { case SingleInputPort3EditPart.VISUAL_ID: for (Iterator<?> it = node.getTargetEdges().iterator(); it .hasNext();) { Edge incomingLink = (Edge) it.next(); if (ComrelVisualIDRegistry.getVisualID(incomingLink) == SinglePortMappingEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest( incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } if (ComrelVisualIDRegistry.getVisualID(incomingLink) == MultiSinglePortMappingEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest( incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = node.getSourceEdges().iterator(); it .hasNext();) { Edge outgoingLink = (Edge) it.next(); if (ComrelVisualIDRegistry.getVisualID(outgoingLink) == SinglePortMappingEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest( outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add(new DestroyElementCommand(new DestroyElementRequest( getEditingDomain(), node.getElement(), false))); // directlyOwned: true // don't need explicit deletion of node as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node)); break; case MultiInputPort2EditPart.VISUAL_ID: for (Iterator<?> it = node.getTargetEdges().iterator(); it .hasNext();) { Edge incomingLink = (Edge) it.next(); if (ComrelVisualIDRegistry.getVisualID(incomingLink) == MultiPortMappingEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest( incomingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), incomingLink)); continue; } } for (Iterator<?> it = node.getSourceEdges().iterator(); it .hasNext();) { Edge outgoingLink = (Edge) it.next(); if (ComrelVisualIDRegistry.getVisualID(outgoingLink) == MultiPortMappingEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest( outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } if (ComrelVisualIDRegistry.getVisualID(outgoingLink) == MultiSinglePortMappingEditPart.VISUAL_ID) { DestroyElementRequest r = new DestroyElementRequest( outgoingLink.getElement(), false); cmd.add(new DestroyElementCommand(r)); cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink)); continue; } } cmd.add(new DestroyElementCommand(new DestroyElementRequest( getEditingDomain(), node.getElement(), false))); // directlyOwned: true // don't need explicit deletion of node as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node)); break; case ParallelQueuedUnitParallelQueuedUnitHelperUnitsCompartment3EditPart.VISUAL_ID: for (Iterator<?> cit = node.getChildren().iterator(); cit .hasNext();) { Node cnode = (Node) cit.next(); switch (ComrelVisualIDRegistry.getVisualID(cnode)) { case SingleFeatureUnit2EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case MultiFeatureUnit2EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case SingleFilterUnit2EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case MultiFilterUnit2EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; } } break; case ParallelQueuedUnitParallelQueuedUnitRefactoringUnitsCompartment3EditPart.VISUAL_ID: for (Iterator<?> cit = node.getChildren().iterator(); cit .hasNext();) { Node cnode = (Node) cit.next(); switch (ComrelVisualIDRegistry.getVisualID(cnode)) { case CartesianQueuedUnit3EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case ParallelQueuedUnit4EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case SingleQueuedUnit3EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case SequentialUnit3EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case ConditionalUnit3EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; case AtomicUnit3EditPart.VISUAL_ID: cmd.add(new DestroyElementCommand( new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true // don't need explicit deletion of cnode as parent's view deletion would clean child views as well // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode)); break; } } break; } } } }
[ "tarendt" ]
tarendt
0bdcc699c8bf541111017e2d257d3803d159b75e
ff802ffe951bef32d25a51df1bfd41db8621dbfb
/src/main/java/org/weight/jmeter/timers/RDistributedSyncTimer.java
447878c6902f3efe671655f8afb79b51f79e5445
[]
no_license
xreztento/JWeight
1fc9b7c2235614bff9e39a130b28c42e0715896f
3ea94c792f62cfa1e907d4dd82ec0a56c1627640
refs/heads/master
2021-05-16T12:13:02.246928
2018-12-19T09:11:09
2018-12-19T09:11:09
105,222,984
9
3
null
null
null
null
UTF-8
Java
false
false
11,551
java
package org.weight.jmeter.timers; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.apache.jmeter.testbeans.TestBean; import org.apache.jmeter.testelement.AbstractTestElement; import org.apache.jmeter.testelement.TestStateListener; import org.apache.jmeter.testelement.ThreadListener; import org.apache.jmeter.threads.JMeterContextService; import org.apache.jmeter.timers.Timer; import org.apache.jmeter.timers.TimerService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPubSub; public class RDistributedSyncTimer extends AbstractTestElement implements Timer, Serializable, TestBean, TestStateListener, ThreadListener { private static final Logger log = LoggerFactory.getLogger(RDistributedSyncTimer.class); /** * Wrapper to {@link CyclicBarrier} to allow lazy init of CyclicBarrier when SyncTimer is configured with 0 */ private static class BarrierWrapper implements Cloneable { private CyclicBarrier barrier; private Jedis jedis = null; private Thread subscribeThread = null; /** * */ public BarrierWrapper() { this.barrier = null; } /** * Synchronized is required to ensure CyclicBarrier is initialized only once per Thread Group * @param parties Number of parties */ public synchronized void setup(String subscribedServerIpAddress, int subscribedServerIpPort, String channelName, int parties) { if (this.barrier == null) { this.barrier = new CyclicBarrier(parties); //Subscribe thread, if onMessage is reset, reset and broke the barrier subscribeThread = new Thread(() -> { jedis = new Jedis(subscribedServerIpAddress, subscribedServerIpPort); try{ jedis.subscribe(new JedisPubSub() { @Override public void onMessage(String channel, String message) { super.onMessage(channel, message); if (message.equals("reset")) { Date now = new Date( ); SimpleDateFormat format = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss"); System.out.println("Aggregate released at" + format.format(now)); reset(); } } }, channelName); } catch (Exception e){ System.out.println("subscribeThread is stop..."); } }); subscribeThread.start(); System.out.println("subscribeThread.start()"); } } /** * Wait until all threads called await on this timer * * @return The arrival index of the current thread * @throws InterruptedException * when interrupted while waiting, or the interrupted status * is set on entering this method * @throws BrokenBarrierException * if the barrier is reset while waiting or broken on * entering or while waiting * @see java.util.concurrent.CyclicBarrier#await() */ public int await() throws InterruptedException, BrokenBarrierException{ return barrier.await(); } /** * Wait until all threads called await on this timer * * @param timeout * The timeout in <code>timeUnit</code> units * @param timeUnit * The time unit for the <code>timeout</code> * @return The arrival index of the current thread * @throws InterruptedException * when interrupted while waiting, or the interrupted status * is set on entering this method * @throws BrokenBarrierException * if the barrier is reset while waiting or broken on * entering or while waiting * @throws TimeoutException * if the specified time elapses * @see java.util.concurrent.CyclicBarrier#await() */ public int await(long timeout, TimeUnit timeUnit) throws InterruptedException, BrokenBarrierException, TimeoutException { return barrier.await(timeout, timeUnit); } /** * @see java.util.concurrent.CyclicBarrier#reset() */ public void reset() { barrier.reset(); } /** * @see java.lang.Object#clone() */ @Override protected Object clone() { BarrierWrapper barrierWrapper= null; try { barrierWrapper = (BarrierWrapper) super.clone(); barrierWrapper.barrier = this.barrier; barrierWrapper.subscribeThread = this.subscribeThread; barrierWrapper.jedis = this.jedis; } catch (CloneNotSupportedException e) { //Cannot happen e.printStackTrace(); } return barrierWrapper; } } private static final long serialVersionUID = 3; private transient BarrierWrapper barrier; private int groupSize; private long timeoutInMs; private String channelName; private String subscribedServerIpAddress; private int subscribedServerIpPort; // Ensure transient object is created by the server private Object readResolve(){ createBarrier(); return this; } /** * @return Returns the numThreads. */ public int getGroupSize() { return groupSize; } /** * @param numThreads * The numThreads to set. */ public void setGroupSize(int numThreads) { this.groupSize = numThreads; } public String getChannelName() { if (channelName.trim().equals("")) { channelName = "default"; } return channelName; } public void setChannelName(String channelName) { this.channelName = channelName; } public String getSubscribedServerIpAddress() { return subscribedServerIpAddress; } public void setSubscribedServerIpAddress(String subscribedServerIpAddress) { this.subscribedServerIpAddress = subscribedServerIpAddress; } public int getSubscribedServerIpPort() { return subscribedServerIpPort; } public void setSubscribedServerIpPort(int subscribedServerIpPort) { this.subscribedServerIpPort = subscribedServerIpPort; } /** * {@inheritDoc} */ @Override public long delay() { Jedis jedis = null; String script = "if redis.call('exists',KEYS[1]) == 0 then return redis.call('set', KEYS[1], '0') else return 2 end"; String key = getChannelName() + "-key"; if (getGroupSize() >= 0) { try { jedis = new Jedis(getSubscribedServerIpAddress(), getSubscribedServerIpPort()); jedis.eval(script, 1, key); if (timeoutInMs == 0) { long arrival = jedis.incr(key); System.out.println("group:" + getGroupSize()); System.out.println(arrival); if (arrival == getGroupSize()) { jedis.set(key, "0"); jedis.publish(getChannelName(), "reset"); } else { this.barrier.await(TimerService.getInstance().adjustDelay(Long.MAX_VALUE), TimeUnit.MILLISECONDS); } } else if (timeoutInMs > 0) { long arrival = jedis.incr(key); if (arrival == getGroupSize()) { jedis.set(key, "0"); jedis.publish(getChannelName(), "reset"); } else { this.barrier.await(TimerService.getInstance().adjustDelay(timeoutInMs), TimeUnit.MILLISECONDS); } } else { throw new IllegalArgumentException("Negative value for timeout:" + timeoutInMs + " in Synchronizing Timer " + getName()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return 0; } catch (BrokenBarrierException e) { return 0; } catch (TimeoutException e) { if (log.isWarnEnabled()) { log.warn("SyncTimer {} timeouted waiting for users after: {}ms", getName(), getTimeoutInMs()); } return 0; } finally { if (jedis != null) { jedis.close(); } } } return 0; } /** * We have to control the cloning process because we need some cross-thread * communication if our synctimers are to be able to determine when to block * and when to release. */ @Override public Object clone() { RDistributedSyncTimer newTimer = (RDistributedSyncTimer) super.clone(); newTimer.barrier = barrier; newTimer.groupSize = groupSize; newTimer.timeoutInMs = timeoutInMs; newTimer.subscribedServerIpAddress = subscribedServerIpAddress; newTimer.subscribedServerIpPort = subscribedServerIpPort; newTimer.channelName = channelName; return newTimer; } /** * {@inheritDoc} */ @Override public void testEnded() { this.testEnded(null); } /** * Reset timerCounter */ @Override public void testEnded(String host) { String key = getChannelName() + "-key"; this.barrier.subscribeThread.interrupt(); this.barrier.jedis.close(); Jedis jedis = new Jedis(getSubscribedServerIpAddress(), getSubscribedServerIpPort()); jedis.del(key); jedis.close(); } /** * {@inheritDoc} */ @Override public void testStarted() { testStarted(null); } /** * Reset timerCounter */ @Override public void testStarted(String host) { createBarrier(); } /** * */ private void createBarrier() { this.barrier = new BarrierWrapper(); } @Override public void threadStarted() { int parties = getGroupSize() == 0 ? JMeterContextService.getContext().getThreadGroup().getNumThreads() : getGroupSize(); // Unique Barrier creation ensured by synchronized setup this.barrier.setup(getSubscribedServerIpAddress(), getSubscribedServerIpPort(), getChannelName(), parties); } @Override public void threadFinished() { // NOOP } /** * @return the timeoutInMs */ public long getTimeoutInMs() { return timeoutInMs; } /** * @param timeoutInMs the timeoutInMs to set */ public void setTimeoutInMs(long timeoutInMs) { this.timeoutInMs = timeoutInMs; } }
[ "liushuai@tiandetech.com" ]
liushuai@tiandetech.com
b70b55cb380147fc1152cc618998e7bf94f485aa
c91fca097bbf00ef0a6e9e9e77c5555cf5d042aa
/src/main/java/customExceptions/InvalidPasswordException.java
bb7b3163e2bef6f2465f0ad3e5e4eaec18714bfa
[]
no_license
Stanly0407/JavaLearning
283b73009e1e35eb86cc12f10b9f6f0a799d3b39
df659ebc3bffef13d1f51a46031117230040e0d4
refs/heads/master
2023-03-18T10:44:25.131395
2021-03-04T16:13:56
2021-03-04T16:13:56
283,487,992
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package customExceptions; // example public class InvalidPasswordException extends Exception { public InvalidPasswordException(String username) { super(String.format("Invalid password for user %s", username)); } }
[ "Shelestova_S_V@mail.ru" ]
Shelestova_S_V@mail.ru
23109a1935e96376f7465b4ead3ae8d9df6cdf54
9fecd19ccc2a679bcc106781c29d084362509d6c
/classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/text/PasswordView.java
38bb0eec13ea1c1f0bf5daeb926ea454e192c0ca
[ "Apache-2.0" ]
permissive
renesugar/Bytecoder
f0c4eb2547fb2ee87f06f9544fa73bc9026bf8e9
e28cb615c2d4e2afa3aa5d29571c8815e0b9d3f5
refs/heads/master
2023-01-06T19:27:17.049721
2020-10-30T22:20:41
2020-10-30T22:20:41
297,577,126
0
0
Apache-2.0
2020-10-30T22:20:43
2020-09-22T07:58:05
null
UTF-8
Java
false
false
13,108
java
/* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing.text; import sun.swing.SwingUtilities2; import java.awt.*; import java.awt.font.FontRenderContext; import javax.swing.JPasswordField; /** * Implements a View suitable for use in JPasswordField * UI implementations. This is basically a field ui that * renders its contents as the echo character specified * in the associated component (if it can narrow the * component to a JPasswordField). * * @author Timothy Prinzing * @see View */ public class PasswordView extends FieldView { /** * Constructs a new view wrapped on an element. * * @param elem the element */ public PasswordView(Element elem) { super(elem); } /** * Renders the given range in the model as normal unselected * text. This sets the foreground color and echos the characters * using the value returned by getEchoChar(). * * @param g the graphics context * @param x the starting X coordinate &gt;= 0 * @param y the starting Y coordinate &gt;= 0 * @param p0 the starting offset in the model &gt;= 0 * @param p1 the ending offset in the model &gt;= p0 * @return the X location of the end of the range &gt;= 0 * @exception BadLocationException if p0 or p1 are out of range * * @deprecated replaced by * {@link #drawUnselectedText(Graphics2D, float, float, int, int)} */ @Deprecated(since = "9") @Override protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { return (int) drawUnselectedTextImpl(g, x, y, p0, p1, false); } @Override protected float drawUnselectedText(Graphics2D g, float x, float y, int p0, int p1) throws BadLocationException { return drawUnselectedTextImpl(g, x, y, p0, p1, true); } @SuppressWarnings("deprecation") private float drawUnselectedTextImpl(Graphics g, float x, float y, int p0, int p1, boolean useFPAPI) throws BadLocationException { Container c = getContainer(); if (c instanceof JPasswordField) { JPasswordField f = (JPasswordField) c; if (!f.echoCharIsSet()) { boolean useDrawUnselectedFPAPI = useFPAPI && drawUnselectedTextOverridden && g instanceof Graphics2D; return (useDrawUnselectedFPAPI ) ? super.drawUnselectedText((Graphics2D) g, x, y, p0, p1) : super.drawUnselectedText(g, (int) x, (int) y, p0, p1); } if (f.isEnabled()) { g.setColor(f.getForeground()); } else { g.setColor(f.getDisabledTextColor()); } char echoChar = f.getEchoChar(); int n = p1 - p0; boolean useEchoCharFPAPI = useFPAPI && drawEchoCharacterOverridden && g instanceof Graphics2D; for (int i = 0; i < n; i++) { x = (useEchoCharFPAPI) ? drawEchoCharacter((Graphics2D) g, x, y, echoChar) : drawEchoCharacter(g, (int) x, (int) y, echoChar); } } return x; } /** * Renders the given range in the model as selected text. This * is implemented to render the text in the color specified in * the hosting component. It assumes the highlighter will render * the selected background. Uses the result of getEchoChar() to * display the characters. * * @param g the graphics context * @param x the starting X coordinate &gt;= 0 * @param y the starting Y coordinate &gt;= 0 * @param p0 the starting offset in the model &gt;= 0 * @param p1 the ending offset in the model &gt;= p0 * @return the X location of the end of the range &gt;= 0 * @exception BadLocationException if p0 or p1 are out of range * * @deprecated replaced by * {@link #drawSelectedText(Graphics2D, float, float, int, int)} */ @Deprecated(since = "9") @Override protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { return (int) drawSelectedTextImpl(g, x, y, p0, p1, false); } @Override protected float drawSelectedText(Graphics2D g, float x, float y, int p0, int p1) throws BadLocationException { return drawSelectedTextImpl(g, x, y, p0, p1, true); } @SuppressWarnings("deprecation") private float drawSelectedTextImpl(Graphics g, float x, float y, int p0, int p1, boolean useFPAPI) throws BadLocationException { g.setColor(selected); Container c = getContainer(); if (c instanceof JPasswordField) { JPasswordField f = (JPasswordField) c; if (!f.echoCharIsSet()) { boolean useDrawUnselectedFPAPI = useFPAPI && drawSelectedTextOverridden && g instanceof Graphics2D; return (useFPAPI) ? super.drawSelectedText((Graphics2D) g, x, y, p0, p1) : super.drawSelectedText(g, (int) x, (int) y, p0, p1); } char echoChar = f.getEchoChar(); int n = p1 - p0; boolean useEchoCharFPAPI = useFPAPI && drawEchoCharacterOverridden && g instanceof Graphics2D; for (int i = 0; i < n; i++) { x = (useEchoCharFPAPI) ? drawEchoCharacter((Graphics2D) g, x, y, echoChar) : drawEchoCharacter(g, (int) x, (int) y, echoChar); } } return x; } /** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate &gt;= 0 * @param y the starting Y coordinate &gt;= 0 * @param c the echo character * @return the updated X position &gt;= 0 * * @deprecated replaced by * {@link #drawEchoCharacter(Graphics2D, float, float, char)} */ @Deprecated(since = "9") protected int drawEchoCharacter(Graphics g, int x, int y, char c) { return (int) drawEchoCharacterImpl(g, x, y, c, false); } /** * Renders the echo character, or whatever graphic should be used * to display the password characters. The color in the Graphics * object is set to the appropriate foreground color for selected * or unselected text. * * @param g the graphics context * @param x the starting X coordinate {@code >= 0} * @param y the starting Y coordinate {@code >= 0} * @param c the echo character * @return the updated X position {@code >= 0} * * @since 9 */ protected float drawEchoCharacter(Graphics2D g, float x, float y, char c) { return drawEchoCharacterImpl(g, x, y, c, true); } private float drawEchoCharacterImpl(Graphics g, float x, float y, char c, boolean useFPAPI) { ONE[0] = c; SwingUtilities2.drawChars(Utilities.getJComponent(this), g, ONE, 0, 1, x, y); if (useFPAPI) { return x + g.getFontMetrics().charWidth(c); } else { FontRenderContext frc = g.getFontMetrics().getFontRenderContext(); return x + (float) g.getFont().getStringBounds(ONE, 0, 1, frc).getWidth(); } } /** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert &gt;= 0 * @param a the allocated region to render into * @return the bounding box of the given position * @exception BadLocationException if the given position does not * represent a valid location in the associated document * @see View#modelToView */ public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { Container c = getContainer(); if (c instanceof JPasswordField) { JPasswordField f = (JPasswordField) c; if (! f.echoCharIsSet()) { return super.modelToView(pos, a, b); } char echoChar = f.getEchoChar(); FontMetrics m = f.getFontMetrics(f.getFont()); Rectangle alloc = adjustAllocation(a).getBounds(); int dx = (pos - getStartOffset()) * m.charWidth(echoChar); alloc.x += dx; alloc.width = 1; return alloc; } return null; } /** * Provides a mapping from the view coordinate space to the logical * coordinate space of the model. * * @param fx the X coordinate &gt;= 0.0f * @param fy the Y coordinate &gt;= 0.0f * @param a the allocated region to render into * @return the location within the model that best represents the * given point in the view * @see View#viewToModel */ public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) { bias[0] = Position.Bias.Forward; int n = 0; Container c = getContainer(); if (c instanceof JPasswordField) { JPasswordField f = (JPasswordField) c; if (! f.echoCharIsSet()) { return super.viewToModel(fx, fy, a, bias); } char echoChar = f.getEchoChar(); int charWidth = f.getFontMetrics(f.getFont()).charWidth(echoChar); a = adjustAllocation(a); Rectangle alloc = (a instanceof Rectangle) ? (Rectangle)a : a.getBounds(); n = (charWidth > 0 ? ((int)fx - alloc.x) / charWidth : Integer.MAX_VALUE); if (n < 0) { n = 0; } else if (n > (getStartOffset() + getDocument().getLength())) { n = getDocument().getLength() - getStartOffset(); } } return getStartOffset() + n; } /** * Determines the preferred span for this view along an * axis. * * @param axis may be either View.X_AXIS or View.Y_AXIS * @return the span the view would like to be rendered into &gt;= 0. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. */ public float getPreferredSpan(int axis) { switch (axis) { case View.X_AXIS: Container c = getContainer(); if (c instanceof JPasswordField) { JPasswordField f = (JPasswordField) c; if (f.echoCharIsSet()) { char echoChar = f.getEchoChar(); FontMetrics m = f.getFontMetrics(f.getFont()); Document doc = getDocument(); return m.charWidth(echoChar) * getDocument().getLength(); } } } return super.getPreferredSpan(axis); } static char[] ONE = new char[1]; private final boolean drawEchoCharacterOverridden = getFPMethodOverridden(getClass(), "drawEchoCharacter", FPMethodArgs.GNNC); }
[ "noreply@github.com" ]
noreply@github.com
8627acc2c653f0acf4aa3ea0bf15d2814750a2cd
8a6453cd49949798c11f57462d3f64a1fa2fc441
/aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/transform/DescribeQueriesRequestMarshaller.java
4350e6b13f8c514893f72fba98a0b0e847009501
[ "Apache-2.0" ]
permissive
tedyu/aws-sdk-java
138837a2be45ecb73c14c0d1b5b021e7470520e1
c97c472fd66d7fc8982cb4cf3c4ae78de590cfe8
refs/heads/master
2020-04-14T14:17:28.985045
2019-01-02T21:46:53
2019-01-02T21:46:53
163,892,339
0
0
Apache-2.0
2019-01-02T21:38:39
2019-01-02T21:38:39
null
UTF-8
Java
false
false
2,964
java
/* * Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.logs.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.logs.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * DescribeQueriesRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class DescribeQueriesRequestMarshaller { private static final MarshallingInfo<String> LOGGROUPNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("logGroupName").build(); private static final MarshallingInfo<String> STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("status").build(); private static final MarshallingInfo<Integer> MAXRESULTS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("maxResults").build(); private static final MarshallingInfo<String> NEXTTOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("nextToken").build(); private static final DescribeQueriesRequestMarshaller instance = new DescribeQueriesRequestMarshaller(); public static DescribeQueriesRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(DescribeQueriesRequest describeQueriesRequest, ProtocolMarshaller protocolMarshaller) { if (describeQueriesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeQueriesRequest.getLogGroupName(), LOGGROUPNAME_BINDING); protocolMarshaller.marshall(describeQueriesRequest.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(describeQueriesRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(describeQueriesRequest.getNextToken(), NEXTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
422d35e0258530d06c53e55593848116ef3b959b
feb5bede307c77093ce4c6ad597678a006cb2690
/spring-hnservice/src/main/java/edu/hanoi/service/ContextStartEventHandler.java
ddffdfc3583c01edd63ffdcaee90e130e6c120d8
[]
no_license
trungdovan87/spring-lab
e6e3734d879ece916790d1d256300e564022bce2
debbfedabf04036775837d9883aa7e94b89a409c
refs/heads/master
2021-01-22T03:44:04.527162
2018-08-30T06:33:10
2018-08-30T06:33:10
81,454,538
0
0
null
null
null
null
UTF-8
Java
false
false
1,625
java
package edu.hanoi.service; import edu.hanoi.service.dao.GroupDAO; import edu.hanoi.service.dao.UserDao; import edu.hanoi.service.model.Group; import edu.hanoi.service.model.User; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.ContextStartedEvent; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; /** * Created by trungdovan on 12/4/16. */ @Component public class ContextStartEventHandler { private final static Logger logger = Logger.getLogger(ContextStartEventHandler.class); @Autowired private UserDao userDao; @Autowired private GroupDAO groupDao; @EventListener public void handleStartedEvent(ContextStartedEvent event) { System.out.println("------ Context Started Event"); } @EventListener public void handleRefredEvent(ContextRefreshedEvent event) { System.out.print("------ Context Refreshed Event"); // for (int i = 0; i < 10; i++) { // User user = new User(); // user.setUsername("test" + i); // user.setPassword("123"); // user.setAge(i); // user.setEmail(String.format("test%d@gmail.com", i)); // userDao.insert(user); // } // // for (int i = 0; i < 4; i++) { // Group userGroup = new Group(); // userGroup.setName("USER ROLE " + i); // //userGroup.setId(i); // groupDao.insert(userGroup); // } } }
[ "trungdovan87@gmail.com" ]
trungdovan87@gmail.com
abe856a047b7fb4984a5843e427ac5e8c19085ad
ddf80834af5e23cc9b101232dbd0ac9ff29ad41d
/src/main/java/com/qh/venus/achilles/pts/sys/domain/TSysSerialNumber.java
b7fdfa946374d24a97e51f5a5ed6e23da68a217c
[]
no_license
wweevv-johndpope/wedding-manager-v2
8f319395c7721acdf0821dc6eebe71d52c3f40b3
5a888f5e0d068a13abaca609b34e80564af838e6
refs/heads/main
2023-03-16T14:12:41.030778
2020-12-11T03:59:06
2020-12-11T03:59:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,633
java
package com.qh.venus.achilles.pts.sys.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.qh.venus.achilles.framework.aspectj.lang.annotation.Excel; import com.qh.venus.achilles.framework.aspectj.lang.annotation.Excel.Type; import com.qh.venus.achilles.framework.web.domain.BaseEntity; /** * 公共流水号对象 t_sys_serial_number * * @author qh_venus_zf * @date 2020-04-22 */ public class TSysSerialNumber extends BaseEntity { private static final long serialVersionUID = 1L; /** 主键 */ private String id; /** 模块名称 */ @Excel(name = "模块名称") private String modelName; /** 模块代码 */ @Excel(name = "模块代码") private String modelCode; /** 参数模板 */ @Excel(name = "参数模板") private String configTemplet; /** 当前最大值 */ @Excel(name = "当前最大值") private String maxSerial; /** 缓存个数 */ @Excel(name = "缓存个数") private String preMaxNum; /** 自增标识 */ @Excel(name = "自增标识") private String autoIncrementFlag; /** 状态 */ @Excel(name = "状态") private Long status; /** 删除标识 */ private Long delFlag; public void setId(String id) { this.id = id; } public String getId() { return id; } public void setModelName(String modelName) { this.modelName = modelName; } public String getModelName() { return modelName; } public void setModelCode(String modelCode) { this.modelCode = modelCode; } public String getModelCode() { return modelCode; } public void setConfigTemplet(String configTemplet) { this.configTemplet = configTemplet; } public String getConfigTemplet() { return configTemplet; } public void setMaxSerial(String maxSerial) { this.maxSerial = maxSerial; } public String getMaxSerial() { return maxSerial; } public void setPreMaxNum(String preMaxNum) { this.preMaxNum = preMaxNum; } public String getPreMaxNum() { return preMaxNum; } public void setAutoIncrementFlag(String autoIncrementFlag) { this.autoIncrementFlag = autoIncrementFlag; } public String getAutoIncrementFlag() { return autoIncrementFlag; } public void setStatus(Long status) { this.status = status; } public Long getStatus() { return status; } public void setDelFlag(Long delFlag) { this.delFlag = delFlag; } public Long getDelFlag() { return delFlag; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("modelName", getModelName()) .append("modelCode", getModelCode()) .append("configTemplet", getConfigTemplet()) .append("maxSerial", getMaxSerial()) .append("preMaxNum", getPreMaxNum()) .append("autoIncrementFlag", getAutoIncrementFlag()) .append("status", getStatus()) .append("delFlag", getDelFlag()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } }
[ "caoxd@133.cn" ]
caoxd@133.cn
1dcfc48ffd2191a440d516873e1175775d81346e
cd283526fc0cbfc191347d739a33e3bab581eb93
/feign/src/main/java/com/shang/controller/indexController.java
5130d59ae03f58adad5f42b3901636743304bd2d
[]
no_license
Dong929/Learning
0feb5c60249fc6a4177c49c7cd0898662b95e0ce
c80cabe7f63070ad3eb6e885f84bd78eda1b497a
refs/heads/master
2023-03-10T04:31:38.976587
2021-02-26T17:29:48
2021-02-26T17:29:48
340,942,497
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package com.shang.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class indexController { @RequestMapping("/index") public String index(){ return "index"; } @RequestMapping("/login") public String login(){ return "login"; } @RequestMapping("/header") public String header(){ return "/common/header.html"; } @RequestMapping("/header2") public String header2(){ return "/common/header.html"; } @RequestMapping("/img") public String img_upload(){ return "redirect:http://localhost:8030/user/set.html#avatar"; } }
[ "2212267271@qq.com" ]
2212267271@qq.com
6f1a8607c473947f09d2cd6aebc6375ac4806c7d
48b706a0930ce5e8bb05b537ac552046436e5b0a
/src/game/Game.java
a396b833a8a276e798ccdc238151844615ede21a
[]
no_license
roflmbo/GrappleRock
b8165a36b74063c65a3e44d0469ee51e6fd27031
65e2e63a13be35273b5d6fc25a85b6cff905ebc4
refs/heads/master
2021-01-22T03:22:41.721066
2013-11-07T06:56:35
2013-11-07T06:56:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,381
java
package game; import gameObjects.IGameObject; import gameObjects.Obstacle; import gameObjects.SampleBox; import gameObjects.SampleObject; import java.util.HashSet; import java.util.Set; import org.jbox2d.common.Vec2; import org.jbox2d.dynamics.World; import org.lwjgl.LWJGLException; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import static org.lwjgl.opengl.GL11.*; public class Game { private static long lastFrame = getTime(); // Used to calculate Delta Time private static long lastFPS = getTime(); // Used to calculate FPS private static int fpsCounter = 0; // Used to calculate FPS private static int deltaTime = 0; // Time since last frame private static int calculatedFPS = 0; // Frames Per Second public static World world = new World(new Vec2(0f, -10f)); // jBox2d World public static final Set<IGameObject> gameObjects = new HashSet<IGameObject>(); // GameObjects // update game objects, render, manage timing public static void startGameLoop() { initialize(); while (!Display.isCloseRequested()) { deltaTime = getDeltaTime(); // update timers: delta time and fps counter updateFPS(); update(); render(); } Display.destroy(); } // Initialize things private static void initialize() { gameObjects.add(new SampleObject()); gameObjects.add(new SampleBox(25,1000, false)); gameObjects.add(new SampleBox(640,400, true)); gameObjects.add(new Obstacle(100,100,100,400)); for(IGameObject gameObject: gameObjects){ gameObject.initialize(); } } // update all game objects private static void update() { for (IGameObject gameObject : gameObjects){ gameObject.update(deltaTime); } world.step((float) deltaTime / 1000f, 8, 3); } // render all game objects private static void render() { glClear(GL_COLOR_BUFFER_BIT); for (IGameObject gameObject : gameObjects){ gameObject.render(); } Display.setTitle("FPS: " + calculatedFPS); // Render FPS counter Display.update(); // Render buffer to screen Display.sync(GameSettings.targetFPS); // sync to xx frames per second } // Set up display / LWJGL private static void setUpDisplay() { try { Display.setDisplayMode(new DisplayMode(GameSettings.screenWidth, GameSettings.screenHeight)); Display.create(); } catch (LWJGLException e) { e.printStackTrace(); System.exit(0); } } // Set up Projection Matrix private static void setUpMatrices () { glMatrixMode(GL_PROJECTION); glOrtho(0, GameSettings.projectionWidth, 0, GameSettings.projectionHeight, 1, -1); glMatrixMode(GL_MODELVIEW); } // return System time in milliseconds public static long getTime() { return System.nanoTime() / 1000000; } // calculate amount of time since last frame in milliseconds. CALL ONLY ONCE PER FRAME. public static int getDeltaTime() { long time = getTime(); int delta = (int) (time - lastFrame); lastFrame = time; return delta; } // update fps counter public static void updateFPS() { if (getTime() - lastFPS > 1000) { calculatedFPS = fpsCounter; fpsCounter = 0; //reset the FPS counter lastFPS += 1000; //add one second } fpsCounter++; } public static void main(String[] argv) { Game.setUpDisplay(); Game.setUpMatrices(); Game.startGameLoop(); } }
[ "colton.ramos567@topper.wku.edu" ]
colton.ramos567@topper.wku.edu
3f07ceb70479e7690e12f71c6ebb11f8e03eb732
bec05445444e7567cc09b80378586f0fc941e380
/WhenWeMet/src/main/java/com/spring/project/dto/MeetingDTO.java
b6ff3af9fa8a387a1df04f0b94464a5afdc73510
[]
no_license
pkhd5454/WhenWeMet
526cec99b488ca020a46b5489df6928739dac5fb
8b801d0fd4756b17445162a9d967d6e7192018c5
refs/heads/master
2022-03-10T19:36:09.367626
2019-10-29T02:48:14
2019-10-29T02:48:14
208,961,300
0
0
null
2019-09-17T04:45:40
2019-09-17T04:45:40
null
UTF-8
Java
false
false
551
java
package com.spring.project.dto; public class MeetingDTO { private int mid; private String mname; private String creator; public int getMid() { return mid; } public String getMname() { return mname; } public void setMname(String mname) { this.mname = mname; } public String getCreator() { return creator; } public void setCreator(String creator) { this.creator = creator; } public void setMid(int mid) { this.mid = mid; } public String toString() { return "mid=" + mid + ", mname=" + mname + ", creator=" + creator; } }
[ "51411433+ngm95@users.noreply.github.com" ]
51411433+ngm95@users.noreply.github.com
2af48276d0cce119870c0b7335fa4778f2a9d0a3
e26c14eee7006b41f5d5ef9270dfce3d68a0c75c
/app/src/main/java/com/example/ashutosh/networkingdemo/model/Contact.java
cf9e1f146729736076ad0ace38cade811f8ca71e
[]
no_license
ashu9326/NetworkingDemo
11f978f854fdec0e9c4924ca12b87652bb63847d
1a38bbc96d380eca15ff0630c0b5fb27a95c49f9
refs/heads/master
2021-01-17T17:44:44.744072
2016-09-25T16:27:12
2016-09-25T16:27:12
69,176,225
0
0
null
null
null
null
UTF-8
Java
false
false
487
java
package com.example.ashutosh.networkingdemo.model; /** * Created by Ashutosh on 24-09-2016. */ public class Contact { private String name,email,phone; public Contact(String name, String email, String phone) { this.name=name; this.email=email; this.phone=phone; } public String getName() { return name; } public String getEmail() { return email; } public String getPhone() { return phone; } }
[ "Ashutosh Gupta" ]
Ashutosh Gupta
045bccb5fe4a98d8b4afe5e3e15fb389dac5bc21
c298362f5b81be4fdaafcd5409e12046ef2022d7
/src/ArrayLists.java
7348a3d94c6f2d42d5c9ce45b5caeb348d39bdc1
[]
no_license
RyanMcGuire1/codeup-java-exercises
c40e874200eea6fe7227c0a8c02c943431ab4ebb
09f531e0b99b20044f536fb239e3a9ed15a8204b
refs/heads/main
2023-02-15T18:19:58.356708
2021-01-07T02:48:30
2021-01-07T02:48:30
317,649,208
0
0
null
2020-12-30T23:14:32
2020-12-01T19:41:21
Java
UTF-8
Java
false
false
1,961
java
import java.util.ArrayList; public class ArrayLists { public static void main(String[] args) { ArrayList<Integer> numbers = new ArrayList<>(); // Add elements to an ArrayList. The element type is the determined by the Object type within the angle brackets <> numbers.add(10); numbers.add(12); numbers.add(13); // prints out ArrayList System.out.println(numbers); // return length of the ArrayList with .size() System.out.println(numbers.size()); // return an element at the specified index System.out.println(numbers.get(1)); // returns index position of found element, -1 if not found. System.out.println(numbers.indexOf(13)); System.out.println(numbers.indexOf(20)); // TODO: Add a new Integer to the numbers ArrayList at index 1. numbers.add(1, 11); System.out.println(numbers); ArrayList<String> roasts = new ArrayList<>(); roasts.add("light"); roasts.add("medium"); roasts.add("medium"); roasts.add("medium"); roasts.add("dark"); roasts.add("dark"); roasts.add("medium"); System.out.println(roasts); // .contains returns a boolean value based on whether or not a searched value exists in the ArrayList System.out.println(roasts.contains("dark")); // TODO: Check if the roasts list contains "espresso" // returns the last occurrence of a given value // TODO: Find the last "medium" roast in the list. // TODO: How could we check if the roasts list is empty? // TODO: Remove one medium roast from the list. If there are duplicate strings in the list, which one is removed first? // TODO: Remove the element at index 4. Note the return value here vs. the previous remove method. // BONUS TODO: How can we get the list of roasts in alphabetical order? } }
[ "ryan.wayne.mcguire@gmail.com" ]
ryan.wayne.mcguire@gmail.com
eca76579ae307a182413978b14d22fd48c44d29e
4760c3fa7f6eea302dc443d65fa4ee2db7277eb5
/app/src/test/java/com/example/dino/ExampleUnitTest.java
0f8e0e6f80d6fb1ef0f144d1d2016b6b1ed6a7ff
[]
no_license
vedaty/dino
7b561579b509c544a17a8a92bfc6a13bda3f169c
84273da707a0d9d35f4ab1e623c8f6012625e03b
refs/heads/master
2021-01-12T10:22:34.118462
2016-12-14T07:59:31
2016-12-14T07:59:31
76,437,692
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package com.example.dino; 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); } }
[ "vedaty@outlook.com" ]
vedaty@outlook.com
d6311b3ff9760fc22faea1c5ff408c7c68dbe95a
c4257dfd084fce5e19a73ce9a8bd3febec2dfde1
/model/src/main/java/org/panteleyev/money/model/CategoryType.java
bc3d660cc9c866ee31b4939853b537bc633edd18
[ "BSD-2-Clause" ]
permissive
petr-panteleyev/money-manager
c285592581da0cff15a75b4b445e187d051b97a2
6f22fa20067e98d7adf5e11e1f4d3f24958fde36
refs/heads/master
2023-09-01T09:24:14.523393
2023-08-20T14:42:59
2023-08-20T17:06:01
82,479,243
0
0
BSD-2-Clause
2022-11-25T19:09:15
2017-02-19T18:14:37
Java
UTF-8
Java
false
false
271
java
/* Copyright © 2017-2022 Petr Panteleyev <petr@panteleyev.org> SPDX-License-Identifier: BSD-2-Clause */ package org.panteleyev.money.model; public enum CategoryType { BANKS_AND_CASH, INCOMES, EXPENSES, DEBTS, PORTFOLIO, ASSETS, STARTUP }
[ "petr-panteleyev@yandex.ru" ]
petr-panteleyev@yandex.ru
f4f7f42c1ff47ddc0b13db2deefa7fd38b192341
16d013d4bdc0375edff0472af1e4d555025a42f4
/Shapes/src/simpleshapes/Triangle.java
eaf4d7064ab360ade489693bd58f9a2cdf803ded
[]
no_license
aworld1/FinalProjectCompSci
4a4242bb2a411505a7c6ad6043cc011cfad84943
0d2768bdb3fbdea478aa8c345892636dfa502c48
refs/heads/master
2020-03-16T03:21:43.766408
2018-06-07T16:52:06
2018-06-07T16:52:06
131,674,734
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package simpleshapes; import handlers.Player; import superclasses.SimpleShape; public class Triangle extends SimpleShape{ public Triangle (Player o) { super(o); value = 3; cost = 30; } public void process() { if (img == null) img = myGame.getUI().readImage("triangle.png"); super.process(); } }
[ "noreply@github.com" ]
noreply@github.com
8128be9f34bae222b22ff586d82aabe1f4debffb
eaf0d78553c3765fe2bfed0d96694f493e8d94a6
/src/main/java/aka/jmetadata/main/helper/DateTimeHelper.java
515912b27a13c1e2d77f443ff08cbc9fd56517e9
[]
no_license
welle/JMetaData
ff76efee1aaecc3a20f0085d843fec4a5e4b26f8
d6552281ee82764b3e7fd25234a3c544f73210e4
refs/heads/master
2020-12-03T00:44:48.409194
2018-08-06T12:13:30
2018-08-06T12:13:30
96,074,116
0
0
null
null
null
null
UTF-8
Java
false
false
2,255
java
package aka.jmetadata.main.helper; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.format.DateTimeParseException; import java.util.regex.Pattern; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; /** * All methods linked to date manipulation. * * @author Charlotte */ public final class DateTimeHelper { // Regex patterns private static Pattern PATTERN_ABSOLUTE = Pattern.compile("(\\d{2}):(\\d{2}):(\\d{2})\\.((\\d{3}))?"); /** * Parses text from the beginning of the given string to produce a date with all DateFormat enum values.<br> * Return first result that match. * The method may not use the entire text of the given string. * * @param dateToParse whose beginning should be parsed. * @return date parsed from the string. */ @Nullable public static LocalDateTime parseLocalDateTime(@NonNull final String dateToParse) { LocalDateTime result = null; final var values = DateFormat.values(); for (final DateFormat dateFormat : values) { try { final var formatter = dateFormat.getSimpleDateFormat(); result = LocalDateTime.parse(dateToParse, formatter); } catch (final DateTimeParseException e) { // Nothing to do } } return result; } /** * Parses text from the beginning of the given string to produce a date with all DateFormat enum values.<br> * Return first result that match. * The method may not use the entire text of the given string. * * @param timeToParse whose beginning should be parsed. * @return time parsed from the string. */ @Nullable public static LocalTime parseLocalTime(@NonNull final String timeToParse) { LocalTime localTime = null; final var matcher = PATTERN_ABSOLUTE.matcher(timeToParse); if (matcher.matches()) { try { localTime = LocalTime.parse(timeToParse); } catch (final DateTimeParseException e) { // Nothing to do } } return localTime; } private DateTimeHelper() { // Singleton } }
[ "charlottewelle@yahoo.fr" ]
charlottewelle@yahoo.fr
36f8457a3251117d5bdaf6afed2439e5876eaf5c
de9a357c5c3b8806b3fbdae55702849d886229ac
/src/main/java/br/com/bexs/tourworld/domain/model/Preto.java
45acd45103f463306af97ba9a53b1661550b3aff
[]
no_license
ederpbrito/tourworld
3ba927def845f09164b332747c6416cb1a24b9ea
ebe7db799ee9d30e149bbae31d73c8de8b41dca4
refs/heads/master
2020-05-16T08:00:42.263269
2019-04-23T01:18:56
2019-04-23T01:18:56
182,895,393
0
0
null
null
null
null
UTF-8
Java
false
false
327
java
package br.com.bexs.tourworld.domain.model; import java.util.List; public class Preto extends Cor { public void assumiu(Aeroporto aeroporto, List<Aeroporto> list) { if(aeroporto.getMelhorRota() != null) { list.add(aeroporto.getMelhorRota()); } if(aeroporto.isOrigemInicial()) list.add(aeroporto); } }
[ "ederpsilva@hotmail.com" ]
ederpsilva@hotmail.com
d7507f05ea70fd979dd51d64965ec74ced23bc38
de76d31cb027eba7e8e569da7c37c1d33508f431
/src/arrays/E12_GeneratedDArray.java
dfa1e0daca9c71a749734bef2bf55bbf934ca05a
[]
no_license
BingYu-track/Thinking-In-Java-Learning
83e4235c66b46e7a3525fc19bb0542f9688f331b
44da040a6ae50b634e793fc50ef97bdfcdbd1acf
refs/heads/master
2023-06-12T09:42:08.872559
2021-07-04T15:00:06
2021-07-04T15:00:06
122,946,178
5
2
null
null
null
null
UTF-8
Java
false
false
489
java
package arrays; import net.mindview.util.ConvertTo; import net.mindview.util.CountingGenerator; import net.mindview.util.Generated; import java.util.Arrays; /** * @version 1.0 * @Description: * @author: hxw * @date: 2019/1/13 21:15 */ public class E12_GeneratedDArray { public static void main(String[] args) { double[] d = ConvertTo.primitive(Generated.array(Double.class, new CountingGenerator.Double(), 15)); System.out.println(Arrays.toString(d)); } }
[ "525782303@qq.com" ]
525782303@qq.com
cb8fcac16724b6fa8d873d7377d102655a6332de
d5fdedea2ef6c5257ff05f8e7201d51c802380e5
/WX_SDK_LoginAuthDemo-V3.1.1/src/com/epoint/wssb/sucheng/wxapi/WXEntryActivity.java
066c9d1de9fe299c1b66749d88debc530c4e2d98
[]
no_license
andli0626/wx_authlogin_eclipse
acbaf01cc2164d6987d5659377f67812a611ae53
92c2dea5e897a35bdd23dbbcc7c6111a68860cd4
refs/heads/master
2021-01-18T19:30:12.792606
2016-07-11T13:16:57
2016-07-11T13:16:57
63,069,501
1
0
null
null
null
null
UTF-8
Java
false
false
4,759
java
package com.epoint.wssb.sucheng.wxapi; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.widget.Toast; import com.epoint.wssb.sucheng.Constants; import com.tencent.mm.sdk.openapi.BaseReq; import com.tencent.mm.sdk.openapi.BaseResp; import com.tencent.mm.sdk.openapi.IWXAPI; import com.tencent.mm.sdk.openapi.IWXAPIEventHandler; import com.tencent.mm.sdk.openapi.SendAuth.Resp; import com.tencent.mm.sdk.openapi.WXAPIFactory; /** * @author andli * @date 2016年6月15日 下午2:33:00 * @annotation */ public class WXEntryActivity extends Activity implements IWXAPIEventHandler { // IWXAPI:第三方APP和微信通信的接口 private IWXAPI api; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 通过WXAPIFactory工厂,获取IWXAPI的实例 api = WXAPIFactory.createWXAPI(this, Constants.APP_ID, false); // 如果分享的时候,该界面没有开启,那么微信开始这个activity时,会调用onCreate,所以这里要处理微信的返回结果 api.handleIntent(getIntent(), this); } // 如果分享的时候,该已经开启,那么微信开始这个activity时,会调用onNewIntent,所以这里要处理微信的返回结果 @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); api.handleIntent(intent, this); } // 微信发送请求到第三方应用时,会回调到该方法 @Override public void onReq(BaseReq arg0) { } // 第三方应用发送到微信的请求处理后的响应结果,会回调到该方法 // 比如:在微信完成文本分享操作后,回调第三方APP @Override public void onResp(BaseResp resp) { String result; switch (resp.errCode) { case BaseResp.ErrCode.ERR_OK: // 处理登录授权成功回调,获取token(注意:新版的SDK,可以直接获取Token) // 第一种 Bundle bundle = new Bundle(); resp.toBundle(bundle); Resp sp = new Resp(bundle); String token = sp.token; // 第二种 // String token = ((SendAuth.Resp) resp).token; Toast.makeText(WXEntryActivity.this, token,Toast.LENGTH_SHORT).show(); // 特别说明:新版SDK貌似不支持获取OpenId,官方文档也没有更新,也没有获取OpenID的具体说明 result = "授权成功!"; break; case BaseResp.ErrCode.ERR_USER_CANCEL: result = "发送取消"; break; case BaseResp.ErrCode.ERR_AUTH_DENIED: result = "发送拒绝"; break; default: result = "发送返回"; break; } Toast.makeText(this, result, Toast.LENGTH_LONG).show(); this.finish(); } private void requestOpenId(String token) { // 开启线程来发起网络请求 new Thread(new Runnable() { @Override public void run() { HttpURLConnection connection = null; try { String urlstr = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid="+Constants.APP_ID+"+&grant_type=refresh_token&refresh_token=REFRESH_TOKEN"; // 获得URL对象 URL url = new URL(urlstr); // 获得HttpURLConnection对象 connection = (HttpURLConnection) url.openConnection(); // 默认为GET请求 connection.setRequestMethod("GET"); // 设置 链接 超时时间 connection.setConnectTimeout(8000); // 设置 读取 超时时间 connection.setReadTimeout(8000); // 设置是否从HttpURLConnection读入,默认为true connection.setDoInput(true); connection.setDoOutput(true); // 请求相应码是否为200(OK) if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { // 下面对获取到的输入流进行读取 InputStream in = connection.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder response = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { response.append(line); } Message message = new Message(); message.what = 1; message.obj = response.toString(); handler.sendMessage(message); } } catch (Exception e) { e.printStackTrace(); } finally { // 关闭连接 if (connection != null) { connection.disconnect(); } } } }).start(); } Handler handler = new Handler(){ public void handleMessage(Message msg) { if(msg.what == 1){ Toast.makeText(WXEntryActivity.this, "返回值:"+msg.obj.toString(), Toast.LENGTH_LONG).show(); } }; }; }
[ "ww1095@163.com" ]
ww1095@163.com
b79ddeacbc5b464f050aaa52b3c9b92139adb20a
6878bcf15c2d57ceaf9af888b9275527616cb4cb
/modul3/app/src/main/java/com/example/modul3/OptionDialogFragment.java
dfda2b91515b32b6205646f0c344f021a32b11c6
[]
no_license
Boooobbbyy/Android
6f9d46fc1f9de534bdf913d7fa3cb1ec2ea85db1
9a497b68611b7acbcd2b74f617a40f017abffad0
refs/heads/master
2023-02-24T00:16:15.700735
2021-01-22T03:25:42
2021-01-22T03:25:42
304,010,171
0
2
null
null
null
null
UTF-8
Java
false
false
3,056
java
package com.example.modul3; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.RadioButton; import android.widget.RadioGroup; public class OptionDialogFragment extends DialogFragment implements View.OnClickListener { private Button btnChoose, btnClose; private RadioGroup rgOptions; private RadioButton rbSaf, rbMou, rbLvg, rbMoyes; private OnOptionDialogListener onOptionDialogListener; public OptionDialogFragment() { // Required empty public constructor } public OnOptionDialogListener getOnOptionDialogListener() { return onOptionDialogListener; } public void setOnOptionDialogListener(OnOptionDialogListener onOptionDialogListener) { this.onOptionDialogListener = onOptionDialogListener; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_option_dialog, container, false); btnChoose = (Button) view.findViewById(R.id.btn_choose); btnChoose.setOnClickListener(this); btnClose = (Button) view.findViewById(R.id.btn_close); btnClose.setOnClickListener(this); rgOptions = (RadioGroup) view.findViewById(R.id.rg_options); rbSaf = (RadioButton) view.findViewById(R.id.rb_saf); rbLvg = (RadioButton) view.findViewById(R.id.rb_lvg); rbMou = (RadioButton) view.findViewById(R.id.rb_mou); rbMoyes = (RadioButton) view.findViewById(R.id.rb_moyes); return view; } @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_close: getDialog().cancel(); break; case R.id.btn_choose: int checkedRadioButtonId = rgOptions.getCheckedRadioButtonId(); if (checkedRadioButtonId != -1) { String coach = null; switch (checkedRadioButtonId) { case R.id.rb_saf: coach = rbSaf.getText().toString().trim(); break; case R.id.rb_mou: coach = rbMou.getText().toString().trim(); break; case R.id.rb_lvg: coach = rbLvg.getText().toString().trim(); break; case R.id.rb_moyes: coach = rbMoyes.getText().toString().trim(); break; } getOnOptionDialogListener().onOptionChoosen(coach); getDialog().cancel(); } break; } } public interface OnOptionDialogListener { void onOptionChoosen(String text); } }
[ "macvermilion@gmail.com" ]
macvermilion@gmail.com
55147c13c5598040485c9064b40095ee22cedecd
8b507d8a34d162900b86e33bcf863803c131450e
/src/main/java/SingleMayBeCompletable.java
a2cf94643b47394bedca369bf55ed012e8b29624
[]
no_license
khatwaniswati/Reactive
8a78d517ecf88bac2daa386c8e3f6e1e3c049632
38b7a3884b90d2e8be9cb2ca0bd1ecb416acafb4
refs/heads/master
2022-09-02T23:41:22.103287
2020-05-31T19:00:36
2020-05-31T19:00:36
266,166,445
0
0
null
null
null
null
UTF-8
Java
false
false
1,993
java
import io.reactivex.rxjava3.core.Completable; import io.reactivex.rxjava3.core.Maybe; import io.reactivex.rxjava3.core.MaybeObserver; import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.disposables.Disposable; public class SingleMayBeCompletable { public static void main(String[] args) { createSingle(); createMaybe(); createCompletable(); } /** * Creates a single and emit data to it's Observer only once */ private static void createSingle() { Single.just("Hello World").subscribe(System.out::println); } /** * Creates a Maybe and it may or may not emit data to it's Observers * <p>Maybe.empty() has been called here and this factory method doesn't emit, only completes</p> */ private static void createMaybe() { Maybe.empty().subscribe(new MaybeObserver<Object>() { @Override public void onSubscribe(Disposable d) { } @Override public void onSuccess(Object o) { System.out.println(o); } @Override public void onError(Throwable e) { } @Override public void onComplete() { System.out.println("Done"); } }); } /** * Creates a Completable * <p> * Completable.fromSingle() factory method has been used here which takes a single * But it doesn't emit any item to it's Observers * </p> * <p> * Because CompletableObserver doesn't have any onNext() method * And it's works is limited to let it's Observers know that something has been completed * You may be using this sometime just to test some stuff * Otherwise, this is not used much often in production * </p> */ private static void createCompletable() { Completable.fromSingle(Single.just("Hello World")).subscribe(() -> System.out.println("Done")); } }
[ "swati22khatwani@gmail.com" ]
swati22khatwani@gmail.com
c1e092e1a8481f65da054fcac756526d48d8c5cb
957852f2339da953ee98948ab04df2ef937e38d1
/src ref/classes-dex2jar_source_from_jdcore/com/google/android/gms/location/places/zzj.java
b0bae6799cb86ce6262d89ef67a5332f84b4ef78
[]
no_license
nvcervantes/apc_softdev_mi151_04
c58fdc7d9e7450654fcb3ce2da48ee62cda5394f
1d23bd19466d2528934110878fdc930c00777636
refs/heads/master
2020-03-22T03:00:40.022931
2019-05-06T04:48:09
2019-05-06T04:48:09
139,407,767
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package com.google.android.gms.location.places; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.Hide; @Hide public final class zzj implements Parcelable.Creator<PlacePhotoMetadataResult> { public zzj() {} }
[ "shierenecervantes23@gmail.com" ]
shierenecervantes23@gmail.com
2059759164edeaf2babf0651a7e84ef288093987
90943e8c10a3e7459964a8e2c94f03a4d73c9553
/app/src/main/java/com/mhl/shop/me/WriteLogisticsActivity.java
d013400ff553e0deb98eca66f9f621ad3a055b89
[]
no_license
fengfenglei/android_app
458aadb1b0f3163feca50f3af6083a00736cfed7
17225d2ea3c909e899e00d95455359084bb42d45
refs/heads/master
2021-01-23T05:25:13.313260
2017-03-27T07:42:54
2017-03-27T07:42:54
86,305,466
3
1
null
null
null
null
UTF-8
Java
false
false
13,784
java
package com.mhl.shop.me; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.Spinner; import android.widget.TextView; import com.lzy.imagepicker.ImagePicker; import com.lzy.imagepicker.bean.ImageItem; import com.lzy.imagepicker.ui.ImageGridActivity; import com.lzy.imagepicker.ui.ImagePreviewDelActivity; import com.lzy.imagepicker.view.CropImageView; import com.lzy.okgo.OkGo; import com.mhl.shop.R; import com.mhl.shop.callback.DialogCallback; import com.mhl.shop.callback.StringDialogCallback; import com.mhl.shop.login.LzyResponse; import com.mhl.shop.login.been.Body; import com.mhl.shop.login.been.Null; import com.mhl.shop.main.MyBaseActivity; import com.mhl.shop.me.adapter.WriteImagePickerAdapter; import com.mhl.shop.me.been.Company; import com.mhl.shop.me.imageloader.GlideImageLoader; import com.mhl.shop.utils.GsonUtils; import com.mhl.shop.utils.JBitmapUtils; import com.mhl.shop.utils.StringUtils; import com.mhl.shop.utils.T; import com.mhl.shop.utils.Urls; import com.umeng.analytics.MobclickAgent; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; import okhttp3.Call; import okhttp3.Response; /** * 作者:lff * 时间;2016-12-22 14:42 * 描述:填写物流信息 */ public class WriteLogisticsActivity extends MyBaseActivity implements WriteImagePickerAdapter.OnRecyclerViewItemClickListener { @Bind(R.id.title_left_imageview) ImageView titleLeftImageview; @Bind(R.id.title_center_textview) TextView titleCenterTextview; @Bind(R.id.order_number) TextView orderNumber; @Bind(R.id.spinner) Spinner spinner; @Bind(R.id.shipcode) EditText shipcode; @Bind(R.id.recyclerView) RecyclerView recyclerView; @Bind(R.id.info) EditText info; @Bind(R.id.ok_button) Button okButton; private String ReturnNo,PkId;//退款编号,退款id private String expressCompanyId,expressCompany;//物流公司ID,物流公司 private WriteImagePickerAdapter adapter; private ArrayList<ImageItem> selImageList; //当前选择的所有图片 private int maxImgCount = 1; //允许选择图片最大数 public static final int IMAGE_ITEM_ADD = -1; public static final int REQUEST_CODE_SELECT = 100; public static final int REQUEST_CODE_PREVIEW = 101; List<File> list= new ArrayList<>();//存放图片的集合 List<String> picList =new ArrayList<>();//存放图片返回成功后的集合 private ArrayAdapter<String> sadapter; private List<Company> company; private Body body;//头像信息 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_write_logistics); ButterKnife.bind(this); initView(); initData(); initImagePicker(); initWidget(); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { TextView tv = (TextView)view; tv.setTextColor(getResources().getColor(R.color.main_text_tow_color)); //设置颜色 tv.setTextSize(14.0f); //设置大小 expressCompanyId =company.get(pos).getPkId()+""; expressCompany =company.get(pos).getCompanyName(); } @Override public void onNothingSelected(AdapterView<?> parent) { // Another interface callback } }); } public void onPause() { super.onPause(); MobclickAgent.onPause(this); } @Override protected void onResume() { super.onResume(); MobclickAgent.onResume(this); } private void initData() { OkGo.post(Urls.URL_ORDER_RETURN_COMPANY)// .tag(this) .execute(new DialogCallback<LzyResponse<List<Company>>>(WriteLogisticsActivity.this, true) { @Override public void onSuccess(LzyResponse<List<Company>> lzyResponse, Call call, Response response) { handleResponse(lzyResponse, call, response); if (lzyResponse.code == 200) { company =lzyResponse.data; // setData(lzyResponse.data); // all_ly.setVisibility(View.VISIBLE); sadapter = new ArrayAdapter<String>(WriteLogisticsActivity.this, android.R.layout.simple_spinner_item, getEditSource()); spinner.setAdapter(sadapter); } else { T.showShort(WriteLogisticsActivity.this, lzyResponse.info); } } @Override public void onError(Call call, Response response, Exception e) { super.onError(call, response, e); handleError(call, response, e); } } ); } public List<String> getEditSource() { List<String> list = new ArrayList<String>(); for(int i=0; i<company.size(); i++) { list.add(company.get(i).getCompanyName()); } return list; } private void initImagePicker() { ImagePicker imagePicker = ImagePicker.getInstance(); imagePicker.setImageLoader(new GlideImageLoader()); //设置图片加载器 imagePicker.setShowCamera(true); //显示拍照按钮 imagePicker.setCrop(false); //允许裁剪(单选才有效) imagePicker.setSaveRectangle(true); //是否按矩形区域保存 imagePicker.setSelectLimit(maxImgCount); //选中数量限制 imagePicker.setStyle(CropImageView.Style.RECTANGLE); //裁剪框的形状 imagePicker.setFocusWidth(800); //裁剪框的宽度。单位像素(圆形自动取宽高最小值) imagePicker.setFocusHeight(800); //裁剪框的高度。单位像素(圆形自动取宽高最小值) imagePicker.setOutPutX(1000); //保存文件的宽度。单位像素 imagePicker.setOutPutY(1000); //保存文件的高度。单位像素 } private void initWidget() { selImageList = new ArrayList<>(); adapter = new WriteImagePickerAdapter(this, selImageList, maxImgCount); adapter.setOnItemClickListener(WriteLogisticsActivity.this); recyclerView.setLayoutManager(new GridLayoutManager(this, 1)); recyclerView.setHasFixedSize(true); recyclerView.setAdapter(adapter); } private void initView() { Intent intent = getIntent(); ReturnNo = intent.getStringExtra("ReturnNo"); PkId= intent.getStringExtra("PkId"); titleCenterTextview.setText("会员退货"); orderNumber.setText(ReturnNo); } @OnClick({R.id.title_left_imageview, R.id.ok_button}) public void onClick(View view) { switch (view.getId()) { case R.id.title_left_imageview: finish(); break; case R.id.ok_button: sumbit(); break; } } private void sumbit() { if(TextUtils.isEmpty(shipcode.getText().toString())){ T.showShort(WriteLogisticsActivity.this,"请填写物流单号"); return; } for (int j = 0; j < selImageList.size(); j++) { try { list.add( new File(JBitmapUtils.saveBitmap2File(JBitmapUtils.revitionImageSize(selImageList.get(j).path),selImageList.get(j).path))); } catch (IOException e) { e.printStackTrace(); } } if (list.size()>0){ OkGo.post(Urls.URL_UPLOAD)// .tag(this) .addFileParams("file", list) // 这里支持一个key传多个文件 // .params("docType", "10") // 可以添加文件上传 .execute(new StringDialogCallback(WriteLogisticsActivity.this, true) { @Override public void onSuccess(String s, Call call, Response response) { body=(Body) GsonUtils.fromJson(s, Body.class); if(body.getCode()==200){ picList= body.getDatas(); post(); }else{ T.showShort(WriteLogisticsActivity.this, body.getMessage()); } } @Override public void onError(Call call, Response response, Exception e) { super.onError(call, response, e); handleError(call, response, e); } } ); }else { post(); } } private void post() { String pic; if (null != picList&& picList.size()>0 ){ pic= StringUtils.listToString(picList); }else { pic= ""; } OkGo.post(Urls.URL_ORDER_RETURN_DELIVER)// .tag(this) .params("returnInfoId",PkId)//退款/退货退款ID .params("expressNo",shipcode.getText().toString())//物流单号 .params("expressCompanyId",expressCompanyId)//物流公司ID .params("expressCompany",expressCompany)//expressCompany .params("expressPic",pic)//物流附件(多个以逗号分隔) .params("expressRemark",info.getText().toString())//备注 .execute(new DialogCallback<LzyResponse<Null>>(WriteLogisticsActivity.this, true) { @Override public void onSuccess(LzyResponse<Null> lzyResponse, Call call, Response response) { handleResponse(lzyResponse, call, response); if (lzyResponse.code == 200) { finish(); } else { T.showShort(WriteLogisticsActivity.this, lzyResponse.info); } } @Override public void onError(Call call, Response response, Exception e) { super.onError(call, response, e); handleError(call, response, e); } } ); } @Override public void onItemClick(View view, int position) { switch (position) { case IMAGE_ITEM_ADD: //打开选择,本次允许选择的数量 ImagePicker.getInstance().setSelectLimit(maxImgCount - selImageList.size()); Intent intent = new Intent(this, ImageGridActivity.class); startActivityForResult(intent, REQUEST_CODE_SELECT); break; default: //打开预览 Intent intentPreview = new Intent(this, ImagePreviewDelActivity.class); intentPreview.putExtra(ImagePicker.EXTRA_IMAGE_ITEMS, (ArrayList<ImageItem>) adapter.getImages()); intentPreview.putExtra(ImagePicker.EXTRA_SELECTED_IMAGE_POSITION, position); startActivityForResult(intentPreview, REQUEST_CODE_PREVIEW); break; } } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == ImagePicker.RESULT_CODE_ITEMS) { //添加图片返回 if (data != null && requestCode == REQUEST_CODE_SELECT) { ArrayList<ImageItem> images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS); selImageList.addAll(images); adapter.setImages(selImageList); } } else if (resultCode == ImagePicker.RESULT_CODE_BACK) { //预览图片返回 if (data != null && requestCode == REQUEST_CODE_PREVIEW) { ArrayList<ImageItem> images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_IMAGE_ITEMS); selImageList.clear(); selImageList.addAll(images); adapter.setImages(selImageList); } } } }
[ "19891124**" ]
19891124**
6e4764e742e277613f61d88f8b7f78941f93c1eb
6675a1a9e2aefd5668c1238c330f3237b253299a
/2.15/dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/FinancialOctoberPeriodType.java
b3ed7cae4a7ffd820035f922a8714abfedc43e96
[ "BSD-3-Clause" ]
permissive
hispindia/dhis-2.15
9e5bd360bf50eb1f770ac75cf01dc848500882c2
f61f791bf9df8d681ec442e289d67638b16f99bf
refs/heads/master
2021-01-12T06:32:38.660800
2016-12-27T07:44:32
2016-12-27T07:44:32
77,379,159
0
0
null
null
null
null
UTF-8
Java
false
false
2,496
java
package org.hisp.dhis.period; /* * Copyright (c) 2004-2014, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * Neither the name of the HISP project nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import java.util.Calendar; /** * @author Chau Thu Tran */ public class FinancialOctoberPeriodType extends FinancialPeriodType { /** * Determines if a de-serialized file is compatible with this class. */ private static final long serialVersionUID = -1623576547899897811L; private static final String ISO_FORMAT = "yyyyOct"; public static final String NAME = "FinancialOct"; @Override protected int getBaseMonth() { return Calendar.OCTOBER; } @Override public String getName() { return NAME; } @Override public String getIsoDate( Period period ) { Calendar cal = createCalendarInstance( period.getStartDate() ); int year = cal.get( Calendar.YEAR ); return String.valueOf( year ) + "Oct"; } @Override public String getIsoFormat() { return ISO_FORMAT; } }
[ "[sagarb.4488@gmail.com]" ]
[sagarb.4488@gmail.com]
6e4f9a86a329f1c9d417ad12213d02a357cc6bcc
74e8db1e680082407c7ca0a86ebedefc2cccd881
/src/test/java/testng/Sleep.java
a7c855d11ed7fe1405e32e0e28b7767dde7150b8
[]
no_license
svolchek/calculator
28b2e77fcadefde26ee9b4418b5ea5932d856982
52de3198ec33ce7dbb882a0927c1093ac77db687
refs/heads/master
2020-03-26T16:46:33.472370
2018-08-28T11:43:06
2018-08-28T11:43:06
145,122,199
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package testng; import java.util.concurrent.TimeUnit; public interface Sleep { default void sleep(){ final short PERIOD=500; try { TimeUnit.MILLISECONDS.sleep(PERIOD); } catch (InterruptedException e) { e.printStackTrace(); } } }
[ "Siarhei_Volchak@epam.com" ]
Siarhei_Volchak@epam.com
7c7483bfc14b67224a9cb4372a670e610710186f
fa444cda81bf78a21b634718d1b30f078b7087e1
/src/main/java/com/learn/core/multithreading/cookbook/Chapter4/ch4_recipe03/src/com/packtpub/java7/concurrency/chapter4/recipe3/trainings/Main.java
6bae1b17463d6214c615919f1870140f9ff36372
[]
no_license
dmitrybilyk/interviews
8fb4356a77ef63d74db613295bbbb296e3e652b7
f48d00bd348bab871304578c0c6c423c24db175e
refs/heads/master
2022-12-22T08:11:35.366586
2022-04-29T17:36:20
2022-04-29T17:36:20
23,141,851
4
0
null
2022-12-16T03:39:20
2014-08-20T08:42:27
Java
UTF-8
Java
false
false
1,150
java
package com.learn.core.multithreading.cookbook.Chapter4.ch4_recipe03.src.com.packtpub.java7.concurrency.chapter4.recipe3.trainings; import java.util.ArrayList; import java.util.List; import java.util.concurrent.*; /** * Created by dmitry on 17.05.17. */ public class Main { public static void main(String[] args) throws InterruptedException, ExecutionException { ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(2); long start = System.currentTimeMillis(); List<Future<Integer>> futures = new ArrayList<>(); for (int i = 0; i < 9999; i++) { AddCalculator addCalculator = new AddCalculator(3, 4); Future<Integer> result = threadPoolExecutor.submit(addCalculator); futures.add(result); // Thread thread = new Thread(addCalculator); // thread.start(); // thread.join(); System.out.println(System.currentTimeMillis() - start); } threadPoolExecutor.shutdown(); for (Future<Integer> future : futures) { System.out.println(future.get()); } } }
[ "dmitry.bilyk@gmail.com" ]
dmitry.bilyk@gmail.com
f4d698e429654ee90d39ac743ced7be0ac7cd92e
6e87bc0ae119b924231d2d1729aa6990f06e84f4
/src/comparable/Main.java
6c46a9aa39f6ac03b5e2bab69ec68f5a287ddd99
[]
no_license
alexeysandler/Course_alexey
448d6867b9e7ec3bd8ff1eb12010ade4355b6901
40903d4dcf09e43d72f39eb67799547ef971a758
refs/heads/master
2021-04-26T22:26:39.135190
2018-03-17T13:38:33
2018-03-17T13:38:33
124,092,450
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package comparable; import java.util.ArrayList; import java.util.Collections; public class Main { public static void main(String[] args) { ArrayList<Person> persons = new ArrayList<Person>(); Person p1 = new Person("alex"); Person p2 = new Person("lior"); Person p3 = new Person("zuzu"); persons.add(p3); Collections.sort(persons); } }
[ "as371x@att.com" ]
as371x@att.com
561b1957f6b8672359d339f30730fde0ded9c2e4
d2227e3fb3cfad48e190f3a3a63e20e61adedd68
/Codigo_Android/app/src/main/java/com/usuarios_api/model/MessagesUserList.java
e423c71d3237bd41ec08654f5d69ba7f994aeca5
[]
no_license
RComonfort/EntregaFinal_DesarrolloWeb
8a6d08680c843408b2e84d8c4cdfb6c6f845bd9f
74467a98076a906d4b3f95b301e6114e9ee9cfa2
refs/heads/master
2021-08-22T08:45:38.603001
2017-11-29T19:56:49
2017-11-29T19:56:49
112,520,454
0
0
null
null
null
null
UTF-8
Java
false
false
2,730
java
/* * 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. */ /* * This code was generated by https://github.com/google/apis-client-generator/ * (build: 2017-11-07 19:12:12 UTC) * on 2017-11-08 at 19:42:08 UTC * Modify at your own risk. */ package com.usuarios_api.model; /** * Model definition for MessagesUserList. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the usuarios_api. For a detailed explanation see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class MessagesUserList extends com.google.api.client.json.GenericJson { /** * The value may be {@code null}. */ @com.google.api.client.util.Key @com.google.api.client.json.JsonString private java.lang.Long code; /** * The value may be {@code null}. */ @com.google.api.client.util.Key private java.util.List<MessagesUserUpdate> data; static { // hack to force ProGuard to consider MessagesUserUpdate used, since otherwise it would be stripped out // see https://github.com/google/google-api-java-client/issues/543 com.google.api.client.util.Data.nullOf(MessagesUserUpdate.class); } /** * @return value or {@code null} for none */ public java.lang.Long getCode() { return code; } /** * @param code code or {@code null} for none */ public MessagesUserList setCode(java.lang.Long code) { this.code = code; return this; } /** * @return value or {@code null} for none */ public java.util.List<MessagesUserUpdate> getData() { return data; } /** * @param data data or {@code null} for none */ public MessagesUserList setData(java.util.List<MessagesUserUpdate> data) { this.data = data; return this; } @Override public MessagesUserList set(String fieldName, Object value) { return (MessagesUserList) super.set(fieldName, value); } @Override public MessagesUserList clone() { return (MessagesUserList) super.clone(); } }
[ "a.comonfort@outlook.com" ]
a.comonfort@outlook.com
24bafe847d8edcd9072d670b4d31591be1ad83ac
19cea1723590baff98ac675de5c05ea1a0a4e330
/src/day19varargsaccessmodifersnt/AcMo02.java
2dd98554d2bbce154ec30f13e8642463ebc19212
[]
no_license
ihsanalgul/techproedfall2020
cf57a45558d4f9478109825273b6ebc42b246c9e
6341e969a62cba4bb511b632827d45e50374d494
refs/heads/master
2023-01-05T16:36:33.436747
2020-11-02T18:08:25
2020-11-02T18:08:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,511
java
package day19varargsaccessmodifersnt; import day18passbyvaluepassbyreferencedatetime.AcMo03; public class AcMo02 extends AcMo03{ public static void main(String[] args) { /* 1) In AcMo01, I created private, protected, default, and public instance variables. In AcMo02, I created an object to access them but I could not access to the private one. So private class members cannot be accessed from other classes. 2) From different packages, you cannot access to default class members. For example; if you create a variable in package A, you can acces to the variable from all classes in the package A but you cannot acces to the variable from other packages. 3) From different packages, you have 2 options for "protected" ones. If you are in "Child" class, you can access to the protected ones. If you are not in a "Child" class, you cannot acces to the protected ones. 4) public class members can be accessed from everywhere. There is no any restriction for public class members Note: For classes, "private" and "protected" access modifiers cannot be used. You can use just "public" or "default" access modifiers. */ AcMo01 obj1 = new AcMo01(); System.out.println(obj1.defaultAge);//27 System.out.println(obj1.protectedAge);//25 System.out.println(obj1.publicAge);//29 AcMo03 obj2 = new AcMo03(); System.out.println(obj2.publicName); System.out.println(obj2.protectedName); } }
[ "apple@apples-imac-6.attlocal.net" ]
apple@apples-imac-6.attlocal.net
1724bc53603e283ef607b879a4e4aac77c968550
7bd7292ebf565f062e89e80ed8b76549893cf909
/src/main/JavaEE_Test/Two/ReflectMainTest.java
da32e1c4d9ef08f682867ace67d8a71ae15411d5
[]
no_license
liucc0413/MyMVCLearning
2d9511178e37b4dd8a7d3ea5bcfc0bbbc911b433
3935aff88b0a1da3c15573c49aab3d019936b176
refs/heads/master
2020-04-23T00:49:17.568986
2019-02-15T03:01:14
2019-02-15T03:01:14
170,793,153
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package Two; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class ReflectMainTest { public static void main(String[] args) { try { ReflectImpl target = (ReflectImpl) Class.forName("Two.ReflectImpl").getConstructor(String.class).newInstance("有参数的狗做器"); Method m = target.getClass().getMethod("sallHello"); m.invoke(target); ReflectImpl reflect = (ReflectImpl) Class.forName("Two.ReflectImpl").newInstance(); Method method = reflect.getClass().getMethod("sallHello", String.class); method.invoke(reflect, "cuicuiliu 没有参数的构造器"); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } }
[ "liucc@dtdream.com" ]
liucc@dtdream.com
f470d6980140bc6e879ecf516decab3e46d9a51b
add554d49171aecfb2ca4d504db7c6e9c50e9124
/app/src/main/java/com/csjbot/blackgaga/ai/NaviAI.java
59170575e457f4fe0e97d758e3b8be5fb58cdf9f
[]
no_license
iamkhan001/RoboDemo
2a9ae5e359bafdfc5cd991ddde7c14067b8de088
11b5e4a7a0bc45c34af593b369cd85dcc74b7a67
refs/heads/master
2020-05-25T10:23:25.479284
2019-05-21T03:53:30
2019-05-21T03:53:30
187,757,641
0
0
null
null
null
null
UTF-8
Java
false
false
6,709
java
package com.csjbot.blackgaga.ai; import android.util.Log; import com.csjbot.blackgaga.R; import com.csjbot.blackgaga.feature.navigation.NaviActivity; import com.csjbot.blackgaga.feature.navigation.TaskStatusManager; import com.csjbot.blackgaga.localbean.NaviBean; import com.csjbot.blackgaga.util.BlackgagaLogger; import java.util.ArrayList; import java.util.List; /** * Created by jingwc on 2017/10/26. */ public class NaviAI extends AI<NaviActivity> { public static NaviAI newInstance() { return new NaviAI(); } public boolean isExistIntent(String text) { String pinyin = strConvertPinyin(text); Intent intent = null; int size = AIParams.datas.size(); for (int i = 0; i < size; i++) { int paramSize = AIParams.datas.get(i)[0].length; for (int j = 0; j < paramSize; j++) { if (pinyin.contains(AIParams.datas.get(i)[0][j].toString())) { intent = (Intent) AIParams.datas.get(i)[1][0]; if (intent == Intent.START_GUIDE || intent == Intent.CANCEL || intent == Intent.BACK_WELCOME || intent == Intent.MAP_SETTING) { return true; } if (intent == Intent.GO_SINGLE){ if (activity.naviBeanList == null || activity.naviBeanList.size() == 0) return false; for (NaviBean naviBean : activity.naviBeanList) { String pinyinPointName = strConvertPinyin(naviBean.getName()).trim(); String pinyinNaviName = strConvertPinyin(naviBean.getNickName()).trim(); if (pinyin.contains(pinyinPointName) || pinyin.contains(pinyinNaviName)) { return true; } } } } } } return false; } @Override public Intent getIntent(String text) { String pinyin = strConvertPinyin(text); Intent intent = null; boolean isStop = false; int size = AIParams.datas.size(); for (int i = 0; i < size; i++) { int paramSize = AIParams.datas.get(i)[0].length; for (int j = 0; j < paramSize; j++) { if (pinyin.contains(AIParams.datas.get(i)[0][j].toString())) { intent = (Intent) AIParams.datas.get(i)[1][0]; if (intent == Intent.GO_SINGLE) { // 无法解决这种情况: // 如果设置了 研发、研发部,而语音是我要去 研发部 // 那么 研发和研发部都能匹配上。。。 if (activity.naviBeanList == null || activity.naviBeanList.size() == 0) break; for (NaviBean naviBean : activity.naviBeanList) { String pinyinPointName = strConvertPinyin(naviBean.getName()).trim(); String pinyinNaviName = strConvertPinyin(naviBean.getNickName()).trim(); if (pinyin.contains(pinyinPointName) || pinyin.contains(pinyinNaviName)) { BlackgagaLogger.debug("语音匹配,单项导览匹配成功"); goSingle(naviBean); break; } } } isStop = true; break; } } if (isStop) { break; } } return intent; } private void goSingle(NaviBean naviBean) { if (activity.guideSingle.workStatus != TaskStatusManager.START && activity.guideAllTask.workStatus != TaskStatusManager.START) { activity.naviAIConfirm(naviBean); // activity.showInfo(naviBean); // activity.isAITalk = true; // activity.guideImm(); } else { activity.runOnUiThread(() -> activity.speak(R.string.working_ing, true)); } } @Override public void handleIntent(Enum e) { super.handleIntent(e); Intent intent = (Intent) e; switch (intent) { case START_GUIDE: BlackgagaLogger.debug("语音匹配,开始一键导览"); if (activity.guideAllTask.workStatus != TaskStatusManager.START && activity.guideSingle.workStatus != TaskStatusManager.START) { activity.isAITalk = true; activity.runOnUiThread(() -> activity.guide()); } break; case BACK_WELCOME: BlackgagaLogger.debug("语音匹配,返回迎宾点"); activity.backWelCome(); break; case GO_SINGLE: break; case MAP_SETTING: BlackgagaLogger.debug("语音匹配,地图设置"); activity.manageMap(); break; case CANCEL: BlackgagaLogger.debug("语音匹配,取消任务"); int workState = activity.workType; if (workState == NaviActivity.GUIDE_SINGLE) { activity.guideImm(); } else if (workState == NaviActivity.GUIDE_ALL) { activity.cancelTask(); } break; default: break; } } static class AIParams { static final String[] GUIDE = {"KAISHIDAOLAN", "DAOLAN", "KAISHI", "DAOYIN"}; static final String[] BACK = {"FANHUIYING", "HUIQU"}; static final String[] GO_SINGLE = {"DAO", "QU", "WOYAOQU", "WOYAODAO","ZAINA"}; static final String[] MAP_SETTING = {"SHEZHIDITU", "DAORUDITU", "CHARUDITU", "GUANLIDITU", "DITUGUANLI", "SHEZHI"}; static final String[] CANCEL = {"QUXIAODAOHANG,QUXIAO,FANHUI,JIESHU,TINGZHI,ZANTING"}; static List<Object[][]> datas; static { datas = new ArrayList<>(); datas.add(new Object[][]{GUIDE, {Intent.START_GUIDE}}); datas.add(new Object[][]{BACK, {Intent.BACK_WELCOME}}); datas.add(new Object[][]{GO_SINGLE, {Intent.GO_SINGLE}}); datas.add(new Object[][]{MAP_SETTING, {Intent.MAP_SETTING}}); datas.add(new Object[][]{CANCEL, {Intent.CANCEL}}); } } public enum Intent { START_GUIDE, BACK_WELCOME, GO_SINGLE, MAP_SETTING, CANCEL } }
[ "imran.k@in.adoroi.com" ]
imran.k@in.adoroi.com
c661d430af5c2561030ffd2366b915f37ca233ae
2cce30032e705abe44ddb41954a8fadba0497dce
/AlyonaAndNumbers.java
d5bb23c4833cccda34b38bd47c4ca47d2a7d2edf
[]
no_license
69-LoVeRGuY/Problems-Solved-Code
f17b4a2268d4a30fc8882d62c92a8c703a270160
91378d4fbe41f191a133995949502f07be5127cb
refs/heads/master
2023-05-20T16:23:02.726278
2021-06-15T01:27:45
2021-06-15T01:27:45
376,980,220
0
0
null
null
null
null
UTF-8
Java
false
false
3,781
java
import java.io.*; import java.util.*; public class AlyonaAndNumbers { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } static class OutputWriter { private final PrintWriter writer; public OutputWriter(OutputStream outputStream) { writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))); } public OutputWriter(Writer writer) { this.writer = new PrintWriter(writer); } public void print(Object...objects) { for (int i = 0; i < objects.length; i++) { if (i != 0) writer.print(' '); writer.print(objects[i]); } } public void printLine(Object...objects) { print(objects); writer.println(); } public void close() { writer.close(); } public void flush() { writer.flush(); } } public static void main(String args[]) { FastReader sc=new FastReader(); OutputWriter out=new OutputWriter(System.out); int n=sc.nextInt(); int m=sc.nextInt(); if(n>m) { int temp=n; n=m; m=temp; } long count=0; int a[]=new int[10]; int q=m/5; if(q==0 || q==1) { for(int i=1;i<=m;i++) a[i]++; } else if(q%2!=0) { for(int i=1;i<=5;i++) a[i]=a[i]+((q/2)+1); for(int i=6;i<=9;i++) a[i]=a[i]+(q/2); a[0]=a[0]+(q/2); for(int i=(5*q)+1;i<=m;i++) { int e=i%10; a[e]++; } } else { for(int i=0;i<=9;i++) a[i]=a[i]+(q/2); for(int i=(5*q)+1;i<=m;i++) { int e=i%10; a[e]++; } } for(int i=1;i<=n;i++) { int d=i%10; if(d==1 || d==6) count=count+a[4]+a[9]; else if(d==2 || d==7) count=count+a[3]+a[8]; else if(d==3 || d==8) count=count+a[2]+a[7]; else if(d==4 || d==9) count=count+a[1]+a[6]; else if(d==5 || d==0) count=count+a[0]+a[5]; } out.printLine(count); out.flush(); } }
[ "abhishek.mehrotra27@gmail.com" ]
abhishek.mehrotra27@gmail.com
66a21137eb9f0cd4b14a4763aa52f813f9a39147
9823434492626672b0288687b0612eff667e25f3
/JARAssign.java
e16b766cb4c08ec1af7587961839bdfbf1cbe6c7
[]
no_license
AnInconvenience/javacc-ohnoes
a234c1a99e83bed78e86428681d3cdc6ff135a52
8c852826d6ca4f83c5be52124a2ff8686776cc93
refs/heads/master
2020-04-02T08:17:50.340742
2015-04-18T16:45:10
2015-04-18T16:45:10
32,636,386
0
0
null
null
null
null
UTF-8
Java
false
false
634
java
/* Generated By:JJTree: Do not edit this line. JARAssign.java Version 4.3 */ /* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=JAR,NODE_EXTENDS=MyNode,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ public class JARAssign extends SimpleNode { public JARAssign(int id) { super(id); } public JARAssign(JarvisParser p, int id) { super(p, id); } public void interpret() { jjtGetChild(1).interpret(); symtab.put(""+((JARVarEval)jjtGetChild(0)).val, stack[top--]); } } /* JavaCC - OriginalChecksum=9a20fc997479c605148e842aba6f7ba8 (do not edit this line) */
[ "nslmdrhr@gmail.com" ]
nslmdrhr@gmail.com
c7cd987409a67bce24c45307f89a5c90f0c99bed
58d43961a774dfec3331e955366b48df763b3f71
/mutool-box-plugin/develop-tools/DirectoryTreeTool/src/main/java/com/xwintop/xJavaFxTool/Main.java
46f1db5ee67f6e612435ef0516935854886c7144
[ "Apache-2.0" ]
permissive
liershuang/mutool-box
e9ddac66fc77c7e7317504dd378a3a5872d7ff75
aba5686f8565e193eda36f952cf9c9433d3d3551
refs/heads/main
2023-02-07T11:13:30.326914
2020-12-30T11:31:58
2020-12-30T11:31:58
309,330,684
4
3
null
null
null
null
UTF-8
Java
false
false
1,621
java
package com.xwintop.xJavaFxTool; import javafx.application.Application; import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.stage.WindowEvent; import lombok.extern.slf4j.Slf4j; import java.net.URL; import java.util.ResourceBundle; @Slf4j public class Main extends Application { public static void main(String[] args) { try { launch(args); } catch (Exception e) { e.printStackTrace(); } } @Override public void start(Stage primaryStage) throws Exception { FXMLLoader fXMLLoader = Main.getFXMLLoader(); ResourceBundle resourceBundle = fXMLLoader.getResources(); Parent root = fXMLLoader.load(); primaryStage.setResizable(true); primaryStage.setTitle(resourceBundle.getString("Title")); // primaryStage.getIcons().add(new Image("/images/icon.jpg")); primaryStage.setScene(new Scene(root)); primaryStage.show(); primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent event) { System.exit(0); } }); } public static FXMLLoader getFXMLLoader() { ResourceBundle resourceBundle = ResourceBundle.getBundle("locale.DirectoryTreeTool"); URL url = Object.class.getResource("/com/xwintop/xJavaFxTool/fxmlView/developTools/DirectoryTreeTool.fxml"); FXMLLoader fXMLLoader = new FXMLLoader(url, resourceBundle); return fXMLLoader; } }
[ "6203" ]
6203
5c9641f577160362f8187a90765737809e2c4d6e
697e8d0a012693876df14ce2440b42d7818149ac
/XChange-develop/xchange-examples/src/main/java/com/xeiam/xchange/examples/kraken/trade/KrakenMarketOrderDemo.java
324ebf6b706db4f133e4f9fbb8f990d9894cb536
[ "MIT" ]
permissive
tochkov/coin-eye
0bdadf195408d77dda220d6558ebc775330ee75c
f04bb141cab3a04d348b04bbf9f00351176bb8d3
refs/heads/master
2021-01-01T04:26:00.984029
2016-04-15T14:22:17
2016-04-15T14:22:17
56,127,186
2
5
null
null
null
null
UTF-8
Java
false
false
2,020
java
package com.xeiam.xchange.examples.kraken.trade; import java.io.IOException; import java.math.BigDecimal; import com.xeiam.xchange.Exchange; import com.xeiam.xchange.currency.CurrencyPair; import com.xeiam.xchange.dto.Order.OrderType; import com.xeiam.xchange.dto.trade.MarketOrder; import com.xeiam.xchange.examples.kraken.KrakenExampleUtils; import com.xeiam.xchange.kraken.dto.trade.KrakenOrderResponse; import com.xeiam.xchange.kraken.service.polling.KrakenTradeServiceRaw; import com.xeiam.xchange.service.polling.trade.PollingTradeService; public class KrakenMarketOrderDemo { public static void main(String[] args) throws IOException { Exchange krakenExchange = KrakenExampleUtils.createTestExchange(); generic(krakenExchange); raw(krakenExchange); } private static void generic(Exchange krakenExchange) throws IOException { // Interested in the private trading functionality (authentication) PollingTradeService tradeService = krakenExchange.getPollingTradeService(); // place a marketOrder with volume 0.01 OrderType orderType = (OrderType.BID); BigDecimal tradeableAmount = new BigDecimal("0.01"); MarketOrder marketOrder = new MarketOrder(orderType, tradeableAmount, CurrencyPair.BTC_EUR); String orderID = tradeService.placeMarketOrder(marketOrder); System.out.println("Market Order ID: " + orderID); } private static void raw(Exchange krakenExchange) throws IOException { // Interested in the private trading functionality (authentication) KrakenTradeServiceRaw tradeService = (KrakenTradeServiceRaw) krakenExchange.getPollingTradeService(); // place a marketOrder with volume 0.01 OrderType orderType = (OrderType.BID); BigDecimal tradeableAmount = new BigDecimal("0.01"); MarketOrder marketOrder = new MarketOrder(orderType, tradeableAmount, CurrencyPair.BTC_EUR); KrakenOrderResponse orderID = tradeService.placeKrakenMarketOrder(marketOrder); System.out.println("Market Order ID: " + orderID); } }
[ "philip.tochkov@gmail.com" ]
philip.tochkov@gmail.com
6c092d5a316a01efae1cc7a712bc01a54d5d0e08
888521cd8198760ded09e9fe0b47f27f2bcac6fa
/Restaurante/Res/src/interfaces/Camareros.java
36202da22806b62abeb9a4ccae40f4bd871b6302
[]
no_license
amrMoreno/Restaurante
c4e7f42a49d3396c44c7cc43810c22887675e4bb
65cd841234d4357ac89af5850c73f16edfb60e8b
refs/heads/master
2020-05-07T18:45:45.300482
2019-05-31T12:33:47
2019-05-31T12:33:47
180,782,653
1
0
null
null
null
null
UTF-8
Java
false
false
3,173
java
package interfaces; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import clases.Camarero; import clases.Mesa; import clases.Productos; import clases.Productos.TipoProducto; import excepciones.DniInvalidoException; import java.awt.SystemColor; import javax.swing.JButton; import javax.swing.JDialog; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.awt.event.ActionEvent; import java.awt.GridLayout; import java.awt.Color; import javax.swing.JLabel; import javax.swing.ImageIcon; public class Camareros extends JDialog { private JDialog thisRef; private Connection c; private JPanel contentPane; public Camareros(Mesa mesa) { super(); this.thisRef=this; setSize(480,200); setTitle("Camareros"); setLocation(400,300); contentPane = new JPanel(); contentPane.setBackground(new Color(220, 220, 220)); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JButton btnRegistrar = new JButton("Nuevo Camarero"); btnRegistrar.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { RegistroCamarero rc=new RegistroCamarero(); rc.setVisible(true); } }); btnRegistrar.setBounds(305, 83, 119, 23); contentPane.add(btnRegistrar); JButton btnAtras = new JButton("Atras"); btnAtras.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { thisRef.setVisible(false); } }); btnAtras.setBounds(305, 128, 119, 23); contentPane.add(btnAtras); JPanel panel = new JPanel(); panel.setBackground(Color.WHITE); panel.setBounds(0, 11, 295, 140); contentPane.add(panel); panel.setLayout(new GridLayout(10, 0)); JLabel Camarero = new JLabel(""); Camarero.setBackground(new Color(220, 220, 220)); Camarero.setIcon(new ImageIcon("./camareroR.png")); Camarero.setBounds(332, 11, 75, 61); contentPane.add(Camarero); try { Connection c=Ventana.cargaBd(); Statement stmte = c.createStatement(); ResultSet rst = stmte .executeQuery("SELECT * FROM camarero"); while (rst.next()) { Camarero camarero = new Camarero(rst.getString("dni"),rst.getString("nombre"),rst.getString("tipoDeCamarero")); JButton camarer = new JButton(camarero.getNombre()); camarer.setFont(new Font("Agency FB", Font.ITALIC, 12)); panel.add(camarer); camarer.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { mesa.setCamarero(camarero); thisRef.setVisible(false); mesa.factura(mesa.getNumeroMesa()); } }); } c.close(); }catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (DniInvalidoException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "adrianmorenoruiz@gmail.com" ]
adrianmorenoruiz@gmail.com
ac4c74bfc8d30155327d67d46624b1aa26376be5
4f1693c50004ecac73386f94b4cc2c0d7cfc32d3
/安卓开发/单元测试/src/com/example/unitTest/CalcTest.java
fe2797fcbd006a1cf1256433008768d9cdb52d61
[]
no_license
MOIPA/MyStudy
57c1ba293d89e5cf937be6b119cde21b46f0fb97
69ca8b4adc8a802b628d39cbf253c5bb040b7c26
refs/heads/master
2021-06-21T05:35:43.289857
2020-02-21T00:47:53
2020-02-21T00:47:53
74,568,907
0
0
null
2020-10-13T07:13:10
2016-11-23T11:08:41
Java
UTF-8
Java
false
false
233
java
package com.example.unitTest; import android.test.AndroidTestCase; public class CalcTest extends AndroidTestCase { public void testAdd(){ Calc calc = new Calc(); int result = calc.add(4, 5); assertEquals(9, result); } }
[ "tassassin@sina.com" ]
tassassin@sina.com
f087e9bc430f8e29d9f9652904cfe8bea3ffbc0b
4008d30a8294d1ab3aa6336f1052ac5ad009731b
/Uebung2/Uebung2/src/ClientUe2.java
52164d906f5796f48fd1fac5f9c2358cc925347a
[]
no_license
JonasFaller/ClientServer_Uebungen
91edf3a9a3eca9f28633b52169de32021533de94
dd69b3d45459e8efd2418694825eb6779f3ce467
refs/heads/master
2021-05-11T13:18:52.439584
2018-03-21T07:10:07
2018-03-21T07:10:07
117,676,181
0
0
null
null
null
null
ISO-8859-3
Java
false
false
1,875
java
import java.io.*; import java.net.*; public class ClientUe2{ public static void main(String[] args) throws UnknownHostException, IOException{ Socket client = new Socket("localhost", 2222); System.out.println("Client wird gestartet"); BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream())); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream())); BufferedReader daten = new BufferedReader(new InputStreamReader(System.in)); //Mit System in schreibt man das in der Console eingegebene in Variablen ein. System.out.print("Benutzer: "); // Eingabe der Benutzernamens: user out.write(daten.readLine()); //Eingabe erfolgt über die Konsole out.newLine(); out.flush(); System.out.print("Passwort: "); //Das Passwort lautet: test out.write(daten.readLine()); out.newLine(); out.flush(); in.readLine(); //eine Zeile muss übersprungen werden beim einlesen System.out.print("Welche Operation moechten Sie durchfuehren: \n + \n - \n * \n / \n"); out.write(daten.readLine()); out.newLine(); out.flush(); System.out.print("\nGeben Sie die erste Zahl: "); out.write(daten.readLine()); out.newLine(); out.flush(); System.out.print("Geben Sie nun die zweite Zahl: "); out.write(daten.readLine()); out.newLine(); out.flush(); System.out.println("Ergebnis: " + in.readLine()); // Ergebnis wird ausgegeben. mit in.readline() wird das Ergebnis vom Server übergeben. out.close(); in.close(); client.close(); } }
[ "noreply@github.com" ]
noreply@github.com
c9ce63020449ad97a1717488e3df2b352af9cd6b
c4a8bede8124116ac06ba7f27fa13952c06c6825
/lib/taskana-data/src/test/java/pro/taskana/sampledata/SampleDataProviderTest.java
d1021605ac711f398d5851184811232b3ae8ef76
[ "Apache-2.0" ]
permissive
generaliinformatik/taskana
4521462accb9a95c5048b065694e311efb49ef1c
bff244543f166b04225a970ea841bf42a0cfa80e
refs/heads/master
2021-01-02T04:09:41.106967
2020-03-03T10:50:37
2020-03-03T15:03:52
239,483,609
4
0
Apache-2.0
2020-03-03T15:03:54
2020-02-10T10:21:56
null
UTF-8
Java
false
false
800
java
package pro.taskana.sampledata; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; /** Test SampleDataGenerator. */ class SampleDataProviderTest { @Test void getScriptsNotNull() { assertThat(SampleDataProvider.getDefaultScripts()).isNotNull(); assertThat(SampleDataProvider.getScriptsWithEvents()).isNotNull(); } @Test void getScriptsNotEmpty() { assertThat(SampleDataProvider.getDefaultScripts().count() > 0).isTrue(); assertThat(SampleDataProvider.getScriptsWithEvents().count() > 0).isTrue(); } @Test void getScriptsFileExists() { SampleDataProvider.getDefaultScripts() .map(SqlReplacer::getScriptBufferedStream) .forEach(Assertions::assertNotNull); } }
[ "zorgati.mustapha@gmail.com" ]
zorgati.mustapha@gmail.com
d6f3d3a089e6d8fdbb88589607b280fcfa7e2a1b
6aa82336675adc8d21c05cedbe9c448a8b1a2d4c
/hybris/bin/custom/myaccelerator/myacceleratorcore/src/com/demo/core/search/solrfacetsearch/provider/impl/GenderFacetDisplayNameProvider.java
4573ba9a4292007db17ec1ab06028741f1eb0fbb
[]
no_license
ronaldkonjer/mycommerce
d6b8df099ad958857d9bd9188a04b42c7f4ffde7
45372746b36fef1a1e0f8f6dbb301dd8e930c250
refs/heads/master
2020-04-19T23:17:16.309603
2018-06-18T11:42:26
2018-06-18T11:42:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,836
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package com.demo.core.search.solrfacetsearch.provider.impl; import de.hybris.platform.core.HybrisEnumValue; import de.hybris.platform.core.enums.Gender; import de.hybris.platform.enumeration.EnumerationService; import de.hybris.platform.servicelayer.i18n.CommonI18NService; import de.hybris.platform.servicelayer.i18n.I18NService; import de.hybris.platform.solrfacetsearch.config.IndexedProperty; import de.hybris.platform.solrfacetsearch.provider.impl.AbstractFacetValueDisplayNameProvider; import de.hybris.platform.solrfacetsearch.search.SearchQuery; import java.util.Locale; import org.springframework.beans.factory.annotation.Required; public class GenderFacetDisplayNameProvider extends AbstractFacetValueDisplayNameProvider { private EnumerationService enumerationService; private I18NService i18nService; private CommonI18NService commonI18NService; @Override public String getDisplayName(final SearchQuery query, final IndexedProperty property, final String facetValue) { if (facetValue == null) { return ""; } final HybrisEnumValue genderEnumValue = getEnumerationService().getEnumerationValue(Gender.class, facetValue); Locale queryLocale = null; if (query == null || query.getLanguage() == null || query.getLanguage().isEmpty()) { queryLocale = getI18nService().getCurrentLocale(); } if (queryLocale == null && query != null) { queryLocale = getCommonI18NService().getLocaleForLanguage(getCommonI18NService().getLanguage(query.getLanguage())); } String genderName = getEnumerationService().getEnumerationName(genderEnumValue, queryLocale); if (genderName == null || genderName.isEmpty()) { genderName = facetValue; } return genderName; } protected EnumerationService getEnumerationService() { return enumerationService; } @Required public void setEnumerationService(final EnumerationService enumerationService) { this.enumerationService = enumerationService; } protected I18NService getI18nService() { return i18nService; } @Required public void setI18nService(final I18NService i18nService) { this.i18nService = i18nService; } protected CommonI18NService getCommonI18NService() { return commonI18NService; } @Required public void setCommonI18NService(final CommonI18NService commonI18NService) { this.commonI18NService = commonI18NService; } }
[ "m.perndorfer@gmx.at" ]
m.perndorfer@gmx.at
27f2d25c371433e1a6d9535d3116f6e8d85dc0f1
10dc1906a257739c5d8380d17f59cae23d6b3b10
/ShadowStrugglesOnline_Servidor/src/br/edu/ifsp/pds/shadowstrugglesonline/servidor/estrutura/GerenciadorFila.java
c422c2eede37285eaa24dc0d670e6eeec131e873
[]
no_license
doanhtdpl/shadowstruggles
6125ba2230cae1bd6aee55f236d4e7c17da33c02
7306e6d1a4cd5c55c77ab9e8d9bd53a79d1292b5
refs/heads/master
2016-09-06T21:52:13.183571
2013-11-28T17:55:05
2013-11-28T17:55:05
40,475,374
0
0
null
null
null
null
UTF-8
Java
false
false
709
java
package br.edu.ifsp.pds.shadowstrugglesonline.servidor.estrutura; import java.util.ArrayList; public class GerenciadorFila { private ArrayList<UsuarioFila> fila; private Servidor servidor; public GerenciadorFila(Servidor servidor) { super(); this.servidor = servidor; } public void run(){ } public boolean selecionarParaPartida(Usuario usuario1, Usuario usuario2){ return false; } public ArrayList<UsuarioFila> getFila() { return fila; } public void setFila(ArrayList<UsuarioFila> fila) { this.fila = fila; } public Servidor getServidor() { return servidor; } public void setServidor(Servidor servidor) { this.servidor = servidor; } }
[ "gmerencio.santos@gmail.com" ]
gmerencio.santos@gmail.com
4c34ff8730467eaeeaa8d960668452211446302a
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-ivs/src/main/java/com/amazonaws/services/ivs/model/transform/S3DestinationConfigurationMarshaller.java
bed8da33c806dc9c8ce14cfcb4c62b3e2742f6f7
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
2,051
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.ivs.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.ivs.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * S3DestinationConfigurationMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class S3DestinationConfigurationMarshaller { private static final MarshallingInfo<String> BUCKETNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("bucketName").build(); private static final S3DestinationConfigurationMarshaller instance = new S3DestinationConfigurationMarshaller(); public static S3DestinationConfigurationMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(S3DestinationConfiguration s3DestinationConfiguration, ProtocolMarshaller protocolMarshaller) { if (s3DestinationConfiguration == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(s3DestinationConfiguration.getBucketName(), BUCKETNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
3631716aca3f88518796cde1a798243d4239d29f
ee8f4bd0b5db983f3eecccd07d565e6a8c135e6b
/server/src/main/java/org/apache/iotdb/db/query/udf/api/exception/UDFInputSeriesIndexNotValidException.java
7c100407666d09f922158b25239d6d5dbc8ba8b4
[ "Apache-2.0", "BSD-3-Clause", "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "MIT", "EPL-1.0", "CDDL-1.1" ]
permissive
phoenix-elite1050/iotdb
3c38ef9eea73f3f973743adf167ad37d21831749
98984d51080e00d641c4bc2e244a7a161eafb0aa
refs/heads/master
2023-03-15T18:59:35.541610
2021-03-05T07:26:25
2021-03-05T07:26:25
339,314,311
0
1
Apache-2.0
2021-03-05T16:58:51
2021-02-16T07:13:03
Java
UTF-8
Java
false
false
1,219
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.iotdb.db.query.udf.api.exception; public class UDFInputSeriesIndexNotValidException extends UDFParameterNotValidException { public UDFInputSeriesIndexNotValidException(int providedIndex, int validIndexUpperBound) { super(String .format("the index (%d) of the input series is not valid. valid index range: [0, %d).", providedIndex, validIndexUpperBound)); } }
[ "noreply@github.com" ]
noreply@github.com
3929d2d2820b8255c0998b1fb7c799b261dbc1b9
d4753523b08243beada98b931a7180ca0a5e1435
/Chapter_02/stereo-xmlconfig/src/main/java/soundsystem/CDPlayerConfig.java
278ae30042ae16a41a5933234c2c658740d9632b
[]
no_license
mzaort/SpringInAction4
5c6f170c4d97c46c6ed5903e4d7b20d5ae7174ed
25fa2aab7874f4b677f8cb31d646b2370de228bd
refs/heads/master
2021-01-24T02:11:49.220282
2017-11-28T00:17:32
2017-11-28T00:17:32
122,840,368
1
0
null
null
null
null
UTF-8
Java
false
false
337
java
package soundsystem; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class CDPlayerConfig { @Bean public CompactDisc compactDisc() { return new SgtPeppers(); } @Bean public CDPlayer cdPlayer() { return new CDPlayer(compactDisc()); } }
[ "mzaort@gmail.com" ]
mzaort@gmail.com
d26ac7553afd73a80c6c9e2eb9d69acd5f3c5a03
cf6531e26372d6b35b97a58a861985e38321414a
/lib/slf4j-1.7.21/slf4j-api/src/main/java/org/slf4j/helpers/BasicMarker.java
fdc1ca4028b39b7efcaa2abb3620ade85cfd56b8
[ "MIT", "Apache-2.0" ]
permissive
yongquanf/RDA
9ce34f98ab71da5edb637b5cfc4c15b9ee70d523
759ff19d37c3a196b798c55b18819fb06e222a3d
refs/heads/master
2020-12-01T18:27:22.579473
2019-12-29T09:50:18
2019-12-29T09:50:18
230,726,676
3
0
Apache-2.0
2020-10-13T18:31:02
2019-12-29T09:01:15
HTML
UTF-8
Java
false
false
5,568
java
/** * Copyright (c) 2004-2011 QOS.ch * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ package org.slf4j.helpers; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Vector; import org.slf4j.Marker; /** * A simple implementation of the {@link Marker} interface. * * @author Ceki G&uuml;lc&uuml; * @author Joern Huxhorn */ public class BasicMarker implements Marker { private static final long serialVersionUID = 1803952589649545191L; private final String name; private List<Marker> referenceList; BasicMarker(String name) { if (name == null) { throw new IllegalArgumentException("A marker name cannot be null"); } this.name = name; } public String getName() { return name; } public synchronized void add(Marker reference) { if (reference == null) { throw new IllegalArgumentException("A null value cannot be added to a Marker as reference."); } // no point in adding the reference multiple times if (this.contains(reference)) { return; } else if (reference.contains(this)) { // avoid recursion // a potential reference should not its future "parent" as a reference return; } else { // let's add the reference if (referenceList == null) { referenceList = new Vector<Marker>(); } referenceList.add(reference); } } public synchronized boolean hasReferences() { return ((referenceList != null) && (referenceList.size() > 0)); } public boolean hasChildren() { return hasReferences(); } public synchronized Iterator<Marker> iterator() { if (referenceList != null) { return referenceList.iterator(); } else { List<Marker> emptyList = Collections.emptyList(); return emptyList.iterator(); } } public synchronized boolean remove(Marker referenceToRemove) { if (referenceList == null) { return false; } int size = referenceList.size(); for (int i = 0; i < size; i++) { Marker m = referenceList.get(i); if (referenceToRemove.equals(m)) { referenceList.remove(i); return true; } } return false; } public boolean contains(Marker other) { if (other == null) { throw new IllegalArgumentException("Other cannot be null"); } if (this.equals(other)) { return true; } if (hasReferences()) { for (Marker ref : referenceList) { if (ref.contains(other)) { return true; } } } return false; } /** * This method is mainly used with Expression Evaluators. */ public boolean contains(String name) { if (name == null) { throw new IllegalArgumentException("Other cannot be null"); } if (this.name.equals(name)) { return true; } if (hasReferences()) { for (Marker ref : referenceList) { if (ref.contains(name)) { return true; } } } return false; } private static String OPEN = "[ "; private static String CLOSE = " ]"; private static String SEP = ", "; public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Marker)) return false; final Marker other = (Marker) obj; return name.equals(other.getName()); } public int hashCode() { return name.hashCode(); } public String toString() { if (!this.hasReferences()) { return this.getName(); } Iterator<Marker> it = this.iterator(); Marker reference; StringBuilder sb = new StringBuilder(this.getName()); sb.append(' ').append(OPEN); while (it.hasNext()) { reference = it.next(); sb.append(reference.getName()); if (it.hasNext()) { sb.append(SEP); } } sb.append(CLOSE); return sb.toString(); } }
[ "quanyongf@126.com" ]
quanyongf@126.com
3627ff312c671a7766c474394036ef898647a605
3647f3da5e8348d5449e2e6f7575a99a2b244849
/高级教程/黑马程序员_Springmvc视频教程video/03_maven_ssh/src/main/java/cn/li/service/CustomerService.java
bffff1d5802e691ac910aba1aecf08d79c436f75
[]
no_license
NianDUI/chuanzhi
f3f04b5da5c15797a9134846b1d20013363e853d
9d4a60b14801ee1483ddade080cf059a4037eacb
refs/heads/master
2022-07-02T01:14:07.768575
2019-11-24T12:45:15
2019-11-24T12:45:15
223,742,493
0
0
null
2022-06-21T02:18:19
2019-11-24T12:43:30
Java
UTF-8
Java
false
false
62
java
package cn.li.service; public interface CustomerService { }
[ "760664212@qq.com" ]
760664212@qq.com
93c97299f59a4d6bf75e11368d8ed6cdf82bf806
b72f4ff642e42e83eb030d06b25d8cdf80a79bf2
/JavaTrainingClass/src/OOPConceptPart2/methodOverRiding.java
10edd0dcd5295d75c04612ea562e127665c3b770
[]
no_license
Ashu7106/JavaPrograms
ba1d0a1778dd9b0ee40642b20f2420d4ca3ee222
4513523e735cb97bf097617236da90c98b4d62e8
refs/heads/master
2023-07-08T17:56:40.164841
2021-08-11T17:25:50
2021-08-11T17:25:50
395,059,126
0
0
null
null
null
null
UTF-8
Java
false
false
145
java
package OOPConceptPart2; public class methodOverRiding { public static void main(String[] args) { // TODO Auto-generated method stub } }
[ "ashishyadgire2@gmail.com" ]
ashishyadgire2@gmail.com
c4946e096809271ce22630e497d9873d2d51f167
9aa4efd977e264506f4be36be45b59079939ba4f
/src/main/java/com/mlinvest/construction/service/exception/IssuerActionNotFoundException.java
5be6ac7df41857259b53d4ef8b3ccb4ab49c1116
[ "MIT" ]
permissive
illusi0n/construction
228b0df1f7c74e245fedd354cd8a97382772d699
44cd402446b4a8b2b1fef0f66ed2fdf975df1a83
refs/heads/main
2023-02-22T07:26:04.005412
2021-01-25T07:43:34
2021-01-25T07:43:34
331,772,503
0
0
null
null
null
null
UTF-8
Java
false
false
306
java
package com.mlinvest.construction.service.exception; import lombok.Getter; @Getter public class IssuerActionNotFoundException extends Exception { private final Long issuerActionId; public IssuerActionNotFoundException(Long issuerActionId) { this.issuerActionId = issuerActionId; } }
[ "milosbiljanovic@gmail.com" ]
milosbiljanovic@gmail.com
be20e7ccb749992e572e3c6d208293d509a37c99
d62d26b35010f52638f87cdcab0618b50ad19b69
/quora-api/target/generated-sources/com/upgrad/quora/api/model/UserDetailsResponse.java
88071bf4b40946cbabfc38301e6862aab47efac2
[]
no_license
CodeVishal/Course5--Project
f05bfee368c6b77cbde7b1bc9142c31b3c799e50
74b7343faca7b7bf8313514928e85b5ad70a3ffa
refs/heads/master
2022-12-24T07:28:25.641913
2020-01-02T16:46:52
2020-01-02T16:46:52
231,296,341
0
0
null
2022-12-10T05:17:23
2020-01-02T02:53:49
Java
UTF-8
Java
false
false
6,140
java
package com.upgrad.quora.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.*; /** * UserDetailsResponse */ @Validated @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2020-01-02T22:14:18.048+05:30") public class UserDetailsResponse { @JsonProperty("first_name") private String firstName = null; @JsonProperty("last_name") private String lastName = null; @JsonProperty("user_name") private String userName = null; @JsonProperty("email_address") private String emailAddress = null; @JsonProperty("country") private String country = null; @JsonProperty("aboutMe") private String aboutMe = null; @JsonProperty("dob") private String dob = null; @JsonProperty("contact_number") private String contactNumber = null; public UserDetailsResponse firstName(String firstName) { this.firstName = firstName; return this; } /** * First name of the user * @return firstName **/ @ApiModelProperty(value = "First name of the user") public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public UserDetailsResponse lastName(String lastName) { this.lastName = lastName; return this; } /** * Last name of the user * @return lastName **/ @ApiModelProperty(value = "Last name of the user") public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public UserDetailsResponse userName(String userName) { this.userName = userName; return this; } /** * Username * @return userName **/ @ApiModelProperty(value = "Username") public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public UserDetailsResponse emailAddress(String emailAddress) { this.emailAddress = emailAddress; return this; } /** * Email address of the user * @return emailAddress **/ @ApiModelProperty(value = "Email address of the user") public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } public UserDetailsResponse country(String country) { this.country = country; return this; } /** * Country of the user * @return country **/ @ApiModelProperty(value = "Country of the user") public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public UserDetailsResponse aboutMe(String aboutMe) { this.aboutMe = aboutMe; return this; } /** * Details of the user * @return aboutMe **/ @ApiModelProperty(value = "Details of the user") public String getAboutMe() { return aboutMe; } public void setAboutMe(String aboutMe) { this.aboutMe = aboutMe; } public UserDetailsResponse dob(String dob) { this.dob = dob; return this; } /** * Date of birth of the user * @return dob **/ @ApiModelProperty(value = "Date of birth of the user") public String getDob() { return dob; } public void setDob(String dob) { this.dob = dob; } public UserDetailsResponse contactNumber(String contactNumber) { this.contactNumber = contactNumber; return this; } /** * Mobile number of the user * @return contactNumber **/ @ApiModelProperty(value = "Mobile number of the user") public String getContactNumber() { return contactNumber; } public void setContactNumber(String contactNumber) { this.contactNumber = contactNumber; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UserDetailsResponse userDetailsResponse = (UserDetailsResponse) o; return Objects.equals(this.firstName, userDetailsResponse.firstName) && Objects.equals(this.lastName, userDetailsResponse.lastName) && Objects.equals(this.userName, userDetailsResponse.userName) && Objects.equals(this.emailAddress, userDetailsResponse.emailAddress) && Objects.equals(this.country, userDetailsResponse.country) && Objects.equals(this.aboutMe, userDetailsResponse.aboutMe) && Objects.equals(this.dob, userDetailsResponse.dob) && Objects.equals(this.contactNumber, userDetailsResponse.contactNumber); } @Override public int hashCode() { return Objects.hash(firstName, lastName, userName, emailAddress, country, aboutMe, dob, contactNumber); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UserDetailsResponse {\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); sb.append(" aboutMe: ").append(toIndentedString(aboutMe)).append("\n"); sb.append(" dob: ").append(toIndentedString(dob)).append("\n"); sb.append(" contactNumber: ").append(toIndentedString(contactNumber)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "vishal.pawar57@gmail.com" ]
vishal.pawar57@gmail.com
c00b960ecda745d2d5fe26eaa983c79652c8fb0e
db5e2811d3988a5e689b5fa63e748c232943b4a0
/jadx/sources/o/C1684.java
0941f138fe7863d8172bf5552d5bfb009cdca59d
[]
no_license
ghuntley/TraceTogether_1.6.1.apk
914885d8be7b23758d161bcd066a4caf5ec03233
b5c515577902482d741cabdbd30f883a016242f8
refs/heads/master
2022-04-23T16:59:33.038690
2020-04-27T05:44:49
2020-04-27T05:44:49
259,217,124
0
0
null
null
null
null
UTF-8
Java
false
false
2,253
java
package o; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /* renamed from: o.ʟɪ reason: contains not printable characters */ public final class C1684 extends RecyclerView.C3243aUx { /* renamed from: ı reason: contains not printable characters */ private int f8717 = 0; /* renamed from: ǃ reason: contains not printable characters */ private List<Object> f8718 = new ArrayList(); /* renamed from: ɩ reason: contains not printable characters */ private final C1510 f8719; public C1684(C1510 r2) { this.f8719 = r2; } /* renamed from: ı reason: contains not printable characters */ public final void m9580(RecyclerView recyclerView, int i) { super.m473(recyclerView, i); if (i == 0 && this.f8717 != 0) { this.f8719.f8074.m9200(); } else if (i != 0 && this.f8717 == 0) { this.f8719.f8074.m9206(); } this.f8717 = i; } /* renamed from: ι reason: contains not printable characters */ public final void m9581(RecyclerView recyclerView, int i, int i2) { C1510 r2 = this.f8719; if (r2.f8065 != null && !r2.f8073 && r2.f8067.getChildCount() > 0) { m9579(recyclerView); } } /* access modifiers changed from: package-private */ /* renamed from: ı reason: contains not printable characters */ public final void m9579(RecyclerView recyclerView) { int i; int i2; int i3; boolean z = true; if (this.f8719.f8069 != 1) { z = false; } if (z) { i3 = recyclerView.computeVerticalScrollOffset(); i2 = recyclerView.computeVerticalScrollExtent(); i = recyclerView.computeVerticalScrollRange(); } else { i3 = recyclerView.computeHorizontalScrollOffset(); i2 = recyclerView.computeHorizontalScrollExtent(); i = recyclerView.computeHorizontalScrollRange(); } this.f8719.m8952(((float) i3) / ((float) (i - i2))); Iterator<Object> it = this.f8718.iterator(); while (it.hasNext()) { it.next(); } } }
[ "ghuntley@ghuntley.com" ]
ghuntley@ghuntley.com
913ca93bc81033ede353fd06606ed84e4536a4e3
646fa56970e74a17d10542fec62e0491b5202908
/app/src/test/java/com/gda/criminalintent/ExampleUnitTest.java
f862ba290be908edae5ffd637893a84f65e05944
[]
no_license
geghetsikd/CriminalIntent
3647e759b0da4b422810ab1bdc01bc753be923b9
40757d5f64fdb4a35233cb6e39f1fae28d97ec87
refs/heads/master
2022-10-24T14:38:30.313987
2020-02-25T20:32:19
2020-02-25T20:32:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
383
java
package com.gda.criminalintent; 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); } }
[ "geghetsikd@gmail.com" ]
geghetsikd@gmail.com
d56f66714cb4eab9d41333b3c6a450a2ad6404fd
66157eb833c0c00b2db2c691cc123bc8eebe37cb
/appdear25/src/testapi/WangUtil.java
db77773af94ef838e7f48d8efdfe83af99912f0a
[]
no_license
gaoguibao1921/android_download
ed7ea81ef8bad31c7ac890336fb5466ab2f8bf4d
b2c3924bb37277b68533b79f0e9b8f01b88583a3
refs/heads/master
2020-12-25T05:37:58.573703
2013-09-09T09:52:52
2013-09-09T09:52:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,286
java
package testapi; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import com.alibaba.fastjson.JSON; import com.appdear.client.model.SoftlistInfo; import com.appdear.client.service.api.ApiSoftListResult; public class WangUtil { public static String wangUrl="http://media.aishangdian.com/"; public static ApiSoftListResult getAd() { ApiSoftListResult adresult =new ApiSoftListResult(); try { String json = getJsonOrmliteByReadLocal(); //System.out.println("json="+json); AppList result=JSON.parseObject(json,AppList.class); //System.out.println("size="+result.getAppList().size()+"limit="+result.limit); List<SoftlistInfo> softList = new ArrayList<SoftlistInfo>(); for(AppDetail detail:result.appList) { SoftlistInfo info= new SoftlistInfo(); info.adid=Integer.parseInt(detail.id); info.imgurl=wangUrl+detail.content.icon; info.softid=Integer.parseInt(detail.id); info.type=3; info.download=0; softList.add(info); } adresult.softList=softList; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } return adresult; } //http://admin.aishangdian.com/app/apps/page?o=0&l=50&od=updated_on+desc&history_type=0&content_type=0&_=1378457069267 public static ApiSoftListResult getSoftList() { ApiSoftListResult softListResult =new ApiSoftListResult(); try { String json = getJsonOrmliteByReadLocal(); //System.out.println("json="+json); AppList result=JSON.parseObject(json,AppList.class); //System.out.println("size="+result.getAppList().size()+"limit="+result.limit); softListResult.totalcount=result.total; List<SoftlistInfo> softList = new ArrayList<SoftlistInfo>(); int i=0; for(AppDetail detail:result.appList) { SoftlistInfo info= new SoftlistInfo(); /*info.imgurl=detail.thumbnail; item.softprice item.softprice == 0 item.softicon item.softname item.softdesc item.softsize item.isfirst =1 /0 info.version item.softgrade info.downloadurl*/ info.softid=Integer.parseInt(detail.id); info.softicon=wangUrl+detail.content.icon; info.softprice =0; info.softname=detail.content.title; info.appid=detail.content.guid; info.softsize= detail.app.fileSize; if(i==0) { info.isfirst="1"; }else { info.isfirst="0"; } info.version=detail.app.versionName; info.versioncode=Integer.parseInt(detail.app.versionCode); info.softgrade=10; info.downloadurl=wangUrl+detail.app.appInstallPkgItem; softList.add(info); i++; } softListResult.softList=softList; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } return softListResult; } public static String getJsonOrmliteByReadLocal() { String json=null; InputStream inStream = TestSoftList.class.getClassLoader() .getResourceAsStream("json2.txt"); try { byte[] data = NetAndStreamTool.readStream(inStream); json = new String(data, "utf-8"); } catch (Exception e) { return null; } return json; } }
[ "359756389@qq.com" ]
359756389@qq.com
916cae2d27248e11c66da2622e5479a81de4a0db
2cdc8232434d36ecb0503a5c71849731b5c931d9
/src/main/java/com/fileUploader/exception/StorageFileNotFoundException.java
e2a151df9f6a712aad917f7e9d4bb1d59f597f0c
[]
no_license
bwc0/File-Uploader
3bc39aa655fee219a9f141a2dcea4e6377c87eef
d19e829b7dc30944919e0a2b636dd646c77f3df1
refs/heads/master
2020-03-30T00:32:06.344475
2018-11-07T17:36:52
2018-11-07T17:36:52
150,528,945
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.fileUploader.exception; public class StorageFileNotFoundException extends RuntimeException { public StorageFileNotFoundException(String message) { super(message); } public StorageFileNotFoundException(String message, Throwable cause) { super(message, cause); } }
[ "bryantcason32@gmail.com" ]
bryantcason32@gmail.com
c2c3face9407f2ad140c1a069490c3f4125e7633
e396a5615054b94db6f8d029f2be415e764e2aa1
/_2292.java
1b03ee34eac0e44189cdc186d8b461301337fb99
[]
no_license
bactoria/Algorithm-java
7b4380eb035386a217533c903f96b3c7e77cf74d
bf9ea050965733e692e3f54d1997e7469bd3fada
refs/heads/master
2021-10-23T01:05:00.681567
2019-03-14T03:59:37
2019-03-14T03:59:37
117,311,128
1
1
null
null
null
null
UTF-8
Java
false
false
467
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class _2292 { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); final int N = Integer.parseInt(br.readLine()); int count = 1; int curMax = 1; while(N>curMax) { curMax += count*6; count++; } System.out.println(count); } }
[ "bactoria@gmail.com" ]
bactoria@gmail.com
2189498a5a451666be1bf857398805598a98633e
03906875786a9411bf10030d47146ba81e264549
/cocos2d/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java
b58c4800680e01c4485b61fe96825334b414f0c2
[ "MIT" ]
permissive
kudrykun/Puzzle
1e05c43964f5de3a5522e5c43ac2c692010600d6
cd2d3c170303f4f21e7e81c647d51c3f4101ab4d
refs/heads/master
2021-03-19T12:31:24.275358
2018-01-26T15:41:18
2018-01-26T15:41:18
119,068,002
0
0
null
null
null
null
UTF-8
Java
false
false
17,158
java
/**************************************************************************** Copyright (c) 2010-2013 cocos2d-x.org http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ package org.cocos2dx.lib; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.graphics.PixelFormat; import android.media.AudioManager; import android.opengl.GLSurfaceView; import android.os.Build; import android.os.Bundle; import android.os.Message; import android.preference.PreferenceManager.OnActivityResultListener; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import org.cocos2dx.lib.Cocos2dxHelper.Cocos2dxHelperListener; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.egl.EGLContext; public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelperListener { // =========================================================== // Constants // =========================================================== private final static String TAG = Cocos2dxActivity.class.getSimpleName(); // =========================================================== // Fields // =========================================================== private Cocos2dxGLSurfaceView mGLSurfaceView = null; private int[] mGLContextAttrs = null; private Cocos2dxHandler mHandler = null; private static Cocos2dxActivity sContext = null; private Cocos2dxVideoHelper mVideoHelper = null; private Cocos2dxWebViewHelper mWebViewHelper = null; private Cocos2dxEditBoxHelper mEditBoxHelper = null; private boolean hasFocus = false; private boolean showVirtualButton = false; public Cocos2dxGLSurfaceView getGLSurfaceView(){ return mGLSurfaceView; } public static Context getContext() { return sContext; } public void setKeepScreenOn(boolean value) { final boolean newValue = value; runOnUiThread(new Runnable() { @Override public void run() { mGLSurfaceView.setKeepScreenOn(newValue); } }); } public void setEnableVirtualButton(boolean value) { this.showVirtualButton = value; } protected void onLoadNativeLibraries() { try { ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); Bundle bundle = ai.metaData; String libName = bundle.getString("android.app.lib_name"); System.loadLibrary(libName); } catch (Exception e) { e.printStackTrace(); } } // =========================================================== // Constructors // =========================================================== @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508 if (!isTaskRoot()) { // Android launched another instance of the root activity into an existing task // so just quietly finish and go away, dropping the user back into the activity // at the top of the stack (ie: the last state of this task) finish(); Log.w(TAG, "[Workaround] Ignore the activity started from icon!"); return; } this.hideVirtualButton(); onLoadNativeLibraries(); sContext = this; this.mHandler = new Cocos2dxHandler(this); Cocos2dxHelper.init(this); this.mGLContextAttrs = getGLContextAttrs(); this.init(); if (mVideoHelper == null) { mVideoHelper = new Cocos2dxVideoHelper(this, mFrameLayout); } if(mWebViewHelper == null){ mWebViewHelper = new Cocos2dxWebViewHelper(mFrameLayout); } if(mEditBoxHelper == null){ mEditBoxHelper = new Cocos2dxEditBoxHelper(mFrameLayout); } Window window = this.getWindow(); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); // Audio configuration this.setVolumeControlStream(AudioManager.STREAM_MUSIC); Cocos2dxEngineDataManager.init(this, mGLSurfaceView); } //native method,call GLViewImpl::getGLContextAttrs() to get the OpenGL ES context attributions private static native int[] getGLContextAttrs(); // =========================================================== // Getter & Setter // =========================================================== // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== @Override protected void onResume() { Log.d(TAG, "onResume()"); super.onResume(); Cocos2dxAudioFocusManager.registerAudioFocusListener(this); this.hideVirtualButton(); resumeIfHasFocus(); Cocos2dxEngineDataManager.resume(); } @Override public void onWindowFocusChanged(boolean hasFocus) { Log.d(TAG, "onWindowFocusChanged() hasFocus=" + hasFocus); super.onWindowFocusChanged(hasFocus); this.hasFocus = hasFocus; resumeIfHasFocus(); } private void resumeIfHasFocus() { if(hasFocus) { this.hideVirtualButton(); Cocos2dxHelper.onResume(); mGLSurfaceView.onResume(); } } @Override protected void onPause() { Log.d(TAG, "onPause()"); super.onPause(); Cocos2dxAudioFocusManager.unregisterAudioFocusListener(this); Cocos2dxHelper.onPause(); mGLSurfaceView.onPause(); Cocos2dxEngineDataManager.pause(); } @Override protected void onDestroy() { Cocos2dxAudioFocusManager.unregisterAudioFocusListener(this); super.onDestroy(); Cocos2dxEngineDataManager.destroy(); } @Override public void showDialog(final String pTitle, final String pMessage) { Message msg = new Message(); msg.what = Cocos2dxHandler.HANDLER_SHOW_DIALOG; msg.obj = new Cocos2dxHandler.DialogMessage(pTitle, pMessage); this.mHandler.sendMessage(msg); } @Override public void runOnGLThread(final Runnable pRunnable) { this.mGLSurfaceView.queueEvent(pRunnable); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { for (OnActivityResultListener listener : Cocos2dxHelper.getOnActivityResultListeners()) { listener.onActivityResult(requestCode, resultCode, data); } super.onActivityResult(requestCode, resultCode, data); } protected ResizeLayout mFrameLayout = null; // =========================================================== // Methods // =========================================================== public void init() { // FrameLayout ViewGroup.LayoutParams framelayout_params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); mFrameLayout = new ResizeLayout(this); mFrameLayout.setLayoutParams(framelayout_params); // Cocos2dxEditText layout ViewGroup.LayoutParams edittext_layout_params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); Cocos2dxEditBox edittext = new Cocos2dxEditBox(this); edittext.setLayoutParams(edittext_layout_params); mFrameLayout.addView(edittext); // Cocos2dxGLSurfaceView this.mGLSurfaceView = this.onCreateView(); // ...add to FrameLayout mFrameLayout.addView(this.mGLSurfaceView); // Switch to supported OpenGL (ARGB888) mode on emulator // this line dows not needed on new emulators and also it breaks stencil buffer //if (isAndroidEmulator()) // this.mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); this.mGLSurfaceView.setCocos2dxRenderer(new Cocos2dxRenderer()); this.mGLSurfaceView.setCocos2dxEditText(edittext); // Set framelayout as the content view setContentView(mFrameLayout); } public Cocos2dxGLSurfaceView onCreateView() { Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); //this line is need on some device if we specify an alpha bits if(this.mGLContextAttrs[3] > 0) glSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT); // use custom EGLConfigureChooser Cocos2dxEGLConfigChooser chooser = new Cocos2dxEGLConfigChooser(this.mGLContextAttrs); glSurfaceView.setEGLConfigChooser(chooser); return glSurfaceView; } protected void hideVirtualButton() { if (showVirtualButton) { return; } if (Build.VERSION.SDK_INT >= 19) { // use reflection to remove dependence of API level Class viewClass = View.class; try { final int SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION = Cocos2dxReflectionHelper.<Integer>getConstantValue(viewClass, "SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION"); final int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN = Cocos2dxReflectionHelper.<Integer>getConstantValue(viewClass, "SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN"); final int SYSTEM_UI_FLAG_HIDE_NAVIGATION = Cocos2dxReflectionHelper.<Integer>getConstantValue(viewClass, "SYSTEM_UI_FLAG_HIDE_NAVIGATION"); final int SYSTEM_UI_FLAG_FULLSCREEN = Cocos2dxReflectionHelper.<Integer>getConstantValue(viewClass, "SYSTEM_UI_FLAG_FULLSCREEN"); final int SYSTEM_UI_FLAG_IMMERSIVE_STICKY = Cocos2dxReflectionHelper.<Integer>getConstantValue(viewClass, "SYSTEM_UI_FLAG_IMMERSIVE_STICKY"); final int SYSTEM_UI_FLAG_LAYOUT_STABLE = Cocos2dxReflectionHelper.<Integer>getConstantValue(viewClass, "SYSTEM_UI_FLAG_LAYOUT_STABLE"); // getWindow().getDecorView().setSystemUiVisibility(); final Object[] parameters = new Object[]{SYSTEM_UI_FLAG_LAYOUT_STABLE | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar | SYSTEM_UI_FLAG_FULLSCREEN // hide status bar | SYSTEM_UI_FLAG_IMMERSIVE_STICKY}; Cocos2dxReflectionHelper.<Void>invokeInstanceMethod(getWindow().getDecorView(), "setSystemUiVisibility", new Class[]{Integer.TYPE}, parameters); } catch (NullPointerException e) { Log.e(TAG, "hideVirtualButton", e); } } } private static boolean isAndroidEmulator() { String model = Build.MODEL; Log.d(TAG, "model=" + model); String product = Build.PRODUCT; Log.d(TAG, "product=" + product); boolean isEmulator = false; if (product != null) { isEmulator = product.equals("sdk") || product.contains("_sdk") || product.contains("sdk_"); } Log.d(TAG, "isEmulator=" + isEmulator); return isEmulator; } // =========================================================== // Inner and Anonymous Classes // =========================================================== private class Cocos2dxEGLConfigChooser implements GLSurfaceView.EGLConfigChooser { private int[] mConfigAttributes; private final int EGL_OPENGL_ES2_BIT = 0x04; private final int EGL_OPENGL_ES3_BIT = 0x40; public Cocos2dxEGLConfigChooser(int redSize, int greenSize, int blueSize, int alphaSize, int depthSize, int stencilSize, int multisamplingCount) { mConfigAttributes = new int[] {redSize, greenSize, blueSize, alphaSize, depthSize, stencilSize, multisamplingCount}; } public Cocos2dxEGLConfigChooser(int[] attributes) { mConfigAttributes = attributes; } @Override public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) { int[][] EGLAttributes = { { // GL ES 2 with user set EGL10.EGL_RED_SIZE, mConfigAttributes[0], EGL10.EGL_GREEN_SIZE, mConfigAttributes[1], EGL10.EGL_BLUE_SIZE, mConfigAttributes[2], EGL10.EGL_ALPHA_SIZE, mConfigAttributes[3], EGL10.EGL_DEPTH_SIZE, mConfigAttributes[4], EGL10.EGL_STENCIL_SIZE, mConfigAttributes[5], EGL10.EGL_SAMPLE_BUFFERS, (mConfigAttributes[6] > 0) ? 1 : 0, EGL10.EGL_SAMPLES, mConfigAttributes[6], EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE }, { // GL ES 2 with user set 16 bit depth buffer EGL10.EGL_RED_SIZE, mConfigAttributes[0], EGL10.EGL_GREEN_SIZE, mConfigAttributes[1], EGL10.EGL_BLUE_SIZE, mConfigAttributes[2], EGL10.EGL_ALPHA_SIZE, mConfigAttributes[3], EGL10.EGL_DEPTH_SIZE, mConfigAttributes[4] >= 24 ? 16 : mConfigAttributes[4], EGL10.EGL_STENCIL_SIZE, mConfigAttributes[5], EGL10.EGL_SAMPLE_BUFFERS, (mConfigAttributes[6] > 0) ? 1 : 0, EGL10.EGL_SAMPLES, mConfigAttributes[6], EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE }, { // GL ES 2 with user set 16 bit depth buffer without multisampling EGL10.EGL_RED_SIZE, mConfigAttributes[0], EGL10.EGL_GREEN_SIZE, mConfigAttributes[1], EGL10.EGL_BLUE_SIZE, mConfigAttributes[2], EGL10.EGL_ALPHA_SIZE, mConfigAttributes[3], EGL10.EGL_DEPTH_SIZE, mConfigAttributes[4] >= 24 ? 16 : mConfigAttributes[4], EGL10.EGL_STENCIL_SIZE, mConfigAttributes[5], EGL10.EGL_SAMPLE_BUFFERS, 0, EGL10.EGL_SAMPLES, 0, EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE }, { // GL ES 2 by default EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE } }; EGLConfig result = null; for (int[] eglAtribute : EGLAttributes) { result = this.doChooseConfig(egl, display, eglAtribute); if (result != null) return result; } Log.e(DEVICE_POLICY_SERVICE, "Can not select an EGLConfig for rendering."); return null; } private EGLConfig doChooseConfig(EGL10 egl, EGLDisplay display, int[] attributes) { EGLConfig[] configs = new EGLConfig[1]; int[] matchedConfigNum = new int[1]; boolean result = egl.eglChooseConfig(display, attributes, configs, 1, matchedConfigNum); if (result && matchedConfigNum[0] > 0) { return configs[0]; } return null; } } }
[ "kudrykun@gmail.com" ]
kudrykun@gmail.com
6ea8f43d3a42c75d04580eba5a06ec5e477634b2
e9df3a9d1051f0e2755aa89797cc8df97a4f399a
/AMediaEditorCollection/src/main/java/hu/csega/editors/common/dndview/DragAndDropHitTriangle.java
e0b232d30dc2d2afceca3493e9f1341f7a0a74ca
[]
no_license
petercsengodi/games
880fb62e77e1fcc2cbf72f78f70f1b5ca53e19b1
7af98b0a89f4b858ba2cef4c63c4973e17689064
refs/heads/master
2023-05-07T03:11:22.268658
2022-10-07T09:28:07
2022-10-07T09:28:07
32,595,357
1
0
null
2023-04-14T17:08:38
2015-03-20T16:43:00
Java
UTF-8
Java
false
false
2,325
java
package hu.csega.editors.common.dndview; import java.awt.Color; import java.awt.Graphics2D; public class DragAndDropHitTriangle implements DragAndDropHitShape { private double x1; private double y1; private double x2; private double y2; private double x3; private double y3; public DragAndDropHitTriangle(double x1, double y1, double x2, double y2, double x3, double y3) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; this.x3 = x3; this.y3 = y3; } public double getX1() { return x1; } public void setX1(double x1) { this.x1 = x1; } public double getY1() { return y1; } public void setY1(double y1) { this.y1 = y1; } public double getX2() { return x2; } public void setX2(double x2) { this.x2 = x2; } public double getY2() { return y2; } public void setY2(double y2) { this.y2 = y2; } public double getX3() { return x3; } public void setX3(double x3) { this.x3 = x3; } public double getY3() { return y3; } public void setY3(double y3) { this.y3 = y3; } @Override public void renderHitShape(DragAndDropRenderContext context, Color color) { Graphics2D graphics = context.getGraphics(); graphics.setColor(color); graphics.drawLine((int)x1, (int)y1, (int)x2, (int)y2); graphics.drawLine((int)x2, (int)y2, (int)x3, (int)y3); graphics.drawLine((int)x3, (int)y3, (int)x1, (int)y1); } @Override public boolean pointIsInsideOfHitShape(double x, double y) { // Algorithm copied from StackOverflow: double d1 = sign(x, y, x1, y1, x2, y2); double d2 = sign(x, y, x2, y2, x3, y3); double d3 = sign(x, y, x3, y3, x1, y1); boolean hasNegative = (d1 < 0) || (d2 < 0) || (d3 < 0); boolean hasPositive = (d1 > 0) || (d2 > 0) || (d3 > 0); return !(hasNegative && hasPositive); } @Override public boolean hitShapeIsInsideOfBox(double x1, double y1, double x2, double y2) { return DragAndDropHitBox.pointIsInsideOfBox(this.x1, this.y1, x1, y1, x2, y2) && DragAndDropHitBox.pointIsInsideOfBox(this.x2, this.y2, x1, y1, x2, y2) && DragAndDropHitBox.pointIsInsideOfBox(this.x3, this.y3, x1, y1, x2, y2); } private static double sign(double x1, double y1, double x2, double y2, double x3, double y3) { // Algorithm copied from StackOverflow: return (x1 - x3) * (y2 - y3) - (x2 - x3) * (y1 - y3); } }
[ "petercsengodi@users.noreply.github.com" ]
petercsengodi@users.noreply.github.com
7e12d35f8364ea8056c8fba34938aba1ee0bd976
8d5cca9ef5fbee0ae29d5eeb48fdd3dace2cd54f
/src/main/java/com/cat/service/IDiaryService.java
88bd649ce807ac3b388ec810d30203a120af1d18
[ "Apache-2.0" ]
permissive
RobinJason/cat
67b274e50340675411d98a4da9984c1fadacb9a7
6d2783c6040f46e9ee77e00ab04a039b630467e4
refs/heads/master
2020-03-23T04:16:57.682683
2018-07-28T07:59:20
2018-07-28T07:59:20
141,074,051
0
0
Apache-2.0
2018-07-30T07:00:10
2018-07-16T01:58:04
Java
UTF-8
Java
false
false
274
java
package com.cat.service; import com.cat.common.ServerResponse; /** * @Author: LR * @Descriprition: * @Date: Created in 9:25 2018/7/17 * @Modified By: **/ public interface IDiaryService { ServerResponse getDetail(Integer userId, String username); }
[ "1875906058@qq.com" ]
1875906058@qq.com
5120c1a97c92b797c4dc1b3d592b5070d801ef3f
a962d3ba6fbcbe84dc70cca5ba51dcd656695c5c
/src/main/java/com/example/course/resources/ProductResource.java
845389a8128360a287bc6abd09ef5654ec88c9a3
[]
no_license
felipe7147/course_spring_java
46c77ea9a638f7426ee1091c7d8f5d5efea759a5
2039e10062ed7f81a8b1b6016a8daa8308b12f16
refs/heads/master
2020-08-24T19:25:20.369782
2019-11-06T12:23:50
2019-11-06T12:23:50
216,890,739
0
0
null
null
null
null
UTF-8
Java
false
false
993
java
package com.example.course.resources; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.example.course.entities.Product; import com.example.course.services.ProductService; @RestController @RequestMapping(value = "/products") public class ProductResource { @Autowired private ProductService service; @GetMapping public ResponseEntity<List<Product>> findAll(){ List<Product> list = service.findAll(); return ResponseEntity.ok().body(list); } @GetMapping(value = "/{id}") public ResponseEntity<Product> findById(@PathVariable Long id) { Product obj = service.findById(id); return ResponseEntity.ok().body(obj); } }
[ "felipe_nunesrodrigues@hotmail.com" ]
felipe_nunesrodrigues@hotmail.com