blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
5c4c4e865f2e4dda80c5a3a73226e60954383986
a5272e1b57fd0a0b1d29c4012434cadfe4ec7ce3
/Skittles/src/skittles/g2/Inventory.java
08895f06b36b840718d85b578855ab622bda91b7
[]
no_license
akivab/skittles
e101847c1ca9a4aed9cf44fa3d43ae189d187e25
78f67ca9bfd0f6120f4244f53ba33044153d656c
refs/heads/master
2021-01-19T10:13:50.723290
2011-11-13T00:35:20
2011-11-13T00:35:20
2,658,339
0
0
null
null
null
null
UTF-8
Java
false
false
3,166
java
package skittles.g2; import java.util.Comparator; import java.util.PriorityQueue; public class Inventory { private Skittle[] skittles; public Inventory(int[] aintInHand) { skittles = new Skittle[aintInHand.length]; for (int i = 0; i < skittles.length; i++) { skittles[i] = new Skittle(aintInHand[i], i); } } /* This would return true only for the skittle with the highest score currently */ public boolean isWorthHoarding(int color) { for (int i = 0; i < skittles.length; i++) { if (i == color) { continue; } double count2ndSktl = skittles[i].getCount(); double value = 1; if (skittles[i].getValue() != Skittle.UNDEFINED_VALUE) { value = skittles[i].getValue(); } if (skittles[color].getCurrentWorth() < value*count2ndSktl*count2ndSktl) { return false; } } return true; } public int size() { return skittles.length; } public Skittle getSkittleByColor(int color) { return skittles[color]; } public Skittle getSkittle(int color) { return skittles[color]; } public Skittle[] getSkittles() { return skittles; } public PriorityQueue<Skittle> untastedSkittlesByCount() { PriorityQueue<Skittle> ret = new PriorityQueue<Skittle>(10, new SkittleComparatorByCount()); for (Skittle s: skittles) { if (!s.isTasted() && s.getCount() > 0) { ret.add(s); } } return ret; } public PriorityQueue<Skittle> tastedSkittlesByCount() { PriorityQueue<Skittle> ret = new PriorityQueue<Skittle>(10, new SkittleComparatorByCount()); for (Skittle s: skittles) { if (s.isTasted() && s.getCount() > 0) { ret.add(s); } } return ret; } public PriorityQueue<Skittle> leastNegativeSkittles() { PriorityQueue<Skittle> ret = new PriorityQueue<Skittle>(10, new SkittleComparatorByValueHigh()); for (Skittle s: skittles) { if (s.getValue() <= 0 && s.getValue() != Skittle.UNDEFINED_VALUE && s.getCount() > 0) { ret.add(s); } } return ret; } public PriorityQueue<Skittle> skittlesByValuesLowest() { PriorityQueue<Skittle> ret = new PriorityQueue<Skittle>(10, new SkittleComparatorByValueLow()); for (Skittle s: skittles) { if (s.getCount() > 0) { ret.add(s); } } return ret; } /* Comparator for Skittles By Count */ private class SkittleComparatorByCount implements Comparator<Skittle> { @Override public int compare(Skittle x, Skittle y) { if (x.getCount() > y.getCount()) { return -1; } if (x.getCount() < y.getCount()) { return 1; } return 0; } } /* Comparator for Skittles PriQueue By Value */ private class SkittleComparatorByValueLow implements Comparator<Skittle> { @Override public int compare(Skittle x, Skittle y) { if (x.getValue() < y.getValue()) { return -1; } if (x.getValue() > y.getValue()) { return 1; } return 0; } } /* Comparator for Skittles PriQueue By Value */ private class SkittleComparatorByValueHigh implements Comparator<Skittle> { @Override public int compare(Skittle x, Skittle y) { if (x.getValue() > y.getValue()) { return -1; } if (x.getValue() < y.getValue()) { return 1; } return 0; } } }
[ "cyan.dai@gmail.com" ]
cyan.dai@gmail.com
0d5fa16ce0e98bded5e503a9c89b05e83fec19c4
629e42efa87f5539ff8731564a9cbf89190aad4a
/unrefactorInstances/jfreechart/27/cloneInstance2.java
e3b3ab39b734680e803f8cf1a731dcd6ddd13bb5
[]
no_license
soniapku/CREC
a68d0b6b02ed4ef2b120fd0c768045424069e726
21d43dd760f453b148134bd526d71f00ad7d3b5e
refs/heads/master
2020-03-23T04:28:06.058813
2018-08-17T13:17:08
2018-08-17T13:17:08
141,085,296
0
4
null
null
null
null
UTF-8
Java
false
false
403
java
public void testRemove() { XYSeries s1 = new XYSeries("Series 1"); s1.add(1.0, 1.0); s1.add(2.0, 2.0); s1.add(3.0, 3.0); assertEquals(3, s1.getItemCount()); s1.remove(new Double(2.0)); assertEquals(new Double(3.0), s1.getX(1)); s1.remove(0); assertEquals(new Double(3.0), s1.getX(0)); }
[ "sonia@pku.edu.cn" ]
sonia@pku.edu.cn
cf6af4a34c5418284e314e707f64c67ab97ae8fc
312e02ac31d750ac91e0fbe7aaf52705edcb7ab1
/JavaThread/src/club/banyuan/demoThreadPool/MyThreadPool.java
7bc470323471f557ff37ce9a92aac002563bbffc
[]
no_license
samho2008/2010JavaSE
52f423c4c135a7ce61c62911ed62cbe2ad91c7ba
890a4f5467aa2e325383f0e4328e6a9249815ebc
refs/heads/master
2023-06-14T07:57:37.914624
2021-07-05T16:34:18
2021-07-05T16:34:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,244
java
package club.banyuan.demoThreadPool; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** * @author sanye * @version 1.0 * @date 2020/12/8 10:49 上午 */ public class MyThreadPool { public static void main(String[] args) { /** * 1.创建一个可缓存的线程池。如果线程池的大小超过了处理任务所需要的线程,那么就会回收部分空闲(60秒不执行任务)的线程<br> * 2.当任务数增加时,此线程池又可以智能的添加新线程来处理任务<br> * 3.此线程池不会对线程池大小做限制,线程池大小完全依赖于操作系统(或者说JVM)能够创建的最大线程大小<br> * */ // ExecutorService executorService = Executors.newCachedThreadPool(); // for (int i = 0; i <10; i++) { // int num = i; // executorService.submit(() -> System.out.println(Thread.currentThread().getName()+"执行"+ num)); // } // executorService.shutdown(); // // System.out.println(); // for (int i = 0; i <20; i++) { // int num = i; // executorService.submit(() -> System.out.println(Thread.currentThread().getName()+"执行"+ num)); // // } // ExecutorService pool = Executors.newSingleThreadExecutor(); // for (int i = 0; i < 10; i++) { // final int ii = i; // pool.execute(() -> System.out.println(Thread.currentThread().getName() + "=>" + ii)); // } // pool.shutdown(); ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(5); Runnable r1 = () -> System.out.println("线程名称:" + Thread.currentThread().getName() + ",执行:3秒后执行"); Runnable r2 = () -> System.out.println("线程名称:" + Thread.currentThread().getName() + ",执行:2秒后执行"); scheduledThreadPool.schedule(r1, 3, TimeUnit.SECONDS); scheduledThreadPool.schedule(r2, 2, TimeUnit.SECONDS); scheduledThreadPool.shutdown(); //使用线程池的方式,发送10万条数据,线程池中只有6个线程,但是要发送给十个人 1 999 1000 1999 2000 2999 } }
[ "zhoujian@banyuan.club" ]
zhoujian@banyuan.club
d05f95654a8500b0984605f397f4abc671a96dc1
643d260ec2b038935427aeaf20177fabda4c039c
/src/main/java/com/shiping/leetcode/medium/PerfectSquares.java
797dafb393019cbed04f0cac7744a50252f76391
[]
no_license
davidpypysp/leetcode-java
455a2d407c406f484b25b75241cc898ea7dd2e86
6edfe0585a7f234e63bebc7e03c828f21711f076
refs/heads/master
2020-04-06T03:34:03.512574
2016-09-11T07:11:44
2016-09-11T07:11:44
40,580,133
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
package com.shiping.leetcode.medium; import java.util.LinkedList; import java.util.Queue; /** * Created by davidpy on 16/2/26. */ public class PerfectSquares { public int numSquares(int n) { int dp[] = new int[n+1]; for(int i = 1; i <= n; i++) { double sqrt = Math.sqrt(i); if(sqrt * sqrt == ((double) i)) dp[i] = 1; int min = i; for(int j = 1; j <= sqrt; j++) { min = Math.min(min, dp[i - j * j] + 1); } dp[i] = min; } return dp[n]; } }
[ "davidpy1992@gmail.com" ]
davidpy1992@gmail.com
ce3a1469eff64f6c578f797993369e1c49564f14
5b67afe8f1165dc212b5a0b453661e1219146872
/trunk/_sungeun/maven/src/main/java/com/nmom/soap/ui/svc/Event_reConsoleSvc.java
ee2b56ff2c5ac76972fca1d314bb081b2ced0aac
[]
no_license
faith5c/natural_mom_git
7ca874064308da816eb7459e0a25ea53597fe025
9f1166e4c0af02f26f1a95a8d8d1c299614e1e74
refs/heads/master
2021-01-20T18:20:24.367735
2016-07-27T07:50:14
2016-07-27T07:50:14
64,285,816
0
0
null
null
null
null
UTF-8
Java
false
false
961
java
package com.nmom.soap.ui.svc; import java.util.List; import com.nmom.soap.data.dao.IEvent_reDao; import com.nmom.soap.data.model.EventVo; import com.nmom.soap.data.model.Event_reVo; public class Event_reConsoleSvc implements IEvent_reSvc { IEvent_reDao eventReDao; public void setEventReDao(IEvent_reDao eventReDao) { this.eventReDao = eventReDao; } @Override public List<Event_reVo> getEventRe(int event_no) { List<Event_reVo> er_list = eventReDao.getEventRe(event_no); System.out.println("#아이디, 내용, 작성일, 리플번호"); for(Event_reVo e : er_list){ System.out.println("#" + e.getMem_id()+", "+e.getEvt_re_content()+", "+e.getEvt_re_write_day()+", "+e.getEvent_re_no()); } return null; } @Override public int addRe(Event_reVo re) { return eventReDao.addRe(re); } @Override public int removeRe(int event_re_no) { return eventReDao.removeRe(event_re_no); } }
[ "sseun0402@7e34a5f0-892d-0510-8adb-eb697a7bbe35" ]
sseun0402@7e34a5f0-892d-0510-8adb-eb697a7bbe35
b39baee90c21fd3c00471212fd19dd482910a48c
b9c898d2e34f4cff129b9433a8a7fa9e285263b0
/backend/src/main/java/com/spring2go/smile/dto/InfoDto.java
c1608cff8b5142fc9f163ed420bf68bb38e0e347
[ "MIT" ]
permissive
lovepli/bookmarker-mono
a9f1527e312d740e6bcd1abd025e8569ca72216a
5d1f07416eee362b7cb7ea9662b42e1df8b0bf77
refs/heads/master
2023-02-15T01:58:51.164359
2019-10-15T11:53:22
2019-10-15T11:53:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
245
java
package com.spring2go.smile.dto; import lombok.Data; import lombok.experimental.Accessors; @Data @Accessors(chain = true) public class Status { private String hostname; private String serverAddress; private String clientAddress; }
[ "william@jskill.local" ]
william@jskill.local
77a4f2fa1b2634db9ad0319f6d38520ecc481e69
c635e8ca9cadc5f4e053d82f603f90601c5cdc9d
/src/racko/PlayerTesting123.java
b480437968431d1b514bd363648e437cd5fa6485
[]
no_license
zjakwani/Racko
529d0266feea8c5e849ee0c85d709b33d203ee44
0051c41f3d6a9de02df45d6f326c7e0db346372f
refs/heads/master
2023-06-15T18:59:32.154502
2021-07-19T01:34:13
2021-07-19T01:34:13
295,847,859
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package racko; import java.util.Random; import java.util.LinkedList; import java.lang.Math; public class PlayerTesting123 implements Player { Random random = new Random(); public void beginGame(Rack rack) { } public int acceptCard(Rack rack, Card card) { int k = 0; return k; } public int placeCard(Rack rack, Card card) { int k = 0; int v = card.value(); for(int i = 0; i < 10; i++) { if((v >= (i * 6)) && (v <= ((i + 1) * 6))) { k = i + 1; } if(k != 0 && (Math.abs(v - rack.get(k-1).value()) < 6)) { k = 0; } } return k; } }
[ "zjakwani@192.168.0.30" ]
zjakwani@192.168.0.30
88d4bbd4f46ba2e29c6792594971b6283bcbc5cd
f622da102b2648c426486eb0f6ed14aefd04d765
/proto/src/main/java/com/ctrip/ferriswheel/proto/v1/Grid.java
e9358a42efc3837c626cc52227a77565349f0d01
[ "MIT" ]
permissive
ctripcorp/ferris-wheel
5b9bb6aef135066c558b6c7a41d8acce958c439b
1d267fa07c5c7c44edd044ad630715d0be1d82e1
refs/heads/master
2023-03-23T15:57:30.992629
2019-03-18T08:54:06
2019-03-18T08:54:06
179,282,071
6
0
MIT
2020-01-14T05:42:10
2019-04-03T12:07:52
Java
UTF-8
Java
false
true
27,605
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: com/ctrip/ferriswheel/proto/workbook.proto package com.ctrip.ferriswheel.proto.v1; /** * Protobuf type {@code ferriswheel.v1.Grid} */ public final class Grid extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:ferriswheel.v1.Grid) GridOrBuilder { private static final long serialVersionUID = 0L; // Use Grid.newBuilder() to construct. private Grid(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Grid() { columns_ = 0; rows_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Grid( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { columns_ = input.readInt32(); break; } case 16: { rows_ = input.readInt32(); break; } case 26: { com.ctrip.ferriswheel.proto.v1.Span.Builder subBuilder = null; if (column_ != null) { subBuilder = column_.toBuilder(); } column_ = input.readMessage(com.ctrip.ferriswheel.proto.v1.Span.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(column_); column_ = subBuilder.buildPartial(); } break; } case 34: { com.ctrip.ferriswheel.proto.v1.Span.Builder subBuilder = null; if (row_ != null) { subBuilder = row_.toBuilder(); } row_ = input.readMessage(com.ctrip.ferriswheel.proto.v1.Span.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(row_); row_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.ctrip.ferriswheel.proto.v1.WorkbookOuterClass.internal_static_ferriswheel_v1_Grid_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.ctrip.ferriswheel.proto.v1.WorkbookOuterClass.internal_static_ferriswheel_v1_Grid_fieldAccessorTable .ensureFieldAccessorsInitialized( com.ctrip.ferriswheel.proto.v1.Grid.class, com.ctrip.ferriswheel.proto.v1.Grid.Builder.class); } public static final int COLUMNS_FIELD_NUMBER = 1; private int columns_; /** * <code>int32 columns = 1;</code> */ public int getColumns() { return columns_; } public static final int ROWS_FIELD_NUMBER = 2; private int rows_; /** * <code>int32 rows = 2;</code> */ public int getRows() { return rows_; } public static final int COLUMN_FIELD_NUMBER = 3; private com.ctrip.ferriswheel.proto.v1.Span column_; /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public boolean hasColumn() { return column_ != null; } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public com.ctrip.ferriswheel.proto.v1.Span getColumn() { return column_ == null ? com.ctrip.ferriswheel.proto.v1.Span.getDefaultInstance() : column_; } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public com.ctrip.ferriswheel.proto.v1.SpanOrBuilder getColumnOrBuilder() { return getColumn(); } public static final int ROW_FIELD_NUMBER = 4; private com.ctrip.ferriswheel.proto.v1.Span row_; /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public boolean hasRow() { return row_ != null; } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public com.ctrip.ferriswheel.proto.v1.Span getRow() { return row_ == null ? com.ctrip.ferriswheel.proto.v1.Span.getDefaultInstance() : row_; } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public com.ctrip.ferriswheel.proto.v1.SpanOrBuilder getRowOrBuilder() { return getRow(); } 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 (columns_ != 0) { output.writeInt32(1, columns_); } if (rows_ != 0) { output.writeInt32(2, rows_); } if (column_ != null) { output.writeMessage(3, getColumn()); } if (row_ != null) { output.writeMessage(4, getRow()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (columns_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, columns_); } if (rows_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, rows_); } if (column_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, getColumn()); } if (row_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getRow()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.ctrip.ferriswheel.proto.v1.Grid)) { return super.equals(obj); } com.ctrip.ferriswheel.proto.v1.Grid other = (com.ctrip.ferriswheel.proto.v1.Grid) obj; boolean result = true; result = result && (getColumns() == other.getColumns()); result = result && (getRows() == other.getRows()); result = result && (hasColumn() == other.hasColumn()); if (hasColumn()) { result = result && getColumn() .equals(other.getColumn()); } result = result && (hasRow() == other.hasRow()); if (hasRow()) { result = result && getRow() .equals(other.getRow()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + COLUMNS_FIELD_NUMBER; hash = (53 * hash) + getColumns(); hash = (37 * hash) + ROWS_FIELD_NUMBER; hash = (53 * hash) + getRows(); if (hasColumn()) { hash = (37 * hash) + COLUMN_FIELD_NUMBER; hash = (53 * hash) + getColumn().hashCode(); } if (hasRow()) { hash = (37 * hash) + ROW_FIELD_NUMBER; hash = (53 * hash) + getRow().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.ctrip.ferriswheel.proto.v1.Grid parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.ctrip.ferriswheel.proto.v1.Grid parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.ctrip.ferriswheel.proto.v1.Grid parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.ctrip.ferriswheel.proto.v1.Grid parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.ctrip.ferriswheel.proto.v1.Grid parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.ctrip.ferriswheel.proto.v1.Grid parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.ctrip.ferriswheel.proto.v1.Grid parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.ctrip.ferriswheel.proto.v1.Grid 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.ctrip.ferriswheel.proto.v1.Grid parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.ctrip.ferriswheel.proto.v1.Grid 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.ctrip.ferriswheel.proto.v1.Grid parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.ctrip.ferriswheel.proto.v1.Grid 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.ctrip.ferriswheel.proto.v1.Grid prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code ferriswheel.v1.Grid} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:ferriswheel.v1.Grid) com.ctrip.ferriswheel.proto.v1.GridOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.ctrip.ferriswheel.proto.v1.WorkbookOuterClass.internal_static_ferriswheel_v1_Grid_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.ctrip.ferriswheel.proto.v1.WorkbookOuterClass.internal_static_ferriswheel_v1_Grid_fieldAccessorTable .ensureFieldAccessorsInitialized( com.ctrip.ferriswheel.proto.v1.Grid.class, com.ctrip.ferriswheel.proto.v1.Grid.Builder.class); } // Construct using com.ctrip.ferriswheel.proto.v1.Grid.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); columns_ = 0; rows_ = 0; if (columnBuilder_ == null) { column_ = null; } else { column_ = null; columnBuilder_ = null; } if (rowBuilder_ == null) { row_ = null; } else { row_ = null; rowBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.ctrip.ferriswheel.proto.v1.WorkbookOuterClass.internal_static_ferriswheel_v1_Grid_descriptor; } @java.lang.Override public com.ctrip.ferriswheel.proto.v1.Grid getDefaultInstanceForType() { return com.ctrip.ferriswheel.proto.v1.Grid.getDefaultInstance(); } @java.lang.Override public com.ctrip.ferriswheel.proto.v1.Grid build() { com.ctrip.ferriswheel.proto.v1.Grid result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.ctrip.ferriswheel.proto.v1.Grid buildPartial() { com.ctrip.ferriswheel.proto.v1.Grid result = new com.ctrip.ferriswheel.proto.v1.Grid(this); result.columns_ = columns_; result.rows_ = rows_; if (columnBuilder_ == null) { result.column_ = column_; } else { result.column_ = columnBuilder_.build(); } if (rowBuilder_ == null) { result.row_ = row_; } else { result.row_ = rowBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.ctrip.ferriswheel.proto.v1.Grid) { return mergeFrom((com.ctrip.ferriswheel.proto.v1.Grid)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.ctrip.ferriswheel.proto.v1.Grid other) { if (other == com.ctrip.ferriswheel.proto.v1.Grid.getDefaultInstance()) return this; if (other.getColumns() != 0) { setColumns(other.getColumns()); } if (other.getRows() != 0) { setRows(other.getRows()); } if (other.hasColumn()) { mergeColumn(other.getColumn()); } if (other.hasRow()) { mergeRow(other.getRow()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.ctrip.ferriswheel.proto.v1.Grid parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.ctrip.ferriswheel.proto.v1.Grid) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int columns_ ; /** * <code>int32 columns = 1;</code> */ public int getColumns() { return columns_; } /** * <code>int32 columns = 1;</code> */ public Builder setColumns(int value) { columns_ = value; onChanged(); return this; } /** * <code>int32 columns = 1;</code> */ public Builder clearColumns() { columns_ = 0; onChanged(); return this; } private int rows_ ; /** * <code>int32 rows = 2;</code> */ public int getRows() { return rows_; } /** * <code>int32 rows = 2;</code> */ public Builder setRows(int value) { rows_ = value; onChanged(); return this; } /** * <code>int32 rows = 2;</code> */ public Builder clearRows() { rows_ = 0; onChanged(); return this; } private com.ctrip.ferriswheel.proto.v1.Span column_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.ctrip.ferriswheel.proto.v1.Span, com.ctrip.ferriswheel.proto.v1.Span.Builder, com.ctrip.ferriswheel.proto.v1.SpanOrBuilder> columnBuilder_; /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public boolean hasColumn() { return columnBuilder_ != null || column_ != null; } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public com.ctrip.ferriswheel.proto.v1.Span getColumn() { if (columnBuilder_ == null) { return column_ == null ? com.ctrip.ferriswheel.proto.v1.Span.getDefaultInstance() : column_; } else { return columnBuilder_.getMessage(); } } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public Builder setColumn(com.ctrip.ferriswheel.proto.v1.Span value) { if (columnBuilder_ == null) { if (value == null) { throw new NullPointerException(); } column_ = value; onChanged(); } else { columnBuilder_.setMessage(value); } return this; } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public Builder setColumn( com.ctrip.ferriswheel.proto.v1.Span.Builder builderForValue) { if (columnBuilder_ == null) { column_ = builderForValue.build(); onChanged(); } else { columnBuilder_.setMessage(builderForValue.build()); } return this; } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public Builder mergeColumn(com.ctrip.ferriswheel.proto.v1.Span value) { if (columnBuilder_ == null) { if (column_ != null) { column_ = com.ctrip.ferriswheel.proto.v1.Span.newBuilder(column_).mergeFrom(value).buildPartial(); } else { column_ = value; } onChanged(); } else { columnBuilder_.mergeFrom(value); } return this; } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public Builder clearColumn() { if (columnBuilder_ == null) { column_ = null; onChanged(); } else { column_ = null; columnBuilder_ = null; } return this; } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public com.ctrip.ferriswheel.proto.v1.Span.Builder getColumnBuilder() { onChanged(); return getColumnFieldBuilder().getBuilder(); } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ public com.ctrip.ferriswheel.proto.v1.SpanOrBuilder getColumnOrBuilder() { if (columnBuilder_ != null) { return columnBuilder_.getMessageOrBuilder(); } else { return column_ == null ? com.ctrip.ferriswheel.proto.v1.Span.getDefaultInstance() : column_; } } /** * <code>.ferriswheel.v1.Span column = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.ctrip.ferriswheel.proto.v1.Span, com.ctrip.ferriswheel.proto.v1.Span.Builder, com.ctrip.ferriswheel.proto.v1.SpanOrBuilder> getColumnFieldBuilder() { if (columnBuilder_ == null) { columnBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.ctrip.ferriswheel.proto.v1.Span, com.ctrip.ferriswheel.proto.v1.Span.Builder, com.ctrip.ferriswheel.proto.v1.SpanOrBuilder>( getColumn(), getParentForChildren(), isClean()); column_ = null; } return columnBuilder_; } private com.ctrip.ferriswheel.proto.v1.Span row_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.ctrip.ferriswheel.proto.v1.Span, com.ctrip.ferriswheel.proto.v1.Span.Builder, com.ctrip.ferriswheel.proto.v1.SpanOrBuilder> rowBuilder_; /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public boolean hasRow() { return rowBuilder_ != null || row_ != null; } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public com.ctrip.ferriswheel.proto.v1.Span getRow() { if (rowBuilder_ == null) { return row_ == null ? com.ctrip.ferriswheel.proto.v1.Span.getDefaultInstance() : row_; } else { return rowBuilder_.getMessage(); } } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public Builder setRow(com.ctrip.ferriswheel.proto.v1.Span value) { if (rowBuilder_ == null) { if (value == null) { throw new NullPointerException(); } row_ = value; onChanged(); } else { rowBuilder_.setMessage(value); } return this; } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public Builder setRow( com.ctrip.ferriswheel.proto.v1.Span.Builder builderForValue) { if (rowBuilder_ == null) { row_ = builderForValue.build(); onChanged(); } else { rowBuilder_.setMessage(builderForValue.build()); } return this; } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public Builder mergeRow(com.ctrip.ferriswheel.proto.v1.Span value) { if (rowBuilder_ == null) { if (row_ != null) { row_ = com.ctrip.ferriswheel.proto.v1.Span.newBuilder(row_).mergeFrom(value).buildPartial(); } else { row_ = value; } onChanged(); } else { rowBuilder_.mergeFrom(value); } return this; } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public Builder clearRow() { if (rowBuilder_ == null) { row_ = null; onChanged(); } else { row_ = null; rowBuilder_ = null; } return this; } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public com.ctrip.ferriswheel.proto.v1.Span.Builder getRowBuilder() { onChanged(); return getRowFieldBuilder().getBuilder(); } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ public com.ctrip.ferriswheel.proto.v1.SpanOrBuilder getRowOrBuilder() { if (rowBuilder_ != null) { return rowBuilder_.getMessageOrBuilder(); } else { return row_ == null ? com.ctrip.ferriswheel.proto.v1.Span.getDefaultInstance() : row_; } } /** * <code>.ferriswheel.v1.Span row = 4;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.ctrip.ferriswheel.proto.v1.Span, com.ctrip.ferriswheel.proto.v1.Span.Builder, com.ctrip.ferriswheel.proto.v1.SpanOrBuilder> getRowFieldBuilder() { if (rowBuilder_ == null) { rowBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.ctrip.ferriswheel.proto.v1.Span, com.ctrip.ferriswheel.proto.v1.Span.Builder, com.ctrip.ferriswheel.proto.v1.SpanOrBuilder>( getRow(), getParentForChildren(), isClean()); row_ = null; } return rowBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:ferriswheel.v1.Grid) } // @@protoc_insertion_point(class_scope:ferriswheel.v1.Grid) private static final com.ctrip.ferriswheel.proto.v1.Grid DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.ctrip.ferriswheel.proto.v1.Grid(); } public static com.ctrip.ferriswheel.proto.v1.Grid getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Grid> PARSER = new com.google.protobuf.AbstractParser<Grid>() { @java.lang.Override public Grid parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Grid(input, extensionRegistry); } }; public static com.google.protobuf.Parser<Grid> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Grid> getParserForType() { return PARSER; } @java.lang.Override public com.ctrip.ferriswheel.proto.v1.Grid getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "liuhaifeng@live.com" ]
liuhaifeng@live.com
44323be466ae58a60bfa7601b48b1d6f8ab97827
b5d6de8fb83be806d08c92268239ef3155a11311
/src/cn/itcast/ssm/service/UserInfoService.java
8cb6ae3910d2fc86cd3d4ab0b341699a2094ea6e
[]
no_license
duliang823/icms
de3171976725a863fe39f49a33f05befdc3ab1a4
9a26d66b40e1b385f62f2393fbe3ec43b9a1f215
refs/heads/master
2021-01-25T06:30:30.830789
2017-06-07T03:20:46
2017-06-07T03:20:46
93,587,556
2
0
null
null
null
null
UTF-8
Java
false
false
983
java
package cn.itcast.ssm.service; import java.util.List; import cn.itcast.ssm.po.UserInfoCustom; import cn.itcast.ssm.po.UserInfoQueryVo; public interface UserInfoService { //查询用户信息列表 public List<UserInfoCustom> findUserInfoList(UserInfoQueryVo userInfoQueryVo) throws Exception; //根据登陆账号查询用户 public List<UserInfoCustom> findUserInfoByloginid(UserInfoQueryVo userInfoQueryVo) throws Exception; //保存用户信息 public void saveUserInfo(UserInfoQueryVo userInfoQueryVo) throws Exception; //更新用户信息 public void updateUserInfo(UserInfoQueryVo userInfoQueryVo) throws Exception; //查询所有用户列表 public List<UserInfoCustom> findUserInfosList() throws Exception; //更新多条用户信息 public void updateUserInfoList(UserInfoQueryVo userInfoQueryVo) throws Exception; //根据用户id删除多条用户信息 public void deleteUserInfosById(UserInfoQueryVo userInfoQueryVo) throws Exception; }
[ "137634560@qq.com" ]
137634560@qq.com
160e33d3c68a8db659d6d2a53303014f1912f27d
230bcb399293a3d8255fab5249832553af453f62
/ParserMC4/src/main/java/com/example/ParserMC4/model/LightEntity/Enum/ExplorerStatus.java
cfff9a502e085db57288bfad35bb737530d41941
[]
no_license
KostyaKrivonos/parser
b0ac6376d26f25a179197a78b62e42723820cc3f
3a98a6990f65b14fd2b48418d40a26e6eebe7dcd
refs/heads/master
2020-03-30T10:04:02.957868
2018-10-01T14:53:37
2018-10-01T14:53:37
151,104,467
0
0
null
null
null
null
UTF-8
Java
false
false
183
java
package com.example.ParserMC4.model.LightEntity.Enum; public enum ExplorerStatus { NOT_STARTED(0), IN_PROGRESS(1), FINISHED(2); ExplorerStatus(int status) { } }
[ "krivonos92@ukr.net" ]
krivonos92@ukr.net
491437be489d9b4ce5617a6b6fdbe4ef0bcea149
771daf4a3c215abd29e142438eb25fd963113bd2
/spring-security-pocs/demo2-springsecurity/src/main/java/com/projects/demospringsecurity/service/SecurityService.java
ffda3673ed92d9aea44b5e3961bd7dfdbca214b1
[]
no_license
zouhairireda/spring-pocs
c2613849901474abbd114fae5bdb008d18f2b853
655b4a32e3ba0f5299b5f25ce0e8aedd833fd803
refs/heads/master
2021-01-12T22:50:22.914537
2017-05-07T17:27:33
2017-05-07T17:27:33
81,758,839
1
0
null
null
null
null
UTF-8
Java
false
false
188
java
package com.projects.demospringsecurity.service; public interface SecurityService { public String findLoggedInUsername(); public void autologin(String username, String password); }
[ "zouhairireda@gmail.com" ]
zouhairireda@gmail.com
3d7febb925afd719996bed6b3535ab7ba622285f
ab38746e32cd56f84f18ba75fafbd9bf73b4e999
/app/src/main/java/p012ch/qos/logback/core/util/DatePatternToRegexUtil.java
497acb1c0a3ed4bf8987119a0b11ec191afe923c
[]
no_license
jack15177089002/mybcz_5_0_1
8c51a9785713046dc8ffffeff0bf8257d2af9013
ab47049b95ab69fe62ff5fd093d2204e00506bd5
refs/heads/master
2021-03-15T09:01:29.235028
2020-03-12T13:20:06
2020-03-12T13:20:06
246,839,031
0
0
null
null
null
null
UTF-8
Java
false
false
1,355
java
package p012ch.qos.logback.core.util; import java.util.ArrayList; import java.util.List; /* renamed from: ch.qos.logback.core.util.DatePatternToRegexUtil */ public class DatePatternToRegexUtil { final String datePattern; final int datePatternLength; final CharSequenceToRegexMapper regexMapper = new CharSequenceToRegexMapper(); public DatePatternToRegexUtil(String str) { this.datePattern = str; this.datePatternLength = str.length(); } public String toRegex() { List<CharSequenceState> list = tokenize(); StringBuilder sb = new StringBuilder(); for (CharSequenceState regex : list) { sb.append(this.regexMapper.toRegex(regex)); } return sb.toString(); } private List<CharSequenceState> tokenize() { ArrayList arrayList = new ArrayList(); CharSequenceState charSequenceState = null; for (int i = 0; i < this.datePatternLength; i++) { char charAt = this.datePattern.charAt(i); if (charSequenceState == null || charSequenceState.f1672c != charAt) { charSequenceState = new CharSequenceState(charAt); arrayList.add(charSequenceState); } else { charSequenceState.incrementOccurrences(); } } return arrayList; } }
[ "3167289375@qq.com" ]
3167289375@qq.com
def0657024527814558b6a8b72a6d99cabdb30b0
e5c4eda9915f43a5a3a46bba5ac0d398659b7fa8
/app/src/main/java/com/womens/womensassociation/ui/main_activity/MainActivity.java
d23439b1ef1fa95186989a441c1c944baf3244b5
[]
no_license
youssefhesham2/women-association
779e5e6aac6e55cb5b17b2ba3be7be26b7803070
4216aaa9eca98a6958f0e413769d251ca7a06ff0
refs/heads/master
2022-06-01T21:28:57.852714
2020-04-30T22:18:07
2020-04-30T22:18:07
260,259,095
0
0
null
null
null
null
UTF-8
Java
false
false
4,404
java
package com.womens.womensassociation.ui.main_activity; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.LinearLayout; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import com.womens.womensassociation.R; import com.womens.womensassociation.ui.ui.main2acticity.Main2Activity; public class MainActivity extends AppCompatActivity { SharedPreferences preferences; SharedPreferences.Editor editor; int languagee; TextView Beneficiary,humanitarianaids,WindowsandOrphans,community,our_project,aboutus,languagevw; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); preferences = PreferenceManager.getDefaultSharedPreferences(this); editor = preferences.edit(); languagee = preferences.getInt("language", 1); intialviews(); LinearLayout ll=findViewById(R.id.back); Animation animation= AnimationUtils.loadAnimation(this,R.anim.myanimition); ll.startAnimation(animation); } private void intialviews() { Beneficiary=findViewById(R.id.beneficiary_txt); humanitarianaids=findViewById(R.id.humanitarianaids_txt); WindowsandOrphans=findViewById(R.id.WindowsandOrphans_txt); community=findViewById(R.id.community_txt); our_project=findViewById(R.id.our_project_txt); aboutus=findViewById(R.id.aboutus_txt); languagevw=findViewById(R.id.language); if(languagee==2){ Beneficiary.setText("خدمات المستفيدين"); humanitarianaids.setText("المساعدات الإنسانية"); WindowsandOrphans.setText("الأرامل والأيتام"); community.setText("المشاركة المجتمعية"); our_project.setText("مشاريعنا"); aboutus.setText("من نحن"); languagevw.setText("en"); } } public void paypal(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","paypal"); startActivity(intent); } public void aboutus(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","aboutus"); startActivity(intent); } public void ourproject(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","ourproject"); startActivity(intent); } public void language(View view) { if(languagee==1){ editor.putInt("language",2); editor.commit(); finish(); startActivity(getIntent()); } else{ editor.putInt("language",1); editor.commit(); finish(); startActivity(getIntent()); } } public void beneficiary(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","beneficiary"); startActivity(intent); } public void human(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","human"); startActivity(intent); } public void widows(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","widow"); startActivity(intent); } public void community(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","community"); startActivity(intent); } public void contect(View view) { Intent intent=new Intent(this, Main2Activity.class); intent.putExtra("check","contect"); startActivity(intent); } /* void ReplaceFragment(Fragment fragment) { FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.view, fragment); fragmentTransaction.disallowAddToBackStack(); fragmentTransaction.commit(); }*/ }
[ "youssef.hesham.rabea@gmail.com" ]
youssef.hesham.rabea@gmail.com
1642bbe29c7f360d4067ff2c02d9afaf5d72f414
42e4e7237ae9ec0b32add6864070515b189deea1
/app/src/test/java/com/example/app_stallman/ExampleUnitTest.java
77e5be843beb03128a442c5cdad9391b2a19e25c
[]
no_license
sebastien42-dev/appstallman
46ee9d1d95eb1c51044e69e8bd2884446dc6022d
d0bf312c8171a4a568dbe1145ad1bf555b860a56
refs/heads/main
2023-05-09T06:28:25.391814
2021-05-30T11:53:56
2021-05-30T11:53:56
359,888,413
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package com.example.app_stallman; 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); } }
[ "s.delclos@skara.ovh" ]
s.delclos@skara.ovh
59e9b2828d380950f8fcea1812bdb96981f56dfe
3efa3fb17672e0037ee4e1fd2066cc6309e14871
/src/boardgame/Piece.java
1f6ef89c714e82a2c13eed21aa85481f2be7142f
[]
no_license
Franciscoas4/Sistema-xadres-java
d225d6c7f1e6b6086e5c5650aeb31543583eb28b
2565db26681d49ac17894ae643414f8acf093a5e
refs/heads/master
2020-08-04T02:40:18.598524
2019-10-14T22:49:48
2019-10-14T22:49:48
211,974,716
0
0
null
null
null
null
UTF-8
Java
false
false
635
java
package boardgame; public abstract class Piece { protected Position position; private Board board; public Piece(Board board) { this.board = board; position = null; } protected Board getBoard() { return board; } public abstract boolean[][] possibleMoves(); public boolean possibleMove(Position position) { return possibleMoves()[position.getRow()][position.getColumn()]; } public boolean isThereAnyPossibleMove() { boolean[][] mat = possibleMoves(); for (int i=0; i<mat.length; i++) { for (int j=0; j<mat.length; j++) { if (mat[i][j]) { return true; } } } return false; } }
[ "franciscoas4@gmail.com" ]
franciscoas4@gmail.com
a2cc8509e92232cd2606eab8e9341f956dd2c552
22012491da3f71140d3b8548eb59905baf95a7e0
/com/planet_ink/coffee_mud/Abilities/Common/Bandaging.java
202a136659662f4fccdf81490e550bd11d8607ce
[ "Apache-2.0" ]
permissive
griffenliu/CoffeeMud
01018dac96d0381ad27cb49e4e5e89557e2c6247
6fb04b990dc6528b01ca8e707a90e752a8310267
refs/heads/master
2020-03-23T02:38:38.136327
2018-07-15T02:18:23
2018-07-15T02:18:23
140,245,931
0
0
Apache-2.0
2018-07-09T07:15:15
2018-07-09T07:15:15
null
UTF-8
Java
false
false
6,006
java
package com.planet_ink.coffee_mud.Abilities.Common; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2006-2018 Bo Zimmerman 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. */ public class Bandaging extends CommonSkill implements MendingSkill { @Override public String ID() { return "Bandaging"; } private final static String localizedName = CMLib.lang().L("Bandaging"); @Override public String name() { return localizedName; } private static final String[] triggerStrings =I(new String[] {"BANDAGE","BANDAGING"}); @Override public String[] triggerStrings() { return triggerStrings; } @Override protected int canAffectCode() { return 0; } @Override protected int canTargetCode() { return Ability.CAN_MOBS; } @Override public int classificationCode() { return Ability.ACODE_SKILL|Ability.DOMAIN_ANATOMY; } protected Physical bandaging=null; protected boolean messedUp=false; public Bandaging() { super(); displayText=L("You are bandaging..."); verb=L("bandaging"); } @Override public boolean supportsMending(Physical item) { if(!(item instanceof MOB)) return false; return (item.fetchEffect("Bleeding")!=null) ||(item.fetchEffect("Injury")!=null) ||(item.fetchEffect("Hamstring")!=null) ||(item.fetchEffect("BrokenLimbs")!=null); } @Override public boolean tick(final Tickable ticking, final int tickID) { if((affected!=null) &&(affected instanceof MOB) &&(tickID==Tickable.TICKID_MOB)) { final MOB mob=(MOB)affected; if((bandaging==null)||(mob.location()==null)) { messedUp=true; unInvoke(); } if((bandaging instanceof MOB)&&(!mob.location().isInhabitant((MOB)bandaging))) { messedUp=true; unInvoke(); } if(mob.curState().adjHitPoints(super.getXLEVELLevel(invoker())+(int)Math.round(CMath.div(mob.phyStats().level(),2.0)),mob.maxState())) mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("<S-NAME> mend(s) and heal(s).")); } return super.tick(ticking,tickID); } @Override public void unInvoke() { if(canBeUninvoked()) { if(affected instanceof MOB) { final MOB mob=(MOB)affected; if((bandaging!=null)&&(!aborted)) { if((messedUp)||(bandaging==null)) commonTell(mob,L("You've failed to bandage @x1!",bandaging.name())); else { Ability A=bandaging.fetchEffect("Bleeding"); if(A != null) A.unInvoke(); A=bandaging.fetchEffect("Injury"); if(A != null) A.unInvoke(); A=bandaging.fetchEffect("Hamstring"); if(A != null) A.unInvoke(); A=bandaging.fetchEffect("BrokenLimbs"); if(A != null) { mob.tell(mob,bandaging,null,L("You finish setting <T-YOUPOSS> bones, so that they can now heal properly.")); if((bandaging instanceof MOB)&&(bandaging != mob)) ((MOB)bandaging).tell(mob,bandaging,null,L("<S-NAME> finishes setting your broken bones, so that they can now heal properly.")); A.setMiscText("+SETBONES"); } } } } } super.unInvoke(); } public double healthPct(MOB mob){ return CMath.div(mob.curState().getHitPoints(),mob.maxState().getHitPoints());} @Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { if(super.checkStop(mob, commands)) return true; verb=L("bandaging"); bandaging=null; final MOB target=super.getTarget(mob,commands,givenTarget); if(target==null) return false; if((target.fetchEffect("Bleeding")==null) &&(target.fetchEffect("BrokenLimbs")==null) &&(target.fetchEffect("Hamstring")==null) &&(target.fetchEffect("Injury")==null)) { super.commonTell(mob,target,null,L("<T-NAME> <T-IS-ARE> not bleeding, broken or injured!")); return false; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; messedUp=!proficiencyCheck(mob,0,auto); int duration=3+(int)Math.round(10*(1.0-healthPct(target)))-getXLEVELLevel(mob); if(duration<3) duration=3; verb=L("bandaging @x1",target.name()); bandaging=target; final String msgStr = (target.fetchEffect("BrokenLimbs")!=null) ? L("<S-NAME> begin(s) bandaging up <T-YOUPOSS> and setting <T-HIS-HER> bones.") : L("<S-NAME> begin(s) bandaging up <T-YOUPOSS> wounds."); final CMMsg msg=CMClass.getMsg(mob,target,this,CMMsg.MSG_DELICATE_HANDS_ACT,msgStr); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); beneficialAffect(mob,mob,asLevel,duration); } return true; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
22d6a516454bad432c2b07a447137b1442df52ab
b96391b3b49234da3fa8ec44a43d0b2a814a394d
/src/main/java/br/usjt/previsao_tempo/model/Cidade.java
e604ac47df63c9b8a8562ec406cb7fa0d54f59ab
[]
no_license
joaorodrigues2012/ccp3an_mca_app_previsoes
ebab6696e339ca22a544d4de3f2aea6610d1ba63
f5cb0b19399949fc3de0511699973d2d780dd6a8
refs/heads/master
2020-04-28T02:12:05.029204
2019-05-01T20:02:01
2019-05-01T20:02:01
174,192,866
0
0
null
null
null
null
UTF-8
Java
false
false
989
java
package br.usjt.previsao_tempo.model; import javax.persistence.*; @Entity @Table(name = "tb_cidade") public class Cidade { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id_cidade") private Long id; @Column(name = "nome_cidade") private String nome; @Column(name = "lat_cidade") private Double latitude; @Column(name = "lon_cidade") private Double longitude; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public Double getLatitude() { return latitude; } public void setLatitude(Double latitude) { this.latitude = latitude; } public Double getLongitude() { return longitude; } public void setLongitude(Double longitude) { this.longitude = longitude; } }
[ "37009151+joaorodrigues2012@users.noreply.github.com" ]
37009151+joaorodrigues2012@users.noreply.github.com
eaa7146dff1e0dc4a06ebd019f15985c0776de3c
52c36ce3a9d25073bdbe002757f08a267abb91c6
/src/main/java/com/alipay/api/request/AlipaySecurityDataNamelistSendRequest.java
d50cfb391aed080b36dd21e0058c151a13368866
[ "Apache-2.0" ]
permissive
itc7/alipay-sdk-java-all
d2f2f2403f3c9c7122baa9e438ebd2932935afec
c220e02cbcdda5180b76d9da129147e5b38dcf17
refs/heads/master
2022-08-28T08:03:08.497774
2020-05-27T10:16:10
2020-05-27T10:16:10
267,271,062
0
0
Apache-2.0
2020-05-27T09:02:04
2020-05-27T09:02:04
null
UTF-8
Java
false
false
3,137
java
package com.alipay.api.request; import com.alipay.api.domain.AlipaySecurityDataNamelistSendModel; import java.util.Map; import com.alipay.api.AlipayRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.AlipaySecurityDataNamelistSendResponse; import com.alipay.api.AlipayObject; /** * ALIPAY API: alipay.security.data.namelist.send request * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class AlipaySecurityDataNamelistSendRequest implements AlipayRequest<AlipaySecurityDataNamelistSendResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 增加名单内容 */ private String bizContent; public void setBizContent(String bizContent) { this.bizContent = bizContent; } public String getBizContent() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "alipay.security.data.namelist.send"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_content", this.bizContent); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<AlipaySecurityDataNamelistSendResponse> getResponseClass() { return AlipaySecurityDataNamelistSendResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
fae9cdd4894570801ceb4ece311f215ca3c4fc0a
4827480649a13f3b3fd4bdd987df3cb83bdaa9da
/crm/common/src/main/java/com/devil/dto/ServiceParams.java
9e166d0965045994d1714dceba987ad9c0c7b9d7
[]
no_license
LiDevilZheng/devilConfig
32cba2dcb28435de04e8f131d43d83df6840f634
11ef94ccdd347f658ad2bc8e3bc40ba65da4ca77
refs/heads/master
2020-03-28T22:33:45.248540
2018-10-29T03:30:38
2018-10-29T03:30:58
149,242,023
0
0
null
null
null
null
UTF-8
Java
false
false
2,217
java
package com.devil.dto; import com.devil.entity.Service; import java.io.Serializable; import java.util.Date; import java.util.List; public class ServiceParams extends PageBean<Service> implements Serializable { private String cust_name; private String title; private String type; private String status; private String create_date1; private String create_date2; public String getCust_name() { return cust_name; } public void setCust_name(String cust_name) { this.cust_name = cust_name; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getCreate_date1() { return create_date1; } public void setCreate_date1(String create_date1) { this.create_date1 = create_date1; } public String getCreate_date2() { return create_date2; } public void setCreate_date2(String create_date2) { this.create_date2 = create_date2; } public ServiceParams(){ } public ServiceParams(String cust_name, String title, String type, String status, String create_date1, String create_date2) { this.cust_name = cust_name; this.title = title; this.type = type; this.status = status; this.create_date1 = create_date1; this.create_date2 = create_date2; } public ServiceParams(Integer pageNo, Integer pageSize, Integer from, Integer offset, Integer count, Integer pageCount, List<Service> list, String cust_name, String title, String type, String status, String create_date1, String create_date2) { super(pageNo, pageSize, from, offset, count, pageCount, list); this.cust_name = cust_name; this.title = title; this.type = type; this.status = status; this.create_date1 = create_date1; this.create_date2 = create_date2; } }
[ "1209351042@qq.com" ]
1209351042@qq.com
1bdd74091d020edc60de6e57ac855e44a747b8fb
389d271865139a9d6ac30f840e87613dd8a77320
/backend/src/main/java/com/gene/bioinfo/ms/gp2s/web/validator/SurfaceTreatmentMachineValidator.java
7cfc13b55b6f9ab5cbd28dd6e487e2ee3fef4830
[ "Apache-2.0" ]
permissive
arohou/gP2S
ad531936e8acd5d7c4f0aed74cb2565eb6b6da41
1a04e7e0a22c6d7205579fe82bc626f850fc99a6
refs/heads/master
2023-01-19T15:56:03.685172
2020-12-04T16:16:15
2020-12-04T16:16:15
181,519,091
18
5
Apache-2.0
2023-01-12T15:05:35
2019-04-15T15:50:28
Java
UTF-8
Java
false
false
1,731
java
/* * Copyright 2018 Genentech 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. */ package com.gene.bioinfo.ms.gp2s.web.validator; import com.gene.bioinfo.ms.gp2s.domain.SurfaceTreatmentMachine; import com.gene.bioinfo.ms.gp2s.infrastructure.constants.DomainConstants; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.Validator; import static com.gene.bioinfo.ms.gp2s.util.ValidationUtils.isNotEmpty; @Component public class SurfaceTreatmentMachineValidator extends LabelValidator { @Override public boolean supports(Class<?> clazz) { return super.supports(clazz) && SurfaceTreatmentMachine.class.isAssignableFrom(clazz); } @Override public void doValidate(Object target, Errors e) { SurfaceTreatmentMachine protocol = (SurfaceTreatmentMachine) target; isNotEmpty(protocol.getManufacturer(), "manufacturer", "Manufacturer", DomainConstants.SHORT_STRING_LENGTH, e); isNotEmpty(protocol.getModel(), "model", "Model", DomainConstants.SHORT_STRING_LENGTH, e); isNotEmpty(protocol.getLocation(), "location", "Location", DomainConstants.SHORT_STRING_LENGTH, e); } }
[ "Supra135" ]
Supra135
ee623cae6ba28fa670203968138ca000838c9110
6124b346c6b4ca617c6f2a9998cc0a0545e18bfc
/workspace/src/uk/ac/stand/gui/tablemodels/TeamTableModel.java
eee9dfb4bbd608d70301bbe45a143ff795413352
[]
no_license
cmdkeen/stand-tab
dc94e25ce6b8abb23020d3bcfd1467bc96747641
64bc766834143aa6e7eb7bc0867e33aa47db44d5
refs/heads/master
2021-01-16T19:13:58.576726
2009-04-17T21:39:07
2009-04-17T21:39:07
129,452
1
0
null
null
null
null
UTF-8
Java
false
false
1,376
java
package uk.ac.stand.gui.tablemodels; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; import uk.ac.stand.impl.Competition; import uk.ac.stand.impl.Flag; import uk.ac.stand.impl.Team; import uk.ac.stand.interfaces.ITeam; /** * @author chris * Displays data about teams in a swing table */ @SuppressWarnings("serial") public class TeamTableModel extends AbstractTableModel { public int getColumnCount() { if(Team.getFlagsStatic()==null) return 0; return Team.getFlagsStatic().getFlags().length; } public int getRowCount() { return Competition.getInstance().getTeams().size(); } public String getColumnName(int columnIndex) { return Team.getFlagsStatic().getFlags()[columnIndex].toString(); } public Object getValueAt(int rowIndex, int columnIndex) { ITeam team = ((ArrayList<ITeam>)Competition.getInstance().getTeams()).get(rowIndex); Flag f = Team.getFlagsStatic().getFlags()[columnIndex]; try { if(f.isMultiple()) { //It is a multi data object so we need to extract that data return team.getSubObject(f); } else { return team.getFlagValue(f); } } catch (Exception e) { e.printStackTrace(); return null; } } public Class<?> getColumnClass(int c) { Object o = getValueAt(0, c); if(o==null) return Object.class; return o.getClass(); } }
[ "blahchris@gmail.com" ]
blahchris@gmail.com
47c3911f1f3d8e1aabc7f3197cc110c88579940a
42f49f1b59f0fb8cadd1138094324d34e1884f61
/spring-boot-start-dynamic-datasource/src/main/java/com/gqzdev/dynamic/datasource/model/DatasourceConfig.java
549396a232dca91bbae45bfd2b61e0bde967e8ac
[ "MIT" ]
permissive
gqzdev/spring-boot-start
d199e747f699a534971a5c43dbffdf8e655b58b2
882bcc0d375f6504223d96fb90f201e6509c4ef2
refs/heads/master
2022-12-16T00:27:25.358459
2020-09-13T14:42:56
2020-09-13T14:42:56
214,058,442
3
1
null
null
null
null
UTF-8
Java
false
false
1,319
java
package com.gqzdev.dynamic.datasource.model; import lombok.Data; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; /** * <p> * 数据源配置表 * </p> * * @author yangkai.shen * @date Created in 2019/9/4 10:58 */ @Data @Table(name = "datasource_config") public class DatasourceConfig implements Serializable { /** * 主键 */ @Id @Column(name = "`id`") @GeneratedValue(generator = "JDBC") private Long id; /** * 数据库地址 */ @Column(name = "`host`") private String host; /** * 数据库端口 */ @Column(name = "`port`") private Integer port; /** * 数据库用户名 */ @Column(name = "`username`") private String username; /** * 数据库密码 */ @Column(name = "`password`") private String password; /** * 数据库名称 */ @Column(name = "`database`") private String database; /** * 构造JDBC URL * * @return JDBC URL */ public String buildJdbcUrl() { return String.format("jdbc:mysql://%s:%s/%s?useUnicode=true&characterEncoding=utf-8&useSSL=false", this.host, this.port, this.database); } }
[ "gqzdev@gmail.com" ]
gqzdev@gmail.com
5b6cda2c58716c0f677472a2b9dc0e4d2fb8490f
1485a8ef86315ef58becf2a3f81f1fd4e5a31c9f
/src/com/zxl/entity/Bills.java
f620da45a8b8b60be19d8c199df83d21b27d1505
[]
no_license
zxl888/pet_hospital
e8ba903148d512aa3d6e95f4174c2f36bbe05ed1
9d7ca31a837901b9902816ce4cd5d871e0afa673
refs/heads/master
2020-04-25T19:25:16.876315
2019-02-28T01:46:17
2019-02-28T01:46:17
173,019,770
0
0
null
null
null
null
UTF-8
Java
false
false
3,432
java
package com.zxl.entity; import java.util.Date; public class Bills { private Integer billid; private String paystatus; private Integer petid; private Double chineseprices; private Double westermprices; private Double materialprices; private Double exanineprices; private Double registrationprices; private Double opsprices; private Double totalprices; private Date billcreatetime; public Integer getBillid() { return billid; } public void setBillid(Integer billid) { this.billid = billid; } public String getPaystatus() { return paystatus; } public void setPaystatus(String paystatus) { this.paystatus = paystatus == null ? null : paystatus.trim(); } public Integer getPetid() { return petid; } public void setPetid(Integer petid) { this.petid = petid; } public Double getChineseprices() { return chineseprices; } public void setChineseprices(Double chineseprices) { this.chineseprices = chineseprices; } public Double getWestermprices() { return westermprices; } public void setWestermprices(Double westermprices) { this.westermprices = westermprices; } public Double getMaterialprices() { return materialprices; } public void setMaterialprices(Double materialprices) { this.materialprices = materialprices; } public Double getExanineprices() { return exanineprices; } public void setExanineprices(Double exanineprices) { this.exanineprices = exanineprices; } public Double getRegistrationprices() { return registrationprices; } public void setRegistrationprices(Double registrationprices) { this.registrationprices = registrationprices; } public Double getOpsprices() { return opsprices; } public void setOpsprices(Double opsprices) { this.opsprices = opsprices; } public Double getTotalprices() { return totalprices; } public void setTotalprices(Double totalprices) { this.totalprices = totalprices; } public Date getBillcreatetime() { return billcreatetime; } public void setBillcreatetime(Date billcreatetime) { this.billcreatetime = billcreatetime; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", billid=").append(billid); sb.append(", paystatus=").append(paystatus); sb.append(", petid=").append(petid); sb.append(", chineseprices=").append(chineseprices); sb.append(", westermprices=").append(westermprices); sb.append(", materialprices=").append(materialprices); sb.append(", exanineprices=").append(exanineprices); sb.append(", registrationprices=").append(registrationprices); sb.append(", opsprices=").append(opsprices); sb.append(", totalprices=").append(totalprices); sb.append(", billcreatetime=").append(billcreatetime); sb.append("]"); return sb.toString(); } }
[ "zxl9508@qq.com" ]
zxl9508@qq.com
99aee903ac6bdbdc690e65e8689af903040149b7
cc241012eebe563a170bc361d7af9850b410cf81
/DesignPattern/compostie-pattern/src/com/techlabs/storageitem/IStorageItem.java
1d63ac4e87d598d96e77186d20a29ae9be34c0bb
[]
no_license
yogitam97/Swabhav_repository
ca820237143fd304456e5b40f1fa30d0e83ef9ea
9c3afd7e11c44b685e8f2dfa8c127c8631bb0a6d
refs/heads/master
2023-01-14T12:21:12.720306
2019-07-15T16:26:42
2019-07-15T16:26:42
165,356,920
1
0
null
2023-01-07T07:48:09
2019-01-12T06:51:07
Java
UTF-8
Java
false
false
93
java
package com.techlabs.storageitem; public interface IStorageItem { public void display(); }
[ "moreyo1496@gmail.com" ]
moreyo1496@gmail.com
0038f6d5554a11fb1437ade2d91ffb1c25d374b9
2c92bad0b2dbea25beaa0883f3950c858b191891
/src/com/github/teocci/nio/socket/nio2/NioSocketServer.java
f11358b701ea52d0664cb23938e8de759f2e2f47
[ "MIT" ]
permissive
DryLeonhard/NioSocketCodeSample
c6223b143543d555ba87bc9b721d4a2f2771c7c5
efef0a8b8270897771a2ef470071b0307fd2d300
refs/heads/master
2023-03-22T08:07:44.965617
2018-08-07T07:42:16
2018-08-07T07:42:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,506
java
package com.github.teocci.nio.socket.nio2; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocketChannel; import java.nio.channels.CompletionHandler; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; /** * Created by teocci. * * @author teocci@yandex.com on 2017-Jun-21 */ public class NioSocketServer { public NioSocketServer() { try { // Create an AsynchronousServerSocketChannel that will listen on port 5000 final AsynchronousServerSocketChannel listener = AsynchronousServerSocketChannel.open().bind(new InetSocketAddress(5000)); // Listen for a new request listener.accept(null, new CompletionHandler<AsynchronousSocketChannel, Void>() { @Override public void completed(AsynchronousSocketChannel ch, Void att) { // Accept the next connection listener.accept(null, this); // Greet the client ch.write(ByteBuffer.wrap("Hello, I am Echo Server, let's have a conversation!\n".getBytes())); // Allocate a byte buffer (4K) to read from the client ByteBuffer byteBuffer = ByteBuffer.allocate(4096); try { // Read the first line int bytesRead = ch.read(byteBuffer).get(120, TimeUnit.SECONDS); boolean running = true; while (bytesRead != -1 && running) { System.out.println("bytes read: " + bytesRead); // Make sure that we have data to read if (byteBuffer.position() > 2) { // Make the buffer ready to read byteBuffer.flip(); // Convert the buffer into a line byte[] lineBytes = new byte[bytesRead]; byteBuffer.get(lineBytes, 0, bytesRead); String line = new String(lineBytes); // Debug System.out.println("Message: " + line); // Echo back to the caller ch.write(ByteBuffer.wrap(line.getBytes())); // Make the buffer ready to write byteBuffer.clear(); // Read the next line bytesRead = ch.read(byteBuffer).get(120, TimeUnit.SECONDS); } else { // An empty line signifies the end of the conversation in our protocol running = false; } } } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } catch (TimeoutException e) { // The user exceeded the 120 second timeout, so close the connection ch.write(ByteBuffer.wrap("Good Bye\n".getBytes())); System.out.println("Connection timed out, closing connection"); } System.out.println("End of conversation"); try { // Close the connection if we need to if (ch.isOpen()) { ch.close(); } } catch (IOException e1) { e1.printStackTrace(); } } @Override public void failed(Throwable exc, Void att) { // ... } }); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { new NioSocketServer(); try { Thread.sleep(60000); } catch (Exception e) { e.printStackTrace(); } } }
[ "teocci@yandex.com" ]
teocci@yandex.com
8477a3aa563df200c54e77fd11b3a45445893b12
a4a297f548bf334e29e537a2327d4bf6a7c5a100
/src/main/java/com/codecool/krk/VisitorsDAO.java
49dcdc5c48a7d29134a4a81591acf70c319ac652
[]
no_license
mikolajurbanek/Guestbook
f511ad873a21d7bdca0f0884b232c13543b6a6e3
063524cc4318864a3ebe2fde00dafdb8e05381c0
refs/heads/main
2022-12-29T20:28:48.562945
2020-10-18T15:33:01
2020-10-18T15:33:01
305,095,605
0
0
null
null
null
null
UTF-8
Java
false
false
1,494
java
package com.codecool.krk; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; public class VisitorsDAO { ConnectionToDB connectionToDB; public VisitorsDAO(ConnectionToDB connectionToDB) { this.connectionToDB = connectionToDB; } public List<Visitor> selectAllVisit() throws SQLException { List<Visitor> visitorList = new ArrayList<>(); ResultSet resultSet = getDataSet("SELECT * FROM visitors"); while (resultSet.next()) { visitorList.add(new Visitor(resultSet.getString("Name"), resultSet.getString("Surname"), resultSet.getString("Message"), resultSet.getDate("Date"))); } resultSet.close(); return visitorList; } public void addNewVisitor(Visitor visitor) { connectionToDB.executeQuery(String.format("INSERT INTO visitors(name, surname, message, date) VALUES ('%s', '%s', '%s', '%s');", visitor.getName(), visitor.getSurname(), visitor.getMessage(), visitor.getDate())); System.out.println("added"); } public ResultSet getDataSet(String query) { connectionToDB.connect(); try { connectionToDB.statement = ConnectionToDB.connection.createStatement(); ResultSet results = connectionToDB.statement.executeQuery(query); return results; } catch (SQLException e) { e.printStackTrace(); } throw new RuntimeException(); } }
[ "mikolaj.urbanek@gmail.com" ]
mikolaj.urbanek@gmail.com
1ff3fef2f8955c64b7967d0821cee339663f3beb
ba0657f835fe4a2fb0b0524ad2a38012be172bc8
/src/main/java/designpatterns/hf/structural/adapter/mediaplayer/pattern/MediaAdapter.java
00adb95e80651bf9979690119ea0af4b56ff179b
[]
no_license
jsdumas/java-dev-practice
bc2e29670dd6f1784b3a84f52e526a56a66bbba2
db85b830e7927fea863d95f5ea8baf8d3bdc448b
refs/heads/master
2020-12-02T16:28:41.081765
2017-12-08T23:10:53
2017-12-08T23:10:53
96,547,922
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
package designpatterns.hf.structural.adapter.mediaplayer.pattern; public class MediaAdapter implements MediaPlayer { private AdvancedMediaPlayer advancedMusicPlayer; public MediaAdapter(String audioType) { if (audioType.equalsIgnoreCase("vlc")) { advancedMusicPlayer = new VlcPlayer(); } else if (audioType.equalsIgnoreCase("mp4")) { advancedMusicPlayer = new Mp4Player(); } } @Override public void play(String audioType, String fileName) { if (audioType.equalsIgnoreCase("vlc")) { advancedMusicPlayer.playVlc(fileName); } else if (audioType.equalsIgnoreCase("mp4")) { advancedMusicPlayer.playMp4(fileName); } } }
[ "jsdumas@free.fr" ]
jsdumas@free.fr
99312b3f37f47e5c62ad65341b63a749018231d8
7b62a58a094702ca3b8ecbe3bfa02ee76b5c6ce9
/src/com/javaex/ex01/ObjApp.java
f2d4732a1df96aff99f263f6ff5f3df5be010beb
[]
no_license
tykaind/charter3
fb85bda973a03ae205355e7276ffbea6ba653e50
8c84c0aa36574d9fead23624556ad3ac3d098088
refs/heads/master
2023-06-05T15:22:00.321234
2021-06-22T03:52:51
2021-06-22T03:52:51
379,134,502
0
0
null
null
null
null
UTF-8
Java
false
false
791
java
package com.javaex.ex01; public class ObjApp { public static void main(String[] args) { Object obj01 = new Object(); System.out.println(obj01.toString()); System.out.println(obj01.getClass()); System.out.println(obj01.hashCode()); System.out.println(obj01.equals(obj01)); System.out.println("obj.getClass()====="); System.out.println(obj01.getClass()); System.out.println("==================="); System.out.println("obj.hashCode()====="); //System.out.println(obj01.hashCode()); Object o01 = new Object(); Object o02 = new Object(); Object o03 = new Object(); System.out.println(o01.hashCode()); System.out.println(o02.hashCode()); System.out.println(o03.hashCode()); System.out.println("==================="); } }
[ "cult40@naver.com" ]
cult40@naver.com
eb932d43b305667dc5bb127e7efa816bba40ef17
f124354e9b497efb156e6cb1cb82fe5d9fb22c8d
/src/Main.java
9c2bba3145a2464c97f2e61348d9c15609f5bea9
[]
no_license
javadevelopcom/WaysToSortArray
a71ec45c715e20cc34bb1c6a60c68a955618ec0a
308330b7fb173287b1f8a57e9bfad9fe7792d583
refs/heads/master
2021-01-10T08:56:33.518738
2015-11-24T06:23:03
2015-11-24T06:23:03
46,652,712
0
0
null
null
null
null
UTF-8
Java
false
false
7,751
java
import bubble.BubbleSortAZ; import bubble.BubbleSortZA; import bubble.BubbleSortAscend; import bubble.BubbleSortDescend; import cocktail.CocktailSortAscend; import exchange.ExchSortAZ; import exchange.ExchSortAscend; import exchange.ExchSortDescend; import exchange.ExchSortZA; import insertion.InsertionSortAscend; import insertion.InsertionSortDescend; import quick.QSortAscend; import quick.Quicksort; import selection.*; import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args) { // вывод содержимого на экран System.out.println("Несортированный массив: " + '\n' + Arrays.toString(MyArray.X)); System.out.println("Несортированный массив: " + '\n' + Arrays.toString(MyArray.Q)); Arrays.sort(MyArray.Q); System.out.println('\n' + "Сортировка массива Arrays.sort(): " + '\n' + Arrays.toString(MyArray.Q)); Arrays.sort(MyArray.X); System.out.println('\n' + "Сортировка массива Arrays.sort() по возрастанию: " + '\n' + Arrays.toString(MyArray.X)); Arrays.sort(MyArray.Y, Collections.reverseOrder()); System.out.println('\n' + "Сортировка массива Arrays.sort() по убыванию: " + '\n' + Arrays.toString(MyArray.Y)); System.out.println('\n' + "Сортировка массива Перемешиванием по возрастанию:"); CocktailSortAscend.cocktailSortAscendingOrder(MyArray.X); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); System.out.println('\n' + "Сортировка массива Пузырьком по возрастанию:"); BubbleSortAscend.bubbleSortAscendingOrder(MyArray.X); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); System.out.println('\n' + "Сортировка массива Пузырьком по убыванию:"); BubbleSortDescend.bubbleSortDescendingOrder(MyArray.X); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); System.out.println('\n' + "Сортировка массива Обменом по возрастанию:"); ExchSortAscend.exchangeSortAscendingOrder(MyArray.X); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); System.out.println('\n' + "Сортировка массива Обменом по убыванию:"); ExchSortDescend.exchangeSortDescendingOrder(MyArray.X); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); System.out.println('\n' + "Несортированный массив: " + Arrays.toString(MyArray.Z)); BubbleSortAZ.sortStringBubbleAscending(MyArray.Z); System.out.println('\n' + "Сортировка массива Пузырьком по возрастанию: "); PrintArray.printArrayZ(); System.out.println("или: " + Arrays.toString(MyArray.Z)); BubbleSortZA.sortStringBubbleDescending(MyArray.Z); System.out.println('\n' + "Сортировка массива Пузырьком по убыванию: "); PrintArray.printArrayZ(); System.out.println("или: " + Arrays.toString(MyArray.Z)); ExchSortAZ.sortStringExchangeAscending(MyArray.Q); System.out.println('\n' + "Сортировка массива Обменом по возрастанию: "); PrintArray.printArrayQ(); System.out.println("или: " + Arrays.toString(MyArray.Q)); ExchSortZA.sortStringExchangeDescending(MyArray.Q); System.out.println('\n' + "Сортировка массива Обменом по убыванию: "); PrintArray.printArrayQ(); System.out.println("или: " + Arrays.toString(MyArray.Q)); SelectionSortAsc.selectionSortAsc(MyArray.X); System.out.println('\n' + "Сортировка массива Выбором по возрастанию (v.1): "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); SelectionSortDesc.selectionSortDesc(MyArray.X); System.out.println('\n' + "Сортировка массива Выбором по убыванию (v.1): "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); SelectionSortAscending.selSortAscending(MyArray.X); System.out.println('\n' + "Сортировка массива Выбором по возрастанию (v.2): "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); SelectionSortDescending.selSortDescending(MyArray.X); System.out.println('\n' + "Сортировка массива Выбором по убыванию (v.2): "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); SelectionSortAscend.selectionSortDescendingOrder(MyArray.X); System.out.println('\n' + "Сортировка массива Выбором по возрастанию (v.3): "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); SelectionSortDescend.selectionSortDescendingOrder(MyArray.X); System.out.println('\n' + "Сортировка массива Выбором по убыванию (v.3): "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); InsertionSortAscend.insertionSortAscendingOrder(MyArray.X); System.out.println('\n' + "Сортировка массива Вставками по возрастанию: "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); InsertionSortDescend.insertionSortDescendingOrder(MyArray.X); System.out.println('\n' + "Сортировка массива Вставками по убыванию: "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); Quicksort qsort = new Quicksort(); qsort.sort(MyArray.X); System.out.println('\n' + "Быстрая сортировка, сортировка Хоара: "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); QSortAscend qsortAscend = new QSortAscend(); qsortAscend.sortA(MyArray.X); System.out.println('\n' + "Быстрая сортировка, сортировка Хоара: "); PrintArray.printArrayX(); System.out.println("или: " + Arrays.toString(MyArray.X)); } } /** * В примере использован рефакторинг IntelliJ IDEA: * методы bubbleSortAscendingOrder() и bubbleSortDescendingOrder() вынесены из класса Main во внешние классы (Refactor => Move ... или нажатие F6) * методы for (int i : X) вынесены в отдельный метод printArrayX() (Refactor => Extract => Method ... или нажатие Ctrl+Alt+M) и перемещен во внешний класс PrintArray (Refactor => Move ... или нажатие F6) * массив int[] X = new int[]{3, 9, 1, 6, 2, 7, 4, 5, 8} вынесен из класса Main в отдельный класс MyArray (Refactor => Extract => Constant ... или нажатие Ctrl+Alt+C) */
[ "java.develop.com@gmail.com" ]
java.develop.com@gmail.com
261610a5a472287d673c25455f46f02f4d2d50e7
862701397dac50a52d4cfe1b9379d325cb07df86
/src/main/java/leetcode/StringSearchBruteForceV2.java
90d05b769df473b363d35e39c7f75993499a7be9
[]
no_license
crackerzzz/leetcode
ff0379d34b698e5dd3506c500800a8e595d03b26
5d3340bfbb836a6ef1316ccc5787778b02c39ac1
refs/heads/master
2021-09-29T00:17:02.674880
2018-11-21T21:34:46
2018-11-21T21:34:46
112,280,724
0
0
null
null
null
null
UTF-8
Java
false
false
968
java
package leetcode; public class StringSearchBruteForceV2 { public int search(final char[] haystack, final char[] needle) { int count = 0; final int M = haystack.length; final int N = needle.length; int iterations = 0; for (int i = 0; i < M - N + 1;) { int j = 0; for (; j < N; j++) { iterations++; if (needle[j] != haystack[i + j]) { break; } } if (j == N) { count++; // for matches skip by length of needle or pattern i += N; } else { // for no matches start comparing at next index i.e. i+1 i++; } } System.out.println("Number of iterations: " + iterations); return count; } public static void main(String[] args) { final char[] haystack = "deaddeadEyeElephant".toLowerCase() .toCharArray(); final char[] needle = "deadEye".toLowerCase() .toCharArray(); System.out.println(new StringSearchBruteForceV2().search(haystack, needle)); } }
[ "shreejwal.shrestha@gmail.com" ]
shreejwal.shrestha@gmail.com
5dec2cf6f571f7b4e172fbd1eeedacd151f322c6
48700053bdf9176201afd389e61c9751144fa001
/fatclient/sample3/modules/app/org.jowidgets.samples.fatclient.sample3.common/src/main/java/org/jowidgets/samples/fatclient/sample3/tags/repository/TagRepository.java
3d77c2018023b557a166ed09edff01268dcadcdc
[]
no_license
jo-source/jo-client-platform-samples
3adf461b6f47f3f228cbf5a802f7e147b985f71c
5c4b58a1b6a11047cb5cc8f13856f7eea0555b06
refs/heads/master
2021-01-17T03:52:24.909003
2017-09-30T09:15:05
2017-09-30T09:15:05
39,778,875
2
1
null
2016-01-14T20:12:51
2015-07-27T14:29:24
Java
UTF-8
Java
false
false
3,376
java
/* * Copyright (c) 2014, grossmann * 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 jo-widgets.org 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 jo-widgets.org BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ package org.jowidgets.samples.fatclient.sample3.tags.repository; import org.jowidgets.api.color.Colors; import org.jowidgets.cap.common.api.execution.IExecutionCallback; import org.jowidgets.cap.service.repository.api.ICrudSupportBeanRepository; import org.jowidgets.cap.service.repository.tools.HashMapCrudRepository; import org.jowidgets.common.color.ColorValue; import org.jowidgets.common.types.Markup; import org.jowidgets.samples.fatclient.sample3.books.bean.Book; import org.jowidgets.samples.fatclient.sample3.books.repository.BookRepository; import org.jowidgets.samples.fatclient.sample3.tags.bean.Tag; public final class TagRepository { public static final Tag MISSING = new Tag("Missing", new ColorValue(255, 0, 0), Markup.STRONG); public static final Tag AVAILABLE = new Tag("Available", Colors.BLACK); public static final Tag LENT = new Tag("Lent", new ColorValue(255, 128, 0)); public static final Tag LENDING_PERIOD_EXPIRED = new Tag("Lending period expired", new ColorValue(255, 128, 0), Markup.STRONG); public static final ICrudSupportBeanRepository<Tag> INSTANCE = createInstance(); private TagRepository() {} private static ICrudSupportBeanRepository<Tag> createInstance() { return new HashMapCrudRepository<Tag>(Tag.class) { { add(AVAILABLE); add(LENT); add(LENDING_PERIOD_EXPIRED); add(MISSING); } @Override public Object getId(final Tag tag) { return tag.getId(); } @Override public void delete(final Tag bean, final IExecutionCallback executionCallback) { for (final Book book : BookRepository.INSTANCE.read()) { if (bean != null && bean.equals(book.getTag())) { book.setTag(null); } } super.delete(bean, executionCallback); } }; }; }
[ "herr.grossmann@gmx.de" ]
herr.grossmann@gmx.de
82d8345cdfbf072e55c74e4e64fd5a75000ba1b8
65fca4dfac2eb44ca1a48724e943f5a1ce3b8b83
/hadoopRpc/src/main/java/proto/CalculatorMsg.java
c1b33c76613eaec0754563948cccbe66e6499ec0
[]
no_license
zhuifengsmile/yarnAppMasterRpc
d6044653b1075bca9bee64b8a3ed6063515faa95
278ff5ec6326fa8b557437886ce218783b473f79
refs/heads/master
2021-01-13T06:05:54.692564
2017-06-25T08:48:46
2017-06-25T08:48:46
95,114,971
0
0
null
null
null
null
UTF-8
Java
false
true
34,565
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: CalculatorMsg.proto package proto; public final class CalculatorMsg { private CalculatorMsg() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { } public interface RequestProtoOrBuilder extends com.google.protobuf.MessageOrBuilder { // required int32 num1 = 1; /** * <code>required int32 num1 = 1;</code> */ boolean hasNum1(); /** * <code>required int32 num1 = 1;</code> */ int getNum1(); // required int32 num2 = 2; /** * <code>required int32 num2 = 2;</code> */ boolean hasNum2(); /** * <code>required int32 num2 = 2;</code> */ int getNum2(); } /** * Protobuf type {@code RequestProto} */ public static final class RequestProto extends com.google.protobuf.GeneratedMessage implements RequestProtoOrBuilder { // Use RequestProto.newBuilder() to construct. private RequestProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private RequestProto(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } private static final RequestProto defaultInstance; public static RequestProto getDefaultInstance() { return defaultInstance; } public RequestProto getDefaultInstanceForType() { return defaultInstance; } private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private RequestProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; num1_ = input.readInt32(); break; } case 16: { bitField0_ |= 0x00000002; num2_ = input.readInt32(); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return proto.CalculatorMsg.internal_static_RequestProto_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return proto.CalculatorMsg.internal_static_RequestProto_fieldAccessorTable .ensureFieldAccessorsInitialized( proto.CalculatorMsg.RequestProto.class, proto.CalculatorMsg.RequestProto.Builder.class); } public static com.google.protobuf.Parser<RequestProto> PARSER = new com.google.protobuf.AbstractParser<RequestProto>() { public RequestProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new RequestProto(input, extensionRegistry); } }; @java.lang.Override public com.google.protobuf.Parser<RequestProto> getParserForType() { return PARSER; } private int bitField0_; // required int32 num1 = 1; public static final int NUM1_FIELD_NUMBER = 1; private int num1_; /** * <code>required int32 num1 = 1;</code> */ public boolean hasNum1() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 num1 = 1;</code> */ public int getNum1() { return num1_; } // required int32 num2 = 2; public static final int NUM2_FIELD_NUMBER = 2; private int num2_; /** * <code>required int32 num2 = 2;</code> */ public boolean hasNum2() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required int32 num2 = 2;</code> */ public int getNum2() { return num2_; } private void initFields() { num1_ = 0; num2_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasNum1()) { memoizedIsInitialized = 0; return false; } if (!hasNum2()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, num1_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(2, num2_); } getUnknownFields().writeTo(output); } private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, num1_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, num2_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof proto.CalculatorMsg.RequestProto)) { return super.equals(obj); } proto.CalculatorMsg.RequestProto other = (proto.CalculatorMsg.RequestProto) obj; boolean result = true; result = result && (hasNum1() == other.hasNum1()); if (hasNum1()) { result = result && (getNum1() == other.getNum1()); } result = result && (hasNum2() == other.hasNum2()); if (hasNum2()) { result = result && (getNum2() == other.getNum2()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; } private int memoizedHashCode = 0; @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasNum1()) { hash = (37 * hash) + NUM1_FIELD_NUMBER; hash = (53 * hash) + getNum1(); } if (hasNum2()) { hash = (37 * hash) + NUM2_FIELD_NUMBER; hash = (53 * hash) + getNum2(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static proto.CalculatorMsg.RequestProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static proto.CalculatorMsg.RequestProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static proto.CalculatorMsg.RequestProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static proto.CalculatorMsg.RequestProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static proto.CalculatorMsg.RequestProto parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static proto.CalculatorMsg.RequestProto parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static proto.CalculatorMsg.RequestProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static proto.CalculatorMsg.RequestProto parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static proto.CalculatorMsg.RequestProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static proto.CalculatorMsg.RequestProto parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(proto.CalculatorMsg.RequestProto prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code RequestProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements proto.CalculatorMsg.RequestProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return proto.CalculatorMsg.internal_static_RequestProto_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return proto.CalculatorMsg.internal_static_RequestProto_fieldAccessorTable .ensureFieldAccessorsInitialized( proto.CalculatorMsg.RequestProto.class, proto.CalculatorMsg.RequestProto.Builder.class); } // Construct using proto.CalculatorMsg.RequestProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } private static Builder create() { return new Builder(); } public Builder clear() { super.clear(); num1_ = 0; bitField0_ = (bitField0_ & ~0x00000001); num2_ = 0; bitField0_ = (bitField0_ & ~0x00000002); return this; } public Builder clone() { return create().mergeFrom(buildPartial()); } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return proto.CalculatorMsg.internal_static_RequestProto_descriptor; } public proto.CalculatorMsg.RequestProto getDefaultInstanceForType() { return proto.CalculatorMsg.RequestProto.getDefaultInstance(); } public proto.CalculatorMsg.RequestProto build() { proto.CalculatorMsg.RequestProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public proto.CalculatorMsg.RequestProto buildPartial() { proto.CalculatorMsg.RequestProto result = new proto.CalculatorMsg.RequestProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.num1_ = num1_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.num2_ = num2_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof proto.CalculatorMsg.RequestProto) { return mergeFrom((proto.CalculatorMsg.RequestProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(proto.CalculatorMsg.RequestProto other) { if (other == proto.CalculatorMsg.RequestProto.getDefaultInstance()) return this; if (other.hasNum1()) { setNum1(other.getNum1()); } if (other.hasNum2()) { setNum2(other.getNum2()); } this.mergeUnknownFields(other.getUnknownFields()); return this; } public final boolean isInitialized() { if (!hasNum1()) { return false; } if (!hasNum2()) { return false; } return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { proto.CalculatorMsg.RequestProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (proto.CalculatorMsg.RequestProto) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; // required int32 num1 = 1; private int num1_ ; /** * <code>required int32 num1 = 1;</code> */ public boolean hasNum1() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 num1 = 1;</code> */ public int getNum1() { return num1_; } /** * <code>required int32 num1 = 1;</code> */ public Builder setNum1(int value) { bitField0_ |= 0x00000001; num1_ = value; onChanged(); return this; } /** * <code>required int32 num1 = 1;</code> */ public Builder clearNum1() { bitField0_ = (bitField0_ & ~0x00000001); num1_ = 0; onChanged(); return this; } // required int32 num2 = 2; private int num2_ ; /** * <code>required int32 num2 = 2;</code> */ public boolean hasNum2() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required int32 num2 = 2;</code> */ public int getNum2() { return num2_; } /** * <code>required int32 num2 = 2;</code> */ public Builder setNum2(int value) { bitField0_ |= 0x00000002; num2_ = value; onChanged(); return this; } /** * <code>required int32 num2 = 2;</code> */ public Builder clearNum2() { bitField0_ = (bitField0_ & ~0x00000002); num2_ = 0; onChanged(); return this; } // @@protoc_insertion_point(builder_scope:RequestProto) } static { defaultInstance = new RequestProto(true); defaultInstance.initFields(); } // @@protoc_insertion_point(class_scope:RequestProto) } public interface ResponseProtoOrBuilder extends com.google.protobuf.MessageOrBuilder { // required int32 result = 1; /** * <code>required int32 result = 1;</code> */ boolean hasResult(); /** * <code>required int32 result = 1;</code> */ int getResult(); } /** * Protobuf type {@code ResponseProto} */ public static final class ResponseProto extends com.google.protobuf.GeneratedMessage implements ResponseProtoOrBuilder { // Use ResponseProto.newBuilder() to construct. private ResponseProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private ResponseProto(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } private static final ResponseProto defaultInstance; public static ResponseProto getDefaultInstance() { return defaultInstance; } public ResponseProto getDefaultInstanceForType() { return defaultInstance; } private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ResponseProto( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; result_ = input.readInt32(); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return proto.CalculatorMsg.internal_static_ResponseProto_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return proto.CalculatorMsg.internal_static_ResponseProto_fieldAccessorTable .ensureFieldAccessorsInitialized( proto.CalculatorMsg.ResponseProto.class, proto.CalculatorMsg.ResponseProto.Builder.class); } public static com.google.protobuf.Parser<ResponseProto> PARSER = new com.google.protobuf.AbstractParser<ResponseProto>() { public ResponseProto parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ResponseProto(input, extensionRegistry); } }; @java.lang.Override public com.google.protobuf.Parser<ResponseProto> getParserForType() { return PARSER; } private int bitField0_; // required int32 result = 1; public static final int RESULT_FIELD_NUMBER = 1; private int result_; /** * <code>required int32 result = 1;</code> */ public boolean hasResult() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 result = 1;</code> */ public int getResult() { return result_; } private void initFields() { result_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasResult()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, result_); } getUnknownFields().writeTo(output); } private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, result_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof proto.CalculatorMsg.ResponseProto)) { return super.equals(obj); } proto.CalculatorMsg.ResponseProto other = (proto.CalculatorMsg.ResponseProto) obj; boolean result = true; result = result && (hasResult() == other.hasResult()); if (hasResult()) { result = result && (getResult() == other.getResult()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; } private int memoizedHashCode = 0; @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasResult()) { hash = (37 * hash) + RESULT_FIELD_NUMBER; hash = (53 * hash) + getResult(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static proto.CalculatorMsg.ResponseProto parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static proto.CalculatorMsg.ResponseProto parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static proto.CalculatorMsg.ResponseProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static proto.CalculatorMsg.ResponseProto parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static proto.CalculatorMsg.ResponseProto parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static proto.CalculatorMsg.ResponseProto parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static proto.CalculatorMsg.ResponseProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static proto.CalculatorMsg.ResponseProto parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static proto.CalculatorMsg.ResponseProto parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static proto.CalculatorMsg.ResponseProto parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(proto.CalculatorMsg.ResponseProto prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code ResponseProto} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements proto.CalculatorMsg.ResponseProtoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return proto.CalculatorMsg.internal_static_ResponseProto_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return proto.CalculatorMsg.internal_static_ResponseProto_fieldAccessorTable .ensureFieldAccessorsInitialized( proto.CalculatorMsg.ResponseProto.class, proto.CalculatorMsg.ResponseProto.Builder.class); } // Construct using proto.CalculatorMsg.ResponseProto.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } private static Builder create() { return new Builder(); } public Builder clear() { super.clear(); result_ = 0; bitField0_ = (bitField0_ & ~0x00000001); return this; } public Builder clone() { return create().mergeFrom(buildPartial()); } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return proto.CalculatorMsg.internal_static_ResponseProto_descriptor; } public proto.CalculatorMsg.ResponseProto getDefaultInstanceForType() { return proto.CalculatorMsg.ResponseProto.getDefaultInstance(); } public proto.CalculatorMsg.ResponseProto build() { proto.CalculatorMsg.ResponseProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public proto.CalculatorMsg.ResponseProto buildPartial() { proto.CalculatorMsg.ResponseProto result = new proto.CalculatorMsg.ResponseProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.result_ = result_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof proto.CalculatorMsg.ResponseProto) { return mergeFrom((proto.CalculatorMsg.ResponseProto)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(proto.CalculatorMsg.ResponseProto other) { if (other == proto.CalculatorMsg.ResponseProto.getDefaultInstance()) return this; if (other.hasResult()) { setResult(other.getResult()); } this.mergeUnknownFields(other.getUnknownFields()); return this; } public final boolean isInitialized() { if (!hasResult()) { return false; } return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { proto.CalculatorMsg.ResponseProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (proto.CalculatorMsg.ResponseProto) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; // required int32 result = 1; private int result_ ; /** * <code>required int32 result = 1;</code> */ public boolean hasResult() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 result = 1;</code> */ public int getResult() { return result_; } /** * <code>required int32 result = 1;</code> */ public Builder setResult(int value) { bitField0_ |= 0x00000001; result_ = value; onChanged(); return this; } /** * <code>required int32 result = 1;</code> */ public Builder clearResult() { bitField0_ = (bitField0_ & ~0x00000001); result_ = 0; onChanged(); return this; } // @@protoc_insertion_point(builder_scope:ResponseProto) } static { defaultInstance = new ResponseProto(true); defaultInstance.initFields(); } // @@protoc_insertion_point(class_scope:ResponseProto) } private static com.google.protobuf.Descriptors.Descriptor internal_static_RequestProto_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_RequestProto_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_ResponseProto_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_ResponseProto_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\023CalculatorMsg.proto\"*\n\014RequestProto\022\014\n" + "\004num1\030\001 \002(\005\022\014\n\004num2\030\002 \002(\005\"\037\n\rResponsePro" + "to\022\016\n\006result\030\001 \002(\005B\034\n\005protoB\rCalculatorM" + "sg\210\001\001\240\001\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; internal_static_RequestProto_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_RequestProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RequestProto_descriptor, new java.lang.String[] { "Num1", "Num2", }); internal_static_ResponseProto_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_ResponseProto_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ResponseProto_descriptor, new java.lang.String[] { "Result", }); return null; } }; com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } // @@protoc_insertion_point(outer_class_scope) }
[ "zhangkui.zk@alibaba-inc.com" ]
zhangkui.zk@alibaba-inc.com
ab07d87a35729682f61a57555f5c68408342f6ce
f8538343a0bee2a3be2295cd535094c4d804a420
/ifood/src/main/java/github/thyagofr/ifood/domain/service/client/IClientService.java
4859c635c4d8557999064dbcdf5d15ee4f368c4a
[]
no_license
ThyagoFr/ifood-spring
fd6edd7b9627941b2bd2a9fe20c8750592923284
d70afb4b6b9a6e58ad999b175e0f2f7e9c30a5ba
refs/heads/master
2023-05-06T06:59:14.316031
2021-05-29T19:40:24
2021-05-29T19:40:24
370,514,555
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package github.thyagofr.ifood.domain.service.client; import github.thyagofr.ifood.domain.entity.ClientEntity; import github.thyagofr.ifood.domain.entity.Pagination; public interface IClientService { ClientEntity create(ClientEntity client); ClientEntity update(Long id, ClientEntity client); Pagination findAll(Integer page, Integer pageSize); ClientEntity findByID(Long id); void remove(Long id); }
[ "tfreitas@mcontigo.com" ]
tfreitas@mcontigo.com
ba5381a09baab579d6a97ae1eef91f77b653e6b6
d14bb8a1b10d418bc58a6a6c59ea9ee051648faf
/158-Read N Characters Given Read4 II - Call multiple times.java
17e1ae9cd71d095300c315dcafb7e7983467a2fb
[]
no_license
trisun1024/leetcode
730403e7f54eaf58bfee6018116bc16bc0079568
eaf8efb8c65b4ce7ed23157aca3e98c86f7d3905
refs/heads/master
2023-04-19T01:58:18.603285
2021-05-06T14:07:07
2021-05-06T14:07:07
185,057,548
0
0
null
null
null
null
UTF-8
Java
false
false
1,516
java
/* The read4 API is defined in the parent class Reader4. int read4(char[] buf); */ // Question: Given a file and assume that you can only read the file using a given method read4, implement a method read to read n characters. Your method read may be called multiple times. // Key is to store memorized variable in the class level and remember offset position and remaining number of elements. class ReadNII extends Reader4 { private int offSet = 0; private int remaining = 0; private boolean isEndOfFile = false; private char[] buffer = new char[4]; /** * @param buf Destination buffer * @param n Maximum number of characters to read * @return The number of characters read */ public int read(char[] buf, int n) { int readBytes = 0; while (readBytes < n && (remaining != 0 || !isEndOfFile)) { int readSize = 0; if (remaining != 0) { readSize = remaining; } else { offSet = 0; readSize = read4(buffer); if (readSize != 4) { isEndOfFile = true; } } int length = Math.min(n - readBytes, readSize); for (int i = offSet; i < offSet + length; i++) { buf[readBytes++] = buffer[i]; } remaining = readSize - length; if (remaining != 0) { offSet += length; } } return readBytes; } }
[ "jip45@pitt.edu" ]
jip45@pitt.edu
397fd64e2ee154a0b942192ac674d9f74fba43e6
76814bf67bb1662f641687a76425a1e4832231dc
/sj-plugins/sj-plugin-demo/src/main/java/com/dc/cd/plugins/demo/DemoPlugin.java
a9aec30084557ff58a6f40bc6a706551ea18a25b
[]
no_license
lpy2017/smart-cd-
9bc1b8ed24598bc168c2f74232e63d2f16d477ab
955921b9baa63b005abe249f7cc14e9c8b8639ed
refs/heads/master
2020-03-20T04:09:14.935206
2019-01-15T11:01:05
2019-01-15T11:01:05
137,172,699
0
0
null
null
null
null
UTF-8
Java
false
false
1,635
java
package com.dc.cd.plugins.demo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.dc.bd.plugin.BaseAgentPlugin; import com.dc.bd.plugin.JobDetailDto; import com.dc.bd.plugin.JobExecResultDto; public class DemoPlugin extends BaseAgentPlugin { private static final Logger log = LoggerFactory.getLogger(DemoPlugin.class); public JobExecResultDto execute(JobDetailDto detailDTO) { log.info("demoplugin receive job"); log.info("action:{}", detailDTO.getAction()); log.info("deviceIP:{}", detailDTO.getDeviceIp()); log.info("JobDetailParam:{}", detailDTO.getJobDetailParam()); log.info("Encode:{}", detailDTO.getEncode()); log.info("jobid:{}", detailDTO.getJobId()); log.info("JobInstId:{}", detailDTO.getJobInstId()); log.info("jobname:{}", detailDTO.getJobName()); log.info("NodeGrpId:{}", detailDTO.getNodeGrpId()); log.info("nodeid:{}", detailDTO.getNodeId()); log.info("PluginCode:{}", detailDTO.getPluginCode()); log.info("ProtocolList:{}", detailDTO.getProtocolList()); log.info("Timeout:{}", detailDTO.getTimeout()); log.info("TypeCode:{}", detailDTO.getTypeCode()); log.info("uuid:{}", detailDTO.getUuid()); /* * 执行作业的代码省略 */ // 创建作业执行结果 JobExecResultDto execResultDto = new JobExecResultDto(detailDTO); execResultDto.setCode("100"); execResultDto.setUuid(detailDTO.getUuid()); execResultDto.setSuccess(true); execResultDto.setMsg(detailDTO.getJobDetailParam()); execResultDto.setData("demoplugin_作业执行数据信息(直接返回接收的消息):\n" + detailDTO.getJobDetailParam()); return execResultDto; } }
[ "395365661@qq.com" ]
395365661@qq.com
86e3036d728827162db8907926ffda8d6bbc620c
0c0fa58b42b3ad29284662c0f06b1f5f46283ea0
/src/interfaces/tasks/task14/A.java
51f26f27c3ee1ffe75ec7d91e730e8b1b9df7538
[]
no_license
zhukis/java_edu_ekkel
a976eb0a382a1c9557840714b9aadba4125c271d
670a7a5b950a29c79e2a103b63f49315ebb51678
refs/heads/master
2021-01-01T19:04:48.520095
2017-08-20T21:13:52
2017-08-20T21:13:52
98,501,377
0
0
null
null
null
null
UTF-8
Java
false
false
87
java
package interfaces.tasks.task14; public interface A { void a1(); void a2(); }
[ "izhu@ericpol.com" ]
izhu@ericpol.com
dab3a2eb7a8b75d149f621d0c24b39eca031a82a
5e29158a8ea5c701378f949e5f991ad171ca4904
/src/main/java/com/yoti/robohoover/repository/RobotHooverRepository.java
3b39616fa42352551bdfb44e28a83feda2dcce09
[]
no_license
padmajaruk/robohoover
3954da5e753038c0df23c20ee66c4260004c8faf
7c4daebf64ad83e0d517bd7716d361c2c4a44b2f
refs/heads/master
2021-01-16T21:05:20.572838
2017-08-13T23:02:39
2017-08-13T23:02:39
100,207,198
0
0
null
null
null
null
UTF-8
Java
false
false
190
java
package com.yoti.robohoover.repository; import org.springframework.data.repository.CrudRepository; public interface RobotHooverRepository extends CrudRepository<RobotHooverData, Long> { }
[ "padmaja.r.uk@gmail.com" ]
padmaja.r.uk@gmail.com
ca57c8bd0f0c5376d7176ca784aa0a683fa6f9ba
a4269b8d5f0cd3fdb7e2c6935810b9014106ae3e
/src/ru/mos/gispro/client/elements/TerrTree.java
09579d2a0d9de9a411f2f282f94dde8069af290e
[]
no_license
gispro/GWTviewer
42f58ed2cf3f66aad920ee700c824427bc8cf417
a1184b7b620b0eb3953edfce5264982aa435620f
refs/heads/master
2020-08-05T23:41:31.332256
2011-07-07T13:40:43
2011-07-07T13:40:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
941
java
package ru.mos.gispro.client.elements; import com.smartgwt.client.widgets.tree.Tree; import com.smartgwt.client.widgets.tree.TreeNode; import ru.mos.gispro.client.json.JSONTerr; import ru.mos.gispro.client.json.JSONTerrs; public class TerrTree extends Tree { public void createTerrTree(JSONTerrs terrs) { TreeNode terrRoot = new TreeNode("root"); TreeNode[] tn = new TreeNode[terrs.terrs().length()]; for (int i = 0; i < terrs.terrs().length(); i++) { JSONTerr terr = terrs.terrs().get(i).cast(); TreeNode t = new TreeNode(terr.name()); if (terr.subterrs().length() > 0) { TreeNode[] st = new TreeNode[terr.subterrs().length()]; for (int j = 0; j < terr.subterrs().length(); j++) { TreeNode s = new TreeNode(terr.subterr(j)); st[j] = s; } t.setChildren(st); } tn[i] = t; } this.setRoot(terrRoot); terrRoot.setChildren(tn); } }
[ "ekoklin@f11919cc-cac4-be47-8c43-ed2f22550f7b" ]
ekoklin@f11919cc-cac4-be47-8c43-ed2f22550f7b
9f6a54ea2ed7614b1345126546dbbd942ff5dd07
798d58e4e7d20d27c19c721b16f937f9a7fc11f1
/NOT_MINE/RecyclerView/app/src/main/java/com/example/vitaliy/recyclerview/Database/MovieDatabase.java
770a3cdb8d371b242adb74033fdc61ab168ed109
[]
no_license
tarasyurts/AndroidProjects
8302d571d2831ad47cec52bf30440976362d2a17
092f1c7bb3bf24eaeb029eac76fe8c66ca08bf6c
refs/heads/master
2022-10-25T20:24:50.434963
2020-06-16T12:40:53
2020-06-16T12:40:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
327
java
package com.example.vitaliy.recyclerview.Database; import android.arch.persistence.room.Database; import android.arch.persistence.room.RoomDatabase; @Database(entities = {Movies.class}, version = 1, exportSchema = false) public abstract class MovieDatabase extends RoomDatabase { public abstract DaoAccess daoAccess() ; }
[ "tariksyurts@gmail.com" ]
tariksyurts@gmail.com
989d5bdd3ffea306cf6897ac96257aabafb06973
a56ce65692017166bbaebed3d847d943584ddcea
/persistence/src/main/java/com/jeeyoh/persistence/domain/FunboardComments.java
0890216cb8e27de521d09205f973cc7fea99c5eb
[]
no_license
sarvesh-tripathi/Jeeyoh
6bf3e489392b795eed154655bc28d44e607b9eac
0c7b8901418d3416dbefdbbc62fdbaca1668bd5a
refs/heads/master
2020-07-21T14:07:20.279424
2014-10-15T13:07:34
2014-10-15T13:07:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,950
java
package com.jeeyoh.persistence.domain; import java.io.Serializable; import java.util.Date; public class FunboardComments implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private Integer id; private User user; private Funboard funboard; private String comment; private boolean isComment; private Date createdTime; private Date updatedTime; /** * @return the id */ public Integer getId() { return id; } /** * @param id the id to set */ public void setId(Integer id) { this.id = id; } /** * @return the user */ public User getUser() { return user; } /** * @param user the user to set */ public void setUser(User user) { this.user = user; } /** * @return the funboard */ public Funboard getFunboard() { return funboard; } /** * @param funboard the funboard to set */ public void setFunboard(Funboard funboard) { this.funboard = funboard; } /** * @return the comment */ public String getComment() { return comment; } /** * @param comment the comment to set */ public void setComment(String comment) { this.comment = comment; } /** * @return the isComment */ public boolean getIsComment() { return isComment; } /** * @param isComment the isComment to set */ public void setIsComment(boolean isComment) { this.isComment = isComment; } /** * @return the createdTime */ public Date getCreatedTime() { return createdTime; } /** * @param createdTime the createdTime to set */ public void setCreatedTime(Date createdTime) { this.createdTime = createdTime; } /** * @return the updatedTime */ public Date getUpdatedTime() { return updatedTime; } /** * @param updatedTime the updatedTime to set */ public void setUpdatedTime(Date updatedTime) { this.updatedTime = updatedTime; } }
[ "babita.dhami@evontech.com" ]
babita.dhami@evontech.com
86210e17eeaf3b72ea4d9dc3e58e812c3e382c9c
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14475-5-26-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/job/AbstractJob_ESTest.java
4f925b00ef034497920b5555d4e9c6c0a38435b4
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
542
java
/* * This file was automatically generated by EvoSuite * Sun Jan 19 13:50:40 UTC 2020 */ package org.xwiki.job; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class AbstractJob_ESTest extends AbstractJob_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
028eda1211d61df3e2ca3ab3bb4ca4ac29d23850
43eb759f66530923dfe1c6e191ec4f350c097bd9
/projects/commons-math/src/main/java/org/apache/commons/math3/linear/BlockRealMatrix.java
1ea22b60dac41264fb04088d3e2700b3faa14997
[ "MIT", "BSD-3-Clause", "Apache-2.0", "LicenseRef-scancode-public-domain", "Minpack", "LicenseRef-scancode-generic-cla" ]
permissive
hayasam/lightweight-effectiveness
fe4bd04f8816c6554e35c8c9fc8489c11fc8ce0b
f6ef4c98b8f572a86e42252686995b771e655f80
refs/heads/master
2023-08-17T01:51:46.351933
2020-09-03T07:38:35
2020-09-03T07:38:35
298,672,257
0
0
MIT
2023-09-08T15:33:03
2020-09-25T20:23:43
null
UTF-8
Java
false
false
67,584
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.commons.math3.linear; import java.io.Serializable; import java.util.Arrays; import org.apache.commons.math3.exception.DimensionMismatchException; import org.apache.commons.math3.exception.NoDataException; import org.apache.commons.math3.exception.NotStrictlyPositiveException; import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.util.MathUtils; /** * Cache-friendly implementation of RealMatrix using a flat arrays to store * square blocks of the matrix. * <p> * This implementation is specially designed to be cache-friendly. Square blocks are * stored as small arrays and allow efficient traversal of data both in row major direction * and columns major direction, one block at a time. This greatly increases performances * for algorithms that use crossed directions loops like multiplication or transposition. * </p> * <p> * The size of square blocks is a static parameter. It may be tuned according to the cache * size of the target computer processor. As a rule of thumbs, it should be the largest * value that allows three blocks to be simultaneously cached (this is necessary for example * for matrix multiplication). The default value is to use 52x52 blocks which is well suited * for processors with 64k L1 cache (one block holds 2704 values or 21632 bytes). This value * could be lowered to 36x36 for processors with 32k L1 cache. * </p> * <p> * The regular blocks represent {@link #BLOCK_SIZE} x {@link #BLOCK_SIZE} squares. Blocks * at right hand side and bottom side which may be smaller to fit matrix dimensions. The square * blocks are flattened in row major order in single dimension arrays which are therefore * {@link #BLOCK_SIZE}<sup>2</sup> elements long for regular blocks. The blocks are themselves * organized in row major order. * </p> * <p> * As an example, for a block size of 52x52, a 100x60 matrix would be stored in 4 blocks. * Block 0 would be a double[2704] array holding the upper left 52x52 square, block 1 would be * a double[416] array holding the upper right 52x8 rectangle, block 2 would be a double[2496] * array holding the lower left 48x52 rectangle and block 3 would be a double[384] array * holding the lower right 48x8 rectangle. * </p> * <p> * The layout complexity overhead versus simple mapping of matrices to java * arrays is negligible for small matrices (about 1%). The gain from cache efficiency leads * to up to 3-fold improvements for matrices of moderate to large size. * </p> * @since 2.0 */ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable { /** Block size. */ public static final int BLOCK_SIZE = 52; /** Serializable version identifier */ private static final long serialVersionUID = 4991895511313664478L; /** Blocks of matrix entries. */ private final double blocks[][]; /** Number of rows of the matrix. */ private final int rows; /** Number of columns of the matrix. */ private final int columns; /** Number of block rows of the matrix. */ private final int blockRows; /** Number of block columns of the matrix. */ private final int blockColumns; /** * Create a new matrix with the supplied row and column dimensions. * * @param rows the number of rows in the new matrix * @param columns the number of columns in the new matrix * @throws NotStrictlyPositiveException if row or column dimension is not * positive. */ public BlockRealMatrix(final int rows, final int columns) throws NotStrictlyPositiveException { super(rows, columns); this.rows = rows; this.columns = columns; // number of blocks blockRows = (rows + BLOCK_SIZE - 1) / BLOCK_SIZE; blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE; // allocate storage blocks, taking care of smaller ones at right and bottom blocks = createBlocksLayout(rows, columns); } /** * Create a new dense matrix copying entries from raw layout data. * <p>The input array <em>must</em> already be in raw layout.</p> * <p>Calling this constructor is equivalent to call: * <pre>matrix = new BlockRealMatrix(rawData.length, rawData[0].length, * toBlocksLayout(rawData), false);</pre> * </p> * * @param rawData data for new matrix, in raw layout * @throws DimensionMismatchException if the shape of {@code blockData} is * inconsistent with block layout. * @throws NotStrictlyPositiveException if row or column dimension is not * positive. * @see #BlockRealMatrix(int, int, double[][], boolean) */ public BlockRealMatrix(final double[][] rawData) throws DimensionMismatchException, NotStrictlyPositiveException { this(rawData.length, rawData[0].length, toBlocksLayout(rawData), false); } /** * Create a new dense matrix copying entries from block layout data. * <p>The input array <em>must</em> already be in blocks layout.</p> * * @param rows Number of rows in the new matrix. * @param columns Number of columns in the new matrix. * @param blockData data for new matrix * @param copyArray Whether the input array will be copied or referenced. * @throws DimensionMismatchException if the shape of {@code blockData} is * inconsistent with block layout. * @throws NotStrictlyPositiveException if row or column dimension is not * positive. * @see #createBlocksLayout(int, int) * @see #toBlocksLayout(double[][]) * @see #BlockRealMatrix(double[][]) */ public BlockRealMatrix(final int rows, final int columns, final double[][] blockData, final boolean copyArray) throws DimensionMismatchException, NotStrictlyPositiveException { super(rows, columns); this.rows = rows; this.columns = columns; // number of blocks blockRows = (rows + BLOCK_SIZE - 1) / BLOCK_SIZE; blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE; if (copyArray) { // allocate storage blocks, taking care of smaller ones at right and bottom blocks = new double[blockRows * blockColumns][]; } else { // reference existing array blocks = blockData; } int index = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int iHeight = blockHeight(iBlock); for (int jBlock = 0; jBlock < blockColumns; ++jBlock, ++index) { if (blockData[index].length != iHeight * blockWidth(jBlock)) { throw new DimensionMismatchException(blockData[index].length, iHeight * blockWidth(jBlock)); } if (copyArray) { blocks[index] = blockData[index].clone(); } } } } /** * Convert a data array from raw layout to blocks layout. * <p> * Raw layout is the straightforward layout where element at row i and * column j is in array element <code>rawData[i][j]</code>. Blocks layout * is the layout used in {@link BlockRealMatrix} instances, where the matrix * is split in square blocks (except at right and bottom side where blocks may * be rectangular to fit matrix size) and each block is stored in a flattened * one-dimensional array. * </p> * <p> * This method creates an array in blocks layout from an input array in raw layout. * It can be used to provide the array argument of the {@link * #BlockRealMatrix(int, int, double[][], boolean)} constructor. * </p> * @param rawData Data array in raw layout. * @return a new data array containing the same entries but in blocks layout. * @throws DimensionMismatchException if {@code rawData} is not rectangular. * @see #createBlocksLayout(int, int) * @see #BlockRealMatrix(int, int, double[][], boolean) */ public static double[][] toBlocksLayout(final double[][] rawData) throws DimensionMismatchException { final int rows = rawData.length; final int columns = rawData[0].length; final int blockRows = (rows + BLOCK_SIZE - 1) / BLOCK_SIZE; final int blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE; // safety checks for (int i = 0; i < rawData.length; ++i) { final int length = rawData[i].length; if (length != columns) { throw new DimensionMismatchException(columns, length); } } // convert array final double[][] blocks = new double[blockRows * blockColumns][]; int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); final int iHeight = pEnd - pStart; for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); final int jWidth = qEnd - qStart; // allocate new block final double[] block = new double[iHeight * jWidth]; blocks[blockIndex] = block; // copy data int index = 0; for (int p = pStart; p < pEnd; ++p) { System.arraycopy(rawData[p], qStart, block, index, jWidth); index += jWidth; } ++blockIndex; } } return blocks; } /** * Create a data array in blocks layout. * <p> * This method can be used to create the array argument of the {@link * #BlockRealMatrix(int, int, double[][], boolean)} constructor. * </p> * @param rows Number of rows in the new matrix. * @param columns Number of columns in the new matrix. * @return a new data array in blocks layout. * @see #toBlocksLayout(double[][]) * @see #BlockRealMatrix(int, int, double[][], boolean) */ public static double[][] createBlocksLayout(final int rows, final int columns) { final int blockRows = (rows + BLOCK_SIZE - 1) / BLOCK_SIZE; final int blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE; final double[][] blocks = new double[blockRows * blockColumns][]; int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); final int iHeight = pEnd - pStart; for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); final int jWidth = qEnd - qStart; blocks[blockIndex] = new double[iHeight * jWidth]; ++blockIndex; } } return blocks; } /** {@inheritDoc} */ @Override public BlockRealMatrix createMatrix(final int rowDimension, final int columnDimension) throws NotStrictlyPositiveException { return new BlockRealMatrix(rowDimension, columnDimension); } /** {@inheritDoc} */ @Override public BlockRealMatrix copy() { // create an empty matrix BlockRealMatrix copied = new BlockRealMatrix(rows, columns); // copy the blocks for (int i = 0; i < blocks.length; ++i) { System.arraycopy(blocks[i], 0, copied.blocks[i], 0, blocks[i].length); } return copied; } /** {@inheritDoc} */ @Override public BlockRealMatrix add(final RealMatrix m) throws MatrixDimensionMismatchException { try { return add((BlockRealMatrix) m); } catch (ClassCastException cce) { // safety check MatrixUtils.checkAdditionCompatible(this, m); final BlockRealMatrix out = new BlockRealMatrix(rows, columns); // perform addition block-wise, to ensure good cache behavior int blockIndex = 0; for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) { for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) { // perform addition on the current block final double[] outBlock = out.blocks[blockIndex]; final double[] tBlock = blocks[blockIndex]; final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); int k = 0; for (int p = pStart; p < pEnd; ++p) { for (int q = qStart; q < qEnd; ++q) { outBlock[k] = tBlock[k] + m.getEntry(p, q); ++k; } } // go to next block ++blockIndex; } } return out; } } /** * Compute the sum of this matrix and {@code m}. * * @param m Matrix to be added. * @return {@code this} + m. * @throws MatrixDimensionMismatchException if {@code m} is not the same * size as this matrix. */ public BlockRealMatrix add(final BlockRealMatrix m) throws MatrixDimensionMismatchException { // safety check MatrixUtils.checkAdditionCompatible(this, m); final BlockRealMatrix out = new BlockRealMatrix(rows, columns); // perform addition block-wise, to ensure good cache behavior for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) { final double[] outBlock = out.blocks[blockIndex]; final double[] tBlock = blocks[blockIndex]; final double[] mBlock = m.blocks[blockIndex]; for (int k = 0; k < outBlock.length; ++k) { outBlock[k] = tBlock[k] + mBlock[k]; } } return out; } /** {@inheritDoc} */ @Override public BlockRealMatrix subtract(final RealMatrix m) throws MatrixDimensionMismatchException { try { return subtract((BlockRealMatrix) m); } catch (ClassCastException cce) { // safety check MatrixUtils.checkSubtractionCompatible(this, m); final BlockRealMatrix out = new BlockRealMatrix(rows, columns); // perform subtraction block-wise, to ensure good cache behavior int blockIndex = 0; for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) { for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) { // perform subtraction on the current block final double[] outBlock = out.blocks[blockIndex]; final double[] tBlock = blocks[blockIndex]; final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); int k = 0; for (int p = pStart; p < pEnd; ++p) { for (int q = qStart; q < qEnd; ++q) { outBlock[k] = tBlock[k] - m.getEntry(p, q); ++k; } } // go to next block ++blockIndex; } } return out; } } /** * Subtract {@code m} from this matrix. * * @param m Matrix to be subtracted. * @return {@code this} - m. * @throws MatrixDimensionMismatchException if {@code m} is not the * same size as this matrix. */ public BlockRealMatrix subtract(final BlockRealMatrix m) throws MatrixDimensionMismatchException { // safety check MatrixUtils.checkSubtractionCompatible(this, m); final BlockRealMatrix out = new BlockRealMatrix(rows, columns); // perform subtraction block-wise, to ensure good cache behavior for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) { final double[] outBlock = out.blocks[blockIndex]; final double[] tBlock = blocks[blockIndex]; final double[] mBlock = m.blocks[blockIndex]; for (int k = 0; k < outBlock.length; ++k) { outBlock[k] = tBlock[k] - mBlock[k]; } } return out; } /** {@inheritDoc} */ @Override public BlockRealMatrix scalarAdd(final double d) { final BlockRealMatrix out = new BlockRealMatrix(rows, columns); // perform subtraction block-wise, to ensure good cache behavior for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) { final double[] outBlock = out.blocks[blockIndex]; final double[] tBlock = blocks[blockIndex]; for (int k = 0; k < outBlock.length; ++k) { outBlock[k] = tBlock[k] + d; } } return out; } /** {@inheritDoc} */ @Override public RealMatrix scalarMultiply(final double d) { final BlockRealMatrix out = new BlockRealMatrix(rows, columns); // perform subtraction block-wise, to ensure good cache behavior for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) { final double[] outBlock = out.blocks[blockIndex]; final double[] tBlock = blocks[blockIndex]; for (int k = 0; k < outBlock.length; ++k) { outBlock[k] = tBlock[k] * d; } } return out; } /** {@inheritDoc} */ @Override public BlockRealMatrix multiply(final RealMatrix m) throws DimensionMismatchException { try { return multiply((BlockRealMatrix) m); } catch (ClassCastException cce) { // safety check MatrixUtils.checkMultiplicationCompatible(this, m); final BlockRealMatrix out = new BlockRealMatrix(rows, m.getColumnDimension()); // perform multiplication block-wise, to ensure good cache behavior int blockIndex = 0; for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) { final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, m.getColumnDimension()); // select current block final double[] outBlock = out.blocks[blockIndex]; // perform multiplication on current block for (int kBlock = 0; kBlock < blockColumns; ++kBlock) { final int kWidth = blockWidth(kBlock); final double[] tBlock = blocks[iBlock * blockColumns + kBlock]; final int rStart = kBlock * BLOCK_SIZE; int k = 0; for (int p = pStart; p < pEnd; ++p) { final int lStart = (p - pStart) * kWidth; final int lEnd = lStart + kWidth; for (int q = qStart; q < qEnd; ++q) { double sum = 0; int r = rStart; for (int l = lStart; l < lEnd; ++l) { sum += tBlock[l] * m.getEntry(r, q); ++r; } outBlock[k] += sum; ++k; } } } // go to next block ++blockIndex; } } return out; } } /** * Returns the result of postmultiplying this by {@code m}. * * @param m Matrix to postmultiply by. * @return {@code this} * m. * @throws DimensionMismatchException if the matrices are not compatible. */ public BlockRealMatrix multiply(BlockRealMatrix m) throws DimensionMismatchException { // safety check MatrixUtils.checkMultiplicationCompatible(this, m); final BlockRealMatrix out = new BlockRealMatrix(rows, m.columns); // perform multiplication block-wise, to ensure good cache behavior int blockIndex = 0; for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) { final int jWidth = out.blockWidth(jBlock); final int jWidth2 = jWidth + jWidth; final int jWidth3 = jWidth2 + jWidth; final int jWidth4 = jWidth3 + jWidth; // select current block final double[] outBlock = out.blocks[blockIndex]; // perform multiplication on current block for (int kBlock = 0; kBlock < blockColumns; ++kBlock) { final int kWidth = blockWidth(kBlock); final double[] tBlock = blocks[iBlock * blockColumns + kBlock]; final double[] mBlock = m.blocks[kBlock * m.blockColumns + jBlock]; int k = 0; for (int p = pStart; p < pEnd; ++p) { final int lStart = (p - pStart) * kWidth; final int lEnd = lStart + kWidth; for (int nStart = 0; nStart < jWidth; ++nStart) { double sum = 0; int l = lStart; int n = nStart; while (l < lEnd - 3) { sum += tBlock[l] * mBlock[n] + tBlock[l + 1] * mBlock[n + jWidth] + tBlock[l + 2] * mBlock[n + jWidth2] + tBlock[l + 3] * mBlock[n + jWidth3]; l += 4; n += jWidth4; } while (l < lEnd) { sum += tBlock[l++] * mBlock[n]; n += jWidth; } outBlock[k] += sum; ++k; } } } // go to next block ++blockIndex; } } return out; } /** {@inheritDoc} */ @Override public double[][] getData() { final double[][] data = new double[getRowDimension()][getColumnDimension()]; final int lastColumns = columns - (blockColumns - 1) * BLOCK_SIZE; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); int regularPos = 0; int lastPos = 0; for (int p = pStart; p < pEnd; ++p) { final double[] dataP = data[p]; int blockIndex = iBlock * blockColumns; int dataPos = 0; for (int jBlock = 0; jBlock < blockColumns - 1; ++jBlock) { System.arraycopy(blocks[blockIndex++], regularPos, dataP, dataPos, BLOCK_SIZE); dataPos += BLOCK_SIZE; } System.arraycopy(blocks[blockIndex], lastPos, dataP, dataPos, lastColumns); regularPos += BLOCK_SIZE; lastPos += lastColumns; } } return data; } /** {@inheritDoc} */ @Override public double getNorm() { final double[] colSums = new double[BLOCK_SIZE]; double maxColSum = 0; for (int jBlock = 0; jBlock < blockColumns; jBlock++) { final int jWidth = blockWidth(jBlock); Arrays.fill(colSums, 0, jWidth, 0.0); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int iHeight = blockHeight(iBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int j = 0; j < jWidth; ++j) { double sum = 0; for (int i = 0; i < iHeight; ++i) { sum += FastMath.abs(block[i * jWidth + j]); } colSums[j] += sum; } } for (int j = 0; j < jWidth; ++j) { maxColSum = FastMath.max(maxColSum, colSums[j]); } } return maxColSum; } /** {@inheritDoc} */ @Override public double getFrobeniusNorm() { double sum2 = 0; for (int blockIndex = 0; blockIndex < blocks.length; ++blockIndex) { for (final double entry : blocks[blockIndex]) { sum2 += entry * entry; } } return FastMath.sqrt(sum2); } /** {@inheritDoc} */ @Override public BlockRealMatrix getSubMatrix(final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException { // safety checks MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); // create the output matrix final BlockRealMatrix out = new BlockRealMatrix(endRow - startRow + 1, endColumn - startColumn + 1); // compute blocks shifts final int blockStartRow = startRow / BLOCK_SIZE; final int rowsShift = startRow % BLOCK_SIZE; final int blockStartColumn = startColumn / BLOCK_SIZE; final int columnsShift = startColumn % BLOCK_SIZE; // perform extraction block-wise, to ensure good cache behavior int pBlock = blockStartRow; for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) { final int iHeight = out.blockHeight(iBlock); int qBlock = blockStartColumn; for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) { final int jWidth = out.blockWidth(jBlock); // handle one block of the output matrix final int outIndex = iBlock * out.blockColumns + jBlock; final double[] outBlock = out.blocks[outIndex]; final int index = pBlock * blockColumns + qBlock; final int width = blockWidth(qBlock); final int heightExcess = iHeight + rowsShift - BLOCK_SIZE; final int widthExcess = jWidth + columnsShift - BLOCK_SIZE; if (heightExcess > 0) { // the submatrix block spans on two blocks rows from the original matrix if (widthExcess > 0) { // the submatrix block spans on two blocks columns from the original matrix final int width2 = blockWidth(qBlock + 1); copyBlockPart(blocks[index], width, rowsShift, BLOCK_SIZE, columnsShift, BLOCK_SIZE, outBlock, jWidth, 0, 0); copyBlockPart(blocks[index + 1], width2, rowsShift, BLOCK_SIZE, 0, widthExcess, outBlock, jWidth, 0, jWidth - widthExcess); copyBlockPart(blocks[index + blockColumns], width, 0, heightExcess, columnsShift, BLOCK_SIZE, outBlock, jWidth, iHeight - heightExcess, 0); copyBlockPart(blocks[index + blockColumns + 1], width2, 0, heightExcess, 0, widthExcess, outBlock, jWidth, iHeight - heightExcess, jWidth - widthExcess); } else { // the submatrix block spans on one block column from the original matrix copyBlockPart(blocks[index], width, rowsShift, BLOCK_SIZE, columnsShift, jWidth + columnsShift, outBlock, jWidth, 0, 0); copyBlockPart(blocks[index + blockColumns], width, 0, heightExcess, columnsShift, jWidth + columnsShift, outBlock, jWidth, iHeight - heightExcess, 0); } } else { // the submatrix block spans on one block row from the original matrix if (widthExcess > 0) { // the submatrix block spans on two blocks columns from the original matrix final int width2 = blockWidth(qBlock + 1); copyBlockPart(blocks[index], width, rowsShift, iHeight + rowsShift, columnsShift, BLOCK_SIZE, outBlock, jWidth, 0, 0); copyBlockPart(blocks[index + 1], width2, rowsShift, iHeight + rowsShift, 0, widthExcess, outBlock, jWidth, 0, jWidth - widthExcess); } else { // the submatrix block spans on one block column from the original matrix copyBlockPart(blocks[index], width, rowsShift, iHeight + rowsShift, columnsShift, jWidth + columnsShift, outBlock, jWidth, 0, 0); } } ++qBlock; } ++pBlock; } return out; } /** * Copy a part of a block into another one * <p>This method can be called only when the specified part fits in both * blocks, no verification is done here.</p> * @param srcBlock source block * @param srcWidth source block width ({@link #BLOCK_SIZE} or smaller) * @param srcStartRow start row in the source block * @param srcEndRow end row (exclusive) in the source block * @param srcStartColumn start column in the source block * @param srcEndColumn end column (exclusive) in the source block * @param dstBlock destination block * @param dstWidth destination block width ({@link #BLOCK_SIZE} or smaller) * @param dstStartRow start row in the destination block * @param dstStartColumn start column in the destination block */ private void copyBlockPart(final double[] srcBlock, final int srcWidth, final int srcStartRow, final int srcEndRow, final int srcStartColumn, final int srcEndColumn, final double[] dstBlock, final int dstWidth, final int dstStartRow, final int dstStartColumn) { final int length = srcEndColumn - srcStartColumn; int srcPos = srcStartRow * srcWidth + srcStartColumn; int dstPos = dstStartRow * dstWidth + dstStartColumn; for (int srcRow = srcStartRow; srcRow < srcEndRow; ++srcRow) { System.arraycopy(srcBlock, srcPos, dstBlock, dstPos, length); srcPos += srcWidth; dstPos += dstWidth; } } /** {@inheritDoc} */ @Override public void setSubMatrix(final double[][] subMatrix, final int row, final int column) throws OutOfRangeException, NoDataException, NullArgumentException, DimensionMismatchException { // safety checks MathUtils.checkNotNull(subMatrix); final int refLength = subMatrix[0].length; if (refLength == 0) { throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN); } final int endRow = row + subMatrix.length - 1; final int endColumn = column + refLength - 1; MatrixUtils.checkSubMatrixIndex(this, row, endRow, column, endColumn); for (final double[] subRow : subMatrix) { if (subRow.length != refLength) { throw new DimensionMismatchException(refLength, subRow.length); } } // compute blocks bounds final int blockStartRow = row / BLOCK_SIZE; final int blockEndRow = (endRow + BLOCK_SIZE) / BLOCK_SIZE; final int blockStartColumn = column / BLOCK_SIZE; final int blockEndColumn = (endColumn + BLOCK_SIZE) / BLOCK_SIZE; // perform copy block-wise, to ensure good cache behavior for (int iBlock = blockStartRow; iBlock < blockEndRow; ++iBlock) { final int iHeight = blockHeight(iBlock); final int firstRow = iBlock * BLOCK_SIZE; final int iStart = FastMath.max(row, firstRow); final int iEnd = FastMath.min(endRow + 1, firstRow + iHeight); for (int jBlock = blockStartColumn; jBlock < blockEndColumn; ++jBlock) { final int jWidth = blockWidth(jBlock); final int firstColumn = jBlock * BLOCK_SIZE; final int jStart = FastMath.max(column, firstColumn); final int jEnd = FastMath.min(endColumn + 1, firstColumn + jWidth); final int jLength = jEnd - jStart; // handle one block, row by row final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int i = iStart; i < iEnd; ++i) { System.arraycopy(subMatrix[i - row], jStart - column, block, (i - firstRow) * jWidth + (jStart - firstColumn), jLength); } } } } /** {@inheritDoc} */ @Override public BlockRealMatrix getRowMatrix(final int row) throws OutOfRangeException { MatrixUtils.checkRowIndex(this, row); final BlockRealMatrix out = new BlockRealMatrix(1, columns); // perform copy block-wise, to ensure good cache behavior final int iBlock = row / BLOCK_SIZE; final int iRow = row - iBlock * BLOCK_SIZE; int outBlockIndex = 0; int outIndex = 0; double[] outBlock = out.blocks[outBlockIndex]; for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; final int available = outBlock.length - outIndex; if (jWidth > available) { System.arraycopy(block, iRow * jWidth, outBlock, outIndex, available); outBlock = out.blocks[++outBlockIndex]; System.arraycopy(block, iRow * jWidth, outBlock, 0, jWidth - available); outIndex = jWidth - available; } else { System.arraycopy(block, iRow * jWidth, outBlock, outIndex, jWidth); outIndex += jWidth; } } return out; } /** {@inheritDoc} */ @Override public void setRowMatrix(final int row, final RealMatrix matrix) throws OutOfRangeException, MatrixDimensionMismatchException { try { setRowMatrix(row, (BlockRealMatrix) matrix); } catch (ClassCastException cce) { super.setRowMatrix(row, matrix); } } /** * Sets the entries in row number <code>row</code> * as a row matrix. Row indices start at 0. * * @param row the row to be set * @param matrix row matrix (must have one row and the same number of columns * as the instance) * @throws OutOfRangeException if the specified row index is invalid. * @throws MatrixDimensionMismatchException if the matrix dimensions do * not match one instance row. */ public void setRowMatrix(final int row, final BlockRealMatrix matrix) throws OutOfRangeException, MatrixDimensionMismatchException { MatrixUtils.checkRowIndex(this, row); final int nCols = getColumnDimension(); if ((matrix.getRowDimension() != 1) || (matrix.getColumnDimension() != nCols)) { throw new MatrixDimensionMismatchException(matrix.getRowDimension(), matrix.getColumnDimension(), 1, nCols); } // perform copy block-wise, to ensure good cache behavior final int iBlock = row / BLOCK_SIZE; final int iRow = row - iBlock * BLOCK_SIZE; int mBlockIndex = 0; int mIndex = 0; double[] mBlock = matrix.blocks[mBlockIndex]; for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; final int available = mBlock.length - mIndex; if (jWidth > available) { System.arraycopy(mBlock, mIndex, block, iRow * jWidth, available); mBlock = matrix.blocks[++mBlockIndex]; System.arraycopy(mBlock, 0, block, iRow * jWidth, jWidth - available); mIndex = jWidth - available; } else { System.arraycopy(mBlock, mIndex, block, iRow * jWidth, jWidth); mIndex += jWidth; } } } /** {@inheritDoc} */ @Override public BlockRealMatrix getColumnMatrix(final int column) throws OutOfRangeException { MatrixUtils.checkColumnIndex(this, column); final BlockRealMatrix out = new BlockRealMatrix(rows, 1); // perform copy block-wise, to ensure good cache behavior final int jBlock = column / BLOCK_SIZE; final int jColumn = column - jBlock * BLOCK_SIZE; final int jWidth = blockWidth(jBlock); int outBlockIndex = 0; int outIndex = 0; double[] outBlock = out.blocks[outBlockIndex]; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int iHeight = blockHeight(iBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int i = 0; i < iHeight; ++i) { if (outIndex >= outBlock.length) { outBlock = out.blocks[++outBlockIndex]; outIndex = 0; } outBlock[outIndex++] = block[i * jWidth + jColumn]; } } return out; } /** {@inheritDoc} */ @Override public void setColumnMatrix(final int column, final RealMatrix matrix) throws OutOfRangeException, MatrixDimensionMismatchException { try { setColumnMatrix(column, (BlockRealMatrix) matrix); } catch (ClassCastException cce) { super.setColumnMatrix(column, matrix); } } /** * Sets the entries in column number <code>column</code> * as a column matrix. Column indices start at 0. * * @param column the column to be set * @param matrix column matrix (must have one column and the same number of rows * as the instance) * @throws OutOfRangeException if the specified column index is invalid. * @throws MatrixDimensionMismatchException if the matrix dimensions do * not match one instance column. */ void setColumnMatrix(final int column, final BlockRealMatrix matrix) throws OutOfRangeException, MatrixDimensionMismatchException { MatrixUtils.checkColumnIndex(this, column); final int nRows = getRowDimension(); if ((matrix.getRowDimension() != nRows) || (matrix.getColumnDimension() != 1)) { throw new MatrixDimensionMismatchException(matrix.getRowDimension(), matrix.getColumnDimension(), nRows, 1); } // perform copy block-wise, to ensure good cache behavior final int jBlock = column / BLOCK_SIZE; final int jColumn = column - jBlock * BLOCK_SIZE; final int jWidth = blockWidth(jBlock); int mBlockIndex = 0; int mIndex = 0; double[] mBlock = matrix.blocks[mBlockIndex]; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int iHeight = blockHeight(iBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int i = 0; i < iHeight; ++i) { if (mIndex >= mBlock.length) { mBlock = matrix.blocks[++mBlockIndex]; mIndex = 0; } block[i * jWidth + jColumn] = mBlock[mIndex++]; } } } /** {@inheritDoc} */ @Override public RealVector getRowVector(final int row) throws OutOfRangeException { MatrixUtils.checkRowIndex(this, row); final double[] outData = new double[columns]; // perform copy block-wise, to ensure good cache behavior final int iBlock = row / BLOCK_SIZE; final int iRow = row - iBlock * BLOCK_SIZE; int outIndex = 0; for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; System.arraycopy(block, iRow * jWidth, outData, outIndex, jWidth); outIndex += jWidth; } return new ArrayRealVector(outData, false); } /** {@inheritDoc} */ @Override public void setRowVector(final int row, final RealVector vector) throws OutOfRangeException, MatrixDimensionMismatchException { try { setRow(row, ((ArrayRealVector) vector).getDataRef()); } catch (ClassCastException cce) { super.setRowVector(row, vector); } } /** {@inheritDoc} */ @Override public RealVector getColumnVector(final int column) throws OutOfRangeException { MatrixUtils.checkColumnIndex(this, column); final double[] outData = new double[rows]; // perform copy block-wise, to ensure good cache behavior final int jBlock = column / BLOCK_SIZE; final int jColumn = column - jBlock * BLOCK_SIZE; final int jWidth = blockWidth(jBlock); int outIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int iHeight = blockHeight(iBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int i = 0; i < iHeight; ++i) { outData[outIndex++] = block[i * jWidth + jColumn]; } } return new ArrayRealVector(outData, false); } /** {@inheritDoc} */ @Override public void setColumnVector(final int column, final RealVector vector) throws OutOfRangeException, MatrixDimensionMismatchException { try { setColumn(column, ((ArrayRealVector) vector).getDataRef()); } catch (ClassCastException cce) { super.setColumnVector(column, vector); } } /** {@inheritDoc} */ @Override public double[] getRow(final int row) throws OutOfRangeException { MatrixUtils.checkRowIndex(this, row); final double[] out = new double[columns]; // perform copy block-wise, to ensure good cache behavior final int iBlock = row / BLOCK_SIZE; final int iRow = row - iBlock * BLOCK_SIZE; int outIndex = 0; for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; System.arraycopy(block, iRow * jWidth, out, outIndex, jWidth); outIndex += jWidth; } return out; } /** {@inheritDoc} */ @Override public void setRow(final int row, final double[] array) throws OutOfRangeException, MatrixDimensionMismatchException { MatrixUtils.checkRowIndex(this, row); final int nCols = getColumnDimension(); if (array.length != nCols) { throw new MatrixDimensionMismatchException(1, array.length, 1, nCols); } // perform copy block-wise, to ensure good cache behavior final int iBlock = row / BLOCK_SIZE; final int iRow = row - iBlock * BLOCK_SIZE; int outIndex = 0; for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; System.arraycopy(array, outIndex, block, iRow * jWidth, jWidth); outIndex += jWidth; } } /** {@inheritDoc} */ @Override public double[] getColumn(final int column) throws OutOfRangeException { MatrixUtils.checkColumnIndex(this, column); final double[] out = new double[rows]; // perform copy block-wise, to ensure good cache behavior final int jBlock = column / BLOCK_SIZE; final int jColumn = column - jBlock * BLOCK_SIZE; final int jWidth = blockWidth(jBlock); int outIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int iHeight = blockHeight(iBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int i = 0; i < iHeight; ++i) { out[outIndex++] = block[i * jWidth + jColumn]; } } return out; } /** {@inheritDoc} */ @Override public void setColumn(final int column, final double[] array) throws OutOfRangeException, MatrixDimensionMismatchException { MatrixUtils.checkColumnIndex(this, column); final int nRows = getRowDimension(); if (array.length != nRows) { throw new MatrixDimensionMismatchException(array.length, 1, nRows, 1); } // perform copy block-wise, to ensure good cache behavior final int jBlock = column / BLOCK_SIZE; final int jColumn = column - jBlock * BLOCK_SIZE; final int jWidth = blockWidth(jBlock); int outIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int iHeight = blockHeight(iBlock); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int i = 0; i < iHeight; ++i) { block[i * jWidth + jColumn] = array[outIndex++]; } } } /** {@inheritDoc} */ @Override public double getEntry(final int row, final int column) throws OutOfRangeException { MatrixUtils.checkMatrixIndex(this, row, column); final int iBlock = row / BLOCK_SIZE; final int jBlock = column / BLOCK_SIZE; final int k = (row - iBlock * BLOCK_SIZE) * blockWidth(jBlock) + (column - jBlock * BLOCK_SIZE); return blocks[iBlock * blockColumns + jBlock][k]; } /** {@inheritDoc} */ @Override public void setEntry(final int row, final int column, final double value) throws OutOfRangeException { MatrixUtils.checkMatrixIndex(this, row, column); final int iBlock = row / BLOCK_SIZE; final int jBlock = column / BLOCK_SIZE; final int k = (row - iBlock * BLOCK_SIZE) * blockWidth(jBlock) + (column - jBlock * BLOCK_SIZE); blocks[iBlock * blockColumns + jBlock][k] = value; } /** {@inheritDoc} */ @Override public void addToEntry(final int row, final int column, final double increment) throws OutOfRangeException { MatrixUtils.checkMatrixIndex(this, row, column); final int iBlock = row / BLOCK_SIZE; final int jBlock = column / BLOCK_SIZE; final int k = (row - iBlock * BLOCK_SIZE) * blockWidth(jBlock) + (column - jBlock * BLOCK_SIZE); blocks[iBlock * blockColumns + jBlock][k] += increment; } /** {@inheritDoc} */ @Override public void multiplyEntry(final int row, final int column, final double factor) throws OutOfRangeException { MatrixUtils.checkMatrixIndex(this, row, column); final int iBlock = row / BLOCK_SIZE; final int jBlock = column / BLOCK_SIZE; final int k = (row - iBlock * BLOCK_SIZE) * blockWidth(jBlock) + (column - jBlock * BLOCK_SIZE); blocks[iBlock * blockColumns + jBlock][k] *= factor; } /** {@inheritDoc} */ @Override public BlockRealMatrix transpose() { final int nRows = getRowDimension(); final int nCols = getColumnDimension(); final BlockRealMatrix out = new BlockRealMatrix(nCols, nRows); // perform transpose block-wise, to ensure good cache behavior int blockIndex = 0; for (int iBlock = 0; iBlock < blockColumns; ++iBlock) { for (int jBlock = 0; jBlock < blockRows; ++jBlock) { // transpose current block final double[] outBlock = out.blocks[blockIndex]; final double[] tBlock = blocks[jBlock * blockColumns + iBlock]; final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, columns); final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, rows); int k = 0; for (int p = pStart; p < pEnd; ++p) { final int lInc = pEnd - pStart; int l = p - pStart; for (int q = qStart; q < qEnd; ++q) { outBlock[k] = tBlock[l]; ++k; l+= lInc; } } // go to next block ++blockIndex; } } return out; } /** {@inheritDoc} */ @Override public int getRowDimension() { return rows; } /** {@inheritDoc} */ @Override public int getColumnDimension() { return columns; } /** {@inheritDoc} */ @Override public double[] operate(final double[] v) throws DimensionMismatchException { if (v.length != columns) { throw new DimensionMismatchException(v.length, columns); } final double[] out = new double[rows]; // perform multiplication block-wise, to ensure good cache behavior for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final double[] block = blocks[iBlock * blockColumns + jBlock]; final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); int k = 0; for (int p = pStart; p < pEnd; ++p) { double sum = 0; int q = qStart; while (q < qEnd - 3) { sum += block[k] * v[q] + block[k + 1] * v[q + 1] + block[k + 2] * v[q + 2] + block[k + 3] * v[q + 3]; k += 4; q += 4; } while (q < qEnd) { sum += block[k++] * v[q++]; } out[p] += sum; } } } return out; } /** {@inheritDoc} */ @Override public double[] preMultiply(final double[] v) throws DimensionMismatchException { if (v.length != rows) { throw new DimensionMismatchException(v.length, rows); } final double[] out = new double[columns]; // perform multiplication block-wise, to ensure good cache behavior for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final int jWidth2 = jWidth + jWidth; final int jWidth3 = jWidth2 + jWidth; final int jWidth4 = jWidth3 + jWidth; final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final double[] block = blocks[iBlock * blockColumns + jBlock]; final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int q = qStart; q < qEnd; ++q) { int k = q - qStart; double sum = 0; int p = pStart; while (p < pEnd - 3) { sum += block[k] * v[p] + block[k + jWidth] * v[p + 1] + block[k + jWidth2] * v[p + 2] + block[k + jWidth3] * v[p + 3]; k += jWidth4; p += 4; } while (p < pEnd) { sum += block[k] * v[p++]; k += jWidth; } out[q] += sum; } } } return out; } /** {@inheritDoc} */ @Override public double walkInRowOrder(final RealMatrixChangingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int p = pStart; p < pEnd; ++p) { for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); final double[] block = blocks[iBlock * blockColumns + jBlock]; int k = (p - pStart) * jWidth; for (int q = qStart; q < qEnd; ++q) { block[k] = visitor.visit(p, q, block[k]); ++k; } } } } return visitor.end(); } /** {@inheritDoc} */ @Override public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int p = pStart; p < pEnd; ++p) { for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int jWidth = blockWidth(jBlock); final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); final double[] block = blocks[iBlock * blockColumns + jBlock]; int k = (p - pStart) * jWidth; for (int q = qStart; q < qEnd; ++q) { visitor.visit(p, q, block[k]); ++k; } } } } return visitor.end(); } /** {@inheritDoc} */ @Override public double walkInRowOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { final int p0 = iBlock * BLOCK_SIZE; final int pStart = FastMath.max(startRow, p0); final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow); for (int p = pStart; p < pEnd; ++p) { for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) { final int jWidth = blockWidth(jBlock); final int q0 = jBlock * BLOCK_SIZE; final int qStart = FastMath.max(startColumn, q0); final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn); final double[] block = blocks[iBlock * blockColumns + jBlock]; int k = (p - p0) * jWidth + qStart - q0; for (int q = qStart; q < qEnd; ++q) { block[k] = visitor.visit(p, q, block[k]); ++k; } } } } return visitor.end(); } /** {@inheritDoc} */ @Override public double walkInRowOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { final int p0 = iBlock * BLOCK_SIZE; final int pStart = FastMath.max(startRow, p0); final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow); for (int p = pStart; p < pEnd; ++p) { for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) { final int jWidth = blockWidth(jBlock); final int q0 = jBlock * BLOCK_SIZE; final int qStart = FastMath.max(startColumn, q0); final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn); final double[] block = blocks[iBlock * blockColumns + jBlock]; int k = (p - p0) * jWidth + qStart - q0; for (int q = qStart; q < qEnd; ++q) { visitor.visit(p, q, block[k]); ++k; } } } } return visitor.end(); } /** {@inheritDoc} */ @Override public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); final double[] block = blocks[blockIndex]; int k = 0; for (int p = pStart; p < pEnd; ++p) { for (int q = qStart; q < qEnd; ++q) { block[k] = visitor.visit(p, q, block[k]); ++k; } } ++blockIndex; } } return visitor.end(); } /** {@inheritDoc} */ @Override public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor) { visitor.start(rows, columns, 0, rows - 1, 0, columns - 1); int blockIndex = 0; for (int iBlock = 0; iBlock < blockRows; ++iBlock) { final int pStart = iBlock * BLOCK_SIZE; final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows); for (int jBlock = 0; jBlock < blockColumns; ++jBlock) { final int qStart = jBlock * BLOCK_SIZE; final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns); final double[] block = blocks[blockIndex]; int k = 0; for (int p = pStart; p < pEnd; ++p) { for (int q = qStart; q < qEnd; ++q) { visitor.visit(p, q, block[k]); ++k; } } ++blockIndex; } } return visitor.end(); } /** {@inheritDoc} */ @Override public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { final int p0 = iBlock * BLOCK_SIZE; final int pStart = FastMath.max(startRow, p0); final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow); for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) { final int jWidth = blockWidth(jBlock); final int q0 = jBlock * BLOCK_SIZE; final int qStart = FastMath.max(startColumn, q0); final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int p = pStart; p < pEnd; ++p) { int k = (p - p0) * jWidth + qStart - q0; for (int q = qStart; q < qEnd; ++q) { block[k] = visitor.visit(p, q, block[k]); ++k; } } } } return visitor.end(); } /** {@inheritDoc} */ @Override public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException { MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn); visitor.start(rows, columns, startRow, endRow, startColumn, endColumn); for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) { final int p0 = iBlock * BLOCK_SIZE; final int pStart = FastMath.max(startRow, p0); final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow); for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) { final int jWidth = blockWidth(jBlock); final int q0 = jBlock * BLOCK_SIZE; final int qStart = FastMath.max(startColumn, q0); final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn); final double[] block = blocks[iBlock * blockColumns + jBlock]; for (int p = pStart; p < pEnd; ++p) { int k = (p - p0) * jWidth + qStart - q0; for (int q = qStart; q < qEnd; ++q) { visitor.visit(p, q, block[k]); ++k; } } } } return visitor.end(); } /** * Get the height of a block. * @param blockRow row index (in block sense) of the block * @return height (number of rows) of the block */ private int blockHeight(final int blockRow) { return (blockRow == blockRows - 1) ? rows - blockRow * BLOCK_SIZE : BLOCK_SIZE; } /** * Get the width of a block. * @param blockColumn column index (in block sense) of the block * @return width (number of columns) of the block */ private int blockWidth(final int blockColumn) { return (blockColumn == blockColumns - 1) ? columns - blockColumn * BLOCK_SIZE : BLOCK_SIZE; } }
[ "granogiovanni90@gmail.com" ]
granogiovanni90@gmail.com
b524b1a88952a5b634003d29030561bda91edbfd
f51adc9fc0119892a9008f2ff6e64619a39d7277
/src/main/java/com/leetcode/contest185/DisplayTable.java
1fa93f84aefc63d1de74188dc595c19420eff763
[]
no_license
RochShur/TsinghuaJS
b73eb8b904377578dcfc66071dd51cc96a2c2f29
aff3fa2ec4c66720b41d06405af7a7a37794f07c
refs/heads/master
2023-02-08T02:27:46.410390
2021-01-01T12:01:58
2021-01-01T12:05:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,923
java
package com.leetcode.contest185; import java.util.*; /** * Created on 2020/4/19 * * @author WuYi */ public class DisplayTable { public static void main(String[] args) { Set <String> set = new TreeSet <>(); set.add("acfds"); set.add("ab"); set.add("ab"); set.add("ab"); System.out.println(set); } public static List <List <String>> displayTable(List <List <String>> orders) { Map <Integer, Map <String, Integer>> map = new TreeMap <>(); Set <String> set = new TreeSet <>(); for (List <String> list : orders) { String dishName = list.get(2); set.add(dishName); } for (List <String> list : orders) { int tableId = Integer.parseInt(list.get(1)); String dishName = list.get(2); Map <String, Integer> treeMap; if (map.containsKey(tableId)) { treeMap = map.get(tableId); } else { treeMap = new TreeMap <>(); for (String di : set) { treeMap.put(di, 0); } map.put(tableId,treeMap); } treeMap.put(dishName, treeMap.get(dishName) + 1); } List <List <String>> res = new ArrayList <>(); List <String> list1 = new ArrayList <>(); list1.add("Table"); for (String s : set) { list1.add(s); } res.add(list1); for (Map.Entry <Integer, Map <String, Integer>> entry : map.entrySet()) { List <String> l = new ArrayList <>(); l.add(entry.getKey() + ""); for (Map.Entry <String, Integer> en : entry.getValue().entrySet()) { l.add(en.getValue()+""); } res.add(l); } return res; } }
[ "1482675166@qq.com" ]
1482675166@qq.com
e5f9313638ed7d279813094d1d913f44735f1bde
4bedfb70ebf3b338fbcadaad687fa363fabccd7e
/src/main/java/com/thed/zephyr/jenkins/reporter/ZfjReporter.java
dd883728b679de3f12a95dae81fda4161a29ab71
[ "Apache-2.0" ]
permissive
maikeffi/JiraTestManager
89529142acd2aa76516d7b8916245ca89b81d20a
55ce09960122621f9c594c6ad298aee1e1fa5ff5
refs/heads/master
2021-01-23T13:29:13.246710
2015-09-19T09:53:46
2015-09-19T09:53:46
42,767,811
0
0
null
null
null
null
UTF-8
Java
false
false
9,856
java
package com.thed.zephyr.jenkins.reporter; /** * @author mohan */ import hudson.Launcher; import hudson.model.BuildListener; import hudson.model.AbstractBuild; import hudson.tasks.BuildStepMonitor; import hudson.tasks.Notifier; import hudson.tasks.junit.SuiteResult; import hudson.tasks.junit.TestResultAction; import hudson.tasks.junit.CaseResult; import java.io.PrintStream; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import com.thed.zephyr.jenkins.model.TestCaseResultModel; import com.thed.zephyr.jenkins.model.ZephyrConfigModel; import com.thed.zephyr.jenkins.model.ZephyrInstance; import com.thed.zephyr.jenkins.utils.rest.Project; import com.thed.zephyr.jenkins.utils.rest.RestClient; import com.thed.zephyr.jenkins.utils.rest.ServerInfo; import com.thed.zephyr.jenkins.utils.rest.TestCaseUtil; import static com.thed.zephyr.jenkins.reporter.ZfjConstants.*; public class ZfjReporter extends Notifier { public static PrintStream logger; private String serverAddress; private String projectKey; private String versionKey; private String cycleKey;; private String cyclePrefix; private String cycleDuration; private static final String PluginName = new String("[JiraTestManager]"); private final String pInfo = String.format("%s [INFO]", PluginName); @DataBoundConstructor public ZfjReporter(String serverAddress, String projectKey, String versionKey, String cycleKey, String cycleDuration, String cyclePrefix) { this.serverAddress = serverAddress; this.projectKey = projectKey; this.versionKey = versionKey; this.cycleKey = cycleKey; this.cyclePrefix = cyclePrefix; this.cycleDuration = cycleDuration; } @Override public BuildStepMonitor getRequiredMonitorService() { return BuildStepMonitor.NONE; } @Override public boolean perform(final AbstractBuild build, final Launcher launcher, final BuildListener listener) { logger = listener.getLogger(); logger.printf("%s Examining test results...%n", pInfo); logger.printf(String.format("Build result is %s%n", build.getResult().toString())); if (!validateBuildConfig()) { logger.println("Cannot Proceed. Please verify the job configuration"); return false; } ZephyrConfigModel zephyrConfig = initializeZephyrData(); boolean prepareZephyrTests = prepareZephyrTests(build, zephyrConfig); if(!prepareZephyrTests) { logger.println("Error parsing surefire reports."); logger.println("Please ensure \"Publish JUnit test result report is added\" as a post build action"); return false; } TestCaseUtil.processTestCaseDetails(zephyrConfig); List<CaseResult> failedTests = testResultAction.getFailedTests(); zephyrConfig.getRestClient().destroy(); logger.printf("%s Done.%n", pInfo); return true; } private boolean prepareZephyrTests(final AbstractBuild build, ZephyrConfigModel zephyrConfig) { boolean status = true; Map<String, Boolean> zephyrTestCaseMap = new HashMap<String, Boolean>(); TestResultAction testResultAction = build.getAction(TestResultAction.class); Collection<SuiteResult> suites = null; try { suites = testResultAction.getResult().getSuites(); } catch (Exception e) { logger.println(e.getMessage()); } if (suites == null || suites.size() == 0) { logger.println("Problem parsing JUnit test Results."); return false; } for (Iterator<SuiteResult> iterator = suites.iterator(); iterator.hasNext();) { SuiteResult suiteResult = iterator.next(); List<CaseResult> cases = suiteResult.getCases(); for (CaseResult caseResult : cases) { boolean isPassed = caseResult.isPassed(); String name = caseResult.getFullName(); if (!zephyrTestCaseMap.containsKey(name)) { zephyrTestCaseMap.put(name, isPassed); } } } logger.print("Total Test Cases : " + zephyrTestCaseMap.size()); List<TestCaseResultModel> testcases = new ArrayList<TestCaseResultModel>(); Set<String> keySet = zephyrTestCaseMap.keySet(); for (Iterator<String> iterator = keySet.iterator(); iterator.hasNext();) { String testCaseName = iterator.next(); Boolean isPassed = zephyrTestCaseMap.get(testCaseName); JSONObject isssueType = new JSONObject(); isssueType.put("id", zephyrConfig.getTestIssueTypeId()+""); JSONObject project = new JSONObject(); project.put("id", zephyrConfig.getZephyrProjectId()); JSONObject fields = new JSONObject(); fields.put("project", project); fields.put("summary", testCaseName); fields.put("description", "Creating the Test via Jenkins\n\n\n"+"Jenkins job: " + build.getAbsoluteUrl() + "\n\n"); fields.put("issuetype", isssueType); JSONObject issue = new JSONObject(); issue.put("fields", fields); TestCaseResultModel caseWithStatus = new TestCaseResultModel(); caseWithStatus.setPassed(isPassed); caseWithStatus.setTestCase(issue.toString()); caseWithStatus.setTestCaseName(testCaseName); testcases.add(caseWithStatus); } zephyrConfig.setTestcases(testcases); return status; } private boolean validateBuildConfig() { boolean valid = true; if (StringUtils.isBlank(serverAddress) || StringUtils.isBlank(projectKey) || StringUtils.isBlank(versionKey) || StringUtils.isBlank(cycleKey) || ADD_ZEPHYR_GLOBAL_CONFIG.equals(serverAddress.trim()) || ADD_ZEPHYR_GLOBAL_CONFIG.equals(projectKey.trim()) || ADD_ZEPHYR_GLOBAL_CONFIG.equals(versionKey.trim()) || ADD_ZEPHYR_GLOBAL_CONFIG.equals(cycleKey.trim())) { logger.println("Cannot Proceed"); valid = false; } return valid; } private void determineTestIssueTypeId(ZephyrConfigModel zephyrConfig) { long testIssueTypeId = ServerInfo.findTestIssueTypeId(zephyrConfig.getRestClient()); zephyrConfig.setTestIssueTypeId(testIssueTypeId); } private void determineCyclePrefix(ZephyrConfigModel zephyrConfig) { if (StringUtils.isNotBlank(cyclePrefix)) { zephyrConfig.setCyclePrefix(cyclePrefix+ "_"); } else { zephyrConfig.setCyclePrefix("Automation_"); } } private ZephyrConfigModel initializeZephyrData() { ZephyrConfigModel zephyrConfig = new ZephyrConfigModel(); String hostName = StringUtils.removeEnd(serverAddress, "/"); fetchCredentials(zephyrConfig, hostName); zephyrConfig.setCycleDuration(cycleDuration); determineProjectID(zephyrConfig); determineVersionID(zephyrConfig); determineCycleID(zephyrConfig); determineCyclePrefix(zephyrConfig); determineTestIssueTypeId(zephyrConfig); return zephyrConfig; } private void fetchCredentials(ZephyrConfigModel zephyrConfig, String url) { List<ZephyrInstance> jiraServers = getDescriptor().getJiraInstances(); for (ZephyrInstance jiraServer : jiraServers) { if (StringUtils.isNotBlank(jiraServer.getServerAddress()) && jiraServer.getServerAddress().trim().equals(serverAddress)) { String userName = jiraServer.getUsername(); String password = jiraServer.getPassword(); RestClient restClient = new RestClient(url, userName, password); zephyrConfig.setRestClient(restClient); break; } } } private void determineCycleID(ZephyrConfigModel zephyrConfig) { if (cycleKey.equalsIgnoreCase(NEW_CYCLE_KEY)) { zephyrConfig.setCycleId(NEW_CYCLE_KEY_IDENTIFIER); return; } long cycleId = 0; try { cycleId = Long.parseLong(cycleKey); } catch (NumberFormatException e1) { logger.println("Cycle Key appears to be the name of the cycle"); e1.printStackTrace(); } zephyrConfig.setCycleName(cycleKey); zephyrConfig.setCycleId(cycleId); } private void determineVersionID(ZephyrConfigModel zephyrData) { long versionId = 0; try { versionId = Long.parseLong(versionKey); } catch (NumberFormatException e1) { logger.println("Version Key appears to be Name of the Version"); e1.printStackTrace(); } zephyrData.setVersionId(versionId); } private void determineProjectID(ZephyrConfigModel zephyrData) { long projectId = 0; try { projectId = Long.parseLong(projectKey); } catch (NumberFormatException e1) { logger.println("Project Key appears to be Name of the project"); try { Long projectIdByName = Project.getProjectIdByName(projectKey, zephyrData.getRestClient()); projectId = projectIdByName; } catch (Exception e) { e.printStackTrace(); } e1.printStackTrace(); } zephyrData.setZephyrProjectId(projectId); } @Override public ZfjDescriptor getDescriptor() { return (ZfjDescriptor) super.getDescriptor(); } public String getServerAddress() { return serverAddress; } public void setServerAddress(String serverAddress) { this.serverAddress = serverAddress; } public String getProjectKey() { return projectKey; } public void setProjectKey(String projectKey) { this.projectKey = projectKey; } public String getVersionKey() { return versionKey; } public void setVersionKey(String versionKey) { this.versionKey = versionKey; } public String getCycleKey() { return cycleKey; } public void setCycleKey(String cycleKey) { this.cycleKey = cycleKey; } public String getCyclePrefix() { return cyclePrefix; } public void setCyclePrefix(String cyclePrefix) { this.cyclePrefix = cyclePrefix; } public String getCycleDuration() { return cycleDuration; } public void setCycleDuration(String cycleDuration) { this.cycleDuration = cycleDuration; } }
[ "maikeffi@gmail.com" ]
maikeffi@gmail.com
751c447ccf77eaa18582b4be6f2ebb47f5d56bd3
47434941a12851bfc4e85adf65e68a0cc659d96a
/app/src/main/java/com/meipan/library/widget/NestedRefreshLayout.java
952470baec9c4d50848b2cc329add5711fe34b75
[]
no_license
ymkmdf/Library
96db27417ab3178a252570e22a8c6e493f29d52e
db14aa32786bb252dbcd50ad96d38b9c895d3aaf
refs/heads/master
2020-04-02T01:46:49.142859
2017-12-20T08:08:28
2017-12-20T08:08:28
83,182,886
1
0
null
null
null
null
UTF-8
Java
false
false
26,213
java
package com.meipan.library.widget; import android.content.Context; import android.content.res.TypedArray; import android.support.v4.view.MotionEventCompat; import android.support.v4.view.NestedScrollingChild; import android.support.v4.view.NestedScrollingChildHelper; import android.support.v4.view.NestedScrollingParent; import android.support.v4.view.NestedScrollingParentHelper; import android.support.v4.view.ViewCompat; import android.support.v4.widget.ScrollerCompat; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewParent; import android.view.animation.Animation; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import android.view.animation.Transformation; import com.meipan.library.R; public class NestedRefreshLayout extends ViewGroup implements NestedScrollingParent, NestedScrollingChild { private static final String TAG=NestedRefreshLayout.class.getSimpleName(); private static final int INVALID_POINTER = -1; private int mActivePointerId = INVALID_POINTER; //手指是否处于屏幕滑动状态 private boolean mIsBeingDragged; //减速插值因子 private static final float DECELERATE_INTERPOLATION_FACTOR = 2f; //回滚动画时间 private int animDuration; private int[] mScrollConsumed = new int[2]; private int[] mScrollOffset = new int[2]; private NestedScrollingChildHelper childHelper; private NestedScrollingParentHelper parentHelper; private int mTouchSlop; private int mLastMotionY; private int mNestedYOffset; private View nestedTarget; private View pullView; private PullViewHelper pullHelper; private IPullRefreshView pullRefreshView; private OnRefreshListener mOnRefreshListener; private Interpolator mInterpolator; private PullAnimation animation; private IPullRefreshView.State pullState= IPullRefreshView.State.GONE; private ScrollerCompat mScroller; public NestedRefreshLayout(Context context) { this(context, null); } public NestedRefreshLayout(Context context, AttributeSet attrs) { super(context, attrs); TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.NestedRefreshLayout); int pullViewHeight = ta.getDimensionPixelSize(R.styleable.NestedRefreshLayout_pullViewHeight, 0); int pullMinViewHeight = ta.getDimensionPixelSize(R.styleable.NestedRefreshLayout_pullMinViewHeight, 0); int pullMaxHeight = ta.getDimensionPixelSize(R.styleable.NestedRefreshLayout_pullMaxHeight, pullViewHeight); int refreshHeight = ta.getDimensionPixelSize(R.styleable.NestedRefreshLayout_refreshHeight, pullViewHeight); animDuration = ta.getInteger(R.styleable.NestedRefreshLayout_animPlayDuration, 300); final int pullviewId = ta.getResourceId(R.styleable.NestedRefreshLayout_pullView, -1); ta.recycle(); if (pullviewId != -1){ pullView = LayoutInflater.from(context).inflate(pullviewId, this, false); pullViewHeight=pullView.getLayoutParams().height; refreshHeight=pullViewHeight; pullMaxHeight=pullViewHeight*3/2; } mScroller=ScrollerCompat.create(context); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR); parentHelper = new NestedScrollingParentHelper(this); childHelper = new NestedScrollingChildHelper(this); pullHelper = new PullViewHelper(pullViewHeight, pullMaxHeight,pullMinViewHeight,refreshHeight); setWillNotDraw(false); setNestedScrollingEnabled(true); animation=new PullAnimation() { @Override public void applyTransformationTop(int targetTop) { final int oldScroll=pullHelper.getScroll(); pullHelper.setScroll(targetTop); final int offsetY=targetTop - oldScroll; if(offsetY!=0) scrollTargetOffset(offsetY); } }; addOrUpdatePullView(pullViewHeight, pullView != null ? pullView : new DeafultRefreshView(context)); } private void addOrUpdatePullView(int pullViewHeight, View pullView) { if (pullView == null || this.pullView == pullView) return; if (this.pullView != null && this.pullView.getParent() != null) { ((ViewGroup) this.pullView.getParent()).removeView(this.pullView); } this.pullView = pullView; if (pullView instanceof IPullRefreshView) { pullRefreshView = (IPullRefreshView) pullView; } else { throw new ClassCastException("the refreshView must implement the interface IPullRefreshView"); } LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, pullViewHeight); addView(this.pullView, 0, layoutParams); } @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (nestedTarget != null) { nestedTarget.measure(MeasureSpec.makeMeasureSpec(getMeasuredWidth() - getPaddingLeft() - getPaddingRight(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(getMeasuredHeight() - getPaddingTop() - getPaddingBottom(), MeasureSpec.EXACTLY)); } if (pullView != null) { pullView.measure(MeasureSpec.makeMeasureSpec(getMeasuredWidth() - getPaddingLeft() - getPaddingRight(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(pullView.getLayoutParams().height, MeasureSpec.EXACTLY)); } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { checkNestedTarget(); if (nestedTarget == null) return; final int width = getMeasuredWidth(); final int height = getMeasuredHeight(); final int childTop = getPaddingTop(); final int childLeft = getPaddingLeft(); final int childWidth = width - getPaddingLeft() - getPaddingRight(); final int childHeight = height - getPaddingTop() - getPaddingBottom(); nestedTarget.layout(childLeft, childTop, childLeft + childWidth, childTop + childHeight); int offsetTop = -pullView.getMeasuredHeight(); pullView.layout(childLeft, offsetTop, childLeft + childWidth, offsetTop + pullView.getMeasuredHeight()); } @Override protected void onFinishInflate() { super.onFinishInflate(); checkNestedTarget(); } // NestedScrollingParent @Override public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) { return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0; } @Override public void onNestedScrollAccepted(View child, View target, int axes) { parentHelper.onNestedScrollAccepted(child, target, axes); startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL); } @Override public void onNestedPreScroll(View target, int dx, int dy, int[] consumed) { final boolean canScrollUp= pullHelper.canScrollUp(); if(dy>0&&canScrollUp){ consumed[1] = scrollMoveOffset(dy); } final int[] parentConsumed = new int [2]; if (dispatchNestedPreScroll(dx - consumed[0], dy - consumed[1], parentConsumed, null)) { consumed[0] += parentConsumed[0]; consumed[1] += parentConsumed[1]; } } @Override public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) { final int myConsumed = scrollMoveOffset(dyUnconsumed); final int myUnconsumed = dyUnconsumed - myConsumed; dispatchNestedScroll(dxConsumed, myConsumed, dxUnconsumed, myUnconsumed, null); } @Override public boolean onNestedPreFling(View target, float velocityX, float velocityY) { return flingWithNestedDispatch((int) velocityY); } @Override public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed) { if(!consumed){ return flingWithNestedDispatch((int) velocityY); } return false; } @Override public int getNestedScrollAxes() { return parentHelper.getNestedScrollAxes(); } @Override public void onStopNestedScroll(View target) { parentHelper.onStopNestedScroll(target); stopNestedScroll(); } // NestedScrollingChild @Override public void setNestedScrollingEnabled(boolean enabled) { childHelper.setNestedScrollingEnabled(enabled); } @Override public boolean isNestedScrollingEnabled() { return childHelper.isNestedScrollingEnabled(); } @Override public boolean startNestedScroll(int axes) { return childHelper.startNestedScroll(axes); } @Override public void stopNestedScroll() { childHelper.stopNestedScroll(); } @Override public boolean hasNestedScrollingParent() { return childHelper.hasNestedScrollingParent(); } @Override public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) { return childHelper.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow); } @Override public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) { return childHelper.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow); } @Override public boolean dispatchNestedFling(float velocityX, float velocityY, boolean consumed) { return childHelper.dispatchNestedFling(velocityX, velocityY, consumed); } @Override public boolean dispatchNestedPreFling(float velocityX, float velocityY) { return childHelper.dispatchNestedPreFling(velocityX, velocityY); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (!isEnabled()) return false; final int action = MotionEventCompat.getActionMasked(ev); if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) { return true; } switch (action) { case MotionEvent.ACTION_DOWN: mLastMotionY = (int) ev.getY(); mScroller.computeScrollOffset(); mIsBeingDragged = !mScroller.isFinished(); mActivePointerId = MotionEventCompat.getPointerId(ev, 0); startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL); break; case MotionEvent.ACTION_MOVE: if (mActivePointerId == INVALID_POINTER) { break; } final int pointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId); if (pointerIndex == -1) { break; } final int y = (int) MotionEventCompat.getY(ev, pointerIndex); final int yDiff = Math.abs(y - mLastMotionY); if (yDiff > mTouchSlop && (getNestedScrollAxes() & ViewCompat.SCROLL_AXIS_VERTICAL) == 0) { mIsBeingDragged = true; mLastMotionY = y; final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } } break; case MotionEvent.ACTION_POINTER_UP: onSecondaryPointerUp(ev); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: /* Release the drag */ mIsBeingDragged = false; mActivePointerId = INVALID_POINTER; stopNestedScroll(); break; default: break; } return mIsBeingDragged; } @Override public boolean dispatchTouchEvent(MotionEvent ev) { final int actionMasked = MotionEventCompat.getActionMasked(ev); if(actionMasked == MotionEvent.ACTION_UP||actionMasked == MotionEvent.ACTION_CANCEL){ checkSpringBack(); } return super.dispatchTouchEvent(ev); } @Override public boolean onTouchEvent(MotionEvent ev) { MotionEvent vtev = MotionEvent.obtain(ev); final int actionMasked = MotionEventCompat.getActionMasked(ev); if (actionMasked == MotionEvent.ACTION_DOWN) { mNestedYOffset = 0; } vtev.offsetLocation(0, mNestedYOffset); switch (actionMasked) { case MotionEvent.ACTION_DOWN: mIsBeingDragged = false; mLastMotionY = (int) ev.getY(); mActivePointerId = MotionEventCompat.getPointerId(ev, 0); startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL); break; case MotionEvent.ACTION_MOVE: { final int activePointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId); if (activePointerIndex == -1) { break; } final int y = (int) MotionEventCompat.getY(ev, activePointerIndex); int deltaY = mLastMotionY - y; if (dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) { deltaY -= mScrollConsumed[1]; vtev.offsetLocation(0, mScrollOffset[1]); mNestedYOffset += mScrollOffset[1]; } if (!mIsBeingDragged && Math.abs(deltaY) > mTouchSlop) { final ViewParent parent = getParent(); if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } mIsBeingDragged = true; if (deltaY > 0) { deltaY -= mTouchSlop; } else { deltaY += mTouchSlop; } } if (mIsBeingDragged) { // Scroll to follow the motion event mLastMotionY = y - mScrollOffset[1]; final int oldY = getScrollY(); scrollMoveOffset(deltaY); final int scrolledDeltaY = getScrollY() - oldY; final int unconsumedY = deltaY - scrolledDeltaY; if (dispatchNestedScroll(0, scrolledDeltaY, 0, unconsumedY, mScrollOffset)) { mLastMotionY -= mScrollOffset[1]; vtev.offsetLocation(0, mScrollOffset[1]); mNestedYOffset += mScrollOffset[1]; } } break; } case MotionEventCompat.ACTION_POINTER_DOWN: { final int index = MotionEventCompat.getActionIndex(ev); mLastMotionY = (int) MotionEventCompat.getY(ev, index); mActivePointerId = MotionEventCompat.getPointerId(ev, index); break; } case MotionEvent.ACTION_POINTER_UP: onSecondaryPointerUp(ev); mLastMotionY = (int) MotionEventCompat.getY(ev, MotionEventCompat.findPointerIndex(ev, mActivePointerId)); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: { mIsBeingDragged = false; mActivePointerId = INVALID_POINTER; stopNestedScroll(); } default: break; } return true; } //视图内容滚动至指定位置并更新下拉视图状态 private int scrollMoveOffset(int deltaY) { if(deltaY==0||pullState== IPullRefreshView.State.MOVE_SRPINGBACK){ return deltaY; } final int oldScrollY = pullHelper.getScroll(); final int consumed =pullHelper.checkUpdateScroll(deltaY); final int scrollY = pullHelper.getScroll(); final int delta = scrollY - oldScrollY; if(pullState == IPullRefreshView.State.MOVE_REFRESH){ //待定处理 }else{ if (pullState!= IPullRefreshView.State.MOVE_REFRESH) { if (pullHelper.canTouchUpToRefresh()) { if(pullState!= IPullRefreshView.State.MOVE_WAIT_REFRESH){ pullState = IPullRefreshView.State.MOVE_WAIT_REFRESH; pullRefreshView.onPullFreeHand(); } } else { if(pullState!= IPullRefreshView.State.MOVE_PULL){ pullState = IPullRefreshView.State.MOVE_PULL; pullRefreshView.onPullDowning(); } } } } // Log.i(TAG,"deltaY=" + deltaY+"\ngetScroll()="+getScrollY() + "\noldScrollY=" + oldScrollY +"\nScrollY=" + scrollY+ // "\nconsumed="+consumed+"\ndelta="+delta + // "\nrefreshHeight="+pullHelper.getPullRefreshHeight()+"\npullMaxHegiht="+pullHelper.getMaxHeight()); if(delta!=0) scrollTargetOffset(delta); return consumed; } //视图内容滚动到指定的位置 private void scrollTargetOffset(int offsetY) { pullView.bringToFront(); scrollBy(0, offsetY); pullRefreshView.onPullProgress(pullHelper.getScroll(),pullHelper.getScrollPercent()); } //【刷新完成】后执行【回滚隐藏动画】 public void refreshFinish() { refreshDelayFinish(1000); } //【刷新完成】后延迟指定时间执行【回滚隐藏动画】 public void refreshDelayFinish(int delayTime) { if (pullRefreshView != null) { pullRefreshView.onPullFinished(); froceRefreshToState(false, delayTime); } } //手离开屏幕后检查和更新状态 private synchronized void checkSpringBack() { // Log.i(TAG,"checkSpringBack ->\npullState="+pullState.toString()+"\npullHelper.getScroll()="+pullHelper.getScroll()+"\ncanTouchUpToRefresh="+pullHelper.canTouchUpToRefresh()); if(pullState== IPullRefreshView.State.MOVE_REFRESH){ if(pullHelper.canTouchUpToRefresh()) animToRefreshPosition(pullHelper.getScroll(), null,0); }else{ if(pullState!= IPullRefreshView.State.MOVE_SRPINGBACK){ froceRefreshToState(pullHelper.canTouchUpToRefresh()); } } } //更新视图至指定刷新状态 public void froceRefreshToState(boolean refresh) { froceRefreshToState(refresh,0); } //更新视图至指定刷新状态 public void froceRefreshToState(boolean refresh, long delay) { final int scrollY=pullHelper.getScroll(); if (refresh) { pullState= IPullRefreshView.State.MOVE_REFRESH; animToRefreshPosition(scrollY, refreshingListener,0); } else { postDelayed(delayAnimToStartPosTask,delay); } } private void animToStartPosition(int from,Animation.AnimationListener listener, long delay) { animToPostion(from,0,delay,listener); } private void animToRefreshPosition(int from, Animation.AnimationListener listener, long delay) { animToPostion(from,-pullHelper.getPullRefreshHeight(),delay,listener); } public void animToPostion(int from,int to,long delayTime,Animation.AnimationListener listener){ animation.reset(); animation.setFrom(from); animation.setTo(to); animation.setStartOffset(delayTime); animation.setDuration(animDuration); animation.setInterpolator(mInterpolator); animation.setAnimationListener(listener); clearAnimation(); startAnimation(animation); } //根据手指快速滑动时候的速率滚动视图 private boolean flingWithNestedDispatch(int velocityY) { final boolean canFilngUp=pullHelper.canScrollUp() && velocityY > 0; // final boolean canFilngDown=pullHelper.canScrollDown() && velocityY < 0 && (!ViewCompat.canScrollVertically(nestedTarget,-1)); // final boolean canFling = canFilngUp || canFilngDown; final boolean canFling = canFilngUp ; if (!dispatchNestedPreFling(0, velocityY)) { dispatchNestedFling(0, velocityY, canFling); if (canFling) { fling(velocityY); } } return canFling; } @Override public void computeScroll() { if (mScroller.computeScrollOffset()) { int oldX = getScrollX(); int oldY = getScrollY(); int x = mScroller.getCurrX(); int y = mScroller.getCurrY(); final int deltay=y-oldY; if (oldX != x || oldY != y) { scrollMoveOffset(deltay); ViewCompat.postInvalidateOnAnimation(this); } } } /** * 根据速率调整视图的滚动 * @param velocityY Y轴方向上的速率. 负值标识用户向下的快速滑动 */ public void fling(int velocityY) { mScroller.abortAnimation(); mScroller.fling(0, pullHelper.getScroll(), 0, velocityY, 0, 0, pullHelper.getMinScroll(), pullHelper.getMaxScroll(), 0, 0); ViewCompat.postInvalidateOnAnimation(this); } //多个手指触摸屏幕状态的变更 private void onSecondaryPointerUp(MotionEvent ev) { final int pointerIndex = (ev.getAction() & MotionEventCompat.ACTION_POINTER_INDEX_MASK) >> MotionEventCompat.ACTION_POINTER_INDEX_SHIFT; final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex); if (pointerId == mActivePointerId) { // This was our active pointer going up. Choose a new // active pointer and adjust accordingly. // Make this decision more intelligent. final int newPointerIndex = pointerIndex == 0 ? 1 : 0; mLastMotionY = (int) MotionEventCompat.getY(ev, newPointerIndex); mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex); } } private void checkNestedTarget() { if (!isTargetValid()) { for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (!child.equals(pullView)) { nestedTarget = child; break; } } } } public boolean isTargetValid() { for (int i = 0; i < getChildCount(); i++) { if (nestedTarget == getChildAt(i)) { return true; } } return false; } public void setPullView(View pullView) { addOrUpdatePullView(pullHelper.getHeight(), pullView); } public void setOnRefreshListener(OnRefreshListener listener) { mOnRefreshListener = listener; } private final PullAnimationListener refreshingListener=new PullAnimationListener() { @Override public void start(Animation animation) { pullRefreshView.onPullRefresh(); if (mOnRefreshListener != null) { mOnRefreshListener.onRefresh(); } } @Override public void end(Animation animation) { } }; private final PullAnimationListener resetListener=new PullAnimationListener() { @Override public void start(Animation animation) { pullState= IPullRefreshView.State.MOVE_SRPINGBACK; } @Override public void end(Animation animation) { if(pullHelper.getScroll()==0){ pullState = IPullRefreshView.State.GONE; pullRefreshView.onPullHided(); } } }; private final Runnable delayAnimToStartPosTask=new Runnable() { @Override public void run() { animToStartPosition(pullHelper.getScroll(), resetListener, 0); } }; public static abstract class PullAnimation extends Animation{ private int from; private int to; private int animDuration; @Override protected void applyTransformation(float interpolatedTime, Transformation t) { final int targetTop = (int) (from + (to - from) * interpolatedTime); applyTransformationTop(targetTop); } public abstract void applyTransformationTop(int targetTop); public int getFrom() { return from; } public void setFrom(int from) { this.from = from; } public int getTo() { return to; } public void setTo(int to) { this.to = to; } public int getAnimDuration() { return animDuration; } public void setAnimDuration(int animDuration) { this.animDuration = animDuration; } } public static abstract class PullAnimationListener implements Animation.AnimationListener{ @Override public void onAnimationStart(Animation animation) { start(animation); } @Override public void onAnimationEnd(Animation animation) { end(animation); } @Override public void onAnimationRepeat(Animation animation) { } public abstract void start(Animation animation); public abstract void end(Animation animation); } public interface OnRefreshListener { void onRefresh(); } }
[ "1275986888@qq.com" ]
1275986888@qq.com
247814a995d652da388a9932f10399a51cfd72c9
0d10dc31706d08bcb495c353fa039a8dd7d7b864
/src/main/java/com/mybatis/CourseExample.java
e4d131aa240b08fe49a1c69c601960d0294e5af6
[]
no_license
todaynowork/wechat
61f2cd770ddde47e39944412656d0ff958abf573
4f12898d022757c72d78829e14647ee0cf059927
refs/heads/master
2021-01-01T16:23:06.856631
2017-12-04T01:21:02
2017-12-04T01:21:02
97,820,202
2
2
null
2017-10-11T07:19:37
2017-07-20T10:01:16
Java
UTF-8
Java
false
false
17,596
java
package com.mybatis; import java.util.ArrayList; import java.util.List; import java.util.Date; public class CourseExample { /** * This field was generated by MyBatis Generator. This field corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ protected String orderByClause; /** * This field was generated by MyBatis Generator. This field corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ protected boolean distinct; /** * This field was generated by MyBatis Generator. This field corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ protected List<Criteria> oredCriteria; /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public CourseExample() { oredCriteria = new ArrayList<Criteria>(); } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public String getOrderByClause() { return orderByClause; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public void setDistinct(boolean distinct) { this.distinct = distinct; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public boolean isDistinct() { return distinct; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public List<Criteria> getOredCriteria() { return oredCriteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public void or(Criteria criteria) { oredCriteria.add(criteria); } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * This class was generated by MyBatis Generator. This class corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("ID is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("ID is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("ID =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("ID <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("ID >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("ID >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("ID <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("ID <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("ID in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("ID not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("ID between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("ID not between", value1, value2, "id"); return (Criteria) this; } public Criteria andTitleIsNull() { addCriterion("TITLE is null"); return (Criteria) this; } public Criteria andTitleIsNotNull() { addCriterion("TITLE is not null"); return (Criteria) this; } public Criteria andTitleEqualTo(String value) { addCriterion("TITLE =", value, "title"); return (Criteria) this; } public Criteria andTitleNotEqualTo(String value) { addCriterion("TITLE <>", value, "title"); return (Criteria) this; } public Criteria andTitleGreaterThan(String value) { addCriterion("TITLE >", value, "title"); return (Criteria) this; } public Criteria andTitleGreaterThanOrEqualTo(String value) { addCriterion("TITLE >=", value, "title"); return (Criteria) this; } public Criteria andTitleLessThan(String value) { addCriterion("TITLE <", value, "title"); return (Criteria) this; } public Criteria andTitleLessThanOrEqualTo(String value) { addCriterion("TITLE <=", value, "title"); return (Criteria) this; } public Criteria andTitleLike(String value) { addCriterion("TITLE like", value, "title"); return (Criteria) this; } public Criteria andTitleNotLike(String value) { addCriterion("TITLE not like", value, "title"); return (Criteria) this; } public Criteria andTitleIn(List<String> values) { addCriterion("TITLE in", values, "title"); return (Criteria) this; } public Criteria andTitleNotIn(List<String> values) { addCriterion("TITLE not in", values, "title"); return (Criteria) this; } public Criteria andTitleBetween(String value1, String value2) { addCriterion("TITLE between", value1, value2, "title"); return (Criteria) this; } public Criteria andTitleNotBetween(String value1, String value2) { addCriterion("TITLE not between", value1, value2, "title"); return (Criteria) this; } public Criteria andDescIsNull() { addCriterion("DESC is null"); return (Criteria) this; } public Criteria andDescIsNotNull() { addCriterion("DESC is not null"); return (Criteria) this; } public Criteria andDescEqualTo(String value) { addCriterion("DESC =", value, "desc"); return (Criteria) this; } public Criteria andDescNotEqualTo(String value) { addCriterion("DESC <>", value, "desc"); return (Criteria) this; } public Criteria andDescGreaterThan(String value) { addCriterion("DESC >", value, "desc"); return (Criteria) this; } public Criteria andDescGreaterThanOrEqualTo(String value) { addCriterion("DESC >=", value, "desc"); return (Criteria) this; } public Criteria andDescLessThan(String value) { addCriterion("DESC <", value, "desc"); return (Criteria) this; } public Criteria andDescLessThanOrEqualTo(String value) { addCriterion("DESC <=", value, "desc"); return (Criteria) this; } public Criteria andDescLike(String value) { addCriterion("DESC like", value, "desc"); return (Criteria) this; } public Criteria andDescNotLike(String value) { addCriterion("DESC not like", value, "desc"); return (Criteria) this; } public Criteria andDescIn(List<String> values) { addCriterion("DESC in", values, "desc"); return (Criteria) this; } public Criteria andDescNotIn(List<String> values) { addCriterion("DESC not in", values, "desc"); return (Criteria) this; } public Criteria andDescBetween(String value1, String value2) { addCriterion("DESC between", value1, value2, "desc"); return (Criteria) this; } public Criteria andDescNotBetween(String value1, String value2) { addCriterion("DESC not between", value1, value2, "desc"); return (Criteria) this; } public Criteria andMemoIsNull() { addCriterion("MEMO is null"); return (Criteria) this; } public Criteria andMemoIsNotNull() { addCriterion("MEMO is not null"); return (Criteria) this; } public Criteria andMemoEqualTo(String value) { addCriterion("MEMO =", value, "memo"); return (Criteria) this; } public Criteria andMemoNotEqualTo(String value) { addCriterion("MEMO <>", value, "memo"); return (Criteria) this; } public Criteria andMemoGreaterThan(String value) { addCriterion("MEMO >", value, "memo"); return (Criteria) this; } public Criteria andMemoGreaterThanOrEqualTo(String value) { addCriterion("MEMO >=", value, "memo"); return (Criteria) this; } public Criteria andMemoLessThan(String value) { addCriterion("MEMO <", value, "memo"); return (Criteria) this; } public Criteria andMemoLessThanOrEqualTo(String value) { addCriterion("MEMO <=", value, "memo"); return (Criteria) this; } public Criteria andMemoLike(String value) { addCriterion("MEMO like", value, "memo"); return (Criteria) this; } public Criteria andMemoNotLike(String value) { addCriterion("MEMO not like", value, "memo"); return (Criteria) this; } public Criteria andMemoIn(List<String> values) { addCriterion("MEMO in", values, "memo"); return (Criteria) this; } public Criteria andMemoNotIn(List<String> values) { addCriterion("MEMO not in", values, "memo"); return (Criteria) this; } public Criteria andMemoBetween(String value1, String value2) { addCriterion("MEMO between", value1, value2, "memo"); return (Criteria) this; } public Criteria andMemoNotBetween(String value1, String value2) { addCriterion("MEMO not between", value1, value2, "memo"); return (Criteria) this; } public Criteria andUpdateTimeIsNull() { addCriterion("UPDATE_TIME is null"); return (Criteria) this; } public Criteria andUpdateTimeIsNotNull() { addCriterion("UPDATE_TIME is not null"); return (Criteria) this; } public Criteria andUpdateTimeEqualTo(Date value) { addCriterion("UPDATE_TIME =", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeNotEqualTo(Date value) { addCriterion("UPDATE_TIME <>", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeGreaterThan(Date value) { addCriterion("UPDATE_TIME >", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { addCriterion("UPDATE_TIME >=", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeLessThan(Date value) { addCriterion("UPDATE_TIME <", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { addCriterion("UPDATE_TIME <=", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeIn(List<Date> values) { addCriterion("UPDATE_TIME in", values, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeNotIn(List<Date> values) { addCriterion("UPDATE_TIME not in", values, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeBetween(Date value1, Date value2) { addCriterion("UPDATE_TIME between", value1, value2, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { addCriterion("UPDATE_TIME not between", value1, value2, "updateTime"); return (Criteria) this; } public Criteria andCreatorIdIsNull() { addCriterion("CREATOR_ID is null"); return (Criteria) this; } public Criteria andCreatorIdIsNotNull() { addCriterion("CREATOR_ID is not null"); return (Criteria) this; } public Criteria andCreatorIdEqualTo(Integer value) { addCriterion("CREATOR_ID =", value, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdNotEqualTo(Integer value) { addCriterion("CREATOR_ID <>", value, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdGreaterThan(Integer value) { addCriterion("CREATOR_ID >", value, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdGreaterThanOrEqualTo(Integer value) { addCriterion("CREATOR_ID >=", value, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdLessThan(Integer value) { addCriterion("CREATOR_ID <", value, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdLessThanOrEqualTo(Integer value) { addCriterion("CREATOR_ID <=", value, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdIn(List<Integer> values) { addCriterion("CREATOR_ID in", values, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdNotIn(List<Integer> values) { addCriterion("CREATOR_ID not in", values, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdBetween(Integer value1, Integer value2) { addCriterion("CREATOR_ID between", value1, value2, "creatorId"); return (Criteria) this; } public Criteria andCreatorIdNotBetween(Integer value1, Integer value2) { addCriterion("CREATOR_ID not between", value1, value2, "creatorId"); return (Criteria) this; } } /** * This class was generated by MyBatis Generator. This class corresponds to the database table PUBLIC.COURSES * @mbg.generated Tue Nov 28 12:49:57 CST 2017 */ public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table PUBLIC.COURSES * * @mbg.generated do_not_delete_during_merge Mon Nov 20 10:00:46 CST 2017 */ public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } }
[ "duzhiguo@cn.ibm.com" ]
duzhiguo@cn.ibm.com
163fcbab61ac9c46a7062cbc4448537602c63d99
793d5098ac640f4a8b2d6d6d8b1b82c45f573f58
/src/main/java/com/sjp/aspect/ServiceAspect.java
f136a447a2a51d692dfb834ce371fddbf03d8d32
[]
no_license
NewFutrue/java-EE
14ab20dde8ce2d89793297cc696eac59b0a92759
e2c24a9291e5cb2a39814ca1daeec1738f148d72
refs/heads/master
2020-04-03T19:29:14.801574
2018-10-31T13:58:13
2018-10-31T13:58:13
155,523,669
0
0
null
null
null
null
UTF-8
Java
false
false
718
java
package com.sjp.aspect; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class ServiceAspect { @AfterReturning("execution(* com.sjp.service.*.*(..))") public void fun(JoinPoint jp){ System.out.println("正常执行"+jp.getSignature().getDeclaringTypeName()+"的"+jp.getSignature().getName()+"方法"); } @AfterThrowing("execution(* com.sjp.service.*.*(..))") public void fun2(JoinPoint jp){ System.out.println("执行"+jp.getSignature().getDeclaringTypeName()+"的"+jp.getSignature().getName()+"方法时,产生异常"); } }
[ "619078708@qq.com" ]
619078708@qq.com
4e300c7cef72f8f8c6c56de7c88d406b2c1abb01
9d23e65649d58ed3ea10efd38e38ac7597239b9d
/src/com/nokarateclass/rpgworld/characters/MonsterCharacter.java
67001b3f3073f42c3b32efeea4de299475ce8faa
[ "MIT" ]
permissive
polerizer/RPGWorld
c74fe66dc0230ba9683766de107b234550fc38c1
bc972527e62399e03d7ce742b1731a2e3bd563c8
refs/heads/master
2021-01-01T20:05:27.386797
2014-05-24T20:32:35
2014-05-24T20:32:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,120
java
/** * Jun 10, 2013 * MonsterCharacter.java * Daniel Pok * AP Java 6th */ package com.nokarateclass.rpgworld.characters; import java.util.*; import com.nokarateclass.rpgworld.R; import com.nokarateclass.rpgworld.editor.CharacterFactory; import android.content.Context; import android.graphics.drawable.Drawable; import android.util.Log; /** * @author poler_000 * */ public class MonsterCharacter extends CharacterActor { public static final int mDefaultId = CharacterFactory.MONSTER; /** * */ public MonsterCharacter(Context context) { super(context.getResources().getDrawable(R.drawable.monster), mDefaultId); mPlayer.setMaxHealth(50); mPlayer.setHealth(50); } /** * @param sprite */ public MonsterCharacter(Drawable sprite) { super(sprite, mDefaultId); mPlayer.setMaxHealth(50); mPlayer.setHealth(50); } public void interact(CharacterActor character){ if(isAdjacent(character)){ mPlayer.addHealth(-10); } } @Override public void act(int beat){ //Log.i("Monster", "Getting characters in range(5)"); ArrayList<CharacterActor> inRange = fourWayLineOfSight(5); //Log.i("Monster", inRange.toString()); for(int i = 0; i < inRange.size(); i++){ if(inRange.get(i).mId == CharacterFactory.HERO){ Log.i("Monster", "Found Hero: " + inRange.get(i).toString()); setTarget(inRange.get(i).getLocation()); stepTowardTarget(); } } if(beat == 0){ ArrayList<CharacterActor> adjacent = getAdjacentCharacters(); //Log.i("Monster", adjacent.toString()); for(int i = 0; i < adjacent.size(); i++){ if(adjacent.get(i).mId == CharacterFactory.HERO){ adjacent.get(i).mPlayer.addHealth(-10); } if(adjacent.get(i).mId == CharacterFactory.MONSTER){ adjacent.get(i).mPlayer.addHealth(-5); } } } } @Override public void onDeath(){ Log.d("Player", toString() + " died" + String.format(" HP: %d/%d", mPlayer.getHealth(), mPlayer.getMaxHealth())); for(CharacterActor i: getAdjacentCharacters()){ i.mPlayer.addHealth(20); } Log.d("Player", "Remove status: " + toString() + " " + removeSelfFromGrid()); } }
[ "polerizer@gmail.com" ]
polerizer@gmail.com
739a600369338a77b8adca229e52280ba31f76e1
b2655aa585e213ee1e861779df4534361ca53aea
/src/main/java/by/epam/dkozyrev1/ecafe/controller/command/impl/AdminClientInfo.java
702ec4532ee3c1ce13ba8866d02bd20e1659edf6
[]
no_license
soasraymean/epam_cafe
3d6781b0c4b088100330906f678a7f286850c6b1
be81bedeb9d5c163b0663dbebeb539907e02e994
refs/heads/master
2023-07-20T23:41:43.034480
2021-08-30T20:59:07
2021-08-30T20:59:07
393,988,891
0
0
null
null
null
null
UTF-8
Java
false
false
1,524
java
package by.epam.dkozyrev1.ecafe.controller.command.impl; import by.epam.dkozyrev1.ecafe.controller.command.AdminCommand; import by.epam.dkozyrev1.ecafe.controller.exception.ControllerException; import by.epam.dkozyrev1.ecafe.service.exception.ServiceException; import by.epam.dkozyrev1.ecafe.service.factory.impl.EntityServiceFactory; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.Objects; public class AdminClientInfo extends AdminCommand { public AdminClientInfo(ServletRequest request, ServletResponse response){ super(request, response); } @Override public void executeValidated() throws ControllerException { try { final String key = getRequest().getParameter("key"); if(Objects.nonNull(key) && !key.isBlank() && !key.isEmpty() && key.matches("\\d++")) { ((HttpServletRequest) getRequest()).getSession().removeAttribute("client"); getRequest().setAttribute("client", EntityServiceFactory.getInstance().getClientService().find(Integer.parseInt(key)).orElseThrow()); } getRequest().getRequestDispatcher("/WEB-INF/jsp/admin/adminclientinfo.jsp").forward(getRequest(), getResponse()); } catch (ServletException | IOException | ServiceException ex) { throw new ControllerException(ex); } } }
[ "dan.kozyrev@gmail.com" ]
dan.kozyrev@gmail.com
4ce5d96b3150e9667b7404bd93b5f78eb65807bc
40953aa2b935b66705457ba5078a6012e883d39a
/WYD-WorldServer/src/com/wyd/empire/world/server/service/base/impl/ChatRecordService.java
c1d93a21adb41bf0af1bc5fa49d8bd72e007239d
[]
no_license
mestatrit/game
91f303ba2ff9d26bdf54cdcf8c99a0c158cdf184
e57b58aa5f282ed035664d08f6a5564161397029
refs/heads/master
2020-12-31T07:19:00.143960
2015-04-18T10:01:14
2015-04-18T10:01:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,665
java
package com.wyd.empire.world.server.service.base.impl; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.springframework.context.ApplicationContext; import com.wyd.db.service.impl.UniversalManagerImpl; import com.wyd.empire.world.bean.ChatRecord; import com.wyd.empire.world.dao.IChatRecordDao; import com.wyd.empire.world.server.service.base.IChatRecordService; /** * The service class for the TabChatRecord entity. */ public class ChatRecordService extends UniversalManagerImpl implements IChatRecordService { /** * The dao instance injected by Spring. */ private IChatRecordDao dao; /** * The service Spring bean id, used in the applicationContext.xml file. */ private static final String SERVICE_BEAN_ID = "ChatRecordService"; public ChatRecordService() { super(); } /** * Returns the singleton <code>IChatRecordService</code> instance. */ public static IChatRecordService getInstance(ApplicationContext context) { return (IChatRecordService) context.getBean(SERVICE_BEAN_ID); } /** * Called by Spring using the injection rules specified in the Spring beans * file "applicationContext.xml". */ public void setDao(IChatRecordDao dao) { super.setDao(dao); this.dao = dao; } public IChatRecordDao getDao() { return this.dao; } /** * 保存聊天记录 * * @param sendName * @param reveName * @param channel * @param message */ public void saveChatLog(String sendName, String reveName, int channel, String message) { ChatRecord chatRecord = new ChatRecord(); chatRecord.setSendName(sendName); chatRecord.setReveName(reveName); chatRecord.setChannel(channel); chatRecord.setMessage(message); chatRecord.setCreateTime(new Date()); this.dao.save(chatRecord); } /** * 查询 * * @param stime * @param etime * @param key * @return * @throws ParseException */ @SuppressWarnings("unchecked") public List<ChatRecord> getChatRecord(String stime, String etime, String key) throws ParseException { List<Object> p = new ArrayList<Object>(); String hql = "from ChatRecord where createTime between ? and ?"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); p.add(sdf.parse(stime)); p.add(sdf.parse(etime)); if (null != key && key.length() > 0) { hql += " and ( sendName like ? or reveName like ? or message like ?)"; key = "%" + key + "%"; p.add(key); p.add(key); p.add(key); } return this.dao.getList(hql, p.toArray()); } }
[ "huangwei2wei@126.com" ]
huangwei2wei@126.com
49c103b105c7ba081cc92336cd2d64f8c79b799f
06af1a4e9e33bdd62e08d420b280f25c36924e9d
/saury-generator/src/main/java/io/renren/modules/oss/cloud/QiniuCloudStorageService.java
0a288d14ef308bd74c137016111d59457f43a504
[ "Apache-2.0" ]
permissive
Heyaoxing/renren-security
ec9097fb7d97f6460fda96a526ac048368bf2015
dbc8a1d2d24fccbaadc87a824ba4ecbbd67fc632
refs/heads/master
2020-03-25T08:44:14.836279
2018-09-05T09:11:14
2018-09-05T09:11:14
143,629,977
0
0
Apache-2.0
2018-08-05T16:32:51
2018-08-05T16:32:50
null
UTF-8
Java
false
false
2,687
java
/** * Copyright 2018 秋刀鱼开源 http://www.renren.io * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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 io.renren.modules.oss.cloud; import com.qiniu.common.Zone; import com.qiniu.http.Response; import com.qiniu.storage.Configuration; import com.qiniu.storage.UploadManager; import com.qiniu.util.Auth; import io.renren.common.exception.RRException; import org.apache.commons.io.IOUtils; import java.io.IOException; import java.io.InputStream; /** * 七牛云存储 * @author * @email * @date 2017-03-25 15:41 */ public class QiniuCloudStorageService extends CloudStorageService { private UploadManager uploadManager; private String token; public QiniuCloudStorageService(CloudStorageConfig config){ this.config = config; //初始化 init(); } private void init(){ uploadManager = new UploadManager(new Configuration(Zone.autoZone())); token = Auth.create(config.getQiniuAccessKey(), config.getQiniuSecretKey()). uploadToken(config.getQiniuBucketName()); } @Override public String upload(byte[] data, String path) { try { Response res = uploadManager.put(data, path, token); if (!res.isOK()) { throw new RuntimeException("上传七牛出错:" + res.toString()); } } catch (Exception e) { throw new RRException("上传文件失败,请核对七牛配置信息", e); } return config.getQiniuDomain() + "/" + path; } @Override public String upload(InputStream inputStream, String path) { try { byte[] data = IOUtils.toByteArray(inputStream); return this.upload(data, path); } catch (IOException e) { throw new RRException("上传文件失败", e); } } @Override public String uploadSuffix(byte[] data, String suffix) { return upload(data, getPath(config.getQiniuPrefix(), suffix)); } @Override public String uploadSuffix(InputStream inputStream, String suffix) { return upload(inputStream, getPath(config.getQiniuPrefix(), suffix)); } }
[ "730530507@qq.com" ]
730530507@qq.com
d04a81d1bb6ea9c86c9abcbab0e4b751e35acb4c
2c08cda53a887fb39c4d6f190eaba986a8ab44dc
/AirQuality/backend/src/main/java/com/weather/model/SensorInfo.java
6931f15888eecaa863adaec121b639f89aabc2f9
[]
no_license
bhuleskar/google-cfi2015
3df5a158b3233356cc870110b2dec535036f5754
ddd4a2cb282e8e97dfa0f3f55213e87dc353d320
refs/heads/master
2021-01-10T14:09:30.159779
2015-09-29T08:43:12
2015-09-29T08:43:12
43,354,847
0
0
null
null
null
null
UTF-8
Java
false
false
1,451
java
/* * Copyright 2015 Google Inc. 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.weather.model; /** * PlaceInfo class extending the Place with additional information. */ @Deprecated public class SensorInfo extends Sensor { /** * The distance to this place from the current working position. */ private double distanceInKilometers; /** * Returns the distance to this place from the current working position. * @return The distance to this place. */ public final double getDistanceInKilometers() { return distanceInKilometers; } /** * Sets the distance to this place from the current working position. * @param pDistanceInKilometers the distance to this place. */ public final void setDistanceInKilometers(final double pDistanceInKilometers) { this.distanceInKilometers = pDistanceInKilometers; } }
[ "ronald.bhuleskar@workday.com" ]
ronald.bhuleskar@workday.com
b9fc528e8c04de711a547d0eced9e11de7584937
6f556398b8954f05d094639b3406dadaea0d019d
/expansion/src/test/java/no/unit/nva/expansion/model/ExpandedTicketStatusTest.java
ff587bb87430134e6b174ca2a6b471ad7f5d72bb
[ "MIT" ]
permissive
BIBSYSDEV/nva-publication-api
4a752e20d3809942a48a00e65c240510ad5f0006
c014d53ef0d8c632737b9d174945e7e86b713894
refs/heads/main
2023-08-30T10:59:46.996870
2023-08-28T13:00:51
2023-08-28T13:00:51
238,656,250
0
1
MIT
2023-09-14T09:59:30
2020-02-06T09:52:53
Java
UTF-8
Java
false
false
514
java
package no.unit.nva.expansion.model; import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; class ExpandedTicketStatusTest { public static final String UNKNOWN_VALUE = "ObviouslyUnknownValue"; @Test void shouldThrowExceptionWhenInputIsUnknownValue() { Executable executable = () -> ExpandedTicketStatus.parse(UNKNOWN_VALUE); assertThrows(IllegalArgumentException.class, executable); } }
[ "eyob.teweldemedhin@sikt.no" ]
eyob.teweldemedhin@sikt.no
15fdd3bae5e06ffd45a6fb92c42f90f3ee10b175
e407cf349fe115f28814f87d30bf36b0902dd260
/app/src/androidTest/java/com/hzy/exampledemo/ExampleInstrumentedTest.java
842a256c7fd479bd13f82212ade4e9c4eb75d71f
[]
no_license
kangxiaohui/ExampleDemo
2f8034691b652ce9e201f18da99983f2156abfe5
6901ee3b9b00d1023e136b5ce9eb23329c7466e5
refs/heads/master
2020-08-26T14:32:47.730015
2019-07-26T07:11:57
2019-07-26T07:11:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
722
java
package com.hzy.exampledemo; 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.hzy.exampledemo", appContext.getPackageName()); } }
[ "362070860@qq.com" ]
362070860@qq.com
02efed35e1b556624e09ef0e8f9854838a59f755
4059bb36a1ff2488cec18edcef9dc20a5970a7f5
/src/Messages/Message.java
98467c6c5d4be28820f09fb207cc21e56fbf3cb7
[]
no_license
Averkina/slovolom
989b1226c5b7e1b3723e1c88a493df8885a2dbb9
b10d6c257042cd6b6895b46618134508632e696d
refs/heads/master
2021-01-01T17:09:59.348443
2013-12-05T19:15:35
2013-12-05T19:15:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
94
java
package Messages; public interface Message { public abstract int getTypeId(); }
[ "Admin@Admin-PC" ]
Admin@Admin-PC
0357e5360edcbfb867665305099e7838d30c10be
c7f3e103762342a058704e09ff4889fdc22ef38c
/src/main/java/io/vasilenko/remedy/spring/activemq/sample/SpringActiveMqSamplePlugin.java
208ae61f08a49c93bd1da601158d5d95fc3213c0
[]
no_license
vasilenkodev/remedy-spring-activemq-sample
5de1e9da29c67da8bea65146c32a0acef8fca9ef
67cecc842854ee589787e9ee2545938c5d402c2f
refs/heads/master
2023-07-21T14:42:30.660464
2019-07-06T00:12:53
2019-07-06T00:12:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,870
java
package io.vasilenko.remedy.spring.activemq.sample; import com.bmc.arsys.api.Value; import com.bmc.arsys.pluginsvr.plugins.ARFilterAPIPlugin; import com.bmc.arsys.pluginsvr.plugins.ARPluginContext; import com.bmc.thirdparty.org.slf4j.Logger; import com.bmc.thirdparty.org.slf4j.LoggerFactory; import io.vasilenko.remedy.spring.activemq.sample.mq.MqSender; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import java.util.ArrayList; import java.util.List; @Configuration @ComponentScan public class SpringActiveMqSamplePlugin extends ARFilterAPIPlugin { private static final int INPUT_MESSAGE_VALUE_INDEX = 0; private final Logger log = LoggerFactory.getLogger(SpringActiveMqSamplePlugin.class); private AnnotationConfigApplicationContext applicationContext; private MqSender sender; @Autowired public void setSender(MqSender sender) { this.sender = sender; } @Override public void initialize(ARPluginContext context) { applicationContext = new AnnotationConfigApplicationContext(SpringActiveMqSamplePlugin.class); applicationContext.getAutowireCapableBeanFactory().autowireBean(this); log.info("initialized"); } @Override public List<Value> filterAPICall(ARPluginContext arPluginContext, List<Value> list) { String message = String.valueOf(list.get(INPUT_MESSAGE_VALUE_INDEX)); sender.sendMessage(message); List<Value> output = new ArrayList<>(); output.add(new Value(message + " sent")); return output; } @Override public void terminate(ARPluginContext context) { applicationContext.close(); } }
[ "com.vasilenko@gmail.com" ]
com.vasilenko@gmail.com
105537eed1cb10e404222c6d53c3545f9f56daba
eb71e782cebec26969623bb5c3638d6f62516290
/src/com/rs/game/player/dialogues/InstanceDialogue.java
efd03143dc55c9d7ab591d50cca7452fa3a3bcf5
[]
no_license
DukeCharles/revision-718-server
0fe7230a4c7da8de6f7de289ef1b4baec81fbd8b
cc69a0ab6e139d5cc7e2db9a73ec1eeaf76fd6e3
refs/heads/main
2023-06-25T05:50:04.376413
2021-07-25T19:38:35
2021-07-25T19:38:35
387,924,360
0
0
null
null
null
null
UTF-8
Java
false
false
1,084
java
package com.rs.game.player.dialogues; import com.rs.game.WorldTile; /** * * @Author Tristam <Hassan> * @Project - Rain * @Date - 3 Mar 2016 * **/ public class InstanceDialogue extends Dialogue { @Override public void start() { sendOptions(TITLE, "Enter room", "Buy an instance"); stage = 1; } @Override public void run(int interfaceId, int componentId) { switch (stage) { case END: end(); break; case 1: switch (componentId) { case OPTION_1: player.setNextWorldTile( player.getX() == 2863 ? new WorldTile(2864, 5354, 2) : new WorldTile(2863, 5354, 2)); end(); break; case OPTION_2: if (!player.hasMoney(10000000)) { sendDialogue("You don't have enough money, you need 10m to buy an instance."); stage = END; } else { end(); player.getMoneyPouch().removeMoneyMisc(10000000); player.IsInInstance = true; player.getControlerManager().startControler("Instance", player); } break; } break; } } @Override public void finish() { // TODO Auto-generated method stub } }
[ "charles.simon.morin@gmail.com" ]
charles.simon.morin@gmail.com
ff92c8f6e5d126ef20b2ae0931ce208105970ae6
051af9a63ab44a140d9f141a1dfb4cee8613b904
/src/test/java/com/barclays/mastercom/transactions/RetrieveAuthDetailTest.java
07c819897b2d405640d56669f9e00c92bdf195f5
[]
no_license
jitendersingh2/rest-apis
aa611d104d928fc0dcd1f5749886ee1dab4e8f6d
5f6451e42dc7a92a8ac49f733deb143becb44e1b
refs/heads/master
2020-04-06T17:12:24.692666
2018-11-15T04:09:01
2018-11-15T04:09:01
157,650,389
1
0
null
null
null
null
UTF-8
Java
false
false
1,327
java
package com.barclays.mastercom.transactions; import com.barclays.mastercom.AppTest; import com.mastercard.api.core.model.RequestMap; import com.mastercard.api.mastercom.Transactions; import static junit.framework.TestCase.assertNotNull; import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; public class RetrieveAuthDetailTest extends AppTest { private String claimId = "200002020654"; private String transactionId = "FIEaEgnM3bwPijwZgjc3Te+Y0ieLbN9ijUugqNSvJmVbO1xs6Jh5iIlmpOpkbax79L8Yj1rBOWBACx+Vj17rzvOepWobpgWNJNdsgHB4ag"; private String accountNumber = "5154676300000001"; private String acquiringInstitutionId = "2705"; private Transactions transactions; @Before public void retrieveAuthDetail() throws Exception { RequestMap map = new RequestMap(); map.set("claim-id", claimId); map.set("transaction-id", transactionId); transactions = Transactions.retrieveAuthorizationDetail("", map); } @Test public void testResponseNotNull() { assertNotNull(transactions); } @Test public void testAuthDetailResponse() { assertEquals(transactions.get("accountNumber"), accountNumber); assertEquals(transactions.get("acquiringInstitutionId"), acquiringInstitutionId); } }
[ "jitender.singh2@cognizant.com" ]
jitender.singh2@cognizant.com
22026ec6121991a38384d4f4006c2d665ebf0ea5
a09c2c33e295890f3548e0a75dcd5c62d994e156
/src/main/java/designPattern/command/LightOffCommand.java
2d74425639eedd9013c55d680e6eb58074654044
[]
no_license
AllenZZQ/design_pattern
d5c5aa0ad9253efbee5e9494641a4cf4a4969cfa
36f34240e34f12fc6cc7a860ca85eaeee24ff00a
refs/heads/master
2020-04-22T03:12:04.931612
2019-04-08T07:04:45
2019-04-08T07:04:45
170,077,427
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
package designPattern.command; public class LightOffCommand implements Command { private Light light; public LightOffCommand(Light light) { this.light = light; } @Override public void execute() { light.off(); } }
[ "zhaoziqiang@yit.com" ]
zhaoziqiang@yit.com
7b5c725a7398f987b6f58a27369b1e08367b1722
8bb352f43babb4bebbdf5bdf46c373681302bd9c
/src/com/xqx/www/view/panel/VipPanel.java
0b3862d8c3da3df1d1af6d2ff65791a30aa56c76
[]
no_license
TopviewIter/hotel
232b35611e454112e5a5b11c13935fdd881ea539
9736717936309e0c359ebb7b05b84a41a56391f9
refs/heads/master
2021-01-20T02:11:35.956524
2017-04-17T06:00:20
2017-04-17T06:00:20
89,383,442
0
0
null
null
null
null
GB18030
Java
false
false
5,578
java
package com.xqx.www.view.panel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; import com.xqx.www.component.CustomPanel; import com.xqx.www.db.SqlHelper; import com.xqx.www.po.User; import com.xqx.www.util.AWTUtil; import com.xqx.www.view.dialog.UserDialogFrame; /** * 用户管理界面 * @author xqx * */ public class VipPanel extends CustomPanel { private static final long serialVersionUID = 1L; private final static String[] colsText = {"身份证", "名称", "性别", "号码", "密码", "等级", "是否为vip"}; private JTable table; private JPanel panel; private JButton insert, update, delete; private List<User> allUser; public VipPanel() { setBackground(Color.WHITE); setLayout(new BorderLayout()); initTable(); initBtn(); this.setVisible(true); } private void initTable() { //用户表格部分开始 DefaultTableModel model = new DefaultTableModel(){ private static final long serialVersionUID = 1L; //让表格可选中但不能编辑 @Override public boolean isCellEditable(int row, int column) { return false; } }; table = new JTable(model); DefaultTableCellRenderer chr = (DefaultTableCellRenderer)table.getTableHeader().getDefaultRenderer(); chr.setHorizontalAlignment(SwingConstants.CENTER); DefaultTableCellRenderer cr = new DefaultTableCellRenderer(); cr.setHorizontalAlignment(SwingConstants.CENTER); table.setDefaultRenderer(Object.class, cr); table.setBorder(BorderFactory.createBevelBorder(HEIGHT)); buildCols(model); allUser = getAllUser(); buildRows(model, allUser); //JTable要放到JScrollPane里面才显示列名 add(new JScrollPane(table), BorderLayout.CENTER); //用户表格部分结束 } private void initBtn() { //表格操作部分开始 panel = new JPanel(); insert = new JButton("添加用户"); insert.addActionListener(new BtnListener(this)); panel.add(insert); update = new JButton("修改用户"); update.addActionListener(new BtnListener(this)); panel.add(update); delete = new JButton("删除用户"); delete.addActionListener(new BtnListener(this)); panel.add(delete); add(panel, BorderLayout.SOUTH); //表格操作部分结束 } private void buildCols(DefaultTableModel model) { for(String t : colsText) { model.addColumn(t); } } private void buildRows(DefaultTableModel model, List<User> users) { Object[] row = new Object[colsText.length]; for(User u : users) { row[0] = u.getIdentify(); row[1] = u.getName(); row[2] = u.getSex(); row[3] = u.getPhone(); row[4] = u.getPassword(); row[5] = u.getRank(); row[6] = u.isVip(); model.addRow(row); } } private List<User> getAllUser() { SqlHelper helper = SqlHelper.getSqlHelper(); String sql = "select * from t_user order by id"; ResultSet rs = helper.query(sql, new Object[] {}); return buildUsers(rs); } private List<User> buildUsers(ResultSet rs) { List<User> users = new ArrayList<User>(); try { while (rs.next()) { User user = new User(); user.setId(rs.getString("id")); user.setIdentify(rs.getString("identify")); user.setName(rs.getString("name")); user.setPassword(rs.getString("password")); user.setPhone(rs.getString("phone")); user.setSex(rs.getString("sex")); user.setVip(rs.getBoolean("isVip")); user.setRank(rs.getString("rank")); users.add(user); } } catch (SQLException e) { e.printStackTrace(); } return users; } class BtnListener implements ActionListener { private VipPanel panel; public BtnListener(VipPanel panel) { this.panel = panel; } @Override public void actionPerformed(ActionEvent e) { if(e.getSource() == insert) { try { new UserDialogFrame(panel, new User()); } catch (Exception e1) { e1.printStackTrace(); } }else if(e.getSource() == update) { int index = table.getSelectedRow(); if(index == -1) { JOptionPane.showMessageDialog(null, "请选中要修改的行"); return; } User user = allUser.get(index); try { new UserDialogFrame(panel, user); } catch (Exception e1) { e1.printStackTrace(); } }else if(e.getSource() == delete) { int index = table.getSelectedRow(); if(index == -1) { JOptionPane.showMessageDialog(null, "请选中要删除的行"); return; } User user = allUser.get(index); SqlHelper helper = SqlHelper.getSqlHelper(); String sql = "delete from t_user where id = ?"; boolean result = helper.executeSql(sql, new Object[] { user.getId() }); if(result) { JOptionPane.showMessageDialog(null, "删除成功"); AWTUtil.updateContent(panel); }else{ JOptionPane.showMessageDialog(null, "删除失败,请稍后重试"); } } } } @Override public void updateContent() { initTable(); initBtn(); } }
[ "xluo@10.0.2.15" ]
xluo@10.0.2.15
55a3daf928d70b95bcef6377f87189ea870553fd
aed4e4bd1d1c2189588a268d0285d2da40027a6c
/src/main/java/com/beer/web/OnTapController.java
4da9f024cfc698ec4067a5af001a62f789c2ebb2
[]
no_license
JKleymeyer/beer-web
1e02271498dd84246e1d7bbec162c725257c9837
cba7a0cbbe1f95737d2f6ceab3a1e0dfc729f55c
refs/heads/master
2020-09-05T09:59:12.973245
2019-12-30T23:05:37
2019-12-30T23:05:37
220,066,505
0
0
null
null
null
null
UTF-8
Java
false
false
2,070
java
package com.beer.web; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.beer.business.OnTap; import com.beer.db.OnTapRepository; @CrossOrigin @RestController @RequestMapping("/ontaps") public class OnTapController { @Autowired private OnTapRepository ontapRepo; // List on tap @GetMapping("/") public JsonResponse listOnTap() { JsonResponse jr = null; try { jr = JsonResponse.getInstance(ontapRepo.findAll()); } catch (Exception e) { jr = JsonResponse.getInstance(e); } return jr; } // List on tap by Id @GetMapping("/{id}") public JsonResponse getOnTapById(@PathVariable int id) { JsonResponse jr = null; try { jr = JsonResponse.getInstance(ontapRepo.findById(id)); } catch (Exception e) { jr = JsonResponse.getInstance(e); } return jr; } // Add on tap to list @PostMapping("/") public JsonResponse addOnTap(@RequestBody OnTap o) { JsonResponse jr = null; try { jr = JsonResponse.getInstance(ontapRepo.save(o)); } catch (Exception e) { jr = JsonResponse.getInstance(e); } return jr; } // Update on tap in list @PutMapping("/") public JsonResponse updateOnTap(@RequestBody OnTap o) { JsonResponse jr = null; try { if (ontapRepo.existsById(o.getId())) { jr = JsonResponse.getInstance(ontapRepo.save(o)); } else { // record doesn't exist jr = JsonResponse.getInstance("Error updating on tap. Id " + o.getId() + " doesn't exist"); } } catch (Exception e) { jr = JsonResponse.getInstance(e); } return jr; } // Delete on tap @DeleteMapping("/{id}") public JsonResponse deleteOnTap(@PathVariable int id) { JsonResponse jr = null; try { if (ontapRepo.existsById(id)) { ontapRepo.deleteById(id); jr = JsonResponse.getInstance("Delete successful"); } else { // record doesn't exist jr = JsonResponse.getInstance("Error updating on tap. Id " + id + " doesn't exist"); } } catch (Exception e) { jr = JsonResponse.getInstance(e); } return jr; } }
[ "josh.kleymeyer@gmail.com" ]
josh.kleymeyer@gmail.com
d76458c90aa20a6ab2866e90ba69ef81be0dc517
d71e879b3517cf4fccde29f7bf82cff69856cfcd
/ExtractedJars/Ibotta_com.ibotta.android/javafiles/com/fasterxml/jackson/databind/util/EnumResolver.java
bada43dbdc1e276321b31a374d53ecd73a0193ee
[ "MIT" ]
permissive
Andreas237/AndroidPolicyAutomation
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
refs/heads/master
2020-04-10T02:14:08.789751
2019-05-16T19:29:11
2019-05-16T19:29:11
160,739,088
5
1
null
null
null
null
UTF-8
Java
false
false
16,057
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) annotate safe package com.fasterxml.jackson.databind.util; import com.fasterxml.jackson.databind.AnnotationIntrospector; import com.fasterxml.jackson.databind.introspect.AnnotatedMember; import java.io.Serializable; import java.util.Collection; import java.util.HashMap; // Referenced classes of package com.fasterxml.jackson.databind.util: // CompactStringObjectMap public class EnumResolver implements Serializable { protected EnumResolver(Class class1, Enum aenum[], HashMap hashmap, Enum enum) { // 0 0:aload_0 // 1 1:invokespecial #27 <Method void Object()> _enumClass = class1; // 2 4:aload_0 // 3 5:aload_1 // 4 6:putfield #29 <Field Class _enumClass> _enums = aenum; // 5 9:aload_0 // 6 10:aload_2 // 7 11:putfield #31 <Field Enum[] _enums> _enumsById = hashmap; // 8 14:aload_0 // 9 15:aload_3 // 10 16:putfield #33 <Field HashMap _enumsById> _defaultValue = enum; // 11 19:aload_0 // 12 20:aload 4 // 13 22:putfield #35 <Field Enum _defaultValue> // 14 25:return } public static EnumResolver constructFor(Class class1, AnnotationIntrospector annotationintrospector) { Enum aenum[] = (Enum[])class1.getEnumConstants(); // 0 0:aload_0 // 1 1:invokevirtual #46 <Method Object[] Class.getEnumConstants()> // 2 4:checkcast #47 <Class Enum[]> // 3 7:astore 6 if(aenum != null) //* 4 9:aload 6 //* 5 11:ifnull 110 { String as[] = annotationintrospector.findEnumValues(class1, aenum, new String[aenum.length]); // 6 14:aload_1 // 7 15:aload_0 // 8 16:aload 6 // 9 18:aload 6 // 10 20:arraylength // 11 21:anewarray String[] // 12 24:invokevirtual #55 <Method String[] AnnotationIntrospector.findEnumValues(Class, Enum[], String[])> // 13 27:astore 7 HashMap hashmap = new HashMap(); // 14 29:new #57 <Class HashMap> // 15 32:dup // 16 33:invokespecial #58 <Method void HashMap()> // 17 36:astore 8 int i = 0; // 18 38:iconst_0 // 19 39:istore_2 for(int j = aenum.length; i < j; i++) //* 20 40:aload 6 //* 21 42:arraylength //* 22 43:istore_3 //* 23 44:iload_2 //* 24 45:iload_3 //* 25 46:icmpge 92 { String s1 = as[i]; // 26 49:aload 7 // 27 51:iload_2 // 28 52:aaload // 29 53:astore 5 String s = s1; // 30 55:aload 5 // 31 57:astore 4 if(s1 == null) //* 32 59:aload 5 //* 33 61:ifnonnull 73 s = aenum[i].name(); // 34 64:aload 6 // 35 66:iload_2 // 36 67:aaload // 37 68:invokevirtual #64 <Method String Enum.name()> // 38 71:astore 4 hashmap.put(((Object) (s)), ((Object) (aenum[i]))); // 39 73:aload 8 // 40 75:aload 4 // 41 77:aload 6 // 42 79:iload_2 // 43 80:aaload // 44 81:invokevirtual #68 <Method Object HashMap.put(Object, Object)> // 45 84:pop } // 46 85:iload_2 // 47 86:iconst_1 // 48 87:iadd // 49 88:istore_2 //* 50 89:goto 44 return new EnumResolver(class1, aenum, hashmap, annotationintrospector.findDefaultEnumValue(class1)); // 51 92:new #2 <Class EnumResolver> // 52 95:dup // 53 96:aload_0 // 54 97:aload 6 // 55 99:aload 8 // 56 101:aload_1 // 57 102:aload_0 // 58 103:invokevirtual #72 <Method Enum AnnotationIntrospector.findDefaultEnumValue(Class)> // 59 106:invokespecial #74 <Method void EnumResolver(Class, Enum[], HashMap, Enum)> // 60 109:areturn } else { annotationintrospector = ((AnnotationIntrospector) (new StringBuilder())); // 61 110:new #76 <Class StringBuilder> // 62 113:dup // 63 114:invokespecial #77 <Method void StringBuilder()> // 64 117:astore_1 ((StringBuilder) (annotationintrospector)).append("No enum constants for class "); // 65 118:aload_1 // 66 119:ldc1 #79 <String "No enum constants for class "> // 67 121:invokevirtual #83 <Method StringBuilder StringBuilder.append(String)> // 68 124:pop ((StringBuilder) (annotationintrospector)).append(class1.getName()); // 69 125:aload_1 // 70 126:aload_0 // 71 127:invokevirtual #86 <Method String Class.getName()> // 72 130:invokevirtual #83 <Method StringBuilder StringBuilder.append(String)> // 73 133:pop throw new IllegalArgumentException(((StringBuilder) (annotationintrospector)).toString()); // 74 134:new #88 <Class IllegalArgumentException> // 75 137:dup // 76 138:aload_1 // 77 139:invokevirtual #91 <Method String StringBuilder.toString()> // 78 142:invokespecial #94 <Method void IllegalArgumentException(String)> // 79 145:athrow } } public static EnumResolver constructUnsafe(Class class1, AnnotationIntrospector annotationintrospector) { return constructFor(class1, annotationintrospector); // 0 0:aload_0 // 1 1:aload_1 // 2 2:invokestatic #98 <Method EnumResolver constructFor(Class, AnnotationIntrospector)> // 3 5:areturn } public static EnumResolver constructUnsafeUsingMethod(Class class1, AnnotatedMember annotatedmember, AnnotationIntrospector annotationintrospector) { return constructUsingMethod(class1, annotatedmember, annotationintrospector); // 0 0:aload_0 // 1 1:aload_1 // 2 2:aload_2 // 3 3:invokestatic #104 <Method EnumResolver constructUsingMethod(Class, AnnotatedMember, AnnotationIntrospector)> // 4 6:areturn } public static EnumResolver constructUnsafeUsingToString(Class class1, AnnotationIntrospector annotationintrospector) { return constructUsingToString(class1, annotationintrospector); // 0 0:aload_0 // 1 1:aload_1 // 2 2:invokestatic #109 <Method EnumResolver constructUsingToString(Class, AnnotationIntrospector)> // 3 5:areturn } public static EnumResolver constructUsingMethod(Class class1, AnnotatedMember annotatedmember, AnnotationIntrospector annotationintrospector) { int i; Enum aenum[]; HashMap hashmap; aenum = (Enum[])class1.getEnumConstants(); // 0 0:aload_0 // 1 1:invokevirtual #46 <Method Object[] Class.getEnumConstants()> // 2 4:checkcast #47 <Class Enum[]> // 3 7:astore 5 hashmap = new HashMap(); // 4 9:new #57 <Class HashMap> // 5 12:dup // 6 13:invokespecial #58 <Method void HashMap()> // 7 16:astore 6 i = aenum.length; // 8 18:aload 5 // 9 20:arraylength // 10 21:istore_3 _L2: int j = i - 1; // 11 22:iload_3 // 12 23:iconst_1 // 13 24:isub // 14 25:istore 4 if(j < 0) break; /* Loop/switch isn't completed */ // 15 27:iload 4 // 16 29:iflt 125 Enum enum = aenum[j]; // 17 32:aload 5 // 18 34:iload 4 // 19 36:aaload // 20 37:astore 7 Object obj; try { obj = annotatedmember.getValue(((Object) (enum))); // 21 39:aload_1 // 22 40:aload 7 // 23 42:invokevirtual #117 <Method Object AnnotatedMember.getValue(Object)> // 24 45:astore 8 } //* 25 47:iload 4 //* 26 49:istore_3 //* 27 50:aload 8 //* 28 52:ifnull 22 //* 29 55:aload 6 //* 30 57:aload 8 //* 31 59:invokevirtual #118 <Method String Object.toString()> //* 32 62:aload 7 //* 33 64:invokevirtual #68 <Method Object HashMap.put(Object, Object)> //* 34 67:pop //* 35 68:iload 4 //* 36 70:istore_3 //* 37 71:goto 22 // Misplaced declaration of an exception variable catch(Class class1) //* 38 74:astore_0 { annotatedmember = ((AnnotatedMember) (new StringBuilder())); // 39 75:new #76 <Class StringBuilder> // 40 78:dup // 41 79:invokespecial #77 <Method void StringBuilder()> // 42 82:astore_1 ((StringBuilder) (annotatedmember)).append("Failed to access @JsonValue of Enum value "); // 43 83:aload_1 // 44 84:ldc1 #120 <String "Failed to access @JsonValue of Enum value "> // 45 86:invokevirtual #83 <Method StringBuilder StringBuilder.append(String)> // 46 89:pop ((StringBuilder) (annotatedmember)).append(((Object) (enum))); // 47 90:aload_1 // 48 91:aload 7 // 49 93:invokevirtual #123 <Method StringBuilder StringBuilder.append(Object)> // 50 96:pop ((StringBuilder) (annotatedmember)).append(": "); // 51 97:aload_1 // 52 98:ldc1 #125 <String ": "> // 53 100:invokevirtual #83 <Method StringBuilder StringBuilder.append(String)> // 54 103:pop ((StringBuilder) (annotatedmember)).append(((Exception) (class1)).getMessage()); // 55 104:aload_1 // 56 105:aload_0 // 57 106:invokevirtual #128 <Method String Exception.getMessage()> // 58 109:invokevirtual #83 <Method StringBuilder StringBuilder.append(String)> // 59 112:pop throw new IllegalArgumentException(((StringBuilder) (annotatedmember)).toString()); // 60 113:new #88 <Class IllegalArgumentException> // 61 116:dup // 62 117:aload_1 // 63 118:invokevirtual #91 <Method String StringBuilder.toString()> // 64 121:invokespecial #94 <Method void IllegalArgumentException(String)> // 65 124:athrow } i = j; if(obj == null) continue; /* Loop/switch isn't completed */ hashmap.put(((Object) (obj.toString())), ((Object) (enum))); i = j; if(true) goto _L2; else goto _L1 _L1: if(annotationintrospector != null) //* 66 125:aload_2 //* 67 126:ifnull 138 annotatedmember = ((AnnotatedMember) (annotationintrospector.findDefaultEnumValue(class1))); // 68 129:aload_2 // 69 130:aload_0 // 70 131:invokevirtual #72 <Method Enum AnnotationIntrospector.findDefaultEnumValue(Class)> // 71 134:astore_1 else //* 72 135:goto 140 annotatedmember = null; // 73 138:aconst_null // 74 139:astore_1 return new EnumResolver(class1, aenum, hashmap, ((Enum) (annotatedmember))); // 75 140:new #2 <Class EnumResolver> // 76 143:dup // 77 144:aload_0 // 78 145:aload 5 // 79 147:aload 6 // 80 149:aload_1 // 81 150:invokespecial #74 <Method void EnumResolver(Class, Enum[], HashMap, Enum)> // 82 153:areturn } public static EnumResolver constructUsingToString(Class class1, AnnotationIntrospector annotationintrospector) { Enum aenum[] = (Enum[])class1.getEnumConstants(); // 0 0:aload_0 // 1 1:invokevirtual #46 <Method Object[] Class.getEnumConstants()> // 2 4:checkcast #47 <Class Enum[]> // 3 7:astore_3 HashMap hashmap = new HashMap(); // 4 8:new #57 <Class HashMap> // 5 11:dup // 6 12:invokespecial #58 <Method void HashMap()> // 7 15:astore 4 int i = aenum.length; // 8 17:aload_3 // 9 18:arraylength // 10 19:istore_2 do { i--; // 11 20:iload_2 // 12 21:iconst_1 // 13 22:isub // 14 23:istore_2 if(i < 0) break; // 15 24:iload_2 // 16 25:iflt 49 Enum enum = aenum[i]; // 17 28:aload_3 // 18 29:iload_2 // 19 30:aaload // 20 31:astore 5 hashmap.put(((Object) (enum.toString())), ((Object) (enum))); // 21 33:aload 4 // 22 35:aload 5 // 23 37:invokevirtual #130 <Method String Enum.toString()> // 24 40:aload 5 // 25 42:invokevirtual #68 <Method Object HashMap.put(Object, Object)> // 26 45:pop } while(true); // 27 46:goto 20 if(annotationintrospector == null) //* 28 49:aload_1 //* 29 50:ifnonnull 58 annotationintrospector = null; // 30 53:aconst_null // 31 54:astore_1 else //* 32 55:goto 64 annotationintrospector = ((AnnotationIntrospector) (annotationintrospector.findDefaultEnumValue(class1))); // 33 58:aload_1 // 34 59:aload_0 // 35 60:invokevirtual #72 <Method Enum AnnotationIntrospector.findDefaultEnumValue(Class)> // 36 63:astore_1 return new EnumResolver(class1, aenum, hashmap, ((Enum) (annotationintrospector))); // 37 64:new #2 <Class EnumResolver> // 38 67:dup // 39 68:aload_0 // 40 69:aload_3 // 41 70:aload 4 // 42 72:aload_1 // 43 73:invokespecial #74 <Method void EnumResolver(Class, Enum[], HashMap, Enum)> // 44 76:areturn } public CompactStringObjectMap constructLookup() { return CompactStringObjectMap.construct(((java.util.Map) (_enumsById))); // 0 0:aload_0 // 1 1:getfield #33 <Field HashMap _enumsById> // 2 4:invokestatic #138 <Method CompactStringObjectMap CompactStringObjectMap.construct(java.util.Map)> // 3 7:areturn } public Enum findEnum(String s) { return (Enum)_enumsById.get(((Object) (s))); // 0 0:aload_0 // 1 1:getfield #33 <Field HashMap _enumsById> // 2 4:aload_1 // 3 5:invokevirtual #143 <Method Object HashMap.get(Object)> // 4 8:checkcast #60 <Class Enum> // 5 11:areturn } public Enum getDefaultValue() { return _defaultValue; // 0 0:aload_0 // 1 1:getfield #35 <Field Enum _defaultValue> // 2 4:areturn } public Class getEnumClass() { return _enumClass; // 0 0:aload_0 // 1 1:getfield #29 <Field Class _enumClass> // 2 4:areturn } public Collection getEnumIds() { return ((Collection) (_enumsById.keySet())); // 0 0:aload_0 // 1 1:getfield #33 <Field HashMap _enumsById> // 2 4:invokevirtual #156 <Method java.util.Set HashMap.keySet()> // 3 7:areturn } public Enum[] getRawEnums() { return _enums; // 0 0:aload_0 // 1 1:getfield #31 <Field Enum[] _enums> // 2 4:areturn } private static final long serialVersionUID = 1L; protected final Enum _defaultValue; protected final Class _enumClass; protected final Enum _enums[]; protected final HashMap _enumsById; }
[ "silenta237@gmail.com" ]
silenta237@gmail.com
ea9184ba45e955be5c1d48b42f1be58d64df2784
2c481f92f88c49f6f73f2441c025a4c5144e1a4a
/app/src/test/java/com/example/youyu4/coolweather/ExampleUnitTest.java
e8ecea8600efd2e535023c6acb8e1b73f6e642e3
[ "Apache-2.0" ]
permissive
youyu4nb/coolweather
b1aa4a8a70f4b597fd411e131d75a9436432a1a4
73ca976cf121ced34b64a126a58e7b61c40d0ad6
refs/heads/master
2020-07-04T01:54:52.834210
2019-08-21T16:40:23
2019-08-21T16:40:23
202,114,988
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
package com.example.youyu4.coolweather; 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); } }
[ "543851874@qq.com" ]
543851874@qq.com
0d61fff77f04e3d64afd645332203a7402f8362a
2ecd69120d070b28b8e032c5b696234e8bb5c42b
/An3/Sem1/Proiect Colectiv/IT-CemetryApp/src/edu/cs/ubbcluj/ro/repository/MonumentRepository.java
b85a3955315d0fb77fcc8657cc124af26d1f6c82
[]
no_license
csergiu/Labs
61a5ba75405805f932a1635ea14d3434def4ffda
4a2be207cfb58e74e8ee426835f84315ee7d8880
refs/heads/master
2021-01-15T11:38:36.182411
2015-01-29T07:58:54
2015-01-29T07:58:54
49,513,568
1
0
null
2016-01-12T16:34:20
2016-01-12T16:34:20
null
UTF-8
Java
false
false
195
java
package edu.cs.ubbcluj.ro.repository; import javax.ejb.Local; import edu.cs.ubbcluj.ro.model.Monument; @Local public interface MonumentRepository extends BaseRepository<Monument,Integer>{ }
[ "mihai.co21@yahoo.com" ]
mihai.co21@yahoo.com
2074fd94ba34cd4600a887fac49b98ccea50a935
43d637b2f294a1a6b20283f7c8648d897b1c1a42
/src/CountingElements/FrogRiverOne.java
0788720d095fec1eb650d5e3c1c688db5368e0b8
[]
no_license
parveznawaz/CodilityProblems
1f45230fe3c5441814c1689e3e4a74f3a310b21b
53ea6adc5eef397b66cec376ad7c037dc5cc7e40
refs/heads/master
2020-03-12T08:36:11.721714
2018-04-22T03:26:11
2018-04-22T03:26:11
130,531,202
0
0
null
null
null
null
UTF-8
Java
false
false
581
java
package CountingElements; import org.junit.Assert; import org.junit.Test; public class FrogRiverOne { public int solution(int X, int[] A){ int count=X; boolean seen[]=new boolean[X]; for(int i=0;i<A.length;i++){ if(seen[A[i]-1]==false){ count--; seen[A[i]-1]=true; if(count==0){ return i; } } } return -1; } @Test public void test1(){ Assert.assertEquals(1, solution(5,new int[]{1,2,3,4,5,6,7})); } }
[ "parvez.nawaz@gmail.com" ]
parvez.nawaz@gmail.com
946d51c3074ace0504e84cc0a06c066a5312ae3e
26f60fe97cd43243436f3b49ed77c1aff9348f35
/Mtestmapa/app/src/androidTest/java/com/example/watchdogs/mtestmapa/ApplicationTest.java
c786ce33cd110cd5bc4287f1c6d614c5f736a23a
[]
no_license
MarceloRoso/atthack
32251f334bacdee65b58875fac7083a5f3a559e2
ddfb8dae60328d81997e410739ddc5fadb8f913a
refs/heads/master
2021-01-10T16:57:58.016862
2016-01-03T12:05:56
2016-01-03T12:05:56
48,940,442
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.example.watchdogs.mtestmapa; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "marcelitoblazer@gmail.com" ]
marcelitoblazer@gmail.com
0e3c704613c8eec759e54286a2660085073c32a4
170e0f227c9cb6013ad8969a60fae71c51e44aae
/app/src/main/java/com/sabkayar/praveen/takeorderdistribute/takeOrder/TakeOrderActivity.java
ce72a455e90f3a0899edaf5739c0c085e322f24a
[]
no_license
praveencris/Capstone-Project
a5e9071a17fa8600aba058fac95512b9cf6fe7e7
7a6ada12b7df92b8ec143975023118d875552386
refs/heads/master
2022-04-13T16:53:04.608851
2020-03-23T13:32:30
2020-03-23T13:32:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
23,244
java
package com.sabkayar.praveen.takeorderdistribute.takeOrder; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.sabkayar.praveen.takeorderdistribute.R; import com.sabkayar.praveen.takeorderdistribute.database.AppDatabase; import com.sabkayar.praveen.takeorderdistribute.database.AppExecutors; import com.sabkayar.praveen.takeorderdistribute.database.entity.UserName; import com.sabkayar.praveen.takeorderdistribute.databinding.ActivityTakeOrderBinding; import com.sabkayar.praveen.takeorderdistribute.databinding.DialogAddItemBinding; import com.sabkayar.praveen.takeorderdistribute.orderDetails.model.OrderPerUser; import com.sabkayar.praveen.takeorderdistribute.realtimedbmodels.Item; import com.sabkayar.praveen.takeorderdistribute.realtimedbmodels.OrderDetail; import com.sabkayar.praveen.takeorderdistribute.realtimedbmodels.User; import com.sabkayar.praveen.takeorderdistribute.takeOrder.adapter.ItemInfoAdapter; import com.sabkayar.praveen.takeorderdistribute.takeOrder.model.ItemInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; public class TakeOrderActivity extends AppCompatActivity implements ItemInfoAdapter.OnListItemListener, View.OnClickListener { public static final String EXTRA_EDITED_ITEMS_LIST_DETAILS = "extra_order_details" + TakeOrderActivity.class.getSimpleName(); public static final String EXTRA_ORDER_DETAILS = "extra_order_details" + TakeOrderActivity.class.getSimpleName(); private static final String EXTRA_USER_NAME = "extra_user_name" + TakeOrderActivity.class.getSimpleName(); private static final String EXTRA_ORDER_PER_USER = "extra_order_per_user" + TakeOrderActivity.class.getSimpleName(); private ActivityTakeOrderBinding mBinding; private ItemInfoAdapter mItemInfoAdapter; private String mUserName; private HashMap<String, OrderDetail> mStringOrderDetailHashMap; private List<OrderDetail> mOrderDetailsForEditList; private OrderPerUser mOrderPerUser; private HashMap<String, ItemInfo> mStringItemInfoHashMap; private DatabaseReference mDatabaseReferenceItems; private DatabaseReference mDatabaseReferenceUsers; private DatabaseReference mDatabaseReferenceNames; private ValueEventListener mValueEventListenerNames; private ValueEventListener mValueEventListenerItems; private ValueEventListener mValueEventListenerUsers; private FirebaseDatabase mFirebaseDatabase; private FirebaseAuth mFirebaseAuth; public static Intent newIntent(Context context, String userName, OrderPerUser orderPerUser) { Intent intent = new Intent(context, TakeOrderActivity.class); if (TextUtils.isEmpty(userName)) { intent.putExtra(EXTRA_USER_NAME, orderPerUser.getUserName()); intent.putExtra(EXTRA_ORDER_PER_USER, orderPerUser); } else { intent.putExtra(EXTRA_USER_NAME, userName); } return intent; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mBinding = DataBindingUtil.setContentView(this, R.layout.activity_take_order); mFirebaseDatabase=FirebaseDatabase.getInstance(); mFirebaseAuth=FirebaseAuth.getInstance(); DatabaseReference singedUserReference=mFirebaseDatabase.getReference(mFirebaseAuth.getUid()); mDatabaseReferenceItems = singedUserReference.child("items"); mDatabaseReferenceUsers = singedUserReference.child("users"); mDatabaseReferenceNames = singedUserReference.child("names"); mStringOrderDetailHashMap = new HashMap<>(); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle("Take Order"); } Intent intent = getIntent(); if (intent.hasExtra(EXTRA_ORDER_PER_USER)) { mOrderPerUser = intent.getParcelableExtra(EXTRA_ORDER_PER_USER); mOrderDetailsForEditList = new ArrayList<>(); mOrderDetailsForEditList.addAll(mOrderPerUser.getOrderDetails()); } else { mOrderDetailsForEditList = null; } mUserName = getIntent().getStringExtra(EXTRA_USER_NAME); mBinding.tvName.setText(mUserName); AppExecutors.getInstance().getDiskIO().execute(new Runnable() { @Override public void run() { AppDatabase.getInstance(TakeOrderActivity.this).takeOrderDao() .insert(new UserName(mUserName)); } }); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL, false); mBinding.recyclerView.setLayoutManager(layoutManager); mItemInfoAdapter = new ItemInfoAdapter(this); mBinding.recyclerView.setAdapter(mItemInfoAdapter); mBinding.floatingActionButton.setOnClickListener(this); } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case android.R.id.home: if (!mStringOrderDetailHashMap.isEmpty()) { String id; if (mOrderDetailsForEditList != null) { id = mOrderPerUser.getUserId(); } else { id = mDatabaseReferenceUsers.push().getKey(); User user = new User(id, mUserName); mDatabaseReferenceUsers.child(id).child("user").setValue(user); } // Getting an iterator Iterator hmIterator = mStringOrderDetailHashMap.entrySet().iterator(); mDatabaseReferenceUsers.child(id).child("order").removeValue(); // Iterate through the hashmap while (hmIterator.hasNext()) { Map.Entry mapElement = (Map.Entry) hmIterator.next(); OrderDetail orderDetail = (OrderDetail) mapElement.getValue(); mDatabaseReferenceUsers.child(id).child("order").child(orderDetail.getItemId()).setValue(orderDetail); } } else { if (mOrderDetailsForEditList != null) { String id = mOrderPerUser.getUserId(); mDatabaseReferenceUsers.child(id).removeValue(); } } mValueEventListenerNames = new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { boolean isNameAvailable = false; for (DataSnapshot namesSnapshot : dataSnapshot.getChildren()) { String name = namesSnapshot.getValue(String.class); if (mUserName.equals(name)) { isNameAvailable = true; break; } } mDatabaseReferenceNames.removeEventListener(mValueEventListenerNames); if (!isNameAvailable) { String id = mDatabaseReferenceNames.push().getKey(); mDatabaseReferenceNames.child(id).setValue(mUserName); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }; mDatabaseReferenceNames.addValueEventListener(mValueEventListenerNames); finish(); } return super.onOptionsItemSelected(item); } @Override public void onEditClick(Item itemInfo) { DialogAddItemBinding dialogAddItemBinding; final AlertDialog.Builder builder = new AlertDialog.Builder(this); dialogAddItemBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.dialog_add_item, (ViewGroup) findViewById(android.R.id.content), false); builder.setView(dialogAddItemBinding.getRoot()); dialogAddItemBinding.tvTitle.setText(R.string.edit_item); dialogAddItemBinding.etItemName.setText(itemInfo.getItemName()); dialogAddItemBinding.etItemPrice.setText(String.valueOf(itemInfo.getItemPrice())); dialogAddItemBinding.etMaxItemsAllowed.setText(String.valueOf(itemInfo.getMaxItemAllowed())); final AlertDialog alertDialog = builder.create(); alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); dialogAddItemBinding.btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alertDialog.cancel(); } }); dialogAddItemBinding.btnDone.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String itemName = dialogAddItemBinding.etItemName.getText().toString().trim(); String itemPrice = dialogAddItemBinding.etItemPrice.getText().toString().trim(); String maxItemAllowed = dialogAddItemBinding.etMaxItemsAllowed.getText().toString().trim(); if (!TextUtils.isEmpty(itemName) && !TextUtils.isEmpty(itemPrice) && !TextUtils.isEmpty(maxItemAllowed)) { if (Integer.valueOf(maxItemAllowed) >= 0) { updateItem(new Item(itemInfo.getItemId(), itemName, itemPrice, Integer.valueOf(maxItemAllowed))); alertDialog.cancel(); } else { Toast.makeText(dialogAddItemBinding.btnDone.getContext(), "Enter valid items allowed to proceed further", Toast.LENGTH_LONG).show(); } } else { Toast.makeText(dialogAddItemBinding.btnDone.getContext(), "Enter Valid details to proceed further", Toast.LENGTH_LONG).show(); } } }); alertDialog.show(); } private void updateItem(Item item) { final boolean[] isAllowedForUpdate = {false}; final boolean[] isItemAvailableInOrders = {false}; mValueEventListenerUsers = null; mValueEventListenerUsers = mDatabaseReferenceUsers.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { label: for (DataSnapshot userDataSnapshot : dataSnapshot.getChildren()) { DataSnapshot ordersPerUserSnapshot = userDataSnapshot.child("order"); //DataSnapshot userSnapshot=userDataSnapshot.child("user"); for (DataSnapshot order : ordersPerUserSnapshot.getChildren()) { OrderDetail newOrderDetail = order.getValue(OrderDetail.class); if (item.getItemId().equals(newOrderDetail.getItemId())) { isItemAvailableInOrders[0] = true; newOrderDetail.setItemName(item.getItemName()); if (item.getMaxItemAllowed() >= newOrderDetail.getItemCount()) { order.getRef().setValue(newOrderDetail); isAllowedForUpdate[0] = true; break; } else { isAllowedForUpdate[0] = false; Toast.makeText(TakeOrderActivity.this, "Max count allowed can not be less then item count. Update item failed!", Toast.LENGTH_LONG).show(); break label; } } } } detachValueEventListener(); if (isAllowedForUpdate[0] || !isItemAvailableInOrders[0]) { mDatabaseReferenceItems.child(item.getItemId()).setValue(item); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { detachValueEventListener(); } }); } private void detachValueEventListener() { if (mValueEventListenerUsers != null) { mDatabaseReferenceUsers.removeEventListener(mValueEventListenerUsers); } } private void addItem(Item item) { final boolean[] isItemNameThere = new boolean[]{false}; mValueEventListenerItems = new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for (DataSnapshot itemDataSnapshot : dataSnapshot.getChildren()) { Item newItem = itemDataSnapshot.getValue(Item.class); if (item.getItemName().equalsIgnoreCase(newItem.getItemName())) { isItemNameThere[0] = true; break; } } if (!isItemNameThere[0]) { mDatabaseReferenceItems.child(item.getItemId()).setValue(item); } else { Toast.makeText(TakeOrderActivity.this, "Item with same name already available", Toast.LENGTH_SHORT).show(); } detachItemsListener(); } private void detachItemsListener() { mDatabaseReferenceItems.removeEventListener(mValueEventListenerItems); mValueEventListenerItems = null; } @Override public void onCancelled(@NonNull DatabaseError databaseError) { detachItemsListener(); } }; mDatabaseReferenceItems.addValueEventListener(mValueEventListenerItems); } @Override public void onCheckBoxChecked(OrderDetail orderDetail, boolean isAdd) { if (isAdd) { mStringOrderDetailHashMap.put(orderDetail.getItemId(), orderDetail); } else { mStringOrderDetailHashMap.remove(orderDetail.getItemId()); } } @Override public void onItemLongPress(Item item) { showDeleteDialog(item); } @Override public void onItemCountChanged(OrderDetail orderFrom) { if (mStringOrderDetailHashMap.containsKey(orderFrom.getItemId())) { mStringOrderDetailHashMap.put(orderFrom.getItemId(), orderFrom); } } private void showDeleteDialog(Item item) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); dialogBuilder.setTitle("Do you want to delete item " + item.getItemName()); dialogBuilder.setNegativeButton("NO", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); dialogBuilder.setPositiveButton("YES", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); final boolean[] isItemAvailableInOrders = {false}; mValueEventListenerUsers = null; mValueEventListenerUsers = mDatabaseReferenceUsers.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for (DataSnapshot userDataSnapshot : dataSnapshot.getChildren()) { DataSnapshot ordersPerUserSnapshot = userDataSnapshot.child("order"); // DataSnapshot userSnapshot=userDataSnapshot.child("user"); for (DataSnapshot order : ordersPerUserSnapshot.getChildren()) { if (order.hasChildren()) { OrderDetail orderDetail = order.getValue(OrderDetail.class); if (item.getItemId().equals(orderDetail.getItemId())) { Toast.makeText(TakeOrderActivity.this, "Item " + item.getItemName() + " already present in one of the order. Deletion not allowed!", Toast.LENGTH_LONG).show(); isItemAvailableInOrders[0] = true; break; } } } } if (!isItemAvailableInOrders[0]) { deleteItem(item); } detachValueEventListener(); } @Override public void onCancelled(@NonNull DatabaseError databaseError) { detachValueEventListener(); } }); } }); AlertDialog dialog = dialogBuilder.create(); dialog.show(); } private void deleteItem(Item item) { mDatabaseReferenceItems.child(item.getItemId()).removeValue(); Toast.makeText(TakeOrderActivity.this, "Item " + item.getItemName() + " deleted successfully!", Toast.LENGTH_LONG).show(); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.floatingActionButton: DialogAddItemBinding dialogAddItemBinding; final AlertDialog.Builder builder = new AlertDialog.Builder(this); dialogAddItemBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.dialog_add_item, (ViewGroup) findViewById(android.R.id.content), false); builder.setView(dialogAddItemBinding.getRoot()); final AlertDialog alertDialog = builder.create(); alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); dialogAddItemBinding.btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alertDialog.cancel(); } }); dialogAddItemBinding.btnDone.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String itemName = dialogAddItemBinding.etItemName.getText().toString().trim(); String itemPrice = dialogAddItemBinding.etItemPrice.getText().toString().trim(); String maxItemAllowed = dialogAddItemBinding.etMaxItemsAllowed.getText().toString().trim(); if (!TextUtils.isEmpty(itemName) && !TextUtils.isEmpty(itemPrice) && !TextUtils.isEmpty(maxItemAllowed)) { if (Integer.valueOf(maxItemAllowed) >= 0) { String id = mDatabaseReferenceItems.push().getKey(); addItem(new Item(id, itemName, itemPrice, Integer.valueOf(maxItemAllowed))); alertDialog.cancel(); } else { Toast.makeText(dialogAddItemBinding.btnDone.getContext(), "Enter valid items allowed to proceed further", Toast.LENGTH_LONG).show(); } } else { Toast.makeText(dialogAddItemBinding.btnDone.getContext(), "Enter Valid details to proceed further", Toast.LENGTH_LONG).show(); } } }); alertDialog.show(); } } @Override protected void onStart() { super.onStart(); mDatabaseReferenceItems.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { List<ItemInfo> itemInfoList = new ArrayList<>(); mStringItemInfoHashMap = new HashMap<>(); for (DataSnapshot itemSnapshot : dataSnapshot.getChildren()) { Item item = itemSnapshot.getValue(Item.class); ItemInfo itemInfo = new ItemInfo(item.getItemId(), item.getItemName(), item.getItemPrice(), item.getMaxItemAllowed(), false, 0); itemInfoList.add(itemInfo); mStringItemInfoHashMap.put(itemInfo.getItemId(), itemInfo); } if (mOrderDetailsForEditList != null) { for (OrderDetail orderDetail : mOrderDetailsForEditList) { if (mStringItemInfoHashMap.containsKey(orderDetail.getItemId())) { ItemInfo itemInfo = mStringItemInfoHashMap.get(orderDetail.getItemId()); if (itemInfo != null) { itemInfo.setItemsSelected(orderDetail.getItemCount() - 1); itemInfo.setChecked(true); mStringItemInfoHashMap.put(orderDetail.getItemId(), itemInfo); } } } // Getting an iterator Iterator hmIterator = mStringItemInfoHashMap.entrySet().iterator(); itemInfoList.clear(); // Iterate through the hashmap while (hmIterator.hasNext()) { Map.Entry mapElement = (Map.Entry) hmIterator.next(); itemInfoList.add((ItemInfo) mapElement.getValue()); } } mItemInfoAdapter.setItemInfoArrayList(itemInfoList); } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } }
[ "pkchmits@gmail.com" ]
pkchmits@gmail.com
22f8c16709b4d7fdec801ae0932117919a361b8d
cecbdde37811ff4b83bad40ffa9e40c6c9e52ef1
/src/nn/NeuronLayerImpl.java
aa843c45106c27e1605f058f7921b48da3829edb
[]
no_license
MistMantis/NN
9c441c9513039c75b9f6fdb28a4b9484592cf3b8
291022dbd56f9a45e65e14071f6f419fc7070402
refs/heads/master
2020-04-02T06:17:08.144022
2016-06-14T17:12:12
2016-06-14T17:12:12
61,126,661
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package nn; import java.util.List; public class NeuronLayerImpl implements NeuronLayer { private List<Neuron> neurons; public NeuronLayerImpl(List<Neuron> neurons) { this.neurons = neurons; } @Override public List<Neuron> getNeurons() { return this.neurons; } }
[ "3r.spam@gmail.com" ]
3r.spam@gmail.com
0f1f48843209c715f60a9c41d8abad2facc39c2e
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/79/1396.java
ea29372965bc7983f92bfdd92eff5b651e6550b4
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package <missing>; public class GlobalMembers { public static int Main() { int n; int m; int i; int s = 0; while (true) { s = 0; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { n = Integer.parseInt(tempVar); } String tempVar2 = ConsoleInput.scanfRead(); if (tempVar2 != null) { m = Integer.parseInt(tempVar2); } if (n == 0) { break; } if (n == 1) { System.out.print("1\n"); } else { for (i = 2; i <= n; i++) { s = (s + m) % i; } System.out.printf("%d\n", s + 1); } } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
a7169125916d1bf4152a9f9b74e591bbfbb6f9b0
e202055b5db0917283208394b9ca94743efc8e49
/myboard-jdbc/src/com/bit/board/vo/BoardVO.java
1738c16c833c0b25c559e7b4b1ea31780ac77d8c
[]
no_license
hyeran-shin/2020-07-bit-java
837ce88014c65dac9cbedecbf17851f59a341b3d
905e574c2d43d5529593d31ee3785fbd1ae082eb
refs/heads/master
2022-11-20T10:19:54.349351
2020-07-16T02:24:59
2020-07-16T02:24:59
280,028,353
0
0
null
null
null
null
UTF-8
Java
false
false
1,368
java
package com.bit.board.vo; import java.io.Serializable; // VO : Value Object // -> 게시글 정보를 기억 또는 전달하기 위한 객체 public class BoardVO implements Serializable { /** * */ private static final long serialVersionUID = 1L; // 이 VO 가 id가 어떤거냐에 따라 jvm 이 식별하는게 다르다. // 자동으로 부여된다. 객체자체를 식별자 값이라고 생각., 유저식별자 private int no; private String title; private String writer; private String regData; public BoardVO(int no, String title, String writer, String regData) { super(); this.no = no; this.title = title; this.writer = writer; this.regData = regData; } public BoardVO() { super(); } public int getNo() { return no; } public void setNo(int no) { this.no = no; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getRegData() { return regData; } public void setRegData(String regData) { this.regData = regData; } public String getWriter() { return writer; } public void setWriter(String writer) { this.writer = writer; } @Override public String toString() { return "BoardVO [no=" + no + ", title=" + title + ", weiter=" + writer + ", regData=" + regData + ", toString()=" + super.toString() + "]"; } }
[ "2931258@gmail.com" ]
2931258@gmail.com
670347637349d5e0da1de81e387fb8b4dc4cc61a
390a4f24cfe9637b7af8bfc664de915b7091b7cb
/src/main/java/guiceservlet/Vehicle.java
99dc0cd500b5f81d1d1b583bc2d86c0f1840d9e1
[]
no_license
kpa-axelor/guice-servlet-jpa
02b59832b1c87c84ce38c1ef4dd1854a1054bbf1
d2ae60f270411e72c0de58fae33d8af9a93b65a4
refs/heads/master
2020-06-10T17:26:48.162085
2019-06-25T11:04:38
2019-06-25T11:04:38
193,691,709
0
0
null
null
null
null
UTF-8
Java
false
false
1,505
java
package guiceservlet; import java.util.ArrayList; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; @Entity public class Vehicle { @Id @GeneratedValue int vehicleId; String vehicleName; @ManyToOne Employee employee; @ManyToMany List<Contect> contect = new ArrayList<Contect>(); public Vehicle(String vehicleName) { super(); this.vehicleName = vehicleName; } public Vehicle() { super(); } public void setEmpId() { this.employee = null; } public Employee getEmployee() { return employee; } public void setEmployee(Employee employee) { this.employee = employee; } public int getVehicleId() { return this.vehicleId; } public void setVehicleId(int vehicleId) { this.vehicleId = vehicleId; } public String getVehicleName() { return vehicleName; } public void setVehicleName(String vehicleName) { this.vehicleName = vehicleName; } public List<Contect> getContect() { return contect; } public void setContect(List<Contect> contect) { this.contect = contect; } //@JoinColumn(name = "vehicleId") //@ManyToMany // Collection<Employee> employeelist = new ArrayList(); // public Collection<Employee> getEmployeelist() { // return employeelist; //} // //public void setEmployeelist(Collection<Employee> employeelist) { // this.employeelist = employeelist; //} }
[ "kpa.axelor@gmail.com" ]
kpa.axelor@gmail.com
5db286d64ab6853165033aad707a61ec3aedf0a8
65dd55f181ddeddff95893abbc06e049d5434e59
/Back-End/src/main/java/br/jus/stj/siscovi/model/RegistroRetroPercentualEstatico.java
4c7fab19b1571c18f720c8aed03f82c8084589aa
[]
no_license
VSSantana/SISCOVI
1805a2aa6f9c9204d669ba60c4c0c5c6947d3f27
e9132ccfa6220b1bac7fa30e4082e550cd4a74f5
refs/heads/master
2021-06-30T06:12:41.674352
2019-02-04T18:06:14
2019-02-04T18:06:14
102,145,041
0
1
null
null
null
null
UTF-8
Java
false
false
1,769
java
package br.jus.stj.siscovi.model; import java.sql.Date; import java.sql.Timestamp; public class RegistroRetroPercentualEstatico { private int pCod; private int pCodContrato; private int pCodPercentualEstatico; private Date pDataInicio; private Date pDataFim; private Date pDataCobranca; private String pLoginAtualizacao; private Timestamp pDataAtualizacao; public RegistroRetroPercentualEstatico (int pCod, int pCodContrato, int pCodPercentualEstatico, Date pDataInicio, Date pDataFim, Date pDataCobranca, String pLoginAtualizacao, Timestamp pDataAtualizacao) { this.pCod = pCod; this.pCodContrato = pCodContrato; this.pCodPercentualEstatico = pCodPercentualEstatico; this.pDataInicio = pDataInicio; this.pDataFim = pDataFim; this.pDataCobranca = pDataCobranca; this.pLoginAtualizacao = pLoginAtualizacao; this.pDataAtualizacao = pDataAtualizacao; } public int getpCod() { return pCod; } public int getpCodContrato() { return pCodContrato; } public int getpCodPercentualEstatico() { return pCodPercentualEstatico; } public Date getpDataInicio() { return pDataInicio; } public Date getpDataFim() { return pDataFim; } public Date getpDataCobranca() { return pDataCobranca; } public String getpLoginAtualizacao() { return pLoginAtualizacao; } public Timestamp getpDataAtualizacao() { return pDataAtualizacao; } }
[ "sousavinicius@hotmail.com" ]
sousavinicius@hotmail.com
6f4a9b1fcfa6ccf7db2a148ae25e72da13e28ce0
cef341641a2aa231071b0f63ce5d98ad3cceb95b
/src/main/java/com/project/model/Timesheet.java
6ede59a684a074f92dc6d2c6cf8300d9b215f8fd
[]
no_license
shauktik/isys631-test2
5b2adbbe040571f663f12ff27c88ff7ac034bfee
bb138a0fb1e3b9bb7fcd620cfa3be495972ebc9a
refs/heads/master
2021-01-19T04:30:34.683296
2017-05-01T16:17:34
2017-05-01T16:17:34
87,378,363
0
5
null
2017-04-12T05:15:33
2017-04-06T02:40:11
HTML
UTF-8
Java
false
false
354
java
package com.project.model; import java.util.List; /*Timesheet.java * Bean class to hold * timesheet entries for submission by a user*/ public class Timesheet { private List<String> timeEntry; public List<String> getTimeEntry() { return timeEntry; } public void setTimeEntry(List<String> timeEntry) { this.timeEntry = timeEntry; } }
[ "shauktik.11@gmail.com" ]
shauktik.11@gmail.com
21545a52f93370678977b2c45246aeca141caabb
0a6ed0714cebd25c452a7cd5861614972a366c04
/src/main/java/com/mycompany/myapp/domain/Equipo.java
59d456b9fbad845828f0dbf964e1fb011dee5b48
[]
no_license
Anunnakifree/liga-baloncesto-j
f851168fefd048594390fb78294a977e29d4992d
47a90ec7254c3f3cb6e69a1d1340b3349bfbc96e
refs/heads/master
2016-09-01T11:12:18.506466
2016-02-03T20:27:48
2016-02-03T20:27:48
49,733,401
0
0
null
null
null
null
UTF-8
Java
false
false
2,383
java
package com.mycompany.myapp.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import java.time.LocalDate; import javax.persistence.*; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import java.util.Objects; /** * A Equipo. */ @Entity @Table(name = "equipo") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Equipo implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "nombre") private String nombre; @Column(name = "fecha_creacion") private LocalDate fechaCreacion; @Column(name = "localidad") private String localidad; @OneToMany(mappedBy = "equipo") @JsonIgnore @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) private Set<Jugador> jugadors = new HashSet<>(); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public LocalDate getFechaCreacion() { return fechaCreacion; } public void setFechaCreacion(LocalDate fechaCreacion) { this.fechaCreacion = fechaCreacion; } public String getLocalidad() { return localidad; } public void setLocalidad(String localidad) { this.localidad = localidad; } public Set<Jugador> getJugadors() { return jugadors; } public void setJugadors(Set<Jugador> jugadors) { this.jugadors = jugadors; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Equipo equipo = (Equipo) o; return Objects.equals(id, equipo.id); } @Override public int hashCode() { return Objects.hashCode(id); } @Override public String toString() { return "Equipo{" + "id=" + id + ", nombre='" + nombre + "'" + ", fechaCreacion='" + fechaCreacion + "'" + ", localidad='" + localidad + "'" + '}'; } }
[ "carlos.carlosrodiba@gmail.com" ]
carlos.carlosrodiba@gmail.com
5329c7fc7b4b4247ff9fd301cc589275de34d11d
3ad090a616c47ab5d679d9bcacdafbc74aaaca84
/spring-mvc-webapplicationinitializer/src/main/java/io/codefountain/spring/mvc/domain/Reservation.java
624c57b0157578c20052cd3ea525d67aa4ed868c
[]
no_license
musibs/Spring
2a8610ba188e7278093e293e2e2d17523c3972ca
62be89e1c9b70ca6804f9ea91b54e03901a96aa2
refs/heads/master
2022-12-23T02:16:42.788016
2019-10-28T22:22:23
2019-10-28T22:22:23
190,841,709
10
10
null
2022-12-16T14:50:27
2019-06-08T03:40:12
Java
UTF-8
Java
false
false
947
java
package io.codefountain.spring.mvc.domain; import java.util.Date; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.ToString; @AllArgsConstructor @NoArgsConstructor @ToString public class Reservation { private String courtName; private Date date; private int hour; private Player player; private SportType sportType; public String getCourtName() { return courtName; } public void setCourtName(String courtName) { this.courtName = courtName; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public int getHour() { return hour; } public void setHour(int hour) { this.hour = hour; } public Player getPlayer() { return player; } public void setPlayer(Player player) { this.player = player; } public SportType getSportType() { return sportType; } public void setSportType(SportType sportType) { this.sportType = sportType; } }
[ "musib.somnath@gmail.com" ]
musib.somnath@gmail.com
58cc881107ab20da2220de42f1cf77bd24044ea9
202e553af2d17146e4d931dd94572980fe2f6247
/pgdRouter-compiler/src/main/java/com/arnold/router/compiler/util/Consts.java
861219dadca697c750b406e0e097824a01f9081a
[]
no_license
BaiShou/router
28c77332f0f2f0b1fbe165890785350835bcbbbc
3407af9e7d0c97c7a33b6b7b243d3c2c86ab6ffd
refs/heads/master
2023-07-02T15:21:19.008270
2021-08-10T03:40:07
2021-08-10T03:40:07
394,515,525
0
0
null
null
null
null
UTF-8
Java
false
false
2,702
java
package com.arnold.router.compiler.util; /** * Some consts used in processors * * @author Alex <a href="mailto:zhilong.liu@aliyun.com">Contact me.</a> * @version 1.0 * @since 16/8/24 20:18 */ public class Consts { // Generate public static final String SEPARATOR = "$$"; public static final String PROJECT = "PGDRouter"; public static final String WARNING_TIPS = "DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY PGDROUTER."; public static final String METHOD_LOAD_INTO = "onCreate"; public static final String METHOD_STOP = "onStop"; public static final String NAME_OF_GROUP = PROJECT + SEPARATOR + "Group" + SEPARATOR; public static final String PACKAGE_OF_GENERATE_FILE = "com.arnold.android.routes"; // Java type private static final String LANG = "java.lang"; public static final String BYTE = LANG + ".Byte"; public static final String SHORT = LANG + ".Short"; public static final String INTEGER = LANG + ".Integer"; public static final String LONG = LANG + ".Long"; public static final String FLOAT = LANG + ".Float"; public static final String DOUBEL = LANG + ".Double"; public static final String BOOLEAN = LANG + ".Boolean"; public static final String CHAR = LANG + ".Character"; public static final String STRING = LANG + ".String"; public static final String SERIALIZABLE = "java.io.Serializable"; // Custom interface private static final String FACADE_PACKAGE = "com.arnold.router"; public static final String BASE_ROUTER_PATH = FACADE_PACKAGE+".base"; public static final String BASE_ROUTER_MAP = "BaseBizRouter"; public static final String BASE_SPI_SERVICE_LOADER = "BaseSpiServiceLoader"; public static final String IRESISTER_MODULE = "com.arnold.router.base.IResisterModule"; public static final String IROUTER_PROTOCOL = "com.arnold.router.base.IRouterProtocol"; // Log static final String PREFIX_OF_LOGGER = PROJECT + "::Compiler "; public static final String NO_MODULE_NAME_TIPS = "These no module name, at 'build.gradle', like :\n" + "android {\n" + " defaultConfig {\n" + " ...\n" + " javaCompileOptions {\n" + " annotationProcessorOptions {\n" + " arguments = [AROUTER_MODULE_NAME: project.getName()]\n" + " }\n" + " }\n" + " }\n" + "}\n"; // Options of processor public static final String KEY_MODULE_NAME = "PGDROUTER_MODULE_NAME"; // Annotation type public static final String ANNOTATION_TYPE_ROUTE = FACADE_PACKAGE + ".annotation.Route"; }
[ "tianzhiheng@dianmi365.com" ]
tianzhiheng@dianmi365.com
4bba95bfac27d2f5280f1a06ed40c8966594a67e
97ee832de46ad08816fd6a00fb062dcfe92b4e8b
/pawo-power/pawo-power-dao/src/main/java/com/gm/po/UserPo.java
0ec4b6358101dfca2689fbfadb991efb52d7358a
[]
no_license
datoubangzhu/pawo
3bd45d297927f5b38b71bde26696cbec026ec521
bb49669c0cf71bf696816e48b19942094f25a543
refs/heads/master
2022-07-14T14:42:57.006431
2019-08-02T14:40:12
2019-08-02T14:40:12
165,336,955
51
5
null
2022-06-10T19:57:29
2019-01-12T02:23:50
Java
UTF-8
Java
false
false
764
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * Copyright (c) 2012-2019. 赵贵明. * pawo-power All rights reserved. */ package com.gm.po; import java.io.Serializable; import lombok.Data; /** * <p> </p> * * <pre> Created: 2019-01-02 20:45 </pre> * <pre> Project: pawo-power </pre> * * @author gmzhao * @version 1.0 * @since JDK 1.7 */ @Data public class UserPo implements Serializable{ private static final long serialVersionUID = -2130727214286792267L; /** * 用户名 */ private String username; /** * 密码 */ private String password; /** * 是否为超级管理员 */ private boolean type; /** * 创建时间 */ private String createTime; }
[ "2419475724@qq.com" ]
2419475724@qq.com
a275f6cc1804132ed4ca6150e2504dd1ba8098b2
4585ec4320c5c731f6d207894112d6613934723b
/Spring/Spring_Study/Spring_IOC_01/src/main/java/com/chen/dao/UserDaoMysqlImpl.java
4304de78d9a114c9c614d1d637aa486d36b7a0b3
[]
no_license
chen934298133/SSM
cb8bfa5dcf582c851e53e9e151c3094fb9f5789a
4bf6843894264c51f9562a48034bfe0ceba0783b
refs/heads/master
2023-03-30T09:54:26.168085
2021-04-07T13:10:50
2021-04-07T13:10:50
345,130,046
0
0
null
null
null
null
UTF-8
Java
false
false
157
java
package com.chen.dao; public class UserDaoMysqlImpl implements UserDao { public void getUser(){ System.out.println("后添加: MySQL"); } }
[ "934298133@qq.com" ]
934298133@qq.com
fa550922a4aae45a6afa8ad51e710fa27672ae95
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava6/Foo840.java
74f5b4fa5dc520f06a1cafafc3a761975a027585
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
575
java
package applicationModulepackageJava6; public class Foo840 { public void foo0() { final Runnable anything0 = () -> System.out.println("anything"); new applicationModulepackageJava6.Foo839().foo9(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } public void foo6() { foo5(); } public void foo7() { foo6(); } public void foo8() { foo7(); } public void foo9() { foo8(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
7ad02418016a5553e185a57383017809a44f2187
6db0e350c1d7fe000e8e702edec2e964d4686807
/javafun-02-streams/src/come/tyro/javafun/results/GroupingDataWithCollectors.java
9142b9b947af37e132be5489bc968ae46a4010bd
[]
no_license
chowow/java-8-lambdas-streams-demo
9693b1f639ccaf63717a37bda6035997cb04cde8
ffba1689d31db34806edbb970826e29e7456cab6
refs/heads/master
2022-01-10T19:20:45.412821
2019-05-27T22:13:30
2019-05-27T22:13:30
20,718,063
0
0
null
null
null
null
UTF-8
Java
false
false
1,198
java
package come.tyro.javafun.results; import com.tyro.javafun.Film; import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; import static com.tyro.javafun.FilmFactory.films; import static java.lang.String.format; public class GroupingDataWithCollectors { private static final Function<String, Predicate<Film>> genre = g -> f -> f.getGenres().contains(g); public static void main(String[] args) { Map<Integer, List<Film>> worstHorrorFilms = films().stream() .filter(genre.apply("Horror")) .filter(f -> f.getRating() < 4) .collect(Collectors.groupingBy(Film::getYear, TreeMap::new, Collectors.toList())); // This is odd... collect returns a Map<Integer, List<Film>> without casting, yet if we inline // the following it complains about types and seems to be using BiConsumer<Object, Object>. // It will also refuse to allow us to cast the lambda parameter fl. Weird... worstHorrorFilms.forEach((y, fl) -> System.out.println(format("%d [%d]: %s", y, fl.size(), fl))); } }
[ "=" ]
=
f42b60b9a603c982b4911d78d21e4ddb1781cdc6
83ac2a6eb8ff7292ec7e2546b7f4e727ca4a758d
/Source Files/Module 1 - Java SE/Java Training/src/tr/org/bura/egitim/java/chapter04/SwitchStatement.java
c301da735f0112c6ebe9aeb6e6c48a4779f2ae75
[]
no_license
enesify/JavaTraining
7d52cf6220c87ecf882654675720e1165fd5a669
2977692284b689d97e1798d6693e94e9e88d85c9
refs/heads/master
2023-06-17T07:40:48.140134
2021-07-17T12:57:30
2021-07-17T12:57:30
380,575,360
2
2
null
null
null
null
UTF-8
Java
false
false
610
java
package tr.org.bura.egitim.java.chapter04; public class SwitchStatement { public static void main(String[] args) { String name = "Zeynep"; switch (name) { case "Hasan": case "Ali": System.out.println("Good name"); break; case "Veli": System.out.println("Hi, Veli"); break; case "Ayşe": System.out.println("Such a good name"); break; default: System.out.println("Probably your name is good too!"); } } }
[ "EBATUR@THY.COM" ]
EBATUR@THY.COM
2beb8c770bf748f16776290e0207a4b1b94b5d68
08f0be9a237467e4c02616669d1d198531d824ca
/backend/src/main/java/com/glauter/dsvendas/dto/SaleSuccessDTO.java
84dfb53918333293eb91c9db631831e3c7d622ff
[]
no_license
glauterius/projeto-sds3
b9d111fce9496e6381030b706ccf6466e8f81524
311035c2ffe84a70092f2b9072217244a673d676
refs/heads/master
2023-04-19T09:26:11.669546
2021-05-10T00:20:08
2021-05-10T00:20:08
364,402,231
0
0
null
null
null
null
UTF-8
Java
false
false
767
java
package com.glauter.dsvendas.dto; import com.glauter.dsvendas.entity.SellerEntity; public class SaleSuccessDTO { private String sellerName; private Long visited; private Long deals; public SaleSuccessDTO() { } public SaleSuccessDTO(SellerEntity seller, Long visited, Long deals) { super(); this.sellerName = seller.getName(); this.visited = visited; this.deals = deals; } public String getSellerName() { return sellerName; } public void setSellerName(String sellerName) { this.sellerName = sellerName; } public Long getVisited() { return visited; } public void setVisited(Long visited) { this.visited = visited; } public Long getDeals() { return deals; } public void setDeals(Long deals) { this.deals = deals; } }
[ "glauterius@gmail.com" ]
glauterius@gmail.com
93ab80c3fbd642c32bb83ee83549dee9cfd49733
4d31d41aabd75621dd0a24391decb80a185d206e
/src/main/lab/config/ApplicationConfigController.java
17f0d0dc5e4b38c23f01effc1b7dc2a0bb90ad51
[]
no_license
VladimirRozov/lab4-spring
839728689fa4173b40a1687995f41b306c2c81fa
c30a92819f5e7e81969631bdc566a9db56c655df
refs/heads/master
2020-04-18T09:02:58.818300
2019-01-24T19:02:05
2019-01-24T19:02:05
167,420,346
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package main.lab.config; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * The type Application config controller for getting ApplicationContext. */ public class ApplicationConfigController { private final static ApplicationContext applicationContext; static { applicationContext = new ClassPathXmlApplicationContext("WEB-INF/ApplicationConfigMain.xml"); } /** * Gets application context. * * @return the application context */ public static ApplicationContext getApplicationContext() { return applicationContext; } }
[ "39130781+VladimirRozov@users.noreply.github.com" ]
39130781+VladimirRozov@users.noreply.github.com
e01a939a7baf9273bfabf3f85214365700950079
17c742fd9f5f8f1cf34fc36d6c1678783c6800ac
/src/main/java/frame/Main/MainFrame.java
bb02c2b64c1d87d8c9206d3280720f20bd74cbc6
[]
no_license
greenman1268/CarDetails
63f57c507bdabbff37b4e264b559ce3ab1f7529c
c3c6d47cc9637ef110a71f887a16e087a5915f99
refs/heads/master
2021-01-01T04:58:12.388543
2016-05-25T08:24:28
2016-05-25T08:24:28
57,205,708
0
0
null
null
null
null
UTF-8
Java
false
false
32,022
java
package frame.Main; /** * Created on 27.04.2016 */ import frame.Print.report.PrintFrame; import frame.Search.SearchDilog; import frame.Search.SearchFrame; import frame.Sold.SoldFrame; import logic.Group; import logic.Item; import logic.ManagementSystem; import javax.swing.*; import javax.swing.border.BevelBorder; import javax.swing.event.*; import javax.swing.table.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.Vector; public class MainFrame extends JFrame implements ActionListener, ListSelectionListener, ChangeListener { // Введем сразу имена для кнопок - потом будем их использовать в обработчиках private static final String MOVE_GR = "moveGroup"; private static final String CLEAR_GR = "clearGroup"; private static final String INSERT_IT = "insertItem"; private static final String UPDATE_IT = "updateItem"; private static final String DELETE_IT = "deleteItem"; private static final String ALL_ITEMS = "allItems"; private static final String SEARCH_IT = "searchItem"; private static final String INSERT_GR = "insertGroup"; private static final String CHANGE_GR = "changeGroup"; private static final String DELETE_GR = "deleteGroup"; private static final String PRINT = "print"; private static final String RATES = "rates"; private static final String BASE = "base"; private ManagementSystem ms = null; private JList grpList; private JTable itemList; private TableSearchRenderer tsr; private ArrayList<Item> vector; private Vector<Item> selected = new Vector<>(); public MainFrame() throws Exception{ setTitle("CarDetails"); // Создаем верхнюю панель JPanel top = new JPanel(); // Устанавливаем для нее layout top.setLayout(null); top.setPreferredSize(new Dimension(500,30)); // Устанавливаем поиск //кнопка поиска JButton btnSrch = new JButton("Поиск"); btnSrch.setName(SEARCH_IT); btnSrch.setBounds(5,5,70,20); btnSrch.addActionListener(this); top.add(btnSrch); //кнопка показать все JButton btnAll = new JButton("Все детали"); btnAll.setName(ALL_ITEMS); btnAll.setBounds(80, 5, 110, 20); btnAll.addActionListener(this); top.add(btnAll); //кнопка печать JButton btnPrint = new JButton("Печать"); btnPrint.setName(PRINT); btnPrint.setBounds(195,5,90,20); btnPrint.addActionListener(this); top.add(btnPrint); //указать курс валют JButton btnRates = new JButton("Курс"); btnRates.setName(RATES); btnRates.setBounds(290, 5, 70, 20); btnRates.addActionListener(this); top.add(btnRates); //показать базу проданных деталей JButton btnSold = new JButton("БАЗА"); btnSold.setName(BASE); btnSold.setBounds(900, 5, 70, 20); btnSold.addActionListener(this); top.add(btnSold); // Создаем нижнюю панель и задаем ей layout JPanel bot = new JPanel(); bot.setLayout(new BorderLayout()); // Создаем левую панель для вывода списка групп // Она у нас GroupPanel left = new GroupPanel(); // Задаем layout и задаем "бордюр" вокруг панели left.setLayout(new BorderLayout()); left.setBorder(new BevelBorder(BevelBorder.LOWERED)); // Получаем коннект к базе и создаем объект ManagementSystem ms = ManagementSystem.getInstance(); // Получаем список групп Vector<Group> gr = new Vector<Group>(ms.getGroups()); // Создаем надпись left.add(new JLabel("Группы:"), BorderLayout.NORTH); // Создаем визуальный список и вставляем его в скроллируемую // панель, которую в свою очередь уже кладем на панель left grpList = new JList(gr); // Добавляем листенер grpList.addListSelectionListener(this); // Сразу выделяем первую группу grpList.setSelectedIndex(0); left.add(new JScrollPane(grpList), BorderLayout.CENTER); // Создаем кнопки для групп JButton btnClGr = new JButton("оч."); btnClGr.setName(CLEAR_GR); JButton btnAdGr = new JButton("доб."); btnAdGr.setName(INSERT_GR); JButton btnChGr = new JButton("ред."); btnChGr.setName(CHANGE_GR); JButton btnDlGr = new JButton("уд."); btnDlGr.setName(DELETE_GR); // Добавляем листенер btnClGr.addActionListener(this); btnAdGr.addActionListener(this); btnChGr.addActionListener(this); btnDlGr.addActionListener(this); // Создаем панель, на которую положим наши кнопки и кладем ее вниз JPanel pnlBtnGr = new JPanel(); pnlBtnGr.setLayout(new GridLayout(1, 5)); pnlBtnGr.add(btnClGr); pnlBtnGr.add(btnAdGr); pnlBtnGr.add(btnChGr); pnlBtnGr.add(btnDlGr); left.add(pnlBtnGr, BorderLayout.SOUTH); // Создаем правую панель для вывода списка деталей JPanel right = new JPanel(); // Задаем layout и задаем "бордюр" вокруг панели right.setLayout(new BorderLayout()); right.setBorder(new BevelBorder(BevelBorder.LOWERED)); // Создаем надпись right.add(new JLabel("Детали:"), BorderLayout.NORTH); // Создаем таблицу и вставляем ее в скроллируемую // панель, которую в свою очередь уже кладем на панель right // Наша таблица пока ничего не умеет - просто положим ее как заготовку // Сделаем в ней 4 колонки - Номер, Дата последнего изменения, Количество в наличии, Количество проданых itemList = new JTable(1, 5); right.add(new JScrollPane(itemList), BorderLayout.CENTER); // Создаем кнопки для деталей JButton btnAddSt = new JButton("Добавить"); btnAddSt.setName(INSERT_IT); btnAddSt.addActionListener(this); JButton btnUpdSt = new JButton("Исправить"); btnUpdSt.setName(UPDATE_IT); btnUpdSt.addActionListener(this); JButton btnDelSt = new JButton("Удалить"); btnDelSt.setName(DELETE_IT); btnDelSt.addActionListener(this); JButton btnMvGr = new JButton("Переместить"); btnMvGr.setName(MOVE_GR); btnMvGr.addActionListener(this); // Создаем панель, на которую положим наши кнопки и кладем ее вниз JPanel pnlBtnSt = new JPanel(); pnlBtnSt.setLayout(new GridLayout(1, 3)); pnlBtnSt.add(btnAddSt); pnlBtnSt.add(btnUpdSt); pnlBtnSt.add(btnDelSt); pnlBtnSt.add(btnMvGr); right.add(pnlBtnSt, BorderLayout.SOUTH); // Вставляем панели со списками групп и деталей в нижнюю панель bot.add(left, BorderLayout.WEST); bot.add(right, BorderLayout.CENTER); // Вставляем верхнюю и нижнюю панели в форму getContentPane().add(top, BorderLayout.NORTH); getContentPane().add(bot, BorderLayout.CENTER); Group g = (Group) grpList.getSelectedValue(); vector =(ArrayList<Item>) ms.getItemsFromGroup(g); tsr = new TableSearchRenderer(); itemList.setDefaultRenderer(Object.class, tsr); JTableHeader header = itemList.getTableHeader(); header.setDefaultRenderer(new MyTableHeaderRenderer(header.getDefaultRenderer())); // Задаем границы формы setBounds(100, 100, 1000, 500); } // Метод для обеспечения интерфейса ActionListener public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof Component) { Component c = (Component) e.getSource(); if (c.getName().equals(MOVE_GR)) { moveTOGroup(); } if (c.getName().equals(CLEAR_GR)) { clearGroup(); } if (c.getName().equals(ALL_ITEMS)) { showAllItems(); } if (c.getName().equals(INSERT_IT)) { insertItem(); } if (c.getName().equals(UPDATE_IT)) { updateItem(); } if (c.getName().equals(DELETE_IT)) { deleteItem(); } if (c.getName().equals(SEARCH_IT)) { searchItem(); } if (c.getName().equals(INSERT_GR)) { insertGroup(); } if (c.getName().equals(CHANGE_GR)) { updateGroup(); } if (c.getName().equals(DELETE_GR)) { deleteGroup(); } if (c.getName().equals(PRINT)) { if(selected.size()==0){ JOptionPane.showMessageDialog(MainFrame.this, "Необходимо отметить деталь в списке"); return; } printReport(); } if (c.getName().equals(RATES)){ updateRates(); } if (c.getName().equals(BASE)){ soldBase(); } }} // Метод для обеспечения интерфейса ListSelectionListener public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { reloadItems(); } } // Метод для обеспечения интерфейса ChangeListener public void stateChanged(ChangeEvent e) { reloadItems(); } // метод для обновления списка груп public void reloadGroups(){ Thread t = new Thread() { //SwingUtilities.invokeLater(new Runnable() { public void run() { if (grpList != null) { try { Collection<Group> gl = ms.getGroups(); grpList.setModel(new GroupListModel(new Vector<Group>(gl))); grpList.setSelectedIndex(0); } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } } };//}); t.start(); } // метод для обновления списка деталей для определенной группы public void reloadItems() { // Создаем анонимный класс для потока SwingUtilities.invokeLater(new Runnable() {// Thread t = new Thread() { // Переопределяем в нем метод run public void run() { if (itemList != null) { // Получаем выделенную группу Group g = (Group) grpList.getSelectedValue(); try { // Получаем список деталей Collection<Item> s = ms.getItemsFromGroup(g); // И устанавливаем модель для таблицы с новыми данными final Vector<Item> v = new Vector(s); if(selected!=null){ for (int i = 0; i < v.size(); i++) { for (int j = 0; j < selected.size(); j++) { if(v.get(i).getItemName().equals(selected.get(j).getItemName())&& v.get(i).getGroupId()==selected.get(j).getGroupId() && v.get(i).getItemId()==selected.get(j).getItemId()) v.get(i).setPrint(selected.get(j).getPrint()); } } } itemList.setModel(new ItemTableModel(v)); itemList.getModel().addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent tableModelEvent) { int row = tableModelEvent.getFirstRow(); int column = tableModelEvent.getColumn(); if(column == 4){ TableModel model = (TableModel)tableModelEvent.getSource(); Boolean checked = (Boolean)model.getValueAt(row,column); Item item = v.get(row); item.setPrint(checked); selected.add(item); } } }); RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(itemList.getModel()); itemList.setRowSorter(sorter); vector =(ArrayList<Item>) s; } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); } } } // Окончание нашего метода run }); //}; // Окончание определения анонимного класса // И теперь мы запускаем наш поток // t.start(); } //метод для удаления группы private void deleteGroup(){ Thread t = new Thread(){ public void run(){ if(grpList != null){ try { if(JOptionPane.showConfirmDialog(MainFrame.this, "Вы хотите удалить эту группу?", "Удаление группы", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){ Group g = (Group)grpList.getSelectedValue(); ms.deleteGroup(g.getGroup_id()); ms.removeItemsFromGroup(g); // reloadItems(); reloadGroups(); } } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } } }; t.start(); } // метод - создать новую группу private void insertGroup(){ Thread t = new Thread(){ public void run(){ GroupInsertDilog gid = new GroupInsertDilog(); // Задаем ему режим модальности - нельзя ничего кроме него выделить gid.setModal(true); // Показываем диалог gid.setVisible(true); if(gid.getResult()){ //reloadItems(); reloadGroups();} } }; t.start(); } // метод - внести изменения в группу private void updateGroup(){ Thread t = new Thread(){ public void run(){ if(grpList != null){ if(grpList.getSelectedValue() != null){ ChangeGroupDilog cgd = new ChangeGroupDilog((Group)grpList.getSelectedValue()); cgd.setModal(true); cgd.setVisible(true); if(cgd.getResult()){ reloadGroups(); } } } } }; t.start(); } // метод для переноса деталей в иную группу private void moveTOGroup() { Thread t = new Thread() { public void run() { if(itemList == null)return; // Если группа не выделена - выходим. Хотя это крайне маловероятно if (itemList.getSelectedRows().length == 0) { JOptionPane.showMessageDialog(MainFrame.this, "Необходимо выделить деталь в списке"); return; } if(itemList.getSelectedRows().length > 0){ GroupDialog gd = null; try { gd = new GroupDialog(ms.getGroups()); // Задаем ему режим модальности - нельзя ничего кроме него выделить gd.setModal(true); // Показываем диалог gd.setVisible(true); } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } if (gd.getResult()) { ItemTableModel itm = (ItemTableModel) itemList.getModel(); Item item; for (int i = 0; i < itemList.getSelectedRows().length; i++) { try { item = itm.getItem(itemList.getSelectedRows()[i]); ms.moveItemsToGroup(item, gd.getGroup()); } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } }} reloadItems(); } } }; t.start(); } // метод для очистки группы private void clearGroup() { Thread t = new Thread() { public void run() { // Проверяем - выделена ли группа if (grpList.getSelectedValue() != null) { if (JOptionPane.showConfirmDialog(MainFrame.this, "Вы хотите удалить детали из группы?", "Удаление деталей", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { // Получаем выделенную группу Group g = (Group) grpList.getSelectedValue(); try { // Удалили детали из группы ms.removeItemsFromGroup(g); // перегрузили список деталей reloadItems(); } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } } } }; t.start(); } // метод для добавления детали private void insertItem() { Thread t = new Thread() { public void run() { if(grpList != null){ try { // Добавляем новую деталь - поэтому true // Также заметим, что необходимо указать не просто this, а MainFrame.this // Иначе класс не будет воспринят - он же другой - анонимный Group g = (Group) grpList.getSelectedValue(); ItemDialog sd = new ItemDialog(ms.getGroups()); sd.setModal(true); sd.setVisible(true); if (sd.getResult()) { Item s = sd.getItem(); s.setGroupId(g.getGroup_id()); ms.insertItem(s); reloadItems(); } } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } } }; t.start(); } // метод для редактирования детали private void updateItem() { Thread t = new Thread() { public void run() { if (itemList != null) { ItemTableModel stm = (ItemTableModel) itemList.getModel(); // Проверяем - выделен ли хоть какая-нибудь деталь if (itemList.getSelectedRow() >= 0) { // Вот где нам пригодился метод getItem(int rowIndex) Item s = stm.getItem(itemList.getSelectedRow()); try { // Исправляем данные на деталь - поэтому false // Также заметим, что необходимо указать не просто this, а MainFrame.this // Иначе класс не будет воспринят - он же другой - анонимный ItemDialog sd = new ItemDialog(ms.getGroups()); sd.setItem(s); sd.setModal(true); sd.setVisible(true); if (sd.getResult()) { Item us = sd.getItem(); ms.updateItem(us); reloadItems(); } } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } // Если деталь не выделена - сообщаем пользователю, что это необходимо else { JOptionPane.showMessageDialog(MainFrame.this, "Необходимо выделить деталь в списке"); } } } }; t.start(); } // метод для удаления детали private void deleteItem() { Thread t = new Thread() { public void run() { if (itemList != null) { ItemTableModel itmstm = (ItemTableModel) itemList.getModel(); // Проверяем - выделена ли хоть какая-нибудь деталь if (itemList.getSelectedRows().length > 0) { if (JOptionPane.showConfirmDialog(MainFrame.this, "Вы хотите удалить деталь?", "Удаление детали", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { // Вот где нам пригодился метод getItem(int rowIndex) Item s; for (int i = 0; i < itemList.getSelectedRows().length; i++) { s = itmstm.getItem(itemList.getSelectedRows()[i]); try { ms.deleteItem(s); } catch (SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } reloadItems(); } } // Если деталь не выделена - сообщаем пользователю, что это необходимо else { JOptionPane.showMessageDialog(MainFrame.this, "Необходимо выделить деталь в списке"); } } } }; t.start(); } // метод для показа всех деталей private void showAllItems() { Thread t = new Thread(){ public void run(){ if(itemList != null){ try { SearchFrame sf = new SearchFrame(false,false,false,true,MainFrame.this,null); sf.setDefaultCloseOperation(HIDE_ON_CLOSE); sf.setVisible(true); sf.setAlwaysOnTop(true); sf.reloadItems(); } catch (Exception e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } else return; reloadItems(); } }; t.start(); } private void searchItem(){ Thread t = new Thread(){ public void run(){ if(itemList != null){ try { SearchDilog sd = new SearchDilog(MainFrame.this); sd.setModal(true); sd.setVisible(true); if (sd.getResult()) { //sf = new SearchFrame(); reloadItems(); } } catch (Exception e){//(SQLException e) { JOptionPane.showMessageDialog(MainFrame.this, e.getMessage()); e.printStackTrace(); } } else return; } // } }; t.start(); } private void printReport(){ Thread t = new Thread(){ public void run() { if (itemList != null){ if(selected.size()>0){ Vector<Item> list = new Vector<>(); for (int i = 0; i < selected.size(); i++) { if(selected.get(i).getPrint()){ Item it = selected.get(i); it.setPrint(false); list.add(selected.get(i)); } } PrintFrame pf = new PrintFrame(list, MainFrame.this,null); pf.setDefaultCloseOperation(HIDE_ON_CLOSE); pf.setVisible(true); pf.reloadItems(); selected.clear(); reloadItems(); }else JOptionPane.showMessageDialog(MainFrame.this, "Необходимо отметить деталь в списке"); return; } } }; t.start(); } private void updateRates(){ Thread t = new Thread(){ public void run(){ RatesDilog rd = new RatesDilog(); rd.setModal(true); rd.setVisible(true); if (rd.getResult()) { reloadItems(); } } }; t.start(); } private void soldBase(){ Thread t = new Thread(){ public void run(){ try{ SoldFrame sf = new SoldFrame(); sf.setDefaultCloseOperation(HIDE_ON_CLOSE); sf.setVisible(true); sf.reloadItems();} catch (Exception ex){ ex.printStackTrace(); } } }; t.start(); } public Vector<Item> getSelected(){return selected;} private class TableSearchRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { setBackground(null); Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if(vector.get(row).getIn_stock() == 0)component.setBackground(Color.RED); else if(vector.get(row).getIn_stock() > 0 && vector.get(row).getIn_stock() < 3)component.setBackground(Color.YELLOW); else component.setBackground(table.getBackground()); if(table.isCellSelected(row,column)){component.setBackground(Color.GRAY);} return component; } } private static class MyTableHeaderRenderer implements TableCellRenderer { private static final Font labelFont = new Font("Arial", Font.BOLD, 11); private TableCellRenderer delegate; public MyTableHeaderRenderer(TableCellRenderer delegate) { this.delegate = delegate; } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component c = delegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if(c instanceof JLabel) { JLabel label = (JLabel) c; label.setFont(labelFont); label.setHorizontalAlignment(SwingConstants.CENTER); label.setBorder(BorderFactory.createEtchedBorder()); } return c; } } public static void main(String args[]) { SwingUtilities.invokeLater(new Runnable() { public void run() { // Мы сразу отменим продолжение работы, если не сможем получить // коннект к базе данных LoginDilog ld = new LoginDilog(); ld.setVisible(true); } }); } // Наш внутренний класс - переопределенная панель. class GroupPanel extends JPanel { public Dimension getPreferredSize() { return new Dimension(300, 0); } }}
[ "grisha-chapliy@rambler.ru" ]
grisha-chapliy@rambler.ru
b5ee2c990d41e427f8b00ed163b517ed9b5ae138
60eae98dcdfe8069971327b8dc1b6a9d9e5ef8db
/src/test/java/com/lmig/gfc/rpn/models/AbsoluterOfOneNumberTests.java
e778aeb1318978ab50699635f788456614f69548
[]
no_license
dlhall123/rpn_calculator
2e9b9c568d5a57e7cf6d2f74404d8fb537bddaca
9eb653eb6dd821352800b2d83370b699f4c0178e
refs/heads/master
2021-08-22T06:34:41.750742
2017-11-29T14:48:13
2017-11-29T14:48:13
112,355,025
0
0
null
null
null
null
UTF-8
Java
false
false
1,625
java
package com.lmig.gfc.rpn.models; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; import java.util.EmptyStackException; import java.util.Stack; import org.junit.Before; import org.junit.Test; public class AbsoluterOfOneNumberTests { private Stack<Double> stack; private AbsoluterOfOneNumber abs; @Before public void setUp() { stack = new Stack<Double>(); abs = new AbsoluterOfOneNumber(stack); } @Test public void goDoIt_replaces_neg_number_on_stack_with_positive_number() { // Arrange stack.push(-4.5); // Act abs.goDoIt(); // Assert assertThat(stack.peek()).isEqualTo(4.5); } @Test public void goDoIt_leaves_pos_num_on_stack_pos() { // Arrange stack.push(4.5); // Act abs.goDoIt(); // Assert assertThat(stack.peek()).isEqualTo(4.5); } @Test public void undo_returns_the_stack_to_the_previous_state() { // Arrange stack.push(-999.0); abs.goDoIt(); // Act abs.undo(stack); // Assert assertThat(stack.peek()).isEqualTo(-999.0); } @Test public void empty_stack_causes_goDoIt_to_throw_EmptyStackException() { // Arrange // Already arranged because stack is empty try { // Act abs.goDoIt(); // Assert fail("Did not throw an EmptyStackException"); } catch (EmptyStackException ese) { } } @Test public void null_stack_causes_goDoIt_to_throw_NullPointerException() { // Arrange abs = new AbsoluterOfOneNumber(null); try { // Act abs.goDoIt(); // Assert fail("Did not throw NullPointerException"); } catch (NullPointerException npe) { } } }
[ "david.hall@libertymutual.com" ]
david.hall@libertymutual.com
4f0aedcce24b35241814cb5a42b6b234300d4533
03bfb7323ccdc27f2b71904bb6bf926bf2ff089b
/Collaboration/src/main/java/com/niit/collaboration/daoimpl/EventDAOImpl.java
58e1079c6f74f41a28d258bf027a3de665c6cfd5
[]
no_license
Shailly16/Collaboration
f7752992cb1e22ecee389c154627a90ede3c5f93
fa195a47db130a94c6f3c9e0b77f56d6f5babc58
refs/heads/master
2021-01-21T11:37:41.607418
2017-03-22T14:49:24
2017-03-22T14:49:24
83,579,921
0
0
null
null
null
null
UTF-8
Java
false
false
1,790
java
package com.niit.collaboration.daoimpl; import java.util.List; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import com.niit.collaboration.dao.EventDAO; import com.niit.collaboration.model.Event; @Repository("eventDAO") public class EventDAOImpl implements EventDAO { @Autowired SessionFactory sessionFactory; public EventDAOImpl(SessionFactory sessionFactory){ this.sessionFactory = sessionFactory; } @Transactional public boolean save(Event event) { try { sessionFactory.getCurrentSession().save(event); return true; } catch (HibernateException e) { e.printStackTrace(); return false; } } @Transactional public boolean update(Event event) { try { sessionFactory.getCurrentSession().update(event); return true; } catch (HibernateException e) { e.printStackTrace(); return false; } } @Transactional public boolean delete(Event event) { try { sessionFactory.getCurrentSession().delete(event); return true; } catch (HibernateException e) { e.printStackTrace(); return false; } } @Transactional public List<Event> list() { String hql = "from Event"; Query query = sessionFactory.getCurrentSession().createQuery(hql); return query.list(); } @Transactional public Event get(String id) { String hql = "from Event where id = " + "'" + id + "'"; Query query = sessionFactory.getCurrentSession().createQuery(hql); List<Event> list = query.list(); if (list == null) { return null; } else { return list.get(0); } } }
[ "shaillygarg16@gmail.com" ]
shaillygarg16@gmail.com
56cba5ae8c983abd3991949911f1cc9a008e4300
07f6a3a7141523ba3fa969d0768f3aac146a577c
/app/src/main/java/cn/vko/ring/im/main/helper/MessageHelper.java
9d08604a1300e629658cc8ca47a9f753d46df4ce
[]
no_license
ShahbazExpress/VKO_AND
c2753c7614e846aeec53aeb85b9ca05358291eec
38a7f78ca29525a6b11c9c1f8cc0d771511b13c0
refs/heads/master
2021-12-16T12:13:53.676663
2017-09-19T06:09:52
2017-09-19T06:09:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,924
java
package cn.vko.ring.im.main.helper; import android.text.TextUtils; import com.netease.nim.uikit.cache.NimUserInfoCache; import com.netease.nim.uikit.cache.TeamDataCache; import com.netease.nimlib.sdk.friend.model.AddFriendNotify; import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum; import com.netease.nimlib.sdk.msg.constant.SystemMessageStatus; import com.netease.nimlib.sdk.msg.constant.SystemMessageType; import com.netease.nimlib.sdk.msg.model.SystemMessage; import com.netease.nimlib.sdk.team.model.Team; /** * Created by huangjun on 2015/4/9. */ public class MessageHelper { public static String getName(String account, SessionTypeEnum sessionType) { if (sessionType == SessionTypeEnum.P2P) { return NimUserInfoCache.getInstance().getUserDisplayName(account); } else if (sessionType == SessionTypeEnum.Team) { return TeamDataCache.getInstance().getTeamName(account); } return account; } public static String getVerifyNotificationText(SystemMessage message) { StringBuilder sb = new StringBuilder(); String fromAccount = NimUserInfoCache.getInstance().getUserDisplayNameYou(message.getFromAccount()); Team team = TeamDataCache.getInstance().getTeamById(message.getTargetId()); if (team == null && message.getAttachObject() instanceof Team) { team = (Team) message.getAttachObject(); } String teamName = team == null ? message.getTargetId() : team.getName(); if (message.getType() == SystemMessageType.TeamInvite) { sb.append("邀请").append("你").append("加入群 ").append(teamName); } else if (message.getType() == SystemMessageType.DeclineTeamInvite) { sb.append(fromAccount).append("拒绝了群 ").append(teamName).append(" 邀请"); } else if (message.getType() == SystemMessageType.ApplyJoinTeam) { sb.append("申请加入群 ").append(teamName); } else if (message.getType() == SystemMessageType.RejectTeamApply) { sb.append(fromAccount).append("拒绝了你加入群 ").append(teamName).append("的申请"); } else if (message.getType() == SystemMessageType.AddFriend) { AddFriendNotify attachData = (AddFriendNotify) message.getAttachObject(); if (attachData != null) { if (attachData.getEvent() == AddFriendNotify.Event.RECV_ADD_FRIEND_DIRECT) { sb.append("已添加你为好友"); } else if (attachData.getEvent() == AddFriendNotify.Event.RECV_AGREE_ADD_FRIEND) { sb.append("通过了你的好友请求"); } else if (attachData.getEvent() == AddFriendNotify.Event.RECV_REJECT_ADD_FRIEND) { sb.append("拒绝了你的好友请求"); } else if (attachData.getEvent() == AddFriendNotify.Event.RECV_ADD_FRIEND_VERIFY_REQUEST) { sb.append("请求添加好友" + (TextUtils.isEmpty(message.getContent()) ? "" : ":" + message.getContent())); } } } return sb.toString(); } /** * 是否验证消息需要处理(需要有同意拒绝的操作栏) */ public static boolean isVerifyMessageNeedDeal(SystemMessage message) { if (message.getType() == SystemMessageType.AddFriend) { if (message.getAttachObject() != null) { AddFriendNotify attachData = (AddFriendNotify) message.getAttachObject(); if (attachData.getEvent() == AddFriendNotify.Event.RECV_ADD_FRIEND_DIRECT || attachData.getEvent() == AddFriendNotify.Event.RECV_AGREE_ADD_FRIEND || attachData.getEvent() == AddFriendNotify.Event.RECV_REJECT_ADD_FRIEND) { return false; // 对方直接加你为好友,对方通过你的好友请求,对方拒绝你的好友请求 } else if (attachData.getEvent() == AddFriendNotify.Event.RECV_ADD_FRIEND_VERIFY_REQUEST) { return true; // 好友验证请求 } } return false; } else if (message.getType() == SystemMessageType.TeamInvite || message.getType() == SystemMessageType.ApplyJoinTeam) { return true; } else { return false; } } public static String getVerifyNotificationDealResult(SystemMessage message) { if (message.getStatus() == SystemMessageStatus.passed) { return "已同意"; } else if (message.getStatus() == SystemMessageStatus.declined) { return "已拒绝"; } else if (message.getStatus() == SystemMessageStatus.ignored) { return "已忽略"; } else if (message.getStatus() == SystemMessageStatus.expired) { return "已过期"; } else { return "未处理"; } } }
[ "380712098@qq.com" ]
380712098@qq.com
40c97f163fa03d68464dc4c1b95bfd93f38e6b40
d5e5173af862553330c2eea6367181b4b87344b3
/PacientesWSSecurityClient/src/main/java/net/euskadi/osakidetza/libs/wsclients/k01/v1/security/pacientesws/Paciente.java
2670d831d6eff7888b4b47db2847a8c4d7f35b4b
[ "Apache-2.0" ]
permissive
egvinaspre/wsssecurityclient
68656c72e19ceb4bb687b90c4af56a3ba660435e
1fa120887224351b3c9f1398d0ec08402b8cb2f4
refs/heads/master
2021-01-25T09:26:25.773638
2017-08-11T07:41:32
2017-08-11T07:41:32
93,834,893
0
0
null
null
null
null
UTF-8
Java
false
false
23,053
java
package net.euskadi.osakidetza.libs.wsclients.k01.v1.security.pacientesws; import java.math.BigDecimal; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; /** * <p>Clase Java para paciente complex type. * * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase. * * <pre> * &lt;complexType name="paciente"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="nombre" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="apellido1" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/> * &lt;element name="apellido2" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/> * &lt;element name="dni" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="tis" type="{http://www.w3.org/2001/XMLSchema}decimal" minOccurs="0" form="qualified"/> * &lt;element name="tisTipo" type="{http://xmlns.osakidetza.com/cdc}tisTipo" minOccurs="0" form="qualified"/> * &lt;element name="nas" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="sns" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="tse" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="institucionTse" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="codigoPaisEmisorTse" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="fechaExpiracionTse" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0" form="qualified"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}sexo" minOccurs="0"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}idioma" minOccurs="0"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}parentesco" minOccurs="0"/> * &lt;element name="fechaNacimiento" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0" form="qualified"/> * &lt;element name="codigoPaisNacimiento" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="fechaFallecimiento" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0" form="qualified"/> * &lt;element name="codigoCupo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}cobertura" minOccurs="0"/> * &lt;element name="farmacia" type="{http://www.w3.org/2001/XMLSchema}decimal" minOccurs="0" form="qualified"/> * &lt;element name="dva" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="centroPrimaria" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}domicilio" minOccurs="0"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}prestacion" minOccurs="0"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}regimen" minOccurs="0"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}situacion" minOccurs="0"/> * &lt;element ref="{http://xmlns.osakidetza.com/cdc}titularidad" minOccurs="0"/> * &lt;element name="telefonoMovil" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="telefonoDomicilio" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="telefonoTrabajo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="email" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0" form="qualified"/> * &lt;element name="baja" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0" form="qualified"/> * &lt;/sequence> * &lt;attribute ref="{http://xmlns.osakidetza.com/cdc}cic use="required""/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "paciente", propOrder = { "nombre", "apellido1", "apellido2", "dni", "tis", "tisTipo", "nas", "sns", "tse", "institucionTse", "codigoPaisEmisorTse", "fechaExpiracionTse", "sexo", "idioma", "parentesco", "fechaNacimiento", "codigoPaisNacimiento", "fechaFallecimiento", "codigoCupo", "cobertura", "farmacia", "dva", "centroPrimaria", "domicilio", "prestacion", "regimen", "situacion", "titularidad", "telefonoMovil", "telefonoDomicilio", "telefonoTrabajo", "email", "baja" }) public class Paciente { protected String nombre; @XmlElement(required = true) protected String apellido1; @XmlElement(required = true) protected String apellido2; protected String dni; protected BigDecimal tis; protected TisTipo tisTipo; protected String nas; protected String sns; protected String tse; protected String institucionTse; protected String codigoPaisEmisorTse; @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar fechaExpiracionTse; protected Sexo sexo; protected Idioma idioma; protected Parentesco parentesco; @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar fechaNacimiento; protected String codigoPaisNacimiento; @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar fechaFallecimiento; protected String codigoCupo; protected Cobertura cobertura; protected BigDecimal farmacia; protected String dva; protected String centroPrimaria; protected Domicilio domicilio; protected Prestacion prestacion; protected Regimen regimen; protected Situacion situacion; protected Titularidad titularidad; protected String telefonoMovil; protected String telefonoDomicilio; protected String telefonoTrabajo; protected String email; protected Boolean baja; @XmlAttribute(name = "cic", namespace = "http://xmlns.osakidetza.com/cdc", required = true) protected long cic; /** * Obtiene el valor de la propiedad nombre. * * @return * possible object is * {@link String } * */ public String getNombre() { return nombre; } /** * Define el valor de la propiedad nombre. * * @param value * allowed object is * {@link String } * */ public void setNombre(String value) { this.nombre = value; } /** * Obtiene el valor de la propiedad apellido1. * * @return * possible object is * {@link String } * */ public String getApellido1() { return apellido1; } /** * Define el valor de la propiedad apellido1. * * @param value * allowed object is * {@link String } * */ public void setApellido1(String value) { this.apellido1 = value; } /** * Obtiene el valor de la propiedad apellido2. * * @return * possible object is * {@link String } * */ public String getApellido2() { return apellido2; } /** * Define el valor de la propiedad apellido2. * * @param value * allowed object is * {@link String } * */ public void setApellido2(String value) { this.apellido2 = value; } /** * Obtiene el valor de la propiedad dni. * * @return * possible object is * {@link String } * */ public String getDni() { return dni; } /** * Define el valor de la propiedad dni. * * @param value * allowed object is * {@link String } * */ public void setDni(String value) { this.dni = value; } /** * Obtiene el valor de la propiedad tis. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getTis() { return tis; } /** * Define el valor de la propiedad tis. * * @param value * allowed object is * {@link BigDecimal } * */ public void setTis(BigDecimal value) { this.tis = value; } /** * Obtiene el valor de la propiedad tisTipo. * * @return * possible object is * {@link TisTipo } * */ public TisTipo getTisTipo() { return tisTipo; } /** * Define el valor de la propiedad tisTipo. * * @param value * allowed object is * {@link TisTipo } * */ public void setTisTipo(TisTipo value) { this.tisTipo = value; } /** * Obtiene el valor de la propiedad nas. * * @return * possible object is * {@link String } * */ public String getNas() { return nas; } /** * Define el valor de la propiedad nas. * * @param value * allowed object is * {@link String } * */ public void setNas(String value) { this.nas = value; } /** * Obtiene el valor de la propiedad sns. * * @return * possible object is * {@link String } * */ public String getSns() { return sns; } /** * Define el valor de la propiedad sns. * * @param value * allowed object is * {@link String } * */ public void setSns(String value) { this.sns = value; } /** * Obtiene el valor de la propiedad tse. * * @return * possible object is * {@link String } * */ public String getTse() { return tse; } /** * Define el valor de la propiedad tse. * * @param value * allowed object is * {@link String } * */ public void setTse(String value) { this.tse = value; } /** * Obtiene el valor de la propiedad institucionTse. * * @return * possible object is * {@link String } * */ public String getInstitucionTse() { return institucionTse; } /** * Define el valor de la propiedad institucionTse. * * @param value * allowed object is * {@link String } * */ public void setInstitucionTse(String value) { this.institucionTse = value; } /** * Obtiene el valor de la propiedad codigoPaisEmisorTse. * * @return * possible object is * {@link String } * */ public String getCodigoPaisEmisorTse() { return codigoPaisEmisorTse; } /** * Define el valor de la propiedad codigoPaisEmisorTse. * * @param value * allowed object is * {@link String } * */ public void setCodigoPaisEmisorTse(String value) { this.codigoPaisEmisorTse = value; } /** * Obtiene el valor de la propiedad fechaExpiracionTse. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getFechaExpiracionTse() { return fechaExpiracionTse; } /** * Define el valor de la propiedad fechaExpiracionTse. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setFechaExpiracionTse(XMLGregorianCalendar value) { this.fechaExpiracionTse = value; } /** * Obtiene el valor de la propiedad sexo. * * @return * possible object is * {@link Sexo } * */ public Sexo getSexo() { return sexo; } /** * Define el valor de la propiedad sexo. * * @param value * allowed object is * {@link Sexo } * */ public void setSexo(Sexo value) { this.sexo = value; } /** * Obtiene el valor de la propiedad idioma. * * @return * possible object is * {@link Idioma } * */ public Idioma getIdioma() { return idioma; } /** * Define el valor de la propiedad idioma. * * @param value * allowed object is * {@link Idioma } * */ public void setIdioma(Idioma value) { this.idioma = value; } /** * Obtiene el valor de la propiedad parentesco. * * @return * possible object is * {@link Parentesco } * */ public Parentesco getParentesco() { return parentesco; } /** * Define el valor de la propiedad parentesco. * * @param value * allowed object is * {@link Parentesco } * */ public void setParentesco(Parentesco value) { this.parentesco = value; } /** * Obtiene el valor de la propiedad fechaNacimiento. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getFechaNacimiento() { return fechaNacimiento; } /** * Define el valor de la propiedad fechaNacimiento. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setFechaNacimiento(XMLGregorianCalendar value) { this.fechaNacimiento = value; } /** * Obtiene el valor de la propiedad codigoPaisNacimiento. * * @return * possible object is * {@link String } * */ public String getCodigoPaisNacimiento() { return codigoPaisNacimiento; } /** * Define el valor de la propiedad codigoPaisNacimiento. * * @param value * allowed object is * {@link String } * */ public void setCodigoPaisNacimiento(String value) { this.codigoPaisNacimiento = value; } /** * Obtiene el valor de la propiedad fechaFallecimiento. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getFechaFallecimiento() { return fechaFallecimiento; } /** * Define el valor de la propiedad fechaFallecimiento. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setFechaFallecimiento(XMLGregorianCalendar value) { this.fechaFallecimiento = value; } /** * Obtiene el valor de la propiedad codigoCupo. * * @return * possible object is * {@link String } * */ public String getCodigoCupo() { return codigoCupo; } /** * Define el valor de la propiedad codigoCupo. * * @param value * allowed object is * {@link String } * */ public void setCodigoCupo(String value) { this.codigoCupo = value; } /** * Obtiene el valor de la propiedad cobertura. * * @return * possible object is * {@link Cobertura } * */ public Cobertura getCobertura() { return cobertura; } /** * Define el valor de la propiedad cobertura. * * @param value * allowed object is * {@link Cobertura } * */ public void setCobertura(Cobertura value) { this.cobertura = value; } /** * Obtiene el valor de la propiedad farmacia. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getFarmacia() { return farmacia; } /** * Define el valor de la propiedad farmacia. * * @param value * allowed object is * {@link BigDecimal } * */ public void setFarmacia(BigDecimal value) { this.farmacia = value; } /** * Obtiene el valor de la propiedad dva. * * @return * possible object is * {@link String } * */ public String getDva() { return dva; } /** * Define el valor de la propiedad dva. * * @param value * allowed object is * {@link String } * */ public void setDva(String value) { this.dva = value; } /** * Obtiene el valor de la propiedad centroPrimaria. * * @return * possible object is * {@link String } * */ public String getCentroPrimaria() { return centroPrimaria; } /** * Define el valor de la propiedad centroPrimaria. * * @param value * allowed object is * {@link String } * */ public void setCentroPrimaria(String value) { this.centroPrimaria = value; } /** * Obtiene el valor de la propiedad domicilio. * * @return * possible object is * {@link Domicilio } * */ public Domicilio getDomicilio() { return domicilio; } /** * Define el valor de la propiedad domicilio. * * @param value * allowed object is * {@link Domicilio } * */ public void setDomicilio(Domicilio value) { this.domicilio = value; } /** * Obtiene el valor de la propiedad prestacion. * * @return * possible object is * {@link Prestacion } * */ public Prestacion getPrestacion() { return prestacion; } /** * Define el valor de la propiedad prestacion. * * @param value * allowed object is * {@link Prestacion } * */ public void setPrestacion(Prestacion value) { this.prestacion = value; } /** * Obtiene el valor de la propiedad regimen. * * @return * possible object is * {@link Regimen } * */ public Regimen getRegimen() { return regimen; } /** * Define el valor de la propiedad regimen. * * @param value * allowed object is * {@link Regimen } * */ public void setRegimen(Regimen value) { this.regimen = value; } /** * Obtiene el valor de la propiedad situacion. * * @return * possible object is * {@link Situacion } * */ public Situacion getSituacion() { return situacion; } /** * Define el valor de la propiedad situacion. * * @param value * allowed object is * {@link Situacion } * */ public void setSituacion(Situacion value) { this.situacion = value; } /** * Obtiene el valor de la propiedad titularidad. * * @return * possible object is * {@link Titularidad } * */ public Titularidad getTitularidad() { return titularidad; } /** * Define el valor de la propiedad titularidad. * * @param value * allowed object is * {@link Titularidad } * */ public void setTitularidad(Titularidad value) { this.titularidad = value; } /** * Obtiene el valor de la propiedad telefonoMovil. * * @return * possible object is * {@link String } * */ public String getTelefonoMovil() { return telefonoMovil; } /** * Define el valor de la propiedad telefonoMovil. * * @param value * allowed object is * {@link String } * */ public void setTelefonoMovil(String value) { this.telefonoMovil = value; } /** * Obtiene el valor de la propiedad telefonoDomicilio. * * @return * possible object is * {@link String } * */ public String getTelefonoDomicilio() { return telefonoDomicilio; } /** * Define el valor de la propiedad telefonoDomicilio. * * @param value * allowed object is * {@link String } * */ public void setTelefonoDomicilio(String value) { this.telefonoDomicilio = value; } /** * Obtiene el valor de la propiedad telefonoTrabajo. * * @return * possible object is * {@link String } * */ public String getTelefonoTrabajo() { return telefonoTrabajo; } /** * Define el valor de la propiedad telefonoTrabajo. * * @param value * allowed object is * {@link String } * */ public void setTelefonoTrabajo(String value) { this.telefonoTrabajo = value; } /** * Obtiene el valor de la propiedad email. * * @return * possible object is * {@link String } * */ public String getEmail() { return email; } /** * Define el valor de la propiedad email. * * @param value * allowed object is * {@link String } * */ public void setEmail(String value) { this.email = value; } /** * Obtiene el valor de la propiedad baja. * * @return * possible object is * {@link Boolean } * */ public Boolean isBaja() { return baja; } /** * Define el valor de la propiedad baja. * * @param value * allowed object is * {@link Boolean } * */ public void setBaja(Boolean value) { this.baja = value; } /** * Obtiene el valor de la propiedad cic. * */ public long getCic() { return cic; } /** * Define el valor de la propiedad cic. * */ public void setCic(long value) { this.cic = value; } }
[ "Eduardo González de Viñaspre" ]
Eduardo González de Viñaspre
09400e9c67c5c294905c7af9aea7921da7f6d4aa
e6f92db1a0e2f69345f76ed41399e8fec781f42c
/src/main/java/com/databasedesign/ecommerce/utils/WebUtils.java
fb9237b7e77dc9f460c8220a79f5d9c2e8a3fbf8
[]
no_license
Necro1yte/e-commerce-website-SCUT
8b0ac7b6601da0928d0c03ed3d5f0258ee6864e6
e801e245626efe2f8ac29d3454ab4a2551505f53
refs/heads/master
2023-03-20T13:32:45.623110
2021-03-15T02:21:17
2021-03-15T02:21:17
347,810,458
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package com.databasedesign.ecommerce.utils; import javax.servlet.http.HttpServletRequest; public class WebUtils { public static String getBaseURL(HttpServletRequest request){ String baseURL = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath(); return baseURL; } }
[ "291847062@qq.com" ]
291847062@qq.com
8211eb43f7ab332a75fb3404e039d946426a9425
bb443ff6acd8dd10dfbd6d7ebff6365258a780c0
/src/test/java/com/tt/spring5recipeapp/Spring5RecipeAppApplicationTests.java
be468102f9a3672245b1f9ecb2f4c02a8b232397
[]
no_license
tolgatuna/Udemy_Spring5BeginnerToGuru_RecipeApp
c87d0ffb3b60dfc3e085fb94d713ffb6b457beb3
016f9a0f4373b358ad95ab7c4cfffadb3bac0cb2
refs/heads/master
2020-03-25T02:39:18.721537
2018-08-29T14:15:53
2018-08-29T14:15:53
143,300,526
0
0
null
null
null
null
UTF-8
Java
false
false
359
java
package com.tt.spring5recipeapp; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class Spring5RecipeAppApplicationTests { @Test public void contextLoads() { } }
[ "tolga.tuna@etstur.com" ]
tolga.tuna@etstur.com
f3109083fc665e5fd8a449acff8e505f55daf0ff
ca376e37d2715686ff29ce66225516ee53333659
/services/hrdb/src/com/auto_erpixegykb/hrdb/controller/QueryExecutionController.java
38176790cec16104a7607b59e38202f74c23730e
[]
no_license
wavemakerapps/Auto_eRPIxEgYkB
65bb084b96b04422eb80214bb2da59c7391bdabe
9f011fe380ed5b0ad1da806033be52df3b7bffbd
refs/heads/master
2020-03-19T10:38:57.222811
2018-06-06T21:46:58
2018-06-06T21:46:58
136,389,379
0
0
null
null
null
null
UTF-8
Java
false
false
874
java
/*Copyright (c) 2015-2016 wavemaker.com All Rights Reserved. This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the source code license agreement you entered into with wavemaker.com*/ package com.auto_erpixegykb.hrdb.controller; /*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.wordnik.swagger.annotations.Api; @RestController(value = "Hrdb.QueryExecutionController") @RequestMapping("/hrdb/queryExecutor") @Api(value = "QueryExecutionController", description = "controller class for query execution") public class QueryExecutionController { }
[ "automate1@wavemaker.com" ]
automate1@wavemaker.com
4dfd4abb7ef803d31ac8a647c393f767ed8dbaff
8050223dee434cd3982e0956492dd56d1c261f65
/src/menu/MenuController.java
76bb2ceee2e0fc63c263dbaa313aa11f5cf0366a
[]
no_license
ErykKrupa/snake
14b6b35ac95a007e8a8c701a018edbd688eadcee
901659eb59746dd70055c496f93e0061d1da0f41
refs/heads/master
2020-03-25T17:34:48.429749
2018-08-20T20:49:26
2018-08-20T20:49:26
143,984,432
1
0
null
null
null
null
UTF-8
Java
false
false
4,646
java
package menu; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.geometry.VPos; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.Label; import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.GridPane; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.scene.text.Font; import java.io.*; import java.util.Optional; import static main.Main.*; public class MenuController { @FXML private void playClick() throws IOException { stage.setTitle("Difficulty"); Parent parent = FXMLLoader.load(getClass().getResource("../difficulty/difficulty.fxml")); stage.setScene(new Scene(parent)); } @FXML private void highScoresClick() throws IOException { stage.setTitle("High Scores"); Pane pane = FXMLLoader.load(getClass().getResource("../highscores/highscores.fxml")); GridPane gridPane = new GridPane(); for(int i = 1; i <= 6; i++) if(i % 2 == 1) gridPane.getColumnConstraints().add(new ColumnConstraints(130)); else gridPane.getColumnConstraints().add(new ColumnConstraints(50)); Label[][] labels = new Label[6][10]; for(int i = 0; i < 6; i += 2) { String filePath = "highscores\\highscores" + (i / 2 + 1); try(DataInputStream inputStream = new DataInputStream(new FileInputStream(filePath))) { for(int j = 0; j < 10; j++) { try { labels[i][j] = new Label(j + 1 + ". " + inputStream.readUTF()); labels[i + 1][j] = new Label(Integer.toString(inputStream.readInt())); } catch(IOException ioe) { labels[i][j] = new Label(j + 1 + ". ...................."); labels[i + 1][j] = new Label("......"); } } } catch(FileNotFoundException ioe) { System.err.println("File not found."); for(int j = 0; j < 10; j++) { labels[i][j] = new Label(j + 1 + ". ...................."); labels[i + 1][j] = new Label("......"); } } for(int j = 0; j < 10; j++) { labels[i][j].setFont(new Font("Monotype Corsiva", 18)); labels[i + 1][j].setFont(new Font("Monotype Corsiva", 18)); GridPane.setConstraints(labels[i][j], i, j); GridPane.setConstraints(labels[i + 1][j], i + 1, j); GridPane.setMargin(labels[i][j], new Insets(5, 10, 5, 10)); GridPane.setMargin(labels[i + 1][j], new Insets(5, 10, 5, 10)); gridPane.getChildren().addAll(labels[i][j], labels[i + 1][j]); } } Button button = new Button("OK"); button.setFont(new Font("Monotype Corsiva", 18)); button.setMaxSize(100, 20); button.setOnAction(event -> { try { stage.setTitle("Snake Game"); Parent parent = FXMLLoader.load(getClass().getResource("../menu/menu.fxml")); stage.setScene(new Scene(parent, 540, 420)); stage.show(); } catch(IOException ioe) { System.err.println("IOException: " + ioe.getMessage()); } }); GridPane.setConstraints(button, 0, 10, 6, 1, HPos.CENTER, VPos.CENTER); GridPane.setMargin(button, new Insets(4)); gridPane.getChildren().add(button); stage.setScene(new Scene(new VBox(pane, gridPane))); } @FXML private void creditClick() { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle("Credit"); alert.setHeaderText(null); alert.setContentText("Author: Eryk Krupa."); alert.showAndWait(); } @FXML private void exitClick() { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle("Exit"); alert.setHeaderText(null); alert.setContentText("Are you sure, that you want to exit?"); Optional<ButtonType> result = alert.showAndWait(); if(result.isPresent() && result.get() == ButtonType.OK) System.exit(0); } }
[ "erykkrupa1@gmail.com" ]
erykkrupa1@gmail.com
5d67d890a638236dde439d3a48ee62c9959e269d
7984756c8896bfa1f38ba9f4a1bd58c3ea12ed52
/src/main/java/com/lyc/classmanag/controller/CommitteeController.java
93b8efb543ce4c4d2b651004e7c6e61f7cdb6f1b
[]
no_license
lblyc8/classmanagement
a7acb314e9b8907116a4369dc1884bc9d3c2c4a4
89920f284f3c7200370eeba1416d031aa1a66917
refs/heads/master
2022-12-23T22:06:22.493857
2020-05-13T09:57:52
2020-05-13T09:57:52
221,895,797
0
0
null
2022-12-16T11:18:13
2019-11-15T09:59:21
CSS
UTF-8
Java
false
false
3,091
java
package com.lyc.classmanag.controller; import com.lyc.classmanag.entity.Committee; import com.lyc.classmanag.entity.Student; import com.lyc.classmanag.entity.User; import com.lyc.classmanag.service.CommitteeService; import com.lyc.classmanag.service.StudentService; import com.lyc.classmanag.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpSession; import java.util.List; import java.util.Set; @Controller public class CommitteeController { @Autowired CommitteeService committeeService; @Autowired StudentService studentService; @Autowired UserService userService; @RequestMapping("queryCommitteeAll") public String queryCommitteeAll(Model model,HttpSession session){ User user = (User) session.getAttribute("USER_SESSION"); Set<String> roles = userService.findRole(user.getUserId()); String role = roles.iterator().next(); String page = userService.findPage(role); List<Committee> committeeList = committeeService.queryCommitteeAll(); model.addAttribute("committeeList",committeeList); return page+"/committeePage"; } @RequestMapping(value = "/insertCommittee.action",method = RequestMethod.POST) @ResponseBody public String insertCommittee(Committee committee){ Student student = studentService.findStudent(committee.getUserId(),committee.getName()); if(student!=null){ int rows = committeeService.insertCommittee(committee); if (rows>0){ return "OK"; }else{ return "FAIL"; } }else { return "FAIL"; } } @RequestMapping(value = "/deleteCommittee.action",method = RequestMethod.POST) @ResponseBody public String deleteCommittee(String UserId){ int row = committeeService.deleteCommittee(UserId); if(row>0){ return "OK"; }else{ return "FAIL"; } } @RequestMapping(value = "/queryCommitteeById.action",method = RequestMethod.GET) public @ResponseBody Committee queryCommitteeById(String UserId){ Committee committee=committeeService.queryCommitteeById(UserId); return committee; } @RequestMapping(value = "/updateCommittee.action",method = RequestMethod.POST) @ResponseBody public String updateCommittee(Committee committee){ Student student = studentService.findStudent(committee.getUserId(),committee.getName()); if(student!=null) { int rows = committeeService.updateCommittee(committee); if (rows > 0) { return "OK"; } else { return "FAIL"; } }else { return "FAIL"; } } }
[ "lblyc8@126.com" ]
lblyc8@126.com
f6ee2cba53dc348b3ac3ee66504f7e4c73521564
d82df7ef4b53d8700e82d132a62208899d6668ef
/attemper-executor/src/main/java/com/github/attemper/executor/camunda/cmd/ParentCmd.java
4d22fee010baba56392f3448f77f0ee6ce34352b
[ "MIT" ]
permissive
attemper/attemper
b8a62cd2feae71ed5acdfa59f6c2a035a4b068d5
0ba921e2ca4024e5bd7f2cfcd5ae182693ca5b74
refs/heads/master
2023-08-11T11:51:28.839614
2022-08-16T14:00:44
2022-08-16T14:00:44
233,859,859
181
62
MIT
2023-07-23T02:46:47
2020-01-14T14:29:01
Java
UTF-8
Java
false
false
692
java
package com.github.attemper.executor.camunda.cmd; import org.camunda.bpm.engine.impl.interceptor.Command; import org.camunda.bpm.engine.impl.interceptor.CommandContext; import org.springframework.jdbc.core.JdbcTemplate; import java.sql.SQLException; public abstract class ParentCmd implements Command<Void> { protected JdbcTemplate injectJdbcTemplate(CommandContext commandContext) { return new JdbcTemplate(commandContext.getProcessEngineConfiguration().getDataSource()); } protected String getDbType(JdbcTemplate jdbcTemplate) throws SQLException { return jdbcTemplate.getDataSource().getConnection().getMetaData().getDatabaseProductName().toLowerCase(); } }
[ "820704815@qq.com" ]
820704815@qq.com
67c76d7a7977030054879dcc6e9c3d38087314c2
a5935946bc84e85ffaa2faf9ee98db82d2cd0ebd
/src/main/java/br/com/josa/gameapi/repository/PlayerRepository.java
370574acb2b27af63e8a6b17799dafe4a88de659
[]
no_license
JonatasBertolazzo/gameapi
13bbc669a6e24752c8056d800bb0e7b06d1032e5
6402653f6d5d3531a96839849996376eea0d7203
refs/heads/master
2021-01-16T17:57:41.548504
2017-08-11T12:38:43
2017-08-11T12:38:43
100,029,782
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package br.com.josa.gameapi.repository; import br.com.josa.gameapi.model.Player; import org.springframework.data.mongodb.repository.MongoRepository; public interface PlayerRepository extends MongoRepository<Player, String> { }
[ "logonrm@fiap.com.br" ]
logonrm@fiap.com.br
34cbc0e515fca3be2c215e4409a7056d80135206
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/17/17_f6204a887f67f4edc91769329ab1f27389626c26/MobilityInterfaceService/17_f6204a887f67f4edc91769329ab1f27389626c26_MobilityInterfaceService_t.java
70f16bed1e99d1e6b3d43de5db0d13c7af366458
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,477
java
package edu.ucla.cens.mobility.glue; import edu.ucla.cens.mobility.Mobility; import edu.ucla.cens.mobility.MobilityControl; import edu.ucla.cens.systemlog.Log; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.IBinder; public class MobilityInterfaceService extends Service { protected static final String TAG = "Mobility"; @Override public IBinder onBind(Intent intent) { Mobility.initSystemLog(getApplicationContext()); return new IMobility.Stub() { public void stopMobility() { SharedPreferences settings = getSharedPreferences(Mobility.MOBILITY, Context.MODE_PRIVATE); if (settings.getBoolean(MobilityControl.MOBILITY_ON, false)) { Editor editor = settings.edit(); editor.putBoolean(MobilityControl.MOBILITY_ON, false); editor.commit(); Log.e(TAG, "MOBILITY_ON was just totally set to false"); Mobility.stop(getApplicationContext()); } else { Log.e(TAG, "Mobility is already off according to settings"); } } public void startMobility() { Log.e(TAG, "I got called!"); SharedPreferences settings = getSharedPreferences(Mobility.MOBILITY, Context.MODE_PRIVATE); if (!settings.getBoolean(MobilityControl.MOBILITY_ON, false)) { Editor editor = settings.edit(); editor.putBoolean(MobilityControl.MOBILITY_ON, true); editor.commit(); Log.e(TAG, "MOBILITY_ON was just totally set to true"); Mobility.start(getApplicationContext()); } else { Log.e(TAG, "Mobility is already on according to settings"); } Log.e(TAG, "MOBILITY_ON was just totally set to true unless it was already"); } /** * Set the rate in seconds to 300, 60, 30, or 15. * @param context * @param intervalInSeconds This must be 300, 60, 30, or 15. * @return true if successful, false otherwise */ public boolean changeMobilityRate(int intervalInSeconds) { for (int rate : new int [] {300, 60, 30, 15}) if (intervalInSeconds == rate) { SharedPreferences settings = getSharedPreferences(Mobility.MOBILITY, Context.MODE_PRIVATE); Editor editor = settings.edit(); editor.putInt(Mobility.SAMPLE_RATE, intervalInSeconds); editor.commit(); if (settings.getBoolean(MobilityControl.MOBILITY_ON, false)) { stopMobility(); startMobility(); } return true; } return false; } public boolean isMobilityOn() { SharedPreferences settings = getSharedPreferences(Mobility.MOBILITY, Context.MODE_PRIVATE); return settings.getBoolean(MobilityControl.MOBILITY_ON, false); } public int getMobilityInterval() { SharedPreferences settings = getSharedPreferences(Mobility.MOBILITY, Context.MODE_PRIVATE); return settings.getInt(Mobility.SAMPLE_RATE, 60); } }; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
63d042984584da4f25a55a2848b0023e8d0b26d3
91557c8d91d94c40b1b8962dcd055d78ba68e964
/src/java/org/primefaces/barcelona/view/ChartDemoView.java
4a6ec3cb1d176dfacca428daaf6262a9153b5303
[ "Apache-2.0" ]
permissive
alkuhlani/cs
6def1584877658311d13a24062437215f058ef1b
0b66e090eae450a5e166184cf94ae636bf6bd2aa
refs/heads/master
2020-04-21T23:37:59.464519
2019-02-10T07:08:01
2019-02-10T07:08:01
169,952,420
1
1
null
null
null
null
UTF-8
Java
false
false
23,049
java
/* * Copyright 2009-2014 PrimeTek. * * 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.primefaces.barcelona.view; import java.io.Serializable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; import org.primefaces.event.ItemSelectEvent; import org.primefaces.model.chart.Axis; import org.primefaces.model.chart.AxisType; import org.primefaces.model.chart.BarChartModel; import org.primefaces.model.chart.BarChartSeries; import org.primefaces.model.chart.BubbleChartModel; import org.primefaces.model.chart.BubbleChartSeries; import org.primefaces.model.chart.CartesianChartModel; import org.primefaces.model.chart.CategoryAxis; import org.primefaces.model.chart.ChartSeries; import org.primefaces.model.chart.DateAxis; import org.primefaces.model.chart.DonutChartModel; import org.primefaces.model.chart.HorizontalBarChartModel; import org.primefaces.model.chart.LineChartModel; import org.primefaces.model.chart.LineChartSeries; import org.primefaces.model.chart.LinearAxis; import org.primefaces.model.chart.MeterGaugeChartModel; import org.primefaces.model.chart.OhlcChartModel; import org.primefaces.model.chart.OhlcChartSeries; import org.primefaces.model.chart.PieChartModel; @ManagedBean(name = "chartDemoView") public class ChartDemoView implements Serializable { private LineChartModel lineModel1; private LineChartModel lineModel2; private LineChartModel zoomModel; private CartesianChartModel combinedModel; private CartesianChartModel fillToZero; private LineChartModel areaModel; private BarChartModel barModel; private HorizontalBarChartModel horizontalBarModel; private PieChartModel pieModel1; private PieChartModel pieModel2; private DonutChartModel donutModel1; private DonutChartModel donutModel2; private MeterGaugeChartModel meterGaugeModel1; private MeterGaugeChartModel meterGaugeModel2; private BubbleChartModel bubbleModel1; private BubbleChartModel bubbleModel2; private OhlcChartModel ohlcModel; private OhlcChartModel ohlcModel2; private PieChartModel livePieModel; private LineChartModel animatedModel1; private BarChartModel animatedModel2; private LineChartModel multiAxisModel; private LineChartModel dateModel; @PostConstruct public void init() { createLineModels(); createAreaModel(); createPieModels(); createDonutModels(); createBubbleModels(); createOhlcModels(); createFillToZero(); createMeterGaugeModels(); createBarModels(); createAnimatedModels(); createCombinedModel(); createMultiAxisModel(); createDateModel(); } public void itemSelect(ItemSelectEvent event) { FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Item selected", "Item Index: " + event.getItemIndex() + ", Series Index:" + event.getSeriesIndex()); FacesContext.getCurrentInstance().addMessage(null, msg); } public LineChartModel getLineModel1() { return lineModel1; } public LineChartModel getLineModel2() { return lineModel2; } public LineChartModel getZoomModel() { return zoomModel; } public CartesianChartModel getCombinedModel() { return combinedModel; } public CartesianChartModel getAreaModel() { return areaModel; } public PieChartModel getPieModel1() { return pieModel1; } public PieChartModel getPieModel2() { return pieModel2; } public MeterGaugeChartModel getMeterGaugeModel1() { return meterGaugeModel1; } public MeterGaugeChartModel getMeterGaugeModel2() { return meterGaugeModel2; } public DonutChartModel getDonutModel1() { return donutModel1; } public DonutChartModel getDonutModel2() { return donutModel2; } public CartesianChartModel getFillToZero() { return fillToZero; } public BubbleChartModel getBubbleModel1() { return bubbleModel1; } public BubbleChartModel getBubbleModel2() { return bubbleModel2; } public OhlcChartModel getOhlcModel() { return ohlcModel; } public OhlcChartModel getOhlcModel2() { return ohlcModel2; } public BarChartModel getBarModel() { return barModel; } public HorizontalBarChartModel getHorizontalBarModel() { return horizontalBarModel; } public LineChartModel getAnimatedModel1() { return animatedModel1; } public BarChartModel getAnimatedModel2() { return animatedModel2; } public LineChartModel getMultiAxisModel() { return multiAxisModel; } public LineChartModel getDateModel() { return dateModel; } public PieChartModel getLivePieModel() { int random1 = (int)(Math.random() * 1000); int random2 = (int)(Math.random() * 1000); livePieModel.getData().put("Candidate 1", random1); livePieModel.getData().put("Candidate 2", random2); livePieModel.setTitle("Votes"); livePieModel.setLegendPosition("ne"); return livePieModel; } private LineChartModel initCategoryModel() { LineChartModel model = new LineChartModel(); ChartSeries boys = new ChartSeries(); boys.setLabel("Boys"); boys.set("2004", 120); boys.set("2005", 100); boys.set("2006", 44); boys.set("2007", 150); boys.set("2008", 25); ChartSeries girls = new ChartSeries(); girls.setLabel("Girls"); girls.set("2004", 52); girls.set("2005", 60); girls.set("2006", 110); girls.set("2007", 90); girls.set("2008", 120); model.addSeries(boys); model.addSeries(girls); return model; } private void createLineModels() { lineModel1 = initLinearModel(); lineModel1.setTitle("Linear Chart"); lineModel1.setLegendPosition("e"); Axis yAxis = lineModel1.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(10); lineModel1.setExtender("skinChart"); lineModel2 = initCategoryModel(); lineModel2.setTitle("Category Chart"); lineModel2.setLegendPosition("e"); lineModel2.setShowPointLabels(true); lineModel2.getAxes().put(AxisType.X, new CategoryAxis("Years")); yAxis = lineModel2.getAxis(AxisType.Y); yAxis.setLabel("Births"); yAxis.setMin(0); yAxis.setMax(200); zoomModel = initLinearModel(); zoomModel.setTitle("Zoom"); zoomModel.setZoom(true); zoomModel.setLegendPosition("e"); yAxis = zoomModel.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(10); } private void createAreaModel() { areaModel = new LineChartModel(); LineChartSeries boys = new LineChartSeries(); boys.setFill(true); boys.setLabel("Boys"); boys.set("2004", 120); boys.set("2005", 100); boys.set("2006", 44); boys.set("2007", 150); boys.set("2008", 25); LineChartSeries girls = new LineChartSeries(); girls.setFill(true); girls.setLabel("Girls"); girls.set("2004", 52); girls.set("2005", 60); girls.set("2006", 110); girls.set("2007", 90); girls.set("2008", 120); areaModel.addSeries(boys); areaModel.addSeries(girls); areaModel.setTitle("Area Chart"); areaModel.setLegendPosition("ne"); areaModel.setStacked(true); areaModel.setShowPointLabels(true); Axis xAxis = new CategoryAxis("Years"); areaModel.getAxes().put(AxisType.X, xAxis); Axis yAxis = areaModel.getAxis(AxisType.Y); yAxis.setLabel("Fails"); yAxis.setMin(0); yAxis.setMax(300); areaModel.setExtender("skinArea"); } private BarChartModel initBarModel() { BarChartModel model = new BarChartModel(); ChartSeries boys = new ChartSeries(); boys.setLabel("Boys"); boys.set("2004", 120); boys.set("2005", 100); boys.set("2006", 44); boys.set("2007", 150); boys.set("2008", 25); ChartSeries girls = new ChartSeries(); girls.setLabel("Girls"); girls.set("2004", 52); girls.set("2005", 60); girls.set("2006", 110); girls.set("2007", 135); girls.set("2008", 120); model.addSeries(boys); model.addSeries(girls); return model; } private void createBarModels() { createBarModel(); createHorizontalBarModel(); } private void createBarModel() { barModel = initBarModel(); barModel.setTitle("Bar Chart"); barModel.setLegendPosition("ne"); Axis xAxis = barModel.getAxis(AxisType.X); xAxis.setLabel("Gender"); Axis yAxis = barModel.getAxis(AxisType.Y); yAxis.setLabel("Births"); yAxis.setMin(0); yAxis.setMax(200); barModel.setExtender("skinBar"); } private void createHorizontalBarModel() { horizontalBarModel = new HorizontalBarChartModel(); ChartSeries boys = new ChartSeries(); boys.setLabel("Boys"); boys.set("2004", 50); boys.set("2005", 96); boys.set("2006", 44); boys.set("2007", 55); boys.set("2008", 25); ChartSeries girls = new ChartSeries(); girls.setLabel("Girls"); girls.set("2004", 52); girls.set("2005", 60); girls.set("2006", 82); girls.set("2007", 35); girls.set("2008", 120); horizontalBarModel.addSeries(boys); horizontalBarModel.addSeries(girls); horizontalBarModel.setTitle("Horizontal and Stacked"); horizontalBarModel.setLegendPosition("e"); horizontalBarModel.setStacked(true); Axis xAxis = horizontalBarModel.getAxis(AxisType.X); xAxis.setLabel("Sales"); xAxis.setMin(0); xAxis.setMax(200); Axis yAxis = horizontalBarModel.getAxis(AxisType.Y); yAxis.setLabel("Gender"); } private void createCombinedModel() { combinedModel = new BarChartModel(); BarChartSeries boys = new BarChartSeries(); boys.setLabel("Boys"); boys.set("2004", 120); boys.set("2005", 100); boys.set("2006", 44); boys.set("2007", 150); boys.set("2008", 25); LineChartSeries girls = new LineChartSeries(); girls.setLabel("Girls"); girls.set("2004", 52); girls.set("2005", 60); girls.set("2006", 110); girls.set("2007", 135); girls.set("2008", 120); combinedModel.addSeries(boys); combinedModel.addSeries(girls); combinedModel.setTitle("Bar and Line"); combinedModel.setLegendPosition("ne"); combinedModel.setMouseoverHighlight(false); combinedModel.setShowDatatip(false); combinedModel.setShowPointLabels(true); Axis yAxis = combinedModel.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(200); combinedModel.setExtender("skinBarAndLine"); } private void createMultiAxisModel() { multiAxisModel = new LineChartModel(); BarChartSeries boys = new BarChartSeries(); boys.setLabel("Boys"); boys.set("2004", 120); boys.set("2005", 100); boys.set("2006", 44); boys.set("2007", 150); boys.set("2008", 25); LineChartSeries girls = new LineChartSeries(); girls.setLabel("Girls"); girls.setXaxis(AxisType.X2); girls.setYaxis(AxisType.Y2); girls.set("A", 52); girls.set("B", 60); girls.set("C", 110); girls.set("D", 135); girls.set("E", 120); multiAxisModel.addSeries(boys); multiAxisModel.addSeries(girls); multiAxisModel.setTitle("Multi Axis Chart"); multiAxisModel.setMouseoverHighlight(false); multiAxisModel.getAxes().put(AxisType.X, new CategoryAxis("Years")); multiAxisModel.getAxes().put(AxisType.X2, new CategoryAxis("Period")); Axis yAxis = multiAxisModel.getAxis(AxisType.Y); yAxis.setLabel("Birth"); yAxis.setMin(0); yAxis.setMax(200); Axis y2Axis = new LinearAxis("Number"); y2Axis.setMin(0); y2Axis.setMax(200); multiAxisModel.getAxes().put(AxisType.Y2, y2Axis); multiAxisModel.setExtender("skinMultiAxis"); } private void createOhlcModels() { createOhlcModel1(); createOhlcModel2(); } private void createOhlcModel1(){ ohlcModel = new OhlcChartModel(); ohlcModel.add(new OhlcChartSeries(2007, 143.82, 144.56, 136.04, 136.97)); ohlcModel.add(new OhlcChartSeries(2008, 138.7, 139.68, 135.18, 135.4)); ohlcModel.add(new OhlcChartSeries(2009, 143.46, 144.66, 139.79, 140.02)); ohlcModel.add(new OhlcChartSeries(2010, 140.67, 143.56, 132.88, 142.44)); ohlcModel.add(new OhlcChartSeries(2011, 136.01, 139.5, 134.53, 139.48)); ohlcModel.add(new OhlcChartSeries(2012, 124.76, 135.9, 124.55, 135.81)); ohlcModel.add(new OhlcChartSeries(2012, 123.73, 129.31, 121.57, 122.5)); ohlcModel.setTitle("OHLC Chart"); ohlcModel.getAxis(AxisType.X).setLabel("Year"); ohlcModel.getAxis(AxisType.Y).setLabel("Price Change $K/Unit"); } private void createOhlcModel2(){ ohlcModel2 = new OhlcChartModel(); for( int i=1 ; i < 41 ; i++) { ohlcModel2.add(new OhlcChartSeries(i, Math.random() * 80 + 80, Math.random() * 50 + 110, Math.random() * 20 + 80, Math.random() * 80 + 80)); } ohlcModel2.setTitle("Candlestick"); ohlcModel2.setCandleStick(true); ohlcModel2.getAxis(AxisType.X).setLabel("Sector"); ohlcModel2.getAxis(AxisType.Y).setLabel("Index Value"); } private void createBubbleModels(){ bubbleModel1 = initBubbleModel(); bubbleModel1.setTitle("Bubble Chart"); bubbleModel1.getAxis(AxisType.X).setLabel("Price"); Axis yAxis = bubbleModel1.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(250); yAxis.setLabel("Labels"); bubbleModel1.setExtender("skinBubble"); bubbleModel2 = initBubbleModel(); bubbleModel2.setTitle("Custom Options"); bubbleModel2.setShadow(false); bubbleModel2.setBubbleGradients(true); bubbleModel2.setBubbleAlpha(0.8); bubbleModel2.getAxis(AxisType.X).setTickAngle(-50); yAxis = bubbleModel2.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(250); yAxis.setTickAngle(50); } private BubbleChartModel initBubbleModel(){ BubbleChartModel model = new BubbleChartModel(); model.add(new BubbleChartSeries("Acura", 70, 183,55)); model.add(new BubbleChartSeries("Alfa Romeo", 45, 92, 36)); model.add(new BubbleChartSeries("AM General", 24, 104, 40)); model.add(new BubbleChartSeries("Bugatti", 50, 123, 60)); model.add(new BubbleChartSeries("BMW", 15, 89, 25)); model.add(new BubbleChartSeries("Audi", 40, 180, 80)); model.add(new BubbleChartSeries("Aston Martin", 70, 70, 48)); return model; } private LineChartModel initLinearModel() { LineChartModel model = new LineChartModel(); LineChartSeries series1 = new LineChartSeries(); series1.setLabel("Series 1"); series1.set(1, 2); series1.set(2, 1); series1.set(3, 3); series1.set(4, 6); series1.set(5, 8); LineChartSeries series2 = new LineChartSeries(); series2.setLabel("Series 2"); series2.set(1, 6); series2.set(2, 3); series2.set(3, 2); series2.set(4, 7); series2.set(5, 9); model.addSeries(series1); model.addSeries(series2); return model; } private void createPieModels() { createPieModel1(); createPieModel2(); createLivePieModel(); } private void createPieModel1() { pieModel1 = new PieChartModel(); pieModel1.set("Brand 1", 540); pieModel1.set("Brand 2", 325); pieModel1.set("Brand 3", 702); pieModel1.set("Brand 4", 421); pieModel1.setTitle("Simple Pie"); pieModel1.setLegendPosition("w"); pieModel1.setExtender("skinPie"); } private void createPieModel2() { pieModel2 = new PieChartModel(); pieModel2.set("Brand 1", 540); pieModel2.set("Brand 2", 325); pieModel2.set("Brand 3", 702); pieModel2.set("Brand 4", 421); pieModel2.setTitle("Custom Pie"); pieModel2.setLegendPosition("e"); pieModel2.setFill(false); pieModel2.setShowDataLabels(true); pieModel2.setDiameter(150); } private void createDonutModels() { donutModel1 = initDonutModel(); donutModel1.setTitle("Donut Chart"); donutModel1.setLegendPosition("w"); donutModel1.setExtender("skinDonut"); donutModel2 = initDonutModel(); donutModel2.setTitle("Custom Options"); donutModel2.setLegendPosition("e"); donutModel2.setSliceMargin(5); donutModel2.setShowDataLabels(true); donutModel2.setDataFormat("value"); donutModel2.setShadow(false); } private DonutChartModel initDonutModel() { DonutChartModel model = new DonutChartModel(); Map<String, Number> circle1 = new LinkedHashMap<String, Number>(); circle1.put("Brand 1", 150); circle1.put("Brand 2", 400); circle1.put("Brand 3", 200); circle1.put("Brand 4", 10); model.addCircle(circle1); Map<String, Number> circle2 = new LinkedHashMap<String, Number>(); circle2.put("Brand 1", 540); circle2.put("Brand 2", 125); circle2.put("Brand 3", 702); circle2.put("Brand 4", 421); model.addCircle(circle2); Map<String, Number> circle3 = new LinkedHashMap<String, Number>(); circle3.put("Brand 1", 40); circle3.put("Brand 2", 325); circle3.put("Brand 3", 402); circle3.put("Brand 4", 421); model.addCircle(circle3); return model; } private void createLivePieModel() { livePieModel = new PieChartModel(); livePieModel.set("Candidate 1", 540); livePieModel.set("Candidate 2", 325); } private void createFillToZero() { fillToZero = new CartesianChartModel(); LineChartSeries series1 = new LineChartSeries(); series1.setLabel("Series 1"); series1.set("4, -3, 3, 6, 2, -2", 0); fillToZero.addSeries(series1); } private MeterGaugeChartModel initMeterGaugeModel() { List<Number> intervals = new ArrayList<Number>(){{ add(20); add(50); add(120); add(220); }}; return new MeterGaugeChartModel(140, intervals); } private void createMeterGaugeModels() { meterGaugeModel1 = initMeterGaugeModel(); meterGaugeModel1.setTitle("MeterGauge Chart"); meterGaugeModel1.setGaugeLabel("km/h"); meterGaugeModel1.setGaugeLabelPosition("bottom"); meterGaugeModel1.setExtender("skinMeterGauge"); meterGaugeModel2 = initMeterGaugeModel(); meterGaugeModel2.setTitle("Custom Options"); meterGaugeModel2.setSeriesColors("66cc66,93b75f,E7E658,cc6666"); meterGaugeModel2.setGaugeLabel("km/h"); meterGaugeModel2.setGaugeLabelPosition("bottom"); meterGaugeModel2.setShowTickLabels(false); meterGaugeModel2.setLabelHeightAdjust(110); meterGaugeModel2.setIntervalOuterRadius(100); } private void createAnimatedModels() { animatedModel1 = initLinearModel(); animatedModel1.setTitle("Line Chart"); animatedModel1.setAnimate(true); animatedModel1.setLegendPosition("se"); Axis yAxis = animatedModel1.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(10); animatedModel2 = initBarModel(); animatedModel2.setTitle("Bar Charts"); animatedModel2.setAnimate(true); animatedModel2.setLegendPosition("ne"); yAxis = animatedModel2.getAxis(AxisType.Y); yAxis.setMin(0); yAxis.setMax(200); } private void createDateModel() { dateModel = new LineChartModel(); LineChartSeries series1 = new LineChartSeries(); series1.setLabel("Series 1"); series1.set("2014-01-01", 51); series1.set("2014-01-06", 22); series1.set("2014-01-12", 65); series1.set("2014-01-18", 74); series1.set("2014-01-24", 24); series1.set("2014-01-30", 51); LineChartSeries series2 = new LineChartSeries(); series2.setLabel("Series 2"); series2.set("2014-01-01", 32); series2.set("2014-01-06", 73); series2.set("2014-01-12", 24); series2.set("2014-01-18", 12); series2.set("2014-01-24", 74); series2.set("2014-01-30", 62); dateModel.addSeries(series1); dateModel.addSeries(series2); dateModel.setTitle("Zoom for Details"); dateModel.setZoom(true); dateModel.getAxis(AxisType.Y).setLabel("Values"); DateAxis axis = new DateAxis("Dates"); axis.setTickAngle(-50); axis.setMax("2014-02-01"); axis.setTickFormat("%b %#d, %y"); dateModel.getAxes().put(AxisType.X, axis); dateModel.setExtender("skinZoom"); } }
[ "ahmed.alkohlany@gmail.com" ]
ahmed.alkohlany@gmail.com
224811a10054691e6d63672c1d3b162bbac9006e
70f7fd1bee8a077a08bff55ba7ff2f7444b86f2d
/Event.java
09770b3522921118ca92812006bb637d5767ecf4
[]
no_license
imaculate/OSSimulation.
83d4ea48bbf3393c045efb31ad8691251929cd8f
cdc6f3ebf65490860cfe2f7199974918cb0b15ad
refs/heads/master
2021-01-18T01:44:26.870585
2015-03-25T04:42:02
2015-03-25T04:42:02
32,556,334
1
0
null
null
null
null
UTF-8
Java
false
false
519
java
/** * Abstract class Event - write a description of the class here * * @author Stephan Jamieson * @version 8/3/15 */ public abstract class Event { private long time; /** * Create an event due to occur at the given time. */ public Event(long systemTime) { this.time=systemTime;} /** * Obtain the system time at which this event is due to occur. */ public long getTime() { return time; } public String toString() { return "Event("+getTime()+")"; } }
[ "imaculatemosha@yahoo.com" ]
imaculatemosha@yahoo.com
6736f57176f42e8f0642e1f6f4bd59803dac350c
2d6ee3b625e20e8c37a0b719077b0188e93065e4
/src/main/java/isocline/reflow/flow/WorkInfo.java
6ad79f3ee1673d7d6ec127f03f5fd50c7864b3b4
[ "Apache-2.0" ]
permissive
sinofeng/reflow
b362b99023a9be53b20170d93a96a786390ea51b
dcc6ab1fd5681d5637a19d23e7265b555e8db0a9
refs/heads/master
2023-01-01T04:57:54.276568
2020-04-06T08:00:27
2020-04-06T08:00:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,161
java
/* * Copyright 2018 The Isocline Project * * The Isocline Project 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 isocline.reflow.flow; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.*; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) /** * * for TEST * * @deprecated */ public @interface WorkInfo { int step() default 1; boolean async() default false; String id() default "1"; boolean start() default false; boolean end() default false; String next() default "x"; String startAfter() default "x"; }
[ "richard.dean.kim@gmail.com" ]
richard.dean.kim@gmail.com
8304528a57d9d6d7d8bbf4617e37d6abcada6176
bacc5bf4da801a83d88d6d8fedb2a73a1caa4376
/app/src/main/java/com/freedom/lauzy/gankpro/ui/adapter/CategoryPagerAdapter.java
5d4380c9fad07e3ad5857f5c639d925fefc61b43
[]
no_license
leeleekaen/GankPro
8368819496ee49013c4a9786ac9601bfe6ae39d1
02b2f2605d131aa3511ef536f9f7361b2a9263ea
refs/heads/master
2020-03-25T20:07:06.513574
2017-06-15T09:08:25
2017-06-15T09:08:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,053
java
package com.freedom.lauzy.gankpro.ui.adapter; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.freedom.lauzy.gankpro.ui.fragment.CategoryChildFragment; /** * Created by Lauzy on 2017/3/20. */ public class CategoryPagerAdapter extends FragmentPagerAdapter { private String[] mTypes; private String[] mTitle; // private GankBottomBehavior mBottomBehavior; public CategoryPagerAdapter(FragmentManager fm, String[] types) { super(fm); mTypes = types; // mBottomBehavior = bottomBehavior; } @Override public Fragment getItem(int position) { return CategoryChildFragment.newInstance(mTypes[position]); } @Override public int getCount() { return mTypes == null ? 0 : mTypes.length; } public void setTitle(String[] title) { mTitle = title; } @Override public CharSequence getPageTitle(int position) { return mTitle[position]; } }
[ "freedompaladin@gmail.com" ]
freedompaladin@gmail.com