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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20014acaba32befcd3e5ab8fa62b92ca719ba48b | 5505c1a4fb3834a84d46c1b591d922bf26a5cd99 | /app/src/main/java/com/mg/dribbler/models/Global.java | c6e8d7b3b423d865e2f73776f7cf8c637682acd7 | [] | no_license | enjoyproduct/dribbler-android | f5daa28c0c748cc6eebe66526bd9069188707c63 | 5511d690c4ca041a23fdfb04d0cbda4657ad2cea | refs/heads/master | 2021-05-16T13:04:35.374402 | 2017-10-18T14:56:53 | 2017-10-18T14:56:53 | 105,352,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,573 | java | package com.mg.dribbler.models;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Created by dell17 on 5/16/2016.
*/
public class Global {
public ArrayList<Tag> tagArr = new ArrayList<>();
// Selected Trick
public Trick selectedTrick;
// My Profile
public ArrayList<Video> myVideos = new ArrayList<>();
public Pagination myVideosPagination;
// public ArrayList<Score> myCategoryScore = new ArrayList<>();
// public ArrayList<Score> myTrickScore = new ArrayList<>();
// public ArrayList<Score> myTagScore = new ArrayList<>();
// Feed and Follower
public ArrayList<User> followers = new ArrayList<>();
// Like List
public HashMap<Integer, Boolean> videoLikeDic = new HashMap<>();
// Singleton
static Global instance;
/**
* Life Cycle
*/
private Global() {
}
public static Global sharedInstance() {
if (instance == null) {
instance = new Global();
}
return instance;
}
public static void init() {
instance = null;
}
public void appendMyVideo(ArrayList<Video> videos) {
for (Video video : videos) {
boolean isExist = false;
for (Video tempVideo : myVideos) {
if (video.video_id == tempVideo.video_id) {
isExist = true;
break;
}
}
if (!isExist) {
myVideos.add(video);
}
}
}
}
| [
"admin@Mac-Admin.local"
] | admin@Mac-Admin.local |
a999a156a298d3805c59f2555caad5f339bdbcca | 05ca6846fe3a149c48e7af4917a3269a387ca5cf | /NewtestNGTest.java | 9b667b7f0508662af7959c5b542bdf273e837795 | [] | no_license | subho-ece18/ExcelReaderDataProviderTestNG | d7e57325e70192ab186538ddda989726d885b297 | f66a18c8b44e67eee604bed6a76f3d863535b035 | refs/heads/master | 2020-03-25T07:19:41.300859 | 2018-08-04T19:02:11 | 2018-08-04T19:02:11 | 143,554,349 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 100 | java | import org.testng.annotations.Test;
public class NewtestNGTest {
@Test
public void f() {
}
}
| [
"V705662@ASIAPAC.AD.JPMORGANCHASE.com"
] | V705662@ASIAPAC.AD.JPMORGANCHASE.com |
134a11259546dc94a455d30e23ecd0cfdc665b4e | befa5b4b28cd3d6ff94de7093bba4b6d568754f5 | /modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/v201605/AwqlReportRequest.java | d62c3d6a5976c8f00a7afb58ebc51973d5cea6ce | [
"Apache-2.0"
] | permissive | jfrost001/googleads-java-lib | ffcf0a759da0ee141bfa29ed0777cd3d5366c53c | 62f0e40b2ee06668ff05ebf99871692d15f71524 | refs/heads/master | 2021-01-20T02:54:19.087207 | 2017-02-14T19:17:29 | 2017-02-14T19:17:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,525 | java | // Copyright 2016 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.google.api.ads.adwords.lib.utils.v201605;
import com.google.api.ads.adwords.lib.jaxb.v201605.DownloadFormat;
import com.google.api.ads.adwords.lib.utils.ReportRequest;
import com.google.common.base.Preconditions;
/**
* ReportRequest for AWQL reports.
*/
class AwqlReportRequest implements ReportRequest {
private final String awqlQuery;
private final DownloadFormat downloadFormat;
public AwqlReportRequest(String awqlQuery, DownloadFormat downloadFormat) {
this.awqlQuery = Preconditions.checkNotNull(awqlQuery, "Null AWQL query");
this.downloadFormat = Preconditions.checkNotNull(downloadFormat, "Null download format");
}
@Override
public String getReportRequestString() {
return awqlQuery;
}
@Override
public DownloadFormat getDownloadFormat() {
return downloadFormat;
}
@Override
public RequestType getRequestType() {
return RequestType.AWQL;
}
}
| [
"jradcliff@users.noreply.github.com"
] | jradcliff@users.noreply.github.com |
247834bd1c9578c5180f5f67e27821d55093dc41 | 8f79c225b5c5a86099bcdac2a011bd6314a18b0c | /src/test/java/com/covalant/ng2/Example1.java | e7b29523716efb3462a14db24d64f3d4459c0a5e | [] | no_license | bharath411/batch25 | 89469f020df02998dab25c5a3d265b92441ebcc8 | 8b3e6ebeb3cdc7bb8e05c596df06fcac5e021c1a | refs/heads/master | 2021-01-19T20:54:17.423882 | 2017-07-10T14:57:58 | 2017-07-10T14:57:58 | 88,574,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,091 | java | package com.covalant.ng2;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import com.covalant.automation.commons.ListenerExample;
@Listeners(ListenerExample.class)
public class Example1 {
@BeforeClass
public void init(){
System.out.println("Init");
}
@Test(priority=1)
public void login(){
System.out.println("This is login");
}
@Test(priority=2)
public void verifyProfile(){
System.out.println("This is verifyProfile");
}
@Test(priority=2)
public void updateProfile(){
System.out.println("This is updateProfile");
Assert.fail();
}
@Test(priority=2)
public void deleteProfile(){
System.out.println("This is deleteProfile");
}
@Test(priority=3)
public void logout(){
System.out.println("This is logout");
}
@AfterSuite
public void afterSuite(){
System.out.println("After Suite");
}
@AfterClass
public void tearDown(){
System.out.println("tearDown");
}
}
| [
"bharath.kristipati@gmail.com"
] | bharath.kristipati@gmail.com |
c8a722793f86c4db0ffcb194f789164e6b716d2d | 074b94b081860e2699dd23a4fd51acc8f4138148 | /graph/Dijkstra.java | 0436738d78ffa943580d8a83d574dea3922b2cc2 | [] | no_license | piomalek/algorithms | 127dd46a7f1c18960b8e57ace8d371ab8743cd6c | d81a56d8099e7d431082ed30ddf43730fbd15d5b | refs/heads/master | 2020-12-03T15:11:50.256308 | 2020-01-14T11:03:24 | 2020-01-14T11:03:24 | 231,366,220 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,663 | java | import java.util.Arrays;
import java.util.PriorityQueue;
public class Dijkstra {
/**
* Dijkstra algorithm implementation for graph with nodes called 0..N represented as
* adjacency matrix.
*
* @param graph - graph[s][t] represents length of the edge from s to t. 0 represents no connection
* @param source -> number of the starting node
* @param distance - array where distance[n] represents distance from source to node
* @param parent - array where parent[n] represents predestor in the shortest path of node n
* @return
*/
private static void dijkstra(int[][] graph, int source, int[] distance, int[] parent) {
int N = graph.length;
// elements -> {node, distance from source}
PriorityQueue<int[]> priorityQueue = new PriorityQueue<>((a,b) -> a[1] - b[1]);
priorityQueue.offer(new int[]{source, 0});
while(!priorityQueue.isEmpty()) {
int[] nodeArr = priorityQueue.poll();
int node = nodeArr[0];
int dist = nodeArr[1];
//System.out.println(String.format("%d->%d - dist[%d] = %d", source, node, node, dist));
//System.out.println(Arrays.toString(distance));
// we have already found better distance
if(distance[node] < dist)
continue;
// go through nodes children, calculating min distance and adding them to the queue
for(int i = 0; i < N; ++i) {
//if(graph[node][i] != 0)
// System.out.println(String.format("\trelaxing edge %d->%d - dist[%d] = %d vs edge(%d, %d) = %d + %d",
// node, i, i, distance[i], node, i, graph[node][i], dist));
if(graph[node][i] != 0 && distance[i] > graph[node][i] + dist) {
distance[i] = graph[node][i] + dist;
parent[i] = node;
priorityQueue.offer(new int[]{i, distance[i]});
}
}
}
return;
}
public static void main(String[] args) {
int source = 0;
int graph[][] = new int[][] {
{ 0, 4, 0, 0, 0, 0, 0, 8, 0 },
{ 4, 0, 8, 0, 0, 0, 0, 11, 0 },
{ 0, 8, 0, 7, 0, 4, 0, 0, 2 },
{ 0, 0, 7, 0, 9, 14, 0, 0, 0 },
{ 0, 0, 0, 9, 0, 10, 0, 0, 0 },
{ 0, 0, 4, 14, 10, 0, 2, 0, 0 },
{ 0, 0, 0, 0, 0, 2, 0, 1, 6 },
{ 8, 11, 0, 0, 0, 0, 1, 0, 7 },
{ 0, 0, 2, 0, 0, 0, 6, 7, 0 }
};
int N = graph.length;
// create array holding all the distances from source
int[] distance = new int[N];
Arrays.fill(distance, Integer.MAX_VALUE);
distance[source] = 0;
int[] parent = new int[N];
Arrays.fill(parent, -1);
parent[source] = source;
dijkstra(graph, source, distance, parent);
// Should print: paths from node 0: [0, 4, 12, 19, 21, 11, 9, 8, 14]
System.out.println(String.format("Paths from node %d: %s", source, Arrays.toString(distance)));
for(int i = 0; i < N; ++i) {
StringBuffer sb = new StringBuffer();
int n = i;
while(n != source) {
sb.insert(0, "" + n);
sb.insert(0, "->");
n = parent[n];
}
sb.insert(0, "" + source);
System.out.println(String.format("\tpath %d->%d: %s", source, i, sb.toString()));
}
return;
}
}
// Should print: paths from node 0: [0, 4, 12, 19, 21, 11, 9, 8, 14]
| [
"piomalek@gmail.com"
] | piomalek@gmail.com |
9d06c8ed099ad63644262332052c05833f7b6dc1 | ec8f4cf382d7033dd8ba0042a28a5559997920f5 | /interviewJava/interview/strings/oneeditdistance.java | 04078603302d5bb313675d64ce1a2690ecf4fd84 | [] | no_license | jiguosong/coding_practice | 7d5b008fbf0cb4181497020fef97e68669f969b0 | 4313bd943c7755ed8127626cad194d7a60d05a14 | refs/heads/master | 2020-12-14T06:09:52.598169 | 2016-12-31T21:40:26 | 2016-12-31T21:40:26 | 68,734,717 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 920 | java | package strings;
public class oneeditdistance {
public boolean isOneEditDistance(String s, String t) {
if(s == null && t != null) return false;
if(s != null && t == null) return false;
int m = s.length();
int n = t.length();
if(Math.abs(m-n) >1) return false;
int count = 0;
int i = 0;
int j = 0;
while(i < m && j < n) {
if(s.charAt(i) == t.charAt(j)) {
i++;
j++;
} else {
count++;
if(count > 1) return false;
if(m < n) j++;
else if(m > n) i++;
else {
i++;
j++;
}
}
}
if(i < m || j < n) {
count++;
}
return count <= 1;
}
/**
* @param args
*/
public static void main(String[] args) {
oneeditdistance test = new oneeditdistance();
String s = "gesek";
String t = "geek";
if(test.isOneEditDistance(s, t)) System.out.println("is one edit distance");
else System.out.println("not one edit distance");
}
}
| [
"songjiguo@gmail.com"
] | songjiguo@gmail.com |
9655d8de3f183ad4f6b5107cfc476269e4332d53 | 8cc15fb4ab638ea4906aa96880f3887e14419436 | /gulimall-coupon/src/main/java/com/clay/gulimall/coupon/service/impl/SeckillSkuNoticeServiceImpl.java | 83186b6c1680181aed9f297bd1902875cdb99825 | [
"Apache-2.0"
] | permissive | wangkaistudy/gulimall | f4399ade7b79ada29a88361866e5248ec71d98ce | cb0d4ae535d212eb4ca954bf33fdc1e96a9ff192 | refs/heads/main | 2023-06-16T11:47:59.763541 | 2021-07-08T15:15:19 | 2021-07-08T15:15:19 | 341,611,018 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,083 | java | package com.clay.gulimall.coupon.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.clay.gulimall.common.utils.PageUtils;
import com.clay.gulimall.common.utils.Query;
import com.clay.gulimall.coupon.dao.SeckillSkuNoticeDao;
import com.clay.gulimall.coupon.entity.SeckillSkuNoticeEntity;
import com.clay.gulimall.coupon.service.SeckillSkuNoticeService;
@Service("seckillSkuNoticeService")
public class SeckillSkuNoticeServiceImpl extends ServiceImpl<SeckillSkuNoticeDao, SeckillSkuNoticeEntity> implements SeckillSkuNoticeService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<SeckillSkuNoticeEntity> page = this.page(
new Query<SeckillSkuNoticeEntity>().getPage(params),
new QueryWrapper<SeckillSkuNoticeEntity>()
);
return new PageUtils(page);
}
} | [
"work_wangkai@163.com"
] | work_wangkai@163.com |
2fe43d39708623374bdf8076910383e9ad00c114 | aa28f37e8d1a0475f43542cfb7a390a397e7bd74 | /app/src/main/java/com/lzjz/expressway/bean/PersonnelBean.java | 242ed0a79b2254637c6138b51b987bcdf8202042 | [] | no_license | jianghaijun/LzExpressWay | 071c82d5b1b652fca574474226a9555c140fc770 | 6e0f9b6058bb2c6cf23cc6ac61664e162c16ec05 | refs/heads/master | 2020-03-24T20:05:41.575158 | 2018-08-31T10:51:38 | 2018-08-31T10:52:22 | 142,959,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,448 | java | package com.lzjz.expressway.bean;
import java.util.ArrayList;
import java.util.List;
import cn.hutool.core.util.StrUtil;
/**
* Create dell By 2018/6/12 11:22
*/
public class PersonnelBean {
private String value;
private String label;
private String title;
private String type;
private String valuePid;
private List<PersonnelBean> children;
public String getValue() {
return StrUtil.isEmpty(value) ? "" : value;
}
public void setValue(String value) {
this.value = value;
}
public String getLabel() {
return StrUtil.isEmpty(label) ? "" : label;
}
public void setLabel(String label) {
this.label = label;
}
public String getTitle() {
return StrUtil.isEmpty(title) ? "" : title;
}
public void setTitle(String title) {
this.title = title;
}
public String getType() {
return StrUtil.isEmpty(type) ? "" : type;
}
public void setType(String type) {
this.type = type;
}
public String getValuePid() {
return StrUtil.isEmpty(valuePid) ? "" : valuePid;
}
public void setValuePid(String valuePid) {
this.valuePid = valuePid;
}
public List<PersonnelBean> getChildren() {
return children == null ? new ArrayList<PersonnelBean>() : children;
}
public void setChildren(List<PersonnelBean> children) {
this.children = children;
}
}
| [
"1320666709@qq.com"
] | 1320666709@qq.com |
d460cc7c65e095d3e8fbb692c08754d928531c8c | be58d0984dbcddd131fe4cfa76eaeca311395139 | /src/main/java/app/service/impl/ImmutableGridDecorator.java | 8754cdeb3e38214cff48e66dee2fc072c32a93d4 | [] | no_license | tirnak/grid-simulator | 342441f1305e90e350af31ce1b218c0298e96332 | e01f144af56487f040fc4ae747107210ff6ff806 | refs/heads/master | 2022-04-28T06:59:57.918528 | 2019-06-28T11:49:56 | 2019-06-28T11:49:56 | 193,969,774 | 0 | 0 | null | 2022-03-31T18:50:36 | 2019-06-26T20:01:53 | Java | UTF-8 | Java | false | false | 840 | java | package app.service.impl;
import app.model.Point2D;
import app.service.InfiniteBlackWhiteGrid;
import lombok.AllArgsConstructor;
import lombok.experimental.Delegate;
/**
* Wrapper class to use when needed to avoid grid state mutation
* As an alternative to defensive copy
*/
@AllArgsConstructor
public class ImmutableGridDecorator implements InfiniteBlackWhiteGrid {
/**
* Delegate from Lombok project is aimed to reduce all the boilerplate for decorator pattern
* use with caution - feature is experimental and may be removed in future releases
*/
@Delegate(excludes = Exclude.class)
private InfiniteBlackWhiteGrid original;
@Override
public void flipColor(Point2D location) {
throw new UnsupportedOperationException();
}
}
interface Exclude {
void flipColor(Point2D location);
}
| [
"semenovkirill.spb@gmail.com"
] | semenovkirill.spb@gmail.com |
25fc65ef831a1a3ed2ecd55c6122d5aa127e4f19 | 236fe1ae3206f848056f92187a6b22cfbc97868a | /asn3/parser/src/java/cool/CoolParser.java | 9e96b326b58e01365c7a2a7aed89b4ea8cfdf3e3 | [] | no_license | ibrahim5253/Cool-Compiler | 0c47e1626d11c3d480a9accb5a733cf4f7dfdec5 | de891a724fcbd5b5243c0620cc38f384e618eb70 | refs/heads/master | 2021-01-11T20:28:26.870887 | 2017-01-16T14:26:06 | 2017-01-16T14:26:06 | 79,124,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 65,649 | java | // Generated from CoolParser.g4 by ANTLR 4.5.3
package cool;
import cool.AST;
import java.util.ArrayList;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class CoolParser extends Parser {
static { RuntimeMetaData.checkVersion("4.5.3", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
ERROR=1, TYPEID=2, OBJECTID=3, BOOL_CONST=4, INT_CONST=5, STR_CONST=6,
LPAREN=7, RPAREN=8, COLON=9, ATSYM=10, SEMICOLON=11, COMMA=12, PLUS=13,
MINUS=14, STAR=15, SLASH=16, TILDE=17, LT=18, EQUALS=19, LBRACE=20, RBRACE=21,
DOT=22, DARROW=23, LE=24, ASSIGN=25, CLASS=26, ELSE=27, FI=28, IF=29,
IN=30, INHERITS=31, LET=32, LOOP=33, POOL=34, THEN=35, WHILE=36, CASE=37,
ESAC=38, OF=39, NEW=40, ISVOID=41, NOT=42, WS=43, THEEND=44, SINGLE_COMMENT=45,
COMMENT_CLOSE=46, CLOSED=47, COM_EOF=48, NEWLINE=49, ESC=50, ESC_NULL=51,
STR_EOF=52, ERR1=53, ERR2=54, ERR3=55, LQUOTE=56, NL=57, TAB=58, BACKSPAC=59,
LINEFEED=60, SLASHN=61, ESC_NL=62;
public static final int
RULE_program = 0, RULE_class_list = 1, RULE_class_ = 2, RULE_feature_list = 3,
RULE_feature = 4, RULE_attr = 5, RULE_method = 6, RULE_formal_list = 7,
RULE_formal = 8, RULE_expr = 9, RULE_arg_list = 10, RULE_expr_list = 11,
RULE_let_list = 12, RULE_branch_list = 13, RULE_branch = 14;
public static final String[] ruleNames = {
"program", "class_list", "class_", "feature_list", "feature", "attr",
"method", "formal_list", "formal", "expr", "arg_list", "expr_list", "let_list",
"branch_list", "branch"
};
private static final String[] _LITERAL_NAMES = {
null, null, null, null, null, null, null, "'('", "')'", "':'", "'@'",
"';'", "','", "'+'", "'-'", "'*'", "'/'", "'~'", "'<'", "'='", "'{'",
"'}'", "'.'", "'=>'", "'<='", "'<-'", null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, "'*)'", null, null, null, null, null, null, null, null, null,
null, null, "'\\t'", "'\\b'", "'\\f'", "'\\n'", "'\\\n'"
};
private static final String[] _SYMBOLIC_NAMES = {
null, "ERROR", "TYPEID", "OBJECTID", "BOOL_CONST", "INT_CONST", "STR_CONST",
"LPAREN", "RPAREN", "COLON", "ATSYM", "SEMICOLON", "COMMA", "PLUS", "MINUS",
"STAR", "SLASH", "TILDE", "LT", "EQUALS", "LBRACE", "RBRACE", "DOT", "DARROW",
"LE", "ASSIGN", "CLASS", "ELSE", "FI", "IF", "IN", "INHERITS", "LET",
"LOOP", "POOL", "THEN", "WHILE", "CASE", "ESAC", "OF", "NEW", "ISVOID",
"NOT", "WS", "THEEND", "SINGLE_COMMENT", "COMMENT_CLOSE", "CLOSED", "COM_EOF",
"NEWLINE", "ESC", "ESC_NULL", "STR_EOF", "ERR1", "ERR2", "ERR3", "LQUOTE",
"NL", "TAB", "BACKSPAC", "LINEFEED", "SLASHN", "ESC_NL"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
/**
* @deprecated Use {@link #VOCABULARY} instead.
*/
@Deprecated
public static final String[] tokenNames;
static {
tokenNames = new String[_SYMBOLIC_NAMES.length];
for (int i = 0; i < tokenNames.length; i++) {
tokenNames[i] = VOCABULARY.getLiteralName(i);
if (tokenNames[i] == null) {
tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
if (tokenNames[i] == null) {
tokenNames[i] = "<INVALID>";
}
}
}
@Override
@Deprecated
public String[] getTokenNames() {
return tokenNames;
}
@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}
@Override
public String getGrammarFileName() { return "CoolParser.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
String filename;
public void setFilename(String f){
filename = f;
}
/*
DO NOT EDIT THE FILE ABOVE THIS LINE
Add member functions, variables below.
*/
public CoolParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ProgramContext extends ParserRuleContext {
public AST.program value;
public Class_listContext cl;
public TerminalNode EOF() { return getToken(CoolParser.EOF, 0); }
public Class_listContext class_list() {
return getRuleContext(Class_listContext.class,0);
}
public ProgramContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_program; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitProgram(this);
else return visitor.visitChildren(this);
}
}
public final ProgramContext program() throws RecognitionException {
ProgramContext _localctx = new ProgramContext(_ctx, getState());
enterRule(_localctx, 0, RULE_program);
try {
enterOuterAlt(_localctx, 1);
{
setState(30);
((ProgramContext)_localctx).cl = class_list();
setState(31);
match(EOF);
((ProgramContext)_localctx).value = new AST.program(((ProgramContext)_localctx).cl.value, ((ProgramContext)_localctx).cl.value.get(0).lineNo);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Class_listContext extends ParserRuleContext {
public List<AST.class_> value;
public Class_Context c;
public List<TerminalNode> SEMICOLON() { return getTokens(CoolParser.SEMICOLON); }
public TerminalNode SEMICOLON(int i) {
return getToken(CoolParser.SEMICOLON, i);
}
public List<Class_Context> class_() {
return getRuleContexts(Class_Context.class);
}
public Class_Context class_(int i) {
return getRuleContext(Class_Context.class,i);
}
public Class_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_class_list; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitClass_list(this);
else return visitor.visitChildren(this);
}
}
public final Class_listContext class_list() throws RecognitionException {
Class_listContext _localctx = new Class_listContext(_ctx, getState());
enterRule(_localctx, 2, RULE_class_list);
((Class_listContext)_localctx).value = new ArrayList<AST.class_>();
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(38);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(34);
((Class_listContext)_localctx).c = class_();
_localctx.value.add(((Class_listContext)_localctx).c.value);
setState(36);
match(SEMICOLON);
}
}
setState(40);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==CLASS );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Class_Context extends ParserRuleContext {
public AST.class_ value;
public Token CLASS;
public Token TYPEID;
public Feature_listContext feature_list;
public Token curr;
public Token par;
public TerminalNode CLASS() { return getToken(CoolParser.CLASS, 0); }
public List<TerminalNode> TYPEID() { return getTokens(CoolParser.TYPEID); }
public TerminalNode TYPEID(int i) {
return getToken(CoolParser.TYPEID, i);
}
public TerminalNode LBRACE() { return getToken(CoolParser.LBRACE, 0); }
public Feature_listContext feature_list() {
return getRuleContext(Feature_listContext.class,0);
}
public TerminalNode RBRACE() { return getToken(CoolParser.RBRACE, 0); }
public TerminalNode INHERITS() { return getToken(CoolParser.INHERITS, 0); }
public Class_Context(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_class_; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitClass_(this);
else return visitor.visitChildren(this);
}
}
public final Class_Context class_() throws RecognitionException {
Class_Context _localctx = new Class_Context(_ctx, getState());
enterRule(_localctx, 4, RULE_class_);
try {
setState(58);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(42);
((Class_Context)_localctx).CLASS = match(CLASS);
setState(43);
((Class_Context)_localctx).TYPEID = match(TYPEID);
setState(44);
match(LBRACE);
setState(45);
((Class_Context)_localctx).feature_list = feature_list();
setState(46);
match(RBRACE);
((Class_Context)_localctx).value = new AST.class_((((Class_Context)_localctx).TYPEID!=null?((Class_Context)_localctx).TYPEID.getText():null), filename, "Object", ((Class_Context)_localctx).feature_list.value,(((Class_Context)_localctx).CLASS!=null?((Class_Context)_localctx).CLASS.getLine():0));
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(49);
((Class_Context)_localctx).CLASS = match(CLASS);
setState(50);
((Class_Context)_localctx).curr = match(TYPEID);
setState(51);
match(INHERITS);
setState(52);
((Class_Context)_localctx).par = match(TYPEID);
setState(53);
match(LBRACE);
setState(54);
((Class_Context)_localctx).feature_list = feature_list();
setState(55);
match(RBRACE);
((Class_Context)_localctx).value = new AST.class_((((Class_Context)_localctx).curr!=null?((Class_Context)_localctx).curr.getText():null), filename, (((Class_Context)_localctx).par!=null?((Class_Context)_localctx).par.getText():null), ((Class_Context)_localctx).feature_list.value, (((Class_Context)_localctx).CLASS!=null?((Class_Context)_localctx).CLASS.getLine():0));
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Feature_listContext extends ParserRuleContext {
public List<AST.feature> value;
public FeatureContext f;
public List<TerminalNode> SEMICOLON() { return getTokens(CoolParser.SEMICOLON); }
public TerminalNode SEMICOLON(int i) {
return getToken(CoolParser.SEMICOLON, i);
}
public List<FeatureContext> feature() {
return getRuleContexts(FeatureContext.class);
}
public FeatureContext feature(int i) {
return getRuleContext(FeatureContext.class,i);
}
public Feature_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_feature_list; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitFeature_list(this);
else return visitor.visitChildren(this);
}
}
public final Feature_listContext feature_list() throws RecognitionException {
Feature_listContext _localctx = new Feature_listContext(_ctx, getState());
enterRule(_localctx, 6, RULE_feature_list);
((Feature_listContext)_localctx).value = new ArrayList<AST.feature>();
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(66);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==OBJECTID) {
{
{
setState(60);
((Feature_listContext)_localctx).f = feature();
_localctx.value.add(((Feature_listContext)_localctx).f.value);
setState(62);
match(SEMICOLON);
}
}
setState(68);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FeatureContext extends ParserRuleContext {
public AST.feature value;
public MethodContext method;
public AttrContext attr;
public MethodContext method() {
return getRuleContext(MethodContext.class,0);
}
public AttrContext attr() {
return getRuleContext(AttrContext.class,0);
}
public FeatureContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_feature; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitFeature(this);
else return visitor.visitChildren(this);
}
}
public final FeatureContext feature() throws RecognitionException {
FeatureContext _localctx = new FeatureContext(_ctx, getState());
enterRule(_localctx, 8, RULE_feature);
((FeatureContext)_localctx).value = new AST.feature();
try {
setState(75);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(69);
((FeatureContext)_localctx).method = method();
((FeatureContext)_localctx).value = ((FeatureContext)_localctx).method.value;
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(72);
((FeatureContext)_localctx).attr = attr();
((FeatureContext)_localctx).value = ((FeatureContext)_localctx).attr.value;
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AttrContext extends ParserRuleContext {
public AST.attr value;
public Token o;
public Token t;
public ExprContext e;
public TerminalNode COLON() { return getToken(CoolParser.COLON, 0); }
public TerminalNode OBJECTID() { return getToken(CoolParser.OBJECTID, 0); }
public TerminalNode TYPEID() { return getToken(CoolParser.TYPEID, 0); }
public TerminalNode ASSIGN() { return getToken(CoolParser.ASSIGN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public AttrContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_attr; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitAttr(this);
else return visitor.visitChildren(this);
}
}
public final AttrContext attr() throws RecognitionException {
AttrContext _localctx = new AttrContext(_ctx, getState());
enterRule(_localctx, 10, RULE_attr);
try {
setState(88);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(77);
((AttrContext)_localctx).o = match(OBJECTID);
setState(78);
match(COLON);
setState(79);
((AttrContext)_localctx).t = match(TYPEID);
((AttrContext)_localctx).value = new AST.attr((((AttrContext)_localctx).o!=null?((AttrContext)_localctx).o.getText():null), (((AttrContext)_localctx).t!=null?((AttrContext)_localctx).t.getText():null), new AST.no_expr((((AttrContext)_localctx).o!=null?((AttrContext)_localctx).o.getLine():0)), (((AttrContext)_localctx).o!=null?((AttrContext)_localctx).o.getLine():0));
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(81);
((AttrContext)_localctx).o = match(OBJECTID);
setState(82);
match(COLON);
setState(83);
((AttrContext)_localctx).t = match(TYPEID);
setState(84);
match(ASSIGN);
setState(85);
((AttrContext)_localctx).e = expr(0);
((AttrContext)_localctx).value = new AST.attr((((AttrContext)_localctx).o!=null?((AttrContext)_localctx).o.getText():null), (((AttrContext)_localctx).t!=null?((AttrContext)_localctx).t.getText():null), ((AttrContext)_localctx).e.value, (((AttrContext)_localctx).o!=null?((AttrContext)_localctx).o.getLine():0));
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class MethodContext extends ParserRuleContext {
public AST.method value;
public Token o;
public Formal_listContext f;
public Token t;
public ExprContext e;
public TerminalNode LPAREN() { return getToken(CoolParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(CoolParser.RPAREN, 0); }
public TerminalNode COLON() { return getToken(CoolParser.COLON, 0); }
public TerminalNode LBRACE() { return getToken(CoolParser.LBRACE, 0); }
public TerminalNode RBRACE() { return getToken(CoolParser.RBRACE, 0); }
public TerminalNode OBJECTID() { return getToken(CoolParser.OBJECTID, 0); }
public Formal_listContext formal_list() {
return getRuleContext(Formal_listContext.class,0);
}
public TerminalNode TYPEID() { return getToken(CoolParser.TYPEID, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public MethodContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_method; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitMethod(this);
else return visitor.visitChildren(this);
}
}
public final MethodContext method() throws RecognitionException {
MethodContext _localctx = new MethodContext(_ctx, getState());
enterRule(_localctx, 12, RULE_method);
try {
enterOuterAlt(_localctx, 1);
{
setState(90);
((MethodContext)_localctx).o = match(OBJECTID);
setState(91);
match(LPAREN);
setState(92);
((MethodContext)_localctx).f = formal_list();
setState(93);
match(RPAREN);
setState(94);
match(COLON);
setState(95);
((MethodContext)_localctx).t = match(TYPEID);
setState(96);
match(LBRACE);
setState(97);
((MethodContext)_localctx).e = expr(0);
setState(98);
match(RBRACE);
((MethodContext)_localctx).value = new AST.method((((MethodContext)_localctx).o!=null?((MethodContext)_localctx).o.getText():null), ((MethodContext)_localctx).f.value, (((MethodContext)_localctx).t!=null?((MethodContext)_localctx).t.getText():null), ((MethodContext)_localctx).e.value, (((MethodContext)_localctx).o!=null?((MethodContext)_localctx).o.getLine():0));
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Formal_listContext extends ParserRuleContext {
public List<AST.formal> value;
public FormalContext g;
public FormalContext f;
public List<FormalContext> formal() {
return getRuleContexts(FormalContext.class);
}
public FormalContext formal(int i) {
return getRuleContext(FormalContext.class,i);
}
public List<TerminalNode> COMMA() { return getTokens(CoolParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(CoolParser.COMMA, i);
}
public Formal_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_formal_list; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitFormal_list(this);
else return visitor.visitChildren(this);
}
}
public final Formal_listContext formal_list() throws RecognitionException {
Formal_listContext _localctx = new Formal_listContext(_ctx, getState());
enterRule(_localctx, 14, RULE_formal_list);
((Formal_listContext)_localctx).value = new ArrayList<AST.formal>();
int _la;
try {
setState(113);
switch (_input.LA(1)) {
case OBJECTID:
enterOuterAlt(_localctx, 1);
{
setState(101);
((Formal_listContext)_localctx).g = formal();
_localctx.value.add(((Formal_listContext)_localctx).g.value);
setState(109);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(103);
match(COMMA);
setState(104);
((Formal_listContext)_localctx).f = formal();
_localctx.value.add(((Formal_listContext)_localctx).f.value);
}
}
setState(111);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case RPAREN:
enterOuterAlt(_localctx, 2);
{
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FormalContext extends ParserRuleContext {
public AST.formal value;
public Token o;
public Token t;
public TerminalNode COLON() { return getToken(CoolParser.COLON, 0); }
public TerminalNode OBJECTID() { return getToken(CoolParser.OBJECTID, 0); }
public TerminalNode TYPEID() { return getToken(CoolParser.TYPEID, 0); }
public FormalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_formal; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitFormal(this);
else return visitor.visitChildren(this);
}
}
public final FormalContext formal() throws RecognitionException {
FormalContext _localctx = new FormalContext(_ctx, getState());
enterRule(_localctx, 16, RULE_formal);
try {
enterOuterAlt(_localctx, 1);
{
setState(115);
((FormalContext)_localctx).o = match(OBJECTID);
setState(116);
match(COLON);
setState(117);
((FormalContext)_localctx).t = match(TYPEID);
((FormalContext)_localctx).value = new AST.formal((((FormalContext)_localctx).o!=null?((FormalContext)_localctx).o.getText():null), (((FormalContext)_localctx).t!=null?((FormalContext)_localctx).t.getText():null), (((FormalContext)_localctx).o!=null?((FormalContext)_localctx).o.getLine():0));
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExprContext extends ParserRuleContext {
public AST.expression value;
public ExprContext c;
public ExprContext e1;
public Token n;
public Arg_listContext al;
public Token IF;
public ExprContext p;
public ExprContext i;
public ExprContext e;
public Token WHILE;
public ExprContext b;
public Token LBRACE;
public Expr_listContext el;
public Token LET;
public Let_listContext ll;
public Token CASE;
public Branch_listContext bl;
public Token NEW;
public Token t;
public Token TILDE;
public Token ISVOID;
public Token NOT;
public Token o;
public Token ic;
public Token str;
public Token bc;
public ExprContext e2;
public TerminalNode LPAREN() { return getToken(CoolParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(CoolParser.RPAREN, 0); }
public TerminalNode OBJECTID() { return getToken(CoolParser.OBJECTID, 0); }
public Arg_listContext arg_list() {
return getRuleContext(Arg_listContext.class,0);
}
public TerminalNode IF() { return getToken(CoolParser.IF, 0); }
public TerminalNode THEN() { return getToken(CoolParser.THEN, 0); }
public TerminalNode ELSE() { return getToken(CoolParser.ELSE, 0); }
public TerminalNode FI() { return getToken(CoolParser.FI, 0); }
public List<ExprContext> expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode WHILE() { return getToken(CoolParser.WHILE, 0); }
public TerminalNode LOOP() { return getToken(CoolParser.LOOP, 0); }
public TerminalNode POOL() { return getToken(CoolParser.POOL, 0); }
public TerminalNode LBRACE() { return getToken(CoolParser.LBRACE, 0); }
public TerminalNode RBRACE() { return getToken(CoolParser.RBRACE, 0); }
public Expr_listContext expr_list() {
return getRuleContext(Expr_listContext.class,0);
}
public TerminalNode LET() { return getToken(CoolParser.LET, 0); }
public Let_listContext let_list() {
return getRuleContext(Let_listContext.class,0);
}
public TerminalNode CASE() { return getToken(CoolParser.CASE, 0); }
public TerminalNode OF() { return getToken(CoolParser.OF, 0); }
public TerminalNode ESAC() { return getToken(CoolParser.ESAC, 0); }
public Branch_listContext branch_list() {
return getRuleContext(Branch_listContext.class,0);
}
public TerminalNode NEW() { return getToken(CoolParser.NEW, 0); }
public TerminalNode TYPEID() { return getToken(CoolParser.TYPEID, 0); }
public TerminalNode TILDE() { return getToken(CoolParser.TILDE, 0); }
public TerminalNode ISVOID() { return getToken(CoolParser.ISVOID, 0); }
public TerminalNode NOT() { return getToken(CoolParser.NOT, 0); }
public TerminalNode ASSIGN() { return getToken(CoolParser.ASSIGN, 0); }
public TerminalNode INT_CONST() { return getToken(CoolParser.INT_CONST, 0); }
public TerminalNode STR_CONST() { return getToken(CoolParser.STR_CONST, 0); }
public TerminalNode BOOL_CONST() { return getToken(CoolParser.BOOL_CONST, 0); }
public TerminalNode STAR() { return getToken(CoolParser.STAR, 0); }
public TerminalNode SLASH() { return getToken(CoolParser.SLASH, 0); }
public TerminalNode PLUS() { return getToken(CoolParser.PLUS, 0); }
public TerminalNode MINUS() { return getToken(CoolParser.MINUS, 0); }
public TerminalNode LE() { return getToken(CoolParser.LE, 0); }
public TerminalNode LT() { return getToken(CoolParser.LT, 0); }
public TerminalNode EQUALS() { return getToken(CoolParser.EQUALS, 0); }
public TerminalNode ATSYM() { return getToken(CoolParser.ATSYM, 0); }
public TerminalNode DOT() { return getToken(CoolParser.DOT, 0); }
public ExprContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expr; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitExpr(this);
else return visitor.visitChildren(this);
}
}
public final ExprContext expr() throws RecognitionException {
return expr(0);
}
private ExprContext expr(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
ExprContext _localctx = new ExprContext(_ctx, _parentState);
ExprContext _prevctx = _localctx;
int _startState = 18;
enterRecursionRule(_localctx, 18, RULE_expr, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(192);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) {
case 1:
{
setState(121);
((ExprContext)_localctx).n = match(OBJECTID);
setState(122);
match(LPAREN);
setState(123);
((ExprContext)_localctx).al = arg_list();
setState(124);
match(RPAREN);
((ExprContext)_localctx).value = new AST.dispatch(new AST.string_const("self",(((ExprContext)_localctx).n!=null?((ExprContext)_localctx).n.getLine():0)), (((ExprContext)_localctx).n!=null?((ExprContext)_localctx).n.getText():null), ((ExprContext)_localctx).al.value, (((ExprContext)_localctx).n!=null?((ExprContext)_localctx).n.getLine():0));
}
break;
case 2:
{
setState(127);
((ExprContext)_localctx).IF = match(IF);
setState(128);
((ExprContext)_localctx).p = expr(0);
setState(129);
match(THEN);
setState(130);
((ExprContext)_localctx).i = expr(0);
setState(131);
match(ELSE);
setState(132);
((ExprContext)_localctx).e = expr(0);
setState(133);
match(FI);
((ExprContext)_localctx).value = new AST.cond(((ExprContext)_localctx).p.value, ((ExprContext)_localctx).i.value, ((ExprContext)_localctx).e.value, (((ExprContext)_localctx).IF!=null?((ExprContext)_localctx).IF.getLine():0));
}
break;
case 3:
{
setState(136);
((ExprContext)_localctx).WHILE = match(WHILE);
setState(137);
((ExprContext)_localctx).p = expr(0);
setState(138);
match(LOOP);
setState(139);
((ExprContext)_localctx).b = expr(0);
setState(140);
match(POOL);
((ExprContext)_localctx).value = new AST.loop(((ExprContext)_localctx).p.value, ((ExprContext)_localctx).b.value, (((ExprContext)_localctx).WHILE!=null?((ExprContext)_localctx).WHILE.getLine():0));
}
break;
case 4:
{
setState(143);
((ExprContext)_localctx).LBRACE = match(LBRACE);
setState(144);
((ExprContext)_localctx).el = expr_list();
setState(145);
match(RBRACE);
((ExprContext)_localctx).value = new AST.block(((ExprContext)_localctx).el.value, (((ExprContext)_localctx).LBRACE!=null?((ExprContext)_localctx).LBRACE.getLine():0));
}
break;
case 5:
{
setState(148);
((ExprContext)_localctx).LET = match(LET);
setState(149);
((ExprContext)_localctx).ll = let_list();
((ExprContext)_localctx).value = new AST.let(((ExprContext)_localctx).ll.name, ((ExprContext)_localctx).ll.typeid, ((ExprContext)_localctx).ll.value, ((ExprContext)_localctx).ll.body, (((ExprContext)_localctx).LET!=null?((ExprContext)_localctx).LET.getLine():0));
}
break;
case 6:
{
setState(152);
((ExprContext)_localctx).CASE = match(CASE);
setState(153);
((ExprContext)_localctx).p = expr(0);
setState(154);
match(OF);
setState(155);
((ExprContext)_localctx).bl = branch_list();
setState(156);
match(ESAC);
((ExprContext)_localctx).value = new AST.typcase(((ExprContext)_localctx).p.value, ((ExprContext)_localctx).bl.value, (((ExprContext)_localctx).CASE!=null?((ExprContext)_localctx).CASE.getLine():0));
}
break;
case 7:
{
setState(159);
((ExprContext)_localctx).NEW = match(NEW);
setState(160);
((ExprContext)_localctx).t = match(TYPEID);
((ExprContext)_localctx).value = new AST.new_((((ExprContext)_localctx).t!=null?((ExprContext)_localctx).t.getText():null), (((ExprContext)_localctx).NEW!=null?((ExprContext)_localctx).NEW.getLine():0));
}
break;
case 8:
{
setState(162);
((ExprContext)_localctx).TILDE = match(TILDE);
setState(163);
((ExprContext)_localctx).e = expr(16);
((ExprContext)_localctx).value = new AST.comp(((ExprContext)_localctx).e.value, (((ExprContext)_localctx).TILDE!=null?((ExprContext)_localctx).TILDE.getLine():0));
}
break;
case 9:
{
setState(166);
((ExprContext)_localctx).ISVOID = match(ISVOID);
setState(167);
((ExprContext)_localctx).e = expr(15);
((ExprContext)_localctx).value = new AST.isvoid(((ExprContext)_localctx).e.value,(((ExprContext)_localctx).ISVOID!=null?((ExprContext)_localctx).ISVOID.getLine():0));
}
break;
case 10:
{
setState(170);
((ExprContext)_localctx).NOT = match(NOT);
setState(171);
((ExprContext)_localctx).e = expr(7);
((ExprContext)_localctx).value = new AST.neg(((ExprContext)_localctx).e.value,(((ExprContext)_localctx).NOT!=null?((ExprContext)_localctx).NOT.getLine():0));
}
break;
case 11:
{
setState(174);
((ExprContext)_localctx).o = match(OBJECTID);
setState(175);
match(ASSIGN);
setState(176);
((ExprContext)_localctx).e = expr(6);
((ExprContext)_localctx).value = new AST.assign((((ExprContext)_localctx).o!=null?((ExprContext)_localctx).o.getText():null),((ExprContext)_localctx).e.value,(((ExprContext)_localctx).o!=null?((ExprContext)_localctx).o.getLine():0));
}
break;
case 12:
{
setState(179);
match(LPAREN);
setState(180);
((ExprContext)_localctx).e = expr(0);
setState(181);
match(RPAREN);
((ExprContext)_localctx).value = new AST.expression();
((ExprContext)_localctx).value = ((ExprContext)_localctx).e.value;
}
break;
case 13:
{
setState(184);
((ExprContext)_localctx).o = match(OBJECTID);
((ExprContext)_localctx).value = new AST.object((((ExprContext)_localctx).o!=null?((ExprContext)_localctx).o.getText():null), (((ExprContext)_localctx).o!=null?((ExprContext)_localctx).o.getLine():0));
}
break;
case 14:
{
setState(186);
((ExprContext)_localctx).ic = match(INT_CONST);
((ExprContext)_localctx).value = new AST.int_const((((ExprContext)_localctx).ic!=null?Integer.valueOf(((ExprContext)_localctx).ic.getText()):0), (((ExprContext)_localctx).ic!=null?((ExprContext)_localctx).ic.getLine():0));
}
break;
case 15:
{
setState(188);
((ExprContext)_localctx).str = match(STR_CONST);
((ExprContext)_localctx).value = new AST.string_const((((ExprContext)_localctx).str!=null?((ExprContext)_localctx).str.getText():null),(((ExprContext)_localctx).str!=null?((ExprContext)_localctx).str.getLine():0));
}
break;
case 16:
{
setState(190);
((ExprContext)_localctx).bc = match(BOOL_CONST);
if((((ExprContext)_localctx).bc!=null?((ExprContext)_localctx).bc.getText():null).toLowerCase().equals("true"))
((ExprContext)_localctx).value = new AST.bool_const(true,(((ExprContext)_localctx).bc!=null?((ExprContext)_localctx).bc.getLine():0));
else
((ExprContext)_localctx).value = new AST.bool_const(false,(((ExprContext)_localctx).bc!=null?((ExprContext)_localctx).bc.getLine():0));
}
break;
}
_ctx.stop = _input.LT(-1);
setState(249);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(247);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) {
case 1:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.e1 = _prevctx;
_localctx.e1 = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(194);
if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)");
setState(195);
match(STAR);
setState(196);
((ExprContext)_localctx).e2 = expr(15);
((ExprContext)_localctx).value = new AST.mul(((ExprContext)_localctx).e1.value,((ExprContext)_localctx).e2.value,((ExprContext)_localctx).e1.value.lineNo);
}
break;
case 2:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.e1 = _prevctx;
_localctx.e1 = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(199);
if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)");
setState(200);
match(SLASH);
setState(201);
((ExprContext)_localctx).e2 = expr(14);
((ExprContext)_localctx).value = new AST.divide(((ExprContext)_localctx).e1.value,((ExprContext)_localctx).e2.value,((ExprContext)_localctx).e1.value.lineNo);
}
break;
case 3:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.e1 = _prevctx;
_localctx.e1 = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(204);
if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)");
setState(205);
match(PLUS);
setState(206);
((ExprContext)_localctx).e2 = expr(13);
((ExprContext)_localctx).value = new AST.plus(((ExprContext)_localctx).e1.value,((ExprContext)_localctx).e2.value,((ExprContext)_localctx).e1.value.lineNo);
}
break;
case 4:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.e1 = _prevctx;
_localctx.e1 = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(209);
if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)");
setState(210);
match(MINUS);
setState(211);
((ExprContext)_localctx).e2 = expr(12);
((ExprContext)_localctx).value = new AST.sub(((ExprContext)_localctx).e1.value,((ExprContext)_localctx).e2.value,((ExprContext)_localctx).e1.value.lineNo);
}
break;
case 5:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.e1 = _prevctx;
_localctx.e1 = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(214);
if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)");
setState(215);
match(LE);
setState(216);
((ExprContext)_localctx).e2 = expr(11);
((ExprContext)_localctx).value = new AST.leq(((ExprContext)_localctx).e1.value,((ExprContext)_localctx).e2.value,((ExprContext)_localctx).e1.value.lineNo);
}
break;
case 6:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.e1 = _prevctx;
_localctx.e1 = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(219);
if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)");
setState(220);
match(LT);
setState(221);
((ExprContext)_localctx).e2 = expr(10);
((ExprContext)_localctx).value = new AST.lt(((ExprContext)_localctx).e1.value,((ExprContext)_localctx).e2.value,((ExprContext)_localctx).e1.value.lineNo);
}
break;
case 7:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.e1 = _prevctx;
_localctx.e1 = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(224);
if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)");
setState(225);
match(EQUALS);
setState(226);
((ExprContext)_localctx).e2 = expr(9);
((ExprContext)_localctx).value = new AST.eq(((ExprContext)_localctx).e1.value,((ExprContext)_localctx).e2.value,((ExprContext)_localctx).e1.value.lineNo);
}
break;
case 8:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.c = _prevctx;
_localctx.c = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(229);
if (!(precpred(_ctx, 25))) throw new FailedPredicateException(this, "precpred(_ctx, 25)");
setState(230);
match(ATSYM);
setState(231);
((ExprContext)_localctx).t = match(TYPEID);
setState(232);
match(DOT);
setState(233);
((ExprContext)_localctx).n = match(OBJECTID);
setState(234);
match(LPAREN);
setState(235);
((ExprContext)_localctx).al = arg_list();
setState(236);
match(RPAREN);
((ExprContext)_localctx).value = new AST.static_dispatch(((ExprContext)_localctx).c.value, (((ExprContext)_localctx).t!=null?((ExprContext)_localctx).t.getText():null), (((ExprContext)_localctx).n!=null?((ExprContext)_localctx).n.getText():null), ((ExprContext)_localctx).al.value, ((ExprContext)_localctx).c.value.lineNo);
}
break;
case 9:
{
_localctx = new ExprContext(_parentctx, _parentState);
_localctx.c = _prevctx;
_localctx.c = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(239);
if (!(precpred(_ctx, 24))) throw new FailedPredicateException(this, "precpred(_ctx, 24)");
setState(240);
match(DOT);
setState(241);
((ExprContext)_localctx).n = match(OBJECTID);
setState(242);
match(LPAREN);
setState(243);
((ExprContext)_localctx).al = arg_list();
setState(244);
match(RPAREN);
((ExprContext)_localctx).value = new AST.dispatch(((ExprContext)_localctx).c.value, (((ExprContext)_localctx).n!=null?((ExprContext)_localctx).n.getText():null), ((ExprContext)_localctx).al.value, ((ExprContext)_localctx).c.value.lineNo);
}
break;
}
}
}
setState(251);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class Arg_listContext extends ParserRuleContext {
public List<AST.expression> value;
public ExprContext e;
public ExprContext f;
public List<ExprContext> expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public List<TerminalNode> COMMA() { return getTokens(CoolParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(CoolParser.COMMA, i);
}
public Arg_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_arg_list; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitArg_list(this);
else return visitor.visitChildren(this);
}
}
public final Arg_listContext arg_list() throws RecognitionException {
Arg_listContext _localctx = new Arg_listContext(_ctx, getState());
enterRule(_localctx, 20, RULE_arg_list);
((Arg_listContext)_localctx).value = new ArrayList<AST.expression>();
int _la;
try {
setState(264);
switch (_input.LA(1)) {
case OBJECTID:
case BOOL_CONST:
case INT_CONST:
case STR_CONST:
case LPAREN:
case TILDE:
case LBRACE:
case IF:
case LET:
case WHILE:
case CASE:
case NEW:
case ISVOID:
case NOT:
enterOuterAlt(_localctx, 1);
{
setState(252);
((Arg_listContext)_localctx).e = expr(0);
_localctx.value.add(((Arg_listContext)_localctx).e.value);
setState(260);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(254);
match(COMMA);
setState(255);
((Arg_listContext)_localctx).f = expr(0);
_localctx.value.add(((Arg_listContext)_localctx).f.value);
}
}
setState(262);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case RPAREN:
enterOuterAlt(_localctx, 2);
{
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Expr_listContext extends ParserRuleContext {
public List<AST.expression> value;
public ExprContext e;
public List<TerminalNode> SEMICOLON() { return getTokens(CoolParser.SEMICOLON); }
public TerminalNode SEMICOLON(int i) {
return getToken(CoolParser.SEMICOLON, i);
}
public List<ExprContext> expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public Expr_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expr_list; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitExpr_list(this);
else return visitor.visitChildren(this);
}
}
public final Expr_listContext expr_list() throws RecognitionException {
Expr_listContext _localctx = new Expr_listContext(_ctx, getState());
enterRule(_localctx, 22, RULE_expr_list);
((Expr_listContext)_localctx).value = new ArrayList<AST.expression>();
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(270);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(266);
((Expr_listContext)_localctx).e = expr(0);
_localctx.value.add(((Expr_listContext)_localctx).e.value);
setState(268);
match(SEMICOLON);
}
}
setState(272);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OBJECTID) | (1L << BOOL_CONST) | (1L << INT_CONST) | (1L << STR_CONST) | (1L << LPAREN) | (1L << TILDE) | (1L << LBRACE) | (1L << IF) | (1L << LET) | (1L << WHILE) | (1L << CASE) | (1L << NEW) | (1L << ISVOID) | (1L << NOT))) != 0) );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Let_listContext extends ParserRuleContext {
public String name;
public String typeid;
public AST.expression value;
public AST.expression body;
public Token o;
public Token t;
public ExprContext b;
public ExprContext v;
public Let_listContext ll;
public TerminalNode COLON() { return getToken(CoolParser.COLON, 0); }
public TerminalNode IN() { return getToken(CoolParser.IN, 0); }
public TerminalNode OBJECTID() { return getToken(CoolParser.OBJECTID, 0); }
public TerminalNode TYPEID() { return getToken(CoolParser.TYPEID, 0); }
public List<ExprContext> expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode ASSIGN() { return getToken(CoolParser.ASSIGN, 0); }
public TerminalNode COMMA() { return getToken(CoolParser.COMMA, 0); }
public Let_listContext let_list() {
return getRuleContext(Let_listContext.class,0);
}
public Let_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_let_list; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitLet_list(this);
else return visitor.visitChildren(this);
}
}
public final Let_listContext let_list() throws RecognitionException {
Let_listContext _localctx = new Let_listContext(_ctx, getState());
enterRule(_localctx, 24, RULE_let_list);
((Let_listContext)_localctx).name = new String();
((Let_listContext)_localctx).typeid = new String();
((Let_listContext)_localctx).value = new AST.expression();
((Let_listContext)_localctx).body = new AST.expression();
try {
setState(306);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(274);
((Let_listContext)_localctx).o = match(OBJECTID);
setState(275);
match(COLON);
setState(276);
((Let_listContext)_localctx).t = match(TYPEID);
setState(277);
match(IN);
setState(278);
((Let_listContext)_localctx).b = expr(0);
((Let_listContext)_localctx).name = (((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getText():null);
((Let_listContext)_localctx).typeid = (((Let_listContext)_localctx).t!=null?((Let_listContext)_localctx).t.getText():null);
((Let_listContext)_localctx).value = new AST.no_expr((((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getLine():0));
((Let_listContext)_localctx).body = ((Let_listContext)_localctx).b.value;
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(281);
((Let_listContext)_localctx).o = match(OBJECTID);
setState(282);
match(COLON);
setState(283);
((Let_listContext)_localctx).t = match(TYPEID);
setState(284);
match(ASSIGN);
setState(285);
((Let_listContext)_localctx).v = expr(0);
setState(286);
match(IN);
setState(287);
((Let_listContext)_localctx).b = expr(0);
((Let_listContext)_localctx).name = (((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getText():null);
((Let_listContext)_localctx).typeid = (((Let_listContext)_localctx).t!=null?((Let_listContext)_localctx).t.getText():null);
((Let_listContext)_localctx).value = ((Let_listContext)_localctx).v.value;
((Let_listContext)_localctx).body = ((Let_listContext)_localctx).b.value;
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(290);
((Let_listContext)_localctx).o = match(OBJECTID);
setState(291);
match(COLON);
setState(292);
((Let_listContext)_localctx).t = match(TYPEID);
setState(293);
match(COMMA);
setState(294);
((Let_listContext)_localctx).ll = let_list();
((Let_listContext)_localctx).name = (((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getText():null);
((Let_listContext)_localctx).typeid = (((Let_listContext)_localctx).t!=null?((Let_listContext)_localctx).t.getText():null);
((Let_listContext)_localctx).value = new AST.no_expr((((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getLine():0));
((Let_listContext)_localctx).body = new AST.let(((Let_listContext)_localctx).ll.name, ((Let_listContext)_localctx).ll.typeid, ((Let_listContext)_localctx).ll.value, ((Let_listContext)_localctx).ll.body, (((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getLine():0));
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(297);
((Let_listContext)_localctx).o = match(OBJECTID);
setState(298);
match(COLON);
setState(299);
((Let_listContext)_localctx).t = match(TYPEID);
setState(300);
match(ASSIGN);
setState(301);
((Let_listContext)_localctx).v = expr(0);
setState(302);
match(COMMA);
setState(303);
((Let_listContext)_localctx).ll = let_list();
((Let_listContext)_localctx).name = (((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getText():null);
((Let_listContext)_localctx).typeid = (((Let_listContext)_localctx).t!=null?((Let_listContext)_localctx).t.getText():null);
((Let_listContext)_localctx).value = ((Let_listContext)_localctx).v.value;
((Let_listContext)_localctx).body = new AST.let(((Let_listContext)_localctx).ll.name, ((Let_listContext)_localctx).ll.typeid, ((Let_listContext)_localctx).ll.value, ((Let_listContext)_localctx).ll.body, (((Let_listContext)_localctx).o!=null?((Let_listContext)_localctx).o.getLine():0));
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Branch_listContext extends ParserRuleContext {
public List<AST.branch> value;
public BranchContext b;
public List<TerminalNode> SEMICOLON() { return getTokens(CoolParser.SEMICOLON); }
public TerminalNode SEMICOLON(int i) {
return getToken(CoolParser.SEMICOLON, i);
}
public List<BranchContext> branch() {
return getRuleContexts(BranchContext.class);
}
public BranchContext branch(int i) {
return getRuleContext(BranchContext.class,i);
}
public Branch_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_branch_list; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitBranch_list(this);
else return visitor.visitChildren(this);
}
}
public final Branch_listContext branch_list() throws RecognitionException {
Branch_listContext _localctx = new Branch_listContext(_ctx, getState());
enterRule(_localctx, 26, RULE_branch_list);
((Branch_listContext)_localctx).value = new ArrayList<AST.branch>();
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(312);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(308);
((Branch_listContext)_localctx).b = branch();
_localctx.value.add(((Branch_listContext)_localctx).b.value);
setState(310);
match(SEMICOLON);
}
}
setState(314);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==OBJECTID );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class BranchContext extends ParserRuleContext {
public AST.branch value;
public Token o;
public Token t;
public ExprContext e;
public TerminalNode COLON() { return getToken(CoolParser.COLON, 0); }
public TerminalNode DARROW() { return getToken(CoolParser.DARROW, 0); }
public TerminalNode OBJECTID() { return getToken(CoolParser.OBJECTID, 0); }
public TerminalNode TYPEID() { return getToken(CoolParser.TYPEID, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public BranchContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_branch; }
@Override
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
if ( visitor instanceof CoolParserVisitor ) return ((CoolParserVisitor<? extends T>)visitor).visitBranch(this);
else return visitor.visitChildren(this);
}
}
public final BranchContext branch() throws RecognitionException {
BranchContext _localctx = new BranchContext(_ctx, getState());
enterRule(_localctx, 28, RULE_branch);
try {
enterOuterAlt(_localctx, 1);
{
setState(316);
((BranchContext)_localctx).o = match(OBJECTID);
setState(317);
match(COLON);
setState(318);
((BranchContext)_localctx).t = match(TYPEID);
setState(319);
match(DARROW);
setState(320);
((BranchContext)_localctx).e = expr(0);
((BranchContext)_localctx).value = new AST.branch((((BranchContext)_localctx).o!=null?((BranchContext)_localctx).o.getText():null), (((BranchContext)_localctx).t!=null?((BranchContext)_localctx).t.getText():null), ((BranchContext)_localctx).e.value, (((BranchContext)_localctx).o!=null?((BranchContext)_localctx).o.getLine():0));
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch (ruleIndex) {
case 9:
return expr_sempred((ExprContext)_localctx, predIndex);
}
return true;
}
private boolean expr_sempred(ExprContext _localctx, int predIndex) {
switch (predIndex) {
case 0:
return precpred(_ctx, 14);
case 1:
return precpred(_ctx, 13);
case 2:
return precpred(_ctx, 12);
case 3:
return precpred(_ctx, 11);
case 4:
return precpred(_ctx, 10);
case 5:
return precpred(_ctx, 9);
case 6:
return precpred(_ctx, 8);
case 7:
return precpred(_ctx, 25);
case 8:
return precpred(_ctx, 24);
}
return true;
}
public static final String _serializedATN =
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3@\u0146\4\2\t\2\4"+
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\3\2\3\2\3\2\3\2\3\3"+
"\3\3\3\3\3\3\6\3)\n\3\r\3\16\3*\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3"+
"\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4=\n\4\3\5\3\5\3\5\3\5\7\5C\n\5\f\5\16\5"+
"F\13\5\3\6\3\6\3\6\3\6\3\6\3\6\5\6N\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3"+
"\7\3\7\3\7\3\7\5\7[\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3"+
"\t\3\t\3\t\3\t\3\t\3\t\7\tn\n\t\f\t\16\tq\13\t\3\t\5\tt\n\t\3\n\3\n\3"+
"\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\5\13\u00c3\n\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\7\13\u00fa\n\13\f\13\16\13\u00fd\13\13\3\f\3\f\3"+
"\f\3\f\3\f\3\f\7\f\u0105\n\f\f\f\16\f\u0108\13\f\3\f\5\f\u010b\n\f\3\r"+
"\3\r\3\r\3\r\6\r\u0111\n\r\r\r\16\r\u0112\3\16\3\16\3\16\3\16\3\16\3\16"+
"\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+
"\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\5\16\u0135"+
"\n\16\3\17\3\17\3\17\3\17\6\17\u013b\n\17\r\17\16\17\u013c\3\20\3\20\3"+
"\20\3\20\3\20\3\20\3\20\3\20\2\3\24\21\2\4\6\b\n\f\16\20\22\24\26\30\32"+
"\34\36\2\2\u015c\2 \3\2\2\2\4(\3\2\2\2\6<\3\2\2\2\bD\3\2\2\2\nM\3\2\2"+
"\2\fZ\3\2\2\2\16\\\3\2\2\2\20s\3\2\2\2\22u\3\2\2\2\24\u00c2\3\2\2\2\26"+
"\u010a\3\2\2\2\30\u0110\3\2\2\2\32\u0134\3\2\2\2\34\u013a\3\2\2\2\36\u013e"+
"\3\2\2\2 !\5\4\3\2!\"\7\2\2\3\"#\b\2\1\2#\3\3\2\2\2$%\5\6\4\2%&\b\3\1"+
"\2&\'\7\r\2\2\')\3\2\2\2($\3\2\2\2)*\3\2\2\2*(\3\2\2\2*+\3\2\2\2+\5\3"+
"\2\2\2,-\7\34\2\2-.\7\4\2\2./\7\26\2\2/\60\5\b\5\2\60\61\7\27\2\2\61\62"+
"\b\4\1\2\62=\3\2\2\2\63\64\7\34\2\2\64\65\7\4\2\2\65\66\7!\2\2\66\67\7"+
"\4\2\2\678\7\26\2\289\5\b\5\29:\7\27\2\2:;\b\4\1\2;=\3\2\2\2<,\3\2\2\2"+
"<\63\3\2\2\2=\7\3\2\2\2>?\5\n\6\2?@\b\5\1\2@A\7\r\2\2AC\3\2\2\2B>\3\2"+
"\2\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2E\t\3\2\2\2FD\3\2\2\2GH\5\16\b\2HI\b"+
"\6\1\2IN\3\2\2\2JK\5\f\7\2KL\b\6\1\2LN\3\2\2\2MG\3\2\2\2MJ\3\2\2\2N\13"+
"\3\2\2\2OP\7\5\2\2PQ\7\13\2\2QR\7\4\2\2R[\b\7\1\2ST\7\5\2\2TU\7\13\2\2"+
"UV\7\4\2\2VW\7\33\2\2WX\5\24\13\2XY\b\7\1\2Y[\3\2\2\2ZO\3\2\2\2ZS\3\2"+
"\2\2[\r\3\2\2\2\\]\7\5\2\2]^\7\t\2\2^_\5\20\t\2_`\7\n\2\2`a\7\13\2\2a"+
"b\7\4\2\2bc\7\26\2\2cd\5\24\13\2de\7\27\2\2ef\b\b\1\2f\17\3\2\2\2gh\5"+
"\22\n\2ho\b\t\1\2ij\7\16\2\2jk\5\22\n\2kl\b\t\1\2ln\3\2\2\2mi\3\2\2\2"+
"nq\3\2\2\2om\3\2\2\2op\3\2\2\2pt\3\2\2\2qo\3\2\2\2rt\3\2\2\2sg\3\2\2\2"+
"sr\3\2\2\2t\21\3\2\2\2uv\7\5\2\2vw\7\13\2\2wx\7\4\2\2xy\b\n\1\2y\23\3"+
"\2\2\2z{\b\13\1\2{|\7\5\2\2|}\7\t\2\2}~\5\26\f\2~\177\7\n\2\2\177\u0080"+
"\b\13\1\2\u0080\u00c3\3\2\2\2\u0081\u0082\7\37\2\2\u0082\u0083\5\24\13"+
"\2\u0083\u0084\7%\2\2\u0084\u0085\5\24\13\2\u0085\u0086\7\35\2\2\u0086"+
"\u0087\5\24\13\2\u0087\u0088\7\36\2\2\u0088\u0089\b\13\1\2\u0089\u00c3"+
"\3\2\2\2\u008a\u008b\7&\2\2\u008b\u008c\5\24\13\2\u008c\u008d\7#\2\2\u008d"+
"\u008e\5\24\13\2\u008e\u008f\7$\2\2\u008f\u0090\b\13\1\2\u0090\u00c3\3"+
"\2\2\2\u0091\u0092\7\26\2\2\u0092\u0093\5\30\r\2\u0093\u0094\7\27\2\2"+
"\u0094\u0095\b\13\1\2\u0095\u00c3\3\2\2\2\u0096\u0097\7\"\2\2\u0097\u0098"+
"\5\32\16\2\u0098\u0099\b\13\1\2\u0099\u00c3\3\2\2\2\u009a\u009b\7\'\2"+
"\2\u009b\u009c\5\24\13\2\u009c\u009d\7)\2\2\u009d\u009e\5\34\17\2\u009e"+
"\u009f\7(\2\2\u009f\u00a0\b\13\1\2\u00a0\u00c3\3\2\2\2\u00a1\u00a2\7*"+
"\2\2\u00a2\u00a3\7\4\2\2\u00a3\u00c3\b\13\1\2\u00a4\u00a5\7\23\2\2\u00a5"+
"\u00a6\5\24\13\22\u00a6\u00a7\b\13\1\2\u00a7\u00c3\3\2\2\2\u00a8\u00a9"+
"\7+\2\2\u00a9\u00aa\5\24\13\21\u00aa\u00ab\b\13\1\2\u00ab\u00c3\3\2\2"+
"\2\u00ac\u00ad\7,\2\2\u00ad\u00ae\5\24\13\t\u00ae\u00af\b\13\1\2\u00af"+
"\u00c3\3\2\2\2\u00b0\u00b1\7\5\2\2\u00b1\u00b2\7\33\2\2\u00b2\u00b3\5"+
"\24\13\b\u00b3\u00b4\b\13\1\2\u00b4\u00c3\3\2\2\2\u00b5\u00b6\7\t\2\2"+
"\u00b6\u00b7\5\24\13\2\u00b7\u00b8\7\n\2\2\u00b8\u00b9\b\13\1\2\u00b9"+
"\u00c3\3\2\2\2\u00ba\u00bb\7\5\2\2\u00bb\u00c3\b\13\1\2\u00bc\u00bd\7"+
"\7\2\2\u00bd\u00c3\b\13\1\2\u00be\u00bf\7\b\2\2\u00bf\u00c3\b\13\1\2\u00c0"+
"\u00c1\7\6\2\2\u00c1\u00c3\b\13\1\2\u00c2z\3\2\2\2\u00c2\u0081\3\2\2\2"+
"\u00c2\u008a\3\2\2\2\u00c2\u0091\3\2\2\2\u00c2\u0096\3\2\2\2\u00c2\u009a"+
"\3\2\2\2\u00c2\u00a1\3\2\2\2\u00c2\u00a4\3\2\2\2\u00c2\u00a8\3\2\2\2\u00c2"+
"\u00ac\3\2\2\2\u00c2\u00b0\3\2\2\2\u00c2\u00b5\3\2\2\2\u00c2\u00ba\3\2"+
"\2\2\u00c2\u00bc\3\2\2\2\u00c2\u00be\3\2\2\2\u00c2\u00c0\3\2\2\2\u00c3"+
"\u00fb\3\2\2\2\u00c4\u00c5\f\20\2\2\u00c5\u00c6\7\21\2\2\u00c6\u00c7\5"+
"\24\13\21\u00c7\u00c8\b\13\1\2\u00c8\u00fa\3\2\2\2\u00c9\u00ca\f\17\2"+
"\2\u00ca\u00cb\7\22\2\2\u00cb\u00cc\5\24\13\20\u00cc\u00cd\b\13\1\2\u00cd"+
"\u00fa\3\2\2\2\u00ce\u00cf\f\16\2\2\u00cf\u00d0\7\17\2\2\u00d0\u00d1\5"+
"\24\13\17\u00d1\u00d2\b\13\1\2\u00d2\u00fa\3\2\2\2\u00d3\u00d4\f\r\2\2"+
"\u00d4\u00d5\7\20\2\2\u00d5\u00d6\5\24\13\16\u00d6\u00d7\b\13\1\2\u00d7"+
"\u00fa\3\2\2\2\u00d8\u00d9\f\f\2\2\u00d9\u00da\7\32\2\2\u00da\u00db\5"+
"\24\13\r\u00db\u00dc\b\13\1\2\u00dc\u00fa\3\2\2\2\u00dd\u00de\f\13\2\2"+
"\u00de\u00df\7\24\2\2\u00df\u00e0\5\24\13\f\u00e0\u00e1\b\13\1\2\u00e1"+
"\u00fa\3\2\2\2\u00e2\u00e3\f\n\2\2\u00e3\u00e4\7\25\2\2\u00e4\u00e5\5"+
"\24\13\13\u00e5\u00e6\b\13\1\2\u00e6\u00fa\3\2\2\2\u00e7\u00e8\f\33\2"+
"\2\u00e8\u00e9\7\f\2\2\u00e9\u00ea\7\4\2\2\u00ea\u00eb\7\30\2\2\u00eb"+
"\u00ec\7\5\2\2\u00ec\u00ed\7\t\2\2\u00ed\u00ee\5\26\f\2\u00ee\u00ef\7"+
"\n\2\2\u00ef\u00f0\b\13\1\2\u00f0\u00fa\3\2\2\2\u00f1\u00f2\f\32\2\2\u00f2"+
"\u00f3\7\30\2\2\u00f3\u00f4\7\5\2\2\u00f4\u00f5\7\t\2\2\u00f5\u00f6\5"+
"\26\f\2\u00f6\u00f7\7\n\2\2\u00f7\u00f8\b\13\1\2\u00f8\u00fa\3\2\2\2\u00f9"+
"\u00c4\3\2\2\2\u00f9\u00c9\3\2\2\2\u00f9\u00ce\3\2\2\2\u00f9\u00d3\3\2"+
"\2\2\u00f9\u00d8\3\2\2\2\u00f9\u00dd\3\2\2\2\u00f9\u00e2\3\2\2\2\u00f9"+
"\u00e7\3\2\2\2\u00f9\u00f1\3\2\2\2\u00fa\u00fd\3\2\2\2\u00fb\u00f9\3\2"+
"\2\2\u00fb\u00fc\3\2\2\2\u00fc\25\3\2\2\2\u00fd\u00fb\3\2\2\2\u00fe\u00ff"+
"\5\24\13\2\u00ff\u0106\b\f\1\2\u0100\u0101\7\16\2\2\u0101\u0102\5\24\13"+
"\2\u0102\u0103\b\f\1\2\u0103\u0105\3\2\2\2\u0104\u0100\3\2\2\2\u0105\u0108"+
"\3\2\2\2\u0106\u0104\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u010b\3\2\2\2\u0108"+
"\u0106\3\2\2\2\u0109\u010b\3\2\2\2\u010a\u00fe\3\2\2\2\u010a\u0109\3\2"+
"\2\2\u010b\27\3\2\2\2\u010c\u010d\5\24\13\2\u010d\u010e\b\r\1\2\u010e"+
"\u010f\7\r\2\2\u010f\u0111\3\2\2\2\u0110\u010c\3\2\2\2\u0111\u0112\3\2"+
"\2\2\u0112\u0110\3\2\2\2\u0112\u0113\3\2\2\2\u0113\31\3\2\2\2\u0114\u0115"+
"\7\5\2\2\u0115\u0116\7\13\2\2\u0116\u0117\7\4\2\2\u0117\u0118\7 \2\2\u0118"+
"\u0119\5\24\13\2\u0119\u011a\b\16\1\2\u011a\u0135\3\2\2\2\u011b\u011c"+
"\7\5\2\2\u011c\u011d\7\13\2\2\u011d\u011e\7\4\2\2\u011e\u011f\7\33\2\2"+
"\u011f\u0120\5\24\13\2\u0120\u0121\7 \2\2\u0121\u0122\5\24\13\2\u0122"+
"\u0123\b\16\1\2\u0123\u0135\3\2\2\2\u0124\u0125\7\5\2\2\u0125\u0126\7"+
"\13\2\2\u0126\u0127\7\4\2\2\u0127\u0128\7\16\2\2\u0128\u0129\5\32\16\2"+
"\u0129\u012a\b\16\1\2\u012a\u0135\3\2\2\2\u012b\u012c\7\5\2\2\u012c\u012d"+
"\7\13\2\2\u012d\u012e\7\4\2\2\u012e\u012f\7\33\2\2\u012f\u0130\5\24\13"+
"\2\u0130\u0131\7\16\2\2\u0131\u0132\5\32\16\2\u0132\u0133\b\16\1\2\u0133"+
"\u0135\3\2\2\2\u0134\u0114\3\2\2\2\u0134\u011b\3\2\2\2\u0134\u0124\3\2"+
"\2\2\u0134\u012b\3\2\2\2\u0135\33\3\2\2\2\u0136\u0137\5\36\20\2\u0137"+
"\u0138\b\17\1\2\u0138\u0139\7\r\2\2\u0139\u013b\3\2\2\2\u013a\u0136\3"+
"\2\2\2\u013b\u013c\3\2\2\2\u013c\u013a\3\2\2\2\u013c\u013d\3\2\2\2\u013d"+
"\35\3\2\2\2\u013e\u013f\7\5\2\2\u013f\u0140\7\13\2\2\u0140\u0141\7\4\2"+
"\2\u0141\u0142\7\31\2\2\u0142\u0143\5\24\13\2\u0143\u0144\b\20\1\2\u0144"+
"\37\3\2\2\2\21*<DMZos\u00c2\u00f9\u00fb\u0106\u010a\u0112\u0134\u013c";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
}
}
} | [
"cs14btech11041@iith.ac.in"
] | cs14btech11041@iith.ac.in |
3e12c5f78f0083b55568eee0cb83757eced95762 | d8d5c3ee47e9be5279a54ffbee580bd6e79b317a | /src/main/java/com/example/entity/Course.java | f668e0ee303afc2982705da50a9e55dab10626c8 | [] | no_license | Gaurav0807/Backend_Liv2Train_Gauravr | 5a7610e6fc6dd8cd38f3b334bb50ae7867fa05cc | b3a2cd90059588e5e17454db207d91bf5ce84020 | refs/heads/master | 2023-06-24T09:19:15.621732 | 2021-07-26T17:38:54 | 2021-07-26T17:38:54 | 388,375,036 | 1 | 1 | null | 2021-07-26T17:38:55 | 2021-07-22T07:51:46 | Java | UTF-8 | Java | false | false | 546 | java | package com.example.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
@Entity
public class Course {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
private String cname;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCname() {
return cname;
}
public void setCname(String cname) {
this.cname = cname;
}
}
| [
"gauravrawat141999@gmail.com"
] | gauravrawat141999@gmail.com |
cd039a0bfb54d6037e8b44074e8fe08eb07dde40 | f543a8fe55e307f1f8ca04b1b50cf38ad845ade8 | /app/src/main/java/com/hzsoft/musicdemo/view/NoDataView.java | 83209617485633fe03851d1fdf71a1b253c17354 | [
"Apache-2.0"
] | permissive | zhouhuandev/MusicDemo | d1da7ca3fbf1d643b8d3a752ff8b3e9b8a80a957 | ca61d12c8e47599372e22cb47d6c0a92b0fa7a77 | refs/heads/main | 2023-01-25T00:34:03.246076 | 2020-11-24T14:46:06 | 2020-11-24T14:46:06 | 315,658,402 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,068 | java | package com.hzsoft.musicdemo.view;
import android.content.Context;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.hzsoft.musicdemo.R;
/**
* <p>NoDataView 没有数据页面</p>
*
* @author zhouhuan
* @Data 2020/11/19
*/
public class NoDataView extends RelativeLayout {
private final RelativeLayout mRlNoDataRoot;
private final ImageView mImgNoDataView;
public NoDataView(Context context, AttributeSet attrs) {
super(context, attrs);
inflate(context, R.layout.view_no_data,this);
mRlNoDataRoot = findViewById(R.id.rl_no_data_root);
mImgNoDataView = findViewById(R.id.img_no_data);
}
public void setNoDataBackground(@ColorRes int colorResId){
mRlNoDataRoot.setBackgroundColor(getResources().getColor(colorResId));
}
public void setNoDataView(@DrawableRes int imgResId){
mImgNoDataView.setImageResource(imgResId);
}
} | [
"zhouhuan88888@163.com"
] | zhouhuan88888@163.com |
34b7e3a93aa8b3ea26670b78acc1829d4c5b357a | 7ef93acc326204111ff6c5b71cc93b4bb723f676 | /src/android/com/affinitybridge/cordova/mapbox/LineGeometry.java | 77b11a24532f7ec9dc4abc1f0f6344a291b4aebe | [
"MIT"
] | permissive | stellasoft-will/cordova-mapbox-android-sdk | dc2c04a1b751e084e9a72da1a2cfe23623e7501b | f394c172ed29cb224546d238764424ac3f0acf33 | refs/heads/master | 2020-12-25T00:28:30.279965 | 2015-07-03T22:10:44 | 2015-07-03T22:10:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,977 | java | package com.affinitybridge.cordova.mapbox;
import android.graphics.Color;
import android.util.Log;
import com.cocoahero.android.geojson.Feature;
import com.cocoahero.android.geojson.LineString;
import com.cocoahero.android.geojson.Position;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.overlay.PathOverlay;
import com.mapbox.mapboxsdk.views.MapView;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
/**
* Created by tnightingale on 15-04-20.
*/
public class LineGeometry implements Builder.GeometryInterface {
final protected int lineColor = Color.RED;
final protected float strokeWidth = 5;
protected MapView mapView;
protected Builder builder;
protected PathOverlay line;
protected ArrayList<LatLng> latLngs;
public LineGeometry(MapView mv, Builder builder) {
this.mapView = mv;
this.builder = builder;
this.latLngs = new ArrayList<LatLng>();
this.line = new PathOverlay(this.lineColor, this.strokeWidth);
this.mapView.getOverlays().add(this.line);
}
public int size() {
return this.latLngs.size();
}
public void addGhostLatLng(LatLng latLng) {
this.line.addPoint(latLng);
}
public boolean addLatLng(LatLng latLng) {
Log.d("LineBuilder", String.format("addLatLng(); latLng: (%f, %f)", latLng.getLongitude(), latLng.getLatitude()));
return this.insertLatLng(-1, latLng);
}
public boolean insertLatLng(int position, LatLng latLng) {
this.line.addPoint(latLng);
if (position < 0) {
this.latLngs.add(latLng);
}
else {
Log.d("LineBuilder", String.format("insertLatLng(); position: %d, latLng: (%f, %f)", position, latLng.getLongitude(), latLng.getLatitude()));
this.latLngs.add(position, latLng);
}
return true;
}
public void setLatLng(int position, LatLng latLng) {
this.latLngs.set(position, latLng);
}
public int indexOfLatLng(LatLng latLng) {
return this.latLngs.indexOf(latLng);
}
public void remove(LatLng latLng) {
this.remove(this.indexOfLatLng(latLng));
}
public void remove(int position) {
this.latLngs.remove(position);
this.reset();
Log.d("LineBuilder", String.format("remove() latLngs.size(): %d, line.getNumberOfPoints(): %d", this.latLngs.size(), this.line.getNumberOfPoints()));
}
public void reset() {
this.line.clearPath();
this.line.addPoints(this.latLngs);
}
public Feature toGeoJSON() {
LineString ls = new LineString();
for (int i = 0; i < this.latLngs.size(); i++) {
LatLng latLng = this.latLngs.get(i);
ls.addPosition(new Position(latLng.getLatitude(), latLng.getLongitude()));
}
Feature f = new Feature(ls);
f.setProperties(new JSONObject());
return f;
}
} | [
"tom@tnightingale.com"
] | tom@tnightingale.com |
ba20ed3a28006898bd14e8bf6d93b95038ce032d | 214ed0a94b7687df0484e4262007a06148c11caf | /src/main/java/com/example/demo/entity/CurrencyCode.java | 3e77aaff975ad3c15e0bb99be3e89b5b665a13ed | [] | no_license | pareshkm/demo | b6a2b776f750e34f77a617d4d22c7445d8a11cb5 | c8f7c88efbef7dcbdf75303ee8f4a77b093bd89c | refs/heads/master | 2021-01-19T11:57:03.327421 | 2017-04-20T17:19:33 | 2017-04-20T17:19:33 | 88,006,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 84 | java | package com.example.demo.entity;
public enum CurrencyCode {
USD, INR, DNR;
}
| [
"Paresh.X.Mohapatra@HealthPartners.Com"
] | Paresh.X.Mohapatra@HealthPartners.Com |
9b885a129930f8a049f1198cf815a4dc8143b10d | 2d5278dd19024290e590e7b3256861ae401c7892 | /src/main/java/com/compomics/peptizer/util/datatools/implementations/pride/PridePeak.java | d4823b9dc29bde0a0b9e1bad2b24e3b7b1bee548 | [
"Apache-2.0"
] | permissive | compomics/peptizer | 8ea046be9cd34d6f1c1c7afacc92f2bc84c1cd8b | 55faddedda079fbd2cb6fda05c596f0719dcc879 | refs/heads/master | 2021-01-10T20:55:26.094502 | 2015-04-14T13:51:45 | 2015-04-14T13:51:45 | 33,931,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 853 | java | package com.compomics.peptizer.util.datatools.implementations.pride;
import com.compomics.peptizer.util.datatools.interfaces.PeptizerPeak;
import com.compomics.peptizer.util.enumerator.SearchEngineEnum;
import org.apache.log4j.Logger;
import java.io.Serializable;
/**
* Created by IntelliJ IDEA.
* User: vaudel
* Date: 19.07.2010
* Time: 13:26:01
* To change this template use File | Settings | File Templates.
*/
public class PridePeak extends PeptizerPeak implements Serializable {
// Class specific log4j logger for PridePeak instances.
private static Logger logger = Logger.getLogger(PridePeak.class);
public PridePeak() {
}
public PridePeak(double mz, double abundance) {
super.iMZ = mz;
super.iIntensity = abundance;
}
public SearchEngineEnum getSearchEngineEnum() {
return null;
}
}
| [
"kennyhelsens@63bb80b4-1254-11df-a01e-a3ea0020dc93"
] | kennyhelsens@63bb80b4-1254-11df-a01e-a3ea0020dc93 |
8e748d2d86cb8b64b9345c86abe5558607db189c | 141899320f3f99b4ee815a7274b19ced6830d3e8 | /src/Outcast.java | 95483324548703dc8d522a2c5b2f15fe4e885f7c | [] | no_license | salamap/WordNet | ee4de677af0b38bd4eb10a8726bbfbf566200269 | 9f98ad57f3643011e4770dbf75a461a09e2301b4 | refs/heads/master | 2016-09-06T19:07:47.444749 | 2014-04-14T20:04:57 | 2014-04-14T20:04:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,418 | java |
public class Outcast {
private final WordNet wordNet;
private class OutcastNoun implements Comparable<OutcastNoun> {
int length = -1;
String noun = null;
public OutcastNoun(String noun) {
this.noun = noun;
}
public int compareTo(OutcastNoun other) {
if (this.length > other.length) return 1;
else if (this.length < other.length) return -1;
else return 0;
}
}
// constructor takes a WordNet object
public Outcast(WordNet wordnet) {
this.wordNet = wordnet;
}
// given an array of WordNet nouns, return an outcast
public String outcast(String[] nouns) {
if (nouns == null) throw new NullPointerException();
MaxPQ<OutcastNoun> q = new MaxPQ<OutcastNoun>();
for (int i = 0; i < nouns.length; i++) {
OutcastNoun x = new OutcastNoun(nouns[i]);
for (int j = 0; j < nouns.length; j++) {
if (i == j ) continue;
x.length += this.wordNet.distance(nouns[i], nouns[j]);
}
q.insert(x);
}
return q.delMax().noun;
}
// for unit testing of this class
public static void main(String[] args) {
WordNet wordnet = new WordNet(args[0], args[1]);
Outcast outcast = new Outcast(wordnet);
for (int t = 2; t < args.length; t++) {
In in = new In(args[t]);
String[] nouns = in.readAllStrings();
StdOut.println(args[t] + ": " + outcast.outcast(nouns));
}
}
}
| [
"salamap@gmail.com"
] | salamap@gmail.com |
c4ddc6dbdacd4bb1bc2f882f2909179b50026367 | 386056485da292685cf6e7faaf192d7d430239ec | /프로그래머스/주식가격/Solution.java | 9666889b5ea2b0b359da8a8428755f7474ccdff8 | [] | no_license | for-ming/Algorithm-Code-Study | 23482516def2c1777145da25ce37c609731fe0d9 | 7a72eabda6c16080baef66ba0e736a2f9633152f | refs/heads/main | 2023-06-09T22:51:42.135564 | 2021-06-29T00:21:10 | 2021-06-29T00:21:10 | 374,576,500 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | class Solution {
public int[] solution(int[] prices) {
int[] answer = new int[prices.length];
for(int i=0; i<prices.length; i++){
int count = 0;
for(int j=i+1; j<prices.length; j++){
if(prices[i] <= prices[j])
count++;
else {
count = count+1;
break;
}
}
answer[i] = count;
}
return answer;
}
} | [
"forming__@naver.com"
] | forming__@naver.com |
1a4ee0fe337d528e0c68d1f634dc5331aaf821bf | 6c370d55da51854b89f0fa3b20a3dd2977326df0 | /Java/src/main/java/eserciziCompleti/studioDentistico/oggetti/filtri/FiltriIntervento.java | 44b8b852ddd26d4e3bb49ecb8a420993214893b4 | [] | no_license | Giuliopime/Esercizi-4A-Informatica-IIS-Silva-Ricci | 69d66f6ba774800be778535022d3595634c3e57b | 8dc66abb945de71a244e015c373df4874b5f109c | refs/heads/master | 2023-06-29T07:12:34.129234 | 2023-06-11T06:56:12 | 2023-06-11T06:56:12 | 298,394,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,404 | java | package eserciziCompleti.studioDentistico.oggetti.filtri;
import java.io.Serializable;
public class FiltriIntervento implements Serializable {
private boolean tipo, costo, tempo, paziente, data;
public FiltriIntervento() {
tipo = true;
costo = true;
tempo = true;
paziente = true;
data = true;
}
public FiltriIntervento(boolean tipo, boolean costo, boolean tempo, boolean paziente, boolean data) {
this.tipo = tipo;
this.costo = costo;
this.tempo = tempo;
this.paziente = paziente;
this.data = data;
}
public boolean tuttiFalsi() {
return !tipo && !costo && !tempo && !paziente && !data;
}
public boolean isTipo() {
return tipo;
}
public void setTipo(boolean tipo) {
this.tipo = tipo;
}
public boolean isCosto() {
return costo;
}
public void setCosto(boolean costo) {
this.costo = costo;
}
public boolean isTempo() {
return tempo;
}
public void setTempo(boolean tempo) {
this.tempo = tempo;
}
public boolean isPaziente() {
return paziente;
}
public void setPaziente(boolean paziente) {
this.paziente = paziente;
}
public boolean isData() {
return data;
}
public void setData(boolean data) {
this.data = data;
}
}
| [
"giuliopime@gmail.com"
] | giuliopime@gmail.com |
e53aad34bd34469e3d0f7e18bc2d56806b6ad019 | 67510bf73b7d6f8b956336581b8dd47b87858a37 | /src/Modelo/Cidade.java | ed0374501926a2a8a77357b7b3682fc8ae5021c7 | [] | no_license | MacielBezerra/ProjetoAPS | cb310eb38485ad6d88115883a59e46a5abcab4b4 | ecc002361704707a69043becf3c0591f5d224fdc | refs/heads/master | 2021-01-06T20:38:25.562922 | 2012-09-28T22:22:43 | 2012-09-28T22:22:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,013 | java | package Modelo;
import java.util.ArrayList;
public class Cidade {
private String nome;
private ArrayList<PontoTuristico> pontosTuristicos = new ArrayList<PontoTuristico>();
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public ArrayList<PontoTuristico> getPontosTuristicos() {
return pontosTuristicos;
}
public void setPontosTuristicos(ArrayList<PontoTuristico> pontosTuristicos) {
this.pontosTuristicos = pontosTuristicos;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((nome == null) ? 0 : nome.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cidade other = (Cidade) obj;
if (nome == null) {
if (other.nome != null)
return false;
} else if (!nome.equals(other.nome))
return false;
return true;
}
}
| [
"maciel.bezerra@dce.ufpb.br"
] | maciel.bezerra@dce.ufpb.br |
8f22f46eb49f3f9bddb5861e8e33879ac2ee3808 | bb209d8118ee2ae91b050ac53973274f5b41039e | /src/kr/co/dhflour/helloweb/servlet/JoinServlet.java | ffa21cfd998bffc6cc442624d6cb848a727e3898 | [] | no_license | jinsnak/helloweb | e69ab87b3515a20ee82be6ab6c7e76051055400c | 98b5127e5b72338c71704216fe4cf1bfbc9702df | refs/heads/master | 2021-01-25T14:10:05.881670 | 2018-03-03T04:20:02 | 2018-03-03T04:20:02 | 123,658,342 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,830 | java | package kr.co.dhflour.helloweb.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/join")
public class JoinServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//get방식인 경우 server.xml의 Connector 부분에 URIEncoding="utf-8"로 한다.(기본 setting)
request.setCharacterEncoding("utf-8"); //post로 넘어올 때 한글이 깨지지 않도록 함.
String email = request.getParameter("email");
String pwd = request.getParameter("password");
String gender = request.getParameter("gender");
String year = request.getParameter("year");
String[] hobbies = request.getParameterValues("hobby");
String selfIntro = request.getParameter("self_intro");
response.setContentType("text/html; charset=utf-8");
PrintWriter out = response.getWriter();
out.println(email);
out.println(pwd);
out.println(gender);
out.println(year);
if(hobbies != null) {
for( String hobby : hobbies ) {
out.println(hobby);
}
}
out.println(selfIntro);
//콘솔로도 출력가능하다 Debug
System.out.println(email);
System.out.println(selfIntro);
//response.getWriter().append("Served at: ").append(request.getContextPath());
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("post방식으로 요청되었습니다.");
doGet(request, response);
}
}
| [
"user@DESKTOP-QUMKO72"
] | user@DESKTOP-QUMKO72 |
8a7d1aa053a067a4afea27c64f30f83b14e82e81 | 40665051fadf3fb75e5a8f655362126c1a2a3af6 | /geosolutions-it-MapStoreMobile/f8a0bf666f21ea2146000f7e455869330d035193/55/SpatialiteStore.java | eaa4b442979a84777f3c7e12ec5b50d87d0f30d5 | [] | no_license | fermadeiral/StyleErrors | 6f44379207e8490ba618365c54bdfef554fc4fde | d1a6149d9526eb757cf053bc971dbd92b2bfcdf1 | refs/heads/master | 2020-07-15T12:55:10.564494 | 2019-10-24T02:30:45 | 2019-10-24T02:30:45 | 205,546,543 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,141 | java | /*
* GeoSolutions - MapstoreMobile - GeoSpatial Framework on Android based devices
* Copyright (C) 2014 GeoSolutions (www.geo-solutions.it)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package it.geosolutions.android.map.model.stores;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Intent;
import it.geosolutions.android.map.DataListActivity;
import it.geosolutions.android.map.MapsActivity;
import it.geosolutions.android.map.model.Layer;
import it.geosolutions.android.map.spatialite.activities.SpatialiteLayerListActivity;
/**
* @author Lorenzo Natali (lorenzo.natali@geo-solutions.it)
*
*/
public class SpatialiteStore extends BaseLayerStore{
/* (non-Javadoc)
* @see it.geosolutions.android.map.model.stores.LayerStore#getLayers()
*/
@Override
public ArrayList<Layer> getLayers() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see it.geosolutions.android.map.model.stores.LayerStore#openDetails(android.app.Activity)
*/
@Override
public void openDetails(Activity ac) {
Intent datalistIntent = new Intent(ac, SpatialiteLayerListActivity.class);
datalistIntent.putExtra(SpatialiteLayerListActivity.PARAMS.LAYERSTORE_NAME, getName());
ac.startActivityForResult(datalistIntent, MapsActivity.DATAPROPERTIES_REQUEST_CODE);
}
/* (non-Javadoc)
* @see it.geosolutions.android.map.model.stores.LayerStore#openEdit(android.app.Activity)
*/
@Override
public void openEdit(Activity ac) {
// TODO Auto-generated method stub
}
}
| [
"fer.madeiral@gmail.com"
] | fer.madeiral@gmail.com |
9286544f2826cf55a44e00b7136a4d9806a2659c | 6c54ea57ff47b9aad414627b972268623134d1f4 | /TSS.Java/src/tss/tpm/StirRandomResponse.java | 069fc728390bde904e633cfd35815de8ff0b1098 | [
"MIT"
] | permissive | raghuncstate/TSS.MSR | c7f062fccbd1c05ac2433e7badb1942c5a996cd3 | 50b9c36d09d5cae89a965f2fc65c58ad29fe1732 | refs/heads/master | 2021-05-15T10:36:59.454709 | 2018-05-14T06:32:22 | 2018-05-14T06:32:22 | 108,195,473 | 0 | 0 | MIT | 2018-04-30T17:04:44 | 2017-10-24T23:34:50 | C++ | UTF-8 | Java | false | false | 1,608 | java | package tss.tpm;
import tss.*;
// -----------This is an auto-generated file: do not edit
//>>>
/**
* This command is used to add "additional information" to the RNG state.
*/
public class StirRandomResponse extends TpmStructure
{
/**
* This command is used to add "additional information" to the RNG state.
*/
public StirRandomResponse()
{
}
@Override
public void toTpm(OutByteBuf buf)
{
}
@Override
public void initFromTpm(InByteBuf buf)
{
}
@Override
public byte[] toTpm()
{
OutByteBuf buf = new OutByteBuf();
toTpm(buf);
return buf.getBuf();
}
public static StirRandomResponse fromTpm (byte[] x)
{
StirRandomResponse ret = new StirRandomResponse();
InByteBuf buf = new InByteBuf(x);
ret.initFromTpm(buf);
if (buf.bytesRemaining()!=0)
throw new AssertionError("bytes remaining in buffer after object was de-serialized");
return ret;
}
public static StirRandomResponse fromTpm (InByteBuf buf)
{
StirRandomResponse ret = new StirRandomResponse();
ret.initFromTpm(buf);
return ret;
}
@Override
public String toString()
{
TpmStructurePrinter _p = new TpmStructurePrinter("TPM2_StirRandom_RESPONSE");
toStringInternal(_p, 1);
_p.endStruct();
return _p.toString();
}
@Override
public void toStringInternal(TpmStructurePrinter _p, int d)
{
};
};
//<<<
| [
"Andrey.Marochko@microsoft.com"
] | Andrey.Marochko@microsoft.com |
096b2093c2f57a23e51494586de4c0886a141493 | bb36bcec9f1f50fd44d8b64e6c10769865f35738 | /src/animals/SwimAnimal.java | 377d3fc62a4f9ee68b3203d6fb93456604214cc2 | [] | no_license | flendger/java_level_1 | c4da27b663244c0c1e27751ca9e46522a2f32331 | 6197a74fbee80dc2a83b87be4d313e594905d9a7 | refs/heads/master | 2022-11-18T12:28:08.031683 | 2020-07-12T21:23:22 | 2020-07-12T21:23:22 | 272,015,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | java | package animals;
public abstract class SwimAnimal extends GroundAnimal{
private double maxSwim;
public SwimAnimal(String name, double maxRun, double maxJump, double maxSwim) {
super(name, maxRun, maxJump);
this.maxSwim = maxSwim;
}
@Override
public String toString() {
return "animals.SwimAnimal{" +
"name='" + getName() + '\'' +
", maxRun=" + getMaxRun() +
", maxJump=" + getMaxJump() +
", maxSwim=" + getMaxSwim() +
'}';
}
protected double getMaxSwim() {
return maxSwim;
}
public abstract String swim(double length);
}
| [
"kiru.ee@yandex.ru"
] | kiru.ee@yandex.ru |
1c8a9c78ed2bcfb21a527076801c1ee0fa21cb93 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project46/src/main/java/org/gradle/test/performance46_1/Production46_33.java | a8be3ccf7685d56336b559b44183012158564b7a | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 302 | java | package org.gradle.test.performance46_1;
public class Production46_33 extends org.gradle.test.performance14_1.Production14_33 {
private final String property;
public Production46_33() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
006bead605d646c9dea5fceabdda84d64e1101b8 | 838910155d242d1cc19538ddaff8ba10352106b1 | /src/Day10/thread3.java | 7c34e7303a6e3a159117862269c145909b26ceb0 | [] | no_license | JINWENAUGUSTZHU/bestone | 026bfd0cd6cd4ccc9d87b64ae4ae204c496f74b5 | 4dc019beadb6aa5ebf362e9824379ffd46fa0657 | refs/heads/master | 2021-01-19T04:46:01.348769 | 2017-05-07T11:19:09 | 2017-05-07T11:19:09 | 87,392,956 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 649 | java | package Day10;
/**
* @author August Zhu
*
*/
public class thread3 {
public static void main(String[] args) {
compute3 t = new compute3();
compute4 t1 = new compute4();
t.start();
t1.start();
}
}
class compute3 extends Thread {
int i = 0;
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println(i);
try {
sleep(1000);
} catch (Exception e) {
}
}
}
}
class compute4 extends Thread {
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println("Õâ¸öÊý×ÖÊÇ£º" + i);
try {
sleep(1000);
} catch (Exception e) {
}
}
}
} | [
"Augustzhu@139.com"
] | Augustzhu@139.com |
b4cb80ad56e606a9b23a847c7c7b7408e27868c3 | 5c14ba83a17cc9bfedfcdd58e2fc2483d42b7172 | /src/main/java/org/launchcode/FamilyOrganizer/AuthenticationFilter.java | 3bc0406d6ac0181dffff88e3bfa5d94a06cd0a25 | [] | no_license | rebuckC2308/antwan-group-b | 7c69d1d83f08070b1229cb6b237c189aac9d49c6 | 67ceb1cf1875b03ad09dc40c02529f5feec4d5d7 | refs/heads/main | 2023-08-24T11:29:38.256389 | 2021-09-28T01:09:43 | 2021-09-28T01:09:43 | 411,091,809 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,817 | java | package org.launchcode.FamilyOrganizer;
import org.launchcode.FamilyOrganizer.controllers.AuthenticationController;
import org.launchcode.FamilyOrganizer.data.UserRepository;
import org.launchcode.FamilyOrganizer.models.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
public class AuthenticationFilter implements HandlerInterceptor {
@Autowired
UserRepository userRepository;
@Autowired
AuthenticationController authenticationController;
private static final List<String> whitelist = Arrays.asList("/login", "/register", "/logout");
private static boolean isWhitelisted(String path) {
for (String pathRoot : whitelist) {
if (path.startsWith(pathRoot)) {
return true;
}
}
return false;
}
@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler) throws IOException {
// Don't require sign-in for whitelisted pages
if (isWhitelisted(request.getRequestURI())) {
// returning true indicates that the request may proceed
return true;
}
HttpSession session = request.getSession();
User user = authenticationController.getUserFromSession(session);
// The user is logged in
if (user != null) {
return true;
}
// The user is NOT logged in
response.sendRedirect("/login");
return false;
}
} | [
"crebuck.apt@gmail.com"
] | crebuck.apt@gmail.com |
d3e2d9af20875dc3dde0984681fc3094daa70442 | f365be489330a4bc54d21f3db31c1bf24cec8998 | /src/main/java/me/macd/springbootdemo/mapper/RolePermissionMapper.java | 410cd4e567d03ff69e34209f53e78e1b33735520 | [] | no_license | MACDfree/springboot-demo | e15b3b4073c451b18c006ef0254cecc9a28d0f40 | c561f99d62c77e32d2ccdc2ece65f24fa968f26b | refs/heads/master | 2020-03-18T21:59:29.612612 | 2018-09-18T14:16:22 | 2018-09-18T14:16:22 | 135,317,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 981 | java | package me.macd.springbootdemo.mapper;
import java.util.List;
import me.macd.springbootdemo.model.RolePermission;
import me.macd.springbootdemo.model.RolePermissionExample;
import org.apache.ibatis.annotations.Param;
public interface RolePermissionMapper {
long countByExample(RolePermissionExample example);
int deleteByExample(RolePermissionExample example);
int deleteByPrimaryKey(Integer id);
int insert(RolePermission record);
int insertSelective(RolePermission record);
List<RolePermission> selectByExample(RolePermissionExample example);
RolePermission selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") RolePermission record, @Param("example") RolePermissionExample example);
int updateByExample(@Param("record") RolePermission record, @Param("example") RolePermissionExample example);
int updateByPrimaryKeySelective(RolePermission record);
int updateByPrimaryKey(RolePermission record);
} | [
"macdfree@163.com"
] | macdfree@163.com |
43a45e352fa0b473f667acb61742e4a2ea52bf72 | c6997f4e5ef23deb6c1b604c0b256ebf16961939 | /final_version/Heeseok.java | c24c7c19ee130819831a05cd20a96c23640394e2 | [] | no_license | jihyunlee96/DB_Hisnet | fe323e12fcf3d504df07cc2db9ea11ff0f8cf1d7 | 71b5da7186feef2eb50d6836914e05ca03d10ebe | refs/heads/master | 2020-05-21T07:28:46.249538 | 2019-08-11T06:24:30 | 2019-08-11T06:24:30 | 185,962,270 | 0 | 1 | null | 2019-05-17T09:20:36 | 2019-05-10T09:43:00 | Java | UTF-8 | Java | false | false | 1,570 | java | import java.sql.Connection;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.Scanner;
public class Heeseok {
// 루트 유저
public static void start(Connection conn, Scanner keyboard ) throws SQLException {
System.out.println("[ Select an operation ]");
System.out.println("0. Back");
System.out.println("1. Manage Course Table");
System.out.println("2. Manage Facility Table");
System.out.println();
System.out.print("Input: ");
int input = keyboard.nextInt();
System.out.println("\n***********************************************************\n");
if (input == 0)
Main.log_in(conn, keyboard);
else if (input == 1) {
Manage_Courses.print_course_menu(conn, keyboard);
}
else if (input == 2) {
Manage_Facilities.print_facility_menu(conn, keyboard);
}
}
// 일반 유저
public static void start(Connection conn, Scanner keyboard, String student_no) throws SQLException {
System.out.println("[ Select an operation ]");
System.out.println("0. Log Out");
System.out.println("1. Course Information");
System.out.println("2. Facility Information");
System.out.println();
System.out.print("Input: ");
int input = keyboard.nextInt();
System.out.println("\n***********************************************************\n");
if (input == 0)
Main.log_in(conn, keyboard);
else if (input == 1)
Course_Information.print_course_menu(conn, keyboard);
else if (input == 2)
Facility_Information.print_facility_menu(conn, keyboard);
}
}
| [
"db3p@naver.com"
] | db3p@naver.com |
fd54f4e98347494c3e3be6b35bfaf44b2135be56 | a0b9407db3f7eb7b1b3a54d3291971e5c2190dc8 | /Crypto_Projet_2/RSA/src/exceptions/ExceptionConversionImpossible.java | aab7859862960d38d5f72461182abfbfa0d8f5df | [] | no_license | SuzanFrogg/Crypto_Ravagex | abc8dabc42b7e0aca0a309496fdaaf3f8dd0616b | 06d1cd5f11236e012ba68be906d34372d6ea6245 | refs/heads/main | 2023-03-13T12:21:07.542849 | 2021-04-02T09:53:02 | 2021-04-02T09:53:02 | 341,145,518 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 484 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package exceptions;
/**
*
* @author simonetma
*/
public class ExceptionConversionImpossible extends ExceptionCryptographie {
public ExceptionConversionImpossible(String message) {
super("Conversion impossible", "Impossible d'effectuer la conversion demandée : ");
}
}
| [
"72934560+MathysC@users.noreply.github.com"
] | 72934560+MathysC@users.noreply.github.com |
d752ea579fc14dfe99f73186699a51b5d620f608 | 926c71b7814401a13eaa3c9884b351a817c1d6ee | /src/main/java/com/francetelecom/orangetv/streammanager/shared/dto/FullVideoInfo.java | 5d39fbd86d3454bd390cd6e14ee6011a01bd188b | [] | no_license | Freizan/StreamManagerPrime | 64bfaf1ec3ae27141c4d3ecabdeadc24329425e2 | 67b119ae8f77bcdcb81807a4f9fc850354bfd2e5 | refs/heads/master | 2021-05-08T18:54:26.598628 | 2018-05-28T13:20:07 | 2018-05-28T13:20:07 | 119,542,092 | 0 | 1 | null | 2018-05-28T13:20:08 | 2018-01-30T13:49:24 | Java | UTF-8 | Java | false | false | 2,192 | java | package com.francetelecom.orangetv.streammanager.shared.dto;
public class FullVideoInfo extends AbstractVideoInfo implements Comparable<FullVideoInfo> {
private static final long serialVersionUID = 1L;
// stream attributs
// determine si la video est utilisée par au moins un stream
private boolean usedByStream;
// determine si au moins un stream enabled utilise cette video
private boolean atLastOneStreamEnabled;
// info issues de la table PMT (peut être null)
private String audioTracks;
private String subtitleTracks;
private String tablePmt;
// champ calcule en fonction de videoStatus et des stream attributs
public FullVideoStatus getFullVideoStatus() {
switch (this.getStatus()) {
case NEW:
return FullVideoStatus.NEW;
case PENDING:
return FullVideoStatus.PENDING;
case ERROR:
return FullVideoStatus.ERROR;
case READY: {
if (this.atLastOneStreamEnabled) {
return FullVideoStatus.RUNNING;
} else if (this.usedByStream) {
return FullVideoStatus.USED;
}
return FullVideoStatus.UPLOADED;
}
}
return FullVideoStatus.NEW;
}
public String getAudioTracks() {
return audioTracks == null ? "" : audioTracks;
}
public void setAudioTracks(String audioTracks) {
this.audioTracks = audioTracks;
}
public String getSubtitleTracks() {
return subtitleTracks == null ? "" : subtitleTracks;
}
public void setSubtitleTracks(String subtitleTracks) {
this.subtitleTracks = subtitleTracks;
}
public String getTablePmt() {
return tablePmt;
}
public void setTablePmt(String tablePmt) {
this.tablePmt = tablePmt;
}
public boolean isUsedByStream() {
return usedByStream;
}
public void setUsedByStream(boolean usedByStream) {
this.usedByStream = usedByStream;
}
public boolean isAtLastOneStreamEnabled() {
return atLastOneStreamEnabled;
}
public void setAtLastOneStreamEnabled(boolean atLastOneStreamEnabled) {
this.atLastOneStreamEnabled = atLastOneStreamEnabled;
}
@Override
public int compareTo(FullVideoInfo o) {
if (o == null) {
return 1;
}
if (this.getName() == o.getName()) {
return 0;
}
return this.getName().toLowerCase().compareTo(o.getName().toLowerCase());
}
} | [
"NDMZ2720@orange.com"
] | NDMZ2720@orange.com |
3124f16dcdd771a39488fc17de7e68ecb9126d33 | 020ac1a66e514f84254b58d0d272b2152496f901 | /src/java/co/com/soundMusic/LogAuditoria/LogAuditoria.java | 6965470796b0ac3fc57820b92cb160234ec8c519 | [] | no_license | SoundMusicPoli/SoundMusic | 389a35a223cb3c744fb4123bb5ed8df68f2d2caf | 3cf2aaac7aa884942b5746e95f347c29601ffd06 | refs/heads/master | 2020-03-28T08:12:57.877306 | 2018-10-02T12:00:49 | 2018-10-02T12:00:49 | 147,951,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package co.com.soundMusic.LogAuditoria;
import co.com.soundMusic.Seguridad.Permisos.Permisos;
import co.com.soundMusic.Login.Usuario.Usuario;
import java.sql.Date;
import java.sql.Time;
/**
*
* @author Santiago Medina Pelaez
*/
public class LogAuditoria {
private int idLogAuditoria;
private Date fecha;
private Time hora;
private Usuario usuario;
private Permisos operaciones;
public LogAuditoria() {
}
public LogAuditoria(int idLogAuditoria, Date fecha, Time hora, Usuario usuario, Permisos operaciones) {
this.idLogAuditoria = idLogAuditoria;
this.fecha = fecha;
this.hora = hora;
this.usuario = usuario;
this.operaciones = operaciones;
}
public int getIdLogAuditoria() {
return idLogAuditoria;
}
public void setIdLogAuditoria(int idLogAuditoria) {
this.idLogAuditoria = idLogAuditoria;
}
public Date getFecha() {
return fecha;
}
public void setFecha(Date fecha) {
this.fecha = fecha;
}
public Time getHora() {
return hora;
}
public void setHora(Time hora) {
this.hora = hora;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
public Permisos getOperaciones() {
return operaciones;
}
public void setOperaciones(Permisos operaciones) {
this.operaciones = operaciones;
}
}
| [
"sanme@Santiago"
] | sanme@Santiago |
15597e43529a4e0c435cefcf5dc1388694ba8306 | f30a483c877b7a9a7209814dea3e2b3c1b8ba40a | /COMP 2210/DFS/WordSearchGameFactory.java | 0dcecab0f175f440c71717a03299404346a661ee | [] | no_license | wmonnette/Coursework | f4986747e9b85672d8d56f91094eef08a532a813 | 59830c2bf20cb558162972f7eebfc4464901eceb | refs/heads/master | 2023-05-22T20:28:21.675339 | 2021-06-09T16:34:35 | 2021-06-09T16:34:35 | 370,825,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java |
/**
* Provides a factory method for creating word search games.
*
* @author Wesley Monnette (wjm0017@auburn.edu)
* @author Dean Hendrix (dh@auburn.edu)
* @version 3/27/2019
*/
public class WordSearchGameFactory {
/**
* Returns an instance of a class that implements the WordSearchGame
* interface.
*/
public static WordSearchGame createGame() {
// You must return an instance of your solution class here instead of null.
return Boggle();
}
}
| [
"60677826+wmonnette@users.noreply.github.com"
] | 60677826+wmonnette@users.noreply.github.com |
f30f14f2a15c3649ff6ef7bc6522130bf395309d | 60f3e362c17de4214fe9d0079136eb77bb8e7767 | /app/src/main/java/com/example/martin/mt/adaptorforfavouritemovie.java | 8612774a6b270697d9742b4f528d88f80ca60f80 | [] | no_license | junglesafari/ShowMeMovie | e1471f1abf567e6e7ae073d26f26c42453ab4ab2 | 3bcd38437d2b727b34a3278a45728c5139da83d5 | refs/heads/master | 2020-03-24T15:23:26.523521 | 2018-12-13T19:51:11 | 2018-12-13T19:51:11 | 142,788,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,021 | java | package com.example.martin.mt;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class adaptorforfavouritemovie extends RecyclerView.Adapter<viewholderforrecyclerview> {
List<classmoviestore> resultList;
itemclicklistener listener;
Context context;
LayoutInflater inflater;
public adaptorforfavouritemovie(Context context,List<classmoviestore> resultList, itemclicklistener listener) {
this.resultList = resultList;
this.listener = listener;
this.context = context;
}
@NonNull
@Override
public viewholderforrecyclerview onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
inflater= (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
View output=inflater.inflate( R.layout.layoutforviewallrecyclerview,viewGroup,false );
return new viewholderforrecyclerview( output );
}
@Override
public void onBindViewHolder(@NonNull final viewholderforrecyclerview viewholderforrecyclerview, int i) {
final classmoviestore result=resultList.get( i );
long movieId=result.movieId;
Retrofit.Builder builder = new Retrofit.Builder().baseUrl( "https://api.themoviedb.org/3/movie/" ).addConverterFactory( GsonConverterFactory.create() );
Retrofit retrofit = builder.build();
callbackListener service = retrofit.create( callbackListener.class );
Call<Pojomoviedetail> call = service.getmoviedetail( movieId + "", MainActivity.api_key, MainActivity.language );
call.enqueue( new Callback<Pojomoviedetail>() {
@Override
public void onResponse(Call<Pojomoviedetail> call, Response<Pojomoviedetail> response) {
Pojomoviedetail moviedetail = response.body();
viewholderforrecyclerview.postername.setText( moviedetail.getTitle() );
viewholderforrecyclerview.posterrating.setText( moviedetail.getVoteAverage()+"" );
GlideApp
.with( context )
.load("https://image.tmdb.org/t/p/w342/" + moviedetail.getBackdropPath())
.thumbnail( Glide.with(context).load(R.drawable.finalplaceholder))
.transition( DrawableTransitionOptions.withCrossFade( 200 ) )
.override( 500,500 )
.diskCacheStrategy( DiskCacheStrategy.RESOURCE)
.into(viewholderforrecyclerview.posterimage );
List<Genre> genere=moviedetail.getGenres();
StringBuilder generetoshow= new StringBuilder();
for(int k=0;k<genere.size();k++){
if(generemap.allgenre().containsKey( genere.get( k ).getId())){
generetoshow.append( " " ).append( generemap.allgenre().get( genere.get( k ).getId() ) );
}
}
viewholderforrecyclerview.genere.setText(generetoshow );
}
@Override
public void onFailure(Call<Pojomoviedetail> call, Throwable t) {
}
} );
viewholderforrecyclerview.itemview.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.myclick( view,viewholderforrecyclerview.getAdapterPosition() );
}
} );
}
@Override
public int getItemCount() {
return resultList.size();
}
}
| [
"himanshusachan806@gmail.com"
] | himanshusachan806@gmail.com |
c69e75b045f5e0e5babd8bedbaacbeed7e025807 | 12c84e4d6ef18a37c70da6e450ac0cdf32a55643 | /SwaaS-LMS-Android/Kangle/app/src/main/java/com/swaas/kangle/SearchAssetActivity.java | 4cf2de00b2a856e5ef37269e5e639eb82316215c | [] | no_license | dineshswaas/hidoctorWHO | 2295d7f51edfc45cf3b3893c7f0bceca89461a80 | bfbac065d972a597335f1a0d881a8bf4dc03c4d5 | refs/heads/master | 2020-06-18T15:55:54.670915 | 2019-07-11T09:16:13 | 2019-07-11T09:16:13 | 196,355,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,878 | java | package com.swaas.kangle;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.swaas.kangle.preferences.PreferenceUtils;
import com.swaas.kangle.utils.Constants;
public class SearchAssetActivity extends AppCompatActivity {
RelativeLayout filter1_background,filter2_background,filter3_background,filter4_background,sort_background,order_background;
LinearLayout filter1,filter2,filter3,filter4,sortlayout,orderlayout;
LinearLayout typesView,weeksView;
RadioGroup radiogroup;
RadioButton today,thisweek,twoweeks,allweeks;
CheckBox document,image,audio,video;
Context mContext;
ImageView icon_readunread,icon_weeks,icon_onlinedownloaded,icon_type,icon_order,icon_sort,companylogo;
TextView readunread,weeks,onlinedownloaded,type,sort,order;
RadioButton selectedradioButton;
Button submitbutton;
LinearLayout header;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search_asset);
mContext = SearchAssetActivity.this;
if(getResources().getBoolean(R.bool.portrait_only)){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
//getSupportActionBar().hide();
initialiseViews();
onBindClickEvents();
/* if(PreferenceUtils.getSubdomainName(mContext).contains("tacobell")){
header.setBackgroundColor(getResources().getColor(R.color.tacobellbackground));
}else {
header.setBackgroundColor(getResources().getColor(R.color.colorgreenbar));
}*/
header.setBackgroundColor(Color.parseColor(Constants.COMPANY_COLOR));
}
public void initialiseViews(){
filter1_background = (RelativeLayout)findViewById(R.id.filter1_background);
filter2_background = (RelativeLayout)findViewById(R.id.filter2_background);
filter3_background = (RelativeLayout)findViewById(R.id.filter3_background);
filter4_background = (RelativeLayout)findViewById(R.id.filter4_background);
sort_background = (RelativeLayout)findViewById(R.id.sort_background);
order_background = (RelativeLayout)findViewById(R.id.order_background);
filter1 = (LinearLayout)findViewById(R.id.filter1);
filter2 = (LinearLayout)findViewById(R.id.filter2);
filter3 = (LinearLayout)findViewById(R.id.filter3);
filter4 = (LinearLayout)findViewById(R.id.filter4);
sortlayout = (LinearLayout)findViewById(R.id.sortlayout);
orderlayout = (LinearLayout)findViewById(R.id.orderlayout);
today = (RadioButton)findViewById(R.id.today);
thisweek = (RadioButton)findViewById(R.id.thisweek);
twoweeks = (RadioButton)findViewById(R.id.twoweeks);
allweeks = (RadioButton)findViewById(R.id.allweeks);
document = (CheckBox)findViewById(R.id.document);
image = (CheckBox)findViewById(R.id.image);
audio = (CheckBox)findViewById(R.id.audio);
video = (CheckBox)findViewById(R.id.video);
icon_readunread = (ImageView)findViewById(R.id.icon_readunread);
icon_weeks = (ImageView)findViewById(R.id.icon_weeks);
icon_onlinedownloaded = (ImageView)findViewById(R.id.icon_onlinedownloaded);
icon_type = (ImageView)findViewById(R.id.icon_type);
icon_order = (ImageView)findViewById(R.id.icon_order);
icon_sort = (ImageView)findViewById(R.id.icon_sort);
readunread = (TextView)findViewById(R.id.readunread);
weeks = (TextView)findViewById(R.id.weeks);
onlinedownloaded = (TextView)findViewById(R.id.onlinedownloaded);
type = (TextView)findViewById(R.id.type);
sort = (TextView)findViewById(R.id.sort);
order = (TextView)findViewById(R.id.order);
submitbutton = (Button) findViewById(R.id.submitbutton);
companylogo = (ImageView) findViewById(R.id.companylogo);
radiogroup = (RadioGroup) findViewById(R.id.radiogroup);
typesView = (LinearLayout)findViewById(R.id.typesView); ;
weeksView = (LinearLayout)findViewById(R.id.weeksView);;
radiogroup.check(R.id.allweeks);
header = (LinearLayout) findViewById(R.id.header);
}
public void onBindClickEvents(){
filter2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typesView.setVisibility(View.GONE);
weeksView.setVisibility(View.VISIBLE);
}
});
filter4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typesView.setVisibility(View.VISIBLE);
weeksView.setVisibility(View.GONE);
}
});
submitbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int selectedId = radiogroup.getCheckedRadioButtonId();
selectedradioButton = (RadioButton) findViewById(selectedId);
Toast.makeText(SearchAssetActivity.this,selectedradioButton.getText(),Toast.LENGTH_SHORT).show();
}
});
companylogo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
| [
"dinesh@swaas.local"
] | dinesh@swaas.local |
7487c9b5e18fc533d2a40464f33e603cc9eda32d | 83bfc74c8d1e34f3c808622bb092a807cae187d5 | /GT-RarasNet/shared/src/main/java/com/rarasnet/rnp/shared/profissionais/controllers/network/responses/ServiceHandler.java | da25d274907d0f4b35c5768bb617d6f2e8138e08 | [
"Unlicense"
] | permissive | monsores/rarasapp | d7539be6f73e9b3f959fecebb36169974bcbe828 | 17537396ae81899e0d611b44cbb0e848963fcf39 | refs/heads/master | 2021-06-16T15:59:23.613976 | 2017-01-11T17:34:07 | 2017-01-11T17:34:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,750 | java | package com.rarasnet.rnp.shared.profissionais.controllers.network.responses;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
/**
* Created by lucas on 08/08/16.
*/
public class ServiceHandler {
static String response = null;
public final static int GET = 1;
public final static int POST = 2;
public ServiceHandler() {
}
/*
* Making service call
* @url - url to make request
* @method - http request method
* */
public String makeServiceCall(String url, int method) {
return this.makeServiceCall(url, method, null);
}
/*
* Making service call
* @url - url to make request
* @method - http request method
* @params - http request params
* */
public String makeServiceCall(String url, int method,
List<NameValuePair> params) {
try {
// http client
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpEntity httpEntity = null;
HttpResponse httpResponse = null;
// Checking http request method type
if (method == POST) {
HttpPost httpPost = new HttpPost(url);
// adding post params
if (params != null) {
httpPost.setEntity(new UrlEncodedFormEntity(params));
}
httpResponse = httpClient.execute(httpPost);
} else if (method == GET) {
// appending params to url
if (params != null) {
String paramString = URLEncodedUtils
.format(params, "utf-8");
url += "?" + paramString;
}
HttpGet httpGet = new HttpGet(url);
httpResponse = httpClient.execute(httpGet);
}
httpEntity = httpResponse.getEntity();
response = EntityUtils.toString(httpEntity);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return response;
}
}
| [
"maciel.lucas@outlook.com"
] | maciel.lucas@outlook.com |
5a625c22dd3547ffa95be5f71495f4ec2952c3e4 | 5fddb9a3f85f50cdefe3bf29ca06b33ad44bcd62 | /src/main/java/com/syncleus/aethermud/game/Abilities/Spells/Spell_ResistAcid.java | 649b76bcbfbe39f12d5b768d1fc7ffe628f2eb03 | [
"Apache-2.0"
] | permissive | freemo/AetherMUD-coffee | da315ae8046d06069a058fb38723750a02f72853 | dbc091b3e1108aa6aff3640da4707ace4c6771e5 | refs/heads/master | 2021-01-19T22:34:29.830622 | 2017-08-26T14:01:24 | 2017-08-26T14:06:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,479 | java | /**
* Copyright 2017 Syncleus, Inc.
* with portions copyright 2004-2017 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.
*/
package com.syncleus.aethermud.game.Abilities.Spells;
import com.syncleus.aethermud.game.Abilities.interfaces.Ability;
import com.syncleus.aethermud.game.Common.interfaces.CMMsg;
import com.syncleus.aethermud.game.Common.interfaces.CharStats;
import com.syncleus.aethermud.game.MOBS.interfaces.MOB;
import com.syncleus.aethermud.game.core.CMClass;
import com.syncleus.aethermud.game.core.CMLib;
import com.syncleus.aethermud.game.core.interfaces.Physical;
import java.util.List;
public class Spell_ResistAcid extends Spell {
private final static String localizedName = CMLib.lang().L("Resist Acid");
private final static String localizedStaticDisplay = CMLib.lang().L("(Resist Acid)");
@Override
public String ID() {
return "Spell_ResistAcid";
}
@Override
public String name() {
return localizedName;
}
@Override
public String displayText() {
return localizedStaticDisplay;
}
@Override
public int abstractQuality() {
return Ability.QUALITY_BENEFICIAL_OTHERS;
}
@Override
protected int canAffectCode() {
return CAN_MOBS;
}
@Override
public int classificationCode() {
return Ability.ACODE_SPELL | Ability.DOMAIN_ABJURATION;
}
@Override
public void unInvoke() {
// undo the affects of this spell
if (!(affected instanceof MOB))
return;
final MOB mob = (MOB) affected;
if (canBeUninvoked())
mob.tell(L("Your oily protection dries up."));
super.unInvoke();
}
@Override
public void affectCharStats(MOB affectedMOB, CharStats affectedStats) {
super.affectCharStats(affectedMOB, affectedStats);
affectedStats.setStat(CharStats.STAT_SAVE_ACID, affectedStats.getStat(CharStats.STAT_SAVE_ACID) + 100);
}
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) {
final MOB target = getTarget(mob, commands, givenTarget);
if (target == null)
return false;
if (!super.invoke(mob, commands, givenTarget, auto, asLevel))
return false;
final boolean success = proficiencyCheck(mob, 0, auto);
if (success) {
final CMMsg msg = CMClass.getMsg(mob, target, this, verbalCastCode(mob, target, auto), auto ? L("<T-NAME> feel(s) oilily protected.") : L("^S<S-NAME> invoke(s) a oily field of protection around <T-NAMESELF>.^?"));
if (mob.location().okMessage(mob, msg)) {
mob.location().send(mob, msg);
beneficialAffect(mob, target, asLevel, 0);
}
} else
beneficialWordsFizzle(mob, target, L("<S-NAME> attempt(s) to invoke acid protection, but fail(s)."));
return success;
}
}
| [
"jeffrey.freeman@syncleus.com"
] | jeffrey.freeman@syncleus.com |
d284e22ad3681407201c206f2151db2d12e83f57 | 7cca5dfcea688e37e0be5d379260c7a003463e11 | /src/main/java/br/com/softop/imobiliaria/logic/impl/TipoImovelLogicImpl.java | 6fc32a945257bd63cdf240d8b291c0b62a43e7ec | [] | no_license | OpenIMB/imobiliaria | dc99c5a8c37c7fef15b364bd600be7206b7b1346 | 34047277003c9b07e1202109e80b0bf6d4e24834 | refs/heads/master | 2021-01-10T15:55:04.679578 | 2016-01-11T17:59:38 | 2016-01-11T17:59:38 | 49,443,784 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | package br.com.softop.imobiliaria.logic.impl;
import br.com.softop.imobiliaria.entity.TipoImovel;
import br.com.softop.imobiliaria.logic.TipoImovelLogic;
import br.com.softop.imobiliaria.util.ContextDAO;
import br.com.softop.imobiliaria.util.StringHelper;
import br.com.softop.imobiliaria.util.exception.BusinessException;
import java.util.List;
/**
*
* @author danilo
*/
public class TipoImovelLogicImpl implements TipoImovelLogic {
@Override
public TipoImovel save(TipoImovel entity) throws BusinessException {
if(StringHelper.isEmpty(entity.getNome())){
throw new BusinessException("Por favor informe o nome!");
}
return ContextDAO.getTipoImovelDAO().save(entity);
}
@Override
public void delete(TipoImovel entity) throws BusinessException {
entity = findById(entity.getId());
ContextDAO.getTipoImovelDAO().delete(entity);
}
@Override
public TipoImovel findById(Integer id) {
return ContextDAO.getTipoImovelDAO().findById(id);
}
@Override
public List<TipoImovel> find(TipoImovel entity) throws BusinessException {
return ContextDAO.getTipoImovelDAO().findAll();
}
}
| [
"professordaniloalmeida@gmail.com"
] | professordaniloalmeida@gmail.com |
f850de64ffbc2e42bcce3f31fd9a0aa553d6b62a | d23b08dc00754f4da152f92b22e2015adb4a8fdb | /rabinizer3.1/rabinizer/automata/ProductState.java | 6cb6c25ebde40827b2adf3cad9657541d1ba6e93 | [] | no_license | dkasenberg/Norms-MDP | 9204a365111b1eca14d1743370e7fb037bc9ce64 | 0e3f3892514b4d04272adbc79bc6dcfaa32733ab | refs/heads/master | 2021-04-09T02:48:41.450777 | 2018-04-06T16:45:48 | 2018-04-06T16:45:48 | 125,407,008 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,105 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package rabinizer.automata;
import java.util.HashMap;
import rabinizer.formulas.Formula;
/**
*
* @author jkretinsky
*/
public class ProductState extends HashMap<Formula, RankingState> {
public FormulaState masterState;
public ProductState(FormulaState masterState) {
super();
this.masterState = masterState;
}
@Override
public int hashCode() {
return 17 * super.hashCode() + 5 * masterState.hashCode();
}
@Override
public boolean equals(Object o) {
if (!super.equals(o)) {
return false;
} else {
return ((ProductState) o).masterState.equals(this.masterState);
}
}
public String toString() {
String result = masterState + "::";
for (Formula slave : keySet()) {
result += get(slave) + ";";
}
return result;//masterState + "::" + super.toString();
}
}
| [
"daniel.kasenberg@gmail.com"
] | daniel.kasenberg@gmail.com |
72fc60494ab9b17aeaf6ac45a45453c7b74e01f8 | 3e0767a4f0a05abc209c09280b51a29c3a183107 | /firstideajava/src/com/company/Sum.java | 839c59a5c6e6e804a105fcf8934b8a8d10b2bb3f | [] | no_license | RohhanGupta/DSA-in-Java | 73eccbeb8ffc9bce2f477f4d79577e93edc7c9b3 | 64a7dc13fc9e36aebd44369662b6a2a308013986 | refs/heads/master | 2023-07-14T11:08:50.137194 | 2021-08-24T08:14:12 | 2021-08-24T08:14:12 | 394,171,549 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package com.company;
import java.util.Scanner;
public class Sum {
public static void main(String[] args) {
System.out.print("Enter the first number: ");
Scanner input= new Scanner(System.in);
int num1= input.nextInt();
System.out.print("Enter the second number: ");
int num2= input.nextInt();
int sum= num1+num2;
System.out.print("Your answer is " + sum);
}
}
| [
"rgupta6_be20@thapar.edu"
] | rgupta6_be20@thapar.edu |
44f37e1e92d087b0d2d544d36470cbf2df6db7f7 | d28e8e95dfa29af69abd8e4a0835e90172611496 | /Java_Project/Source/src/servlet/admin/AdminDeleteProductCtl.java | c784447ef199e21e07b9a698f1deaba615d6c417 | [] | no_license | ChaeRin-Im/PotatoMarket | d35914ae64aaac11b4f780804d2eec7d4897803a | c001968ff453cf952bbf6e50834b5d4ce44a08d8 | refs/heads/main | 2023-02-11T10:47:24.726172 | 2021-01-12T02:48:07 | 2021-01-12T02:48:07 | 329,307,300 | 0 | 1 | null | 2021-01-13T12:52:06 | 2021-01-13T12:52:05 | null | UTF-8 | Java | false | false | 1,853 | java | package servlet.admin;
import java.io.IOException;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import service.ChatService;
import service.ProductService;
import vo.ProductVO;
/**
* Servlet implementation class AdminDeleteProductCtl
*/
@WebServlet("/AdminDeleteProductCtl.do")
public class AdminDeleteProductCtl extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public AdminDeleteProductCtl() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int p_id = Integer.parseInt(request.getParameter("p_id"));
ProductService sv = new ProductService();
List<ProductVO> list = sv.selectProduct(p_id);
ProductVO vo = list.get(0);
int result = sv.AdminDeleteProduct(p_id);
if(result == 1) {
ChatService cs = new ChatService();
cs.submit("MasterPotato1", vo.getM_id(), vo.getP_name()+" 이라는 제목으로 올린 상품이 관리자에 의해 삭제되었습니다.");
}
RequestDispatcher dis = request.getRequestDispatcher("AdminListViewCtl.do?type=P");
dis.forward(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"nothing1360@gmail.com"
] | nothing1360@gmail.com |
aaecb46dac3c84dfb9c93177cfa9ab08a1a2472d | d7d997d7d2a50a85eaf2eae8b5bfebc6862cef55 | /src/main/java/invalue/core/dto/ObjectOutPutDTO.java | 31b34a7caa2c6d2254b074297e47a3f702a1c5f8 | [] | no_license | datpt154/stock-filter-server | c5af00584b806ef25e1281f5c3de5a666a539bf6 | 77a8d586ed8ff77d318cef940424c54df4aad8fa | refs/heads/master | 2020-03-20T05:39:15.352908 | 2018-12-20T05:59:20 | 2018-12-20T05:59:20 | 134,129,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | package invalue.core.dto;
import java.math.BigInteger;
public class ObjectOutPutDTO {
private BigInteger id;
private String code;
private String name;
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"nguyenphathuy0808@gmail.com"
] | nguyenphathuy0808@gmail.com |
4b898e293dc8d3a9a91b3eec6d5abf29aaf55fd6 | cd011432e2e0cfb28005b030ed21102aecd4c6af | /core/src/main/java/com/tw/entity/Customer.java | 6eff9d5b5621c986c75ae3650495d9bd072d2b3c | [] | no_license | huanw415/JavaEE_Spring_CSS | 54f04ddfb02d84cbc4dee2df185742279ec9e53b | 06e976449e094ad8c1e12bb73e40072c1dd6e82d | refs/heads/master | 2021-05-30T03:39:26.562004 | 2015-08-07T03:15:25 | 2015-08-07T03:15:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,024 | java | package com.tw.entity;
import javax.persistence.*;
import java.util.List;
/**
* Created by hgwang on 7/16/15.
*/
@Entity
@Table(name="CUSTOMER")
public class Customer {
private int id;
private String name;
private List<Course> courses;
public Customer() {
}
public Customer(String name) {
this.name = name;
}
@Id
@Column(name="Id")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "Name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "CUSTOMER_COURSE",
joinColumns = {@JoinColumn(name = "CustomerId")},
inverseJoinColumns = {@JoinColumn(name = "CourseId")})
public List<Course> getCourses() {
return courses;
}
public void setCourses(List<Course> courses) {
this.courses = courses;
}
}
| [
"654296217@qq.com"
] | 654296217@qq.com |
10422227184f538e909dee4dea2426392ad67112 | 34de945d320fad3de0acc0a5a2c6feca4653443e | /src/main/java/com/baojinsuo/base/BaseServiceImpl.java | c7c18c607897e68d3bf88b0c11060204113341fc | [] | no_license | xiewenya/spring-boot-security-rest-demo | 0991abb7c77bd67c92e5e6ea79849187123efe41 | 1cb053a7fe9b143d328497e54c52d4f0841b68bc | refs/heads/master | 2021-01-11T01:48:57.477048 | 2016-10-12T06:44:09 | 2016-10-12T06:44:09 | 70,660,921 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | package com.baojinsuo.base;
import com.baojinsuo.common.ReflectUtils;
import com.baojinsuo.common.SafeUtils;
import com.baojinsuo.common.exception.BaseException;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
/**
* Created by bresai on 2016/10/3.
*/
public class BaseServiceImpl<T extends BaseModel> implements BaseService<T> {
@Override
public void copyProperties(T target, Object source) {
try {
Field[] targetFields = ReflectUtils.getDeclaredFields(target);
for (Field field : targetFields){
Field sourceField = ReflectUtils.getField(source, field.getName());
if (SafeUtils.isNotNull(sourceField) && SafeUtils.isNotNull(sourceField.get(source))){
BeanUtils.setProperty(target,field.getName(),sourceField.get(source));
}
}
} catch (IllegalAccessException | InvocationTargetException e) {
throwBaseException(e);
}
}
public void throwBaseException(Exception e) {
throw new BaseException(e.getClass().getSimpleName(), e.getMessage());
}
}
| [
"bresai@live.cn"
] | bresai@live.cn |
f1612005df9b63fe8cebbfba829928ce439b9127 | 18943b8008a6249d956a666baeecdb94b2a74fc8 | /print/src/main/java/com/wrq/vo/ShopVo.java | 1ad0bcd324a6755e80081c692e113fd33c195145 | [
"MIT"
] | permissive | liuurick/print | 05c2a18a91e6c81316c30a32063f1b9c167c43d3 | f5df762c3f5f75d976d1523d8cfc6fa6212b92f6 | refs/heads/master | 2022-12-09T06:39:40.765296 | 2020-09-16T13:57:27 | 2020-09-16T13:57:27 | 296,036,876 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 778 | java | package com.wrq.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* Created by wangqian on 2019/3/30.
*/
@Data
public class ShopVo {
/* 店铺ID */
private Integer shopId;
private String shopName;
private String shopDescription;
/* 店铺评分 */
private String credit;
/* 交易人数 */
private Integer dealNum;
/* 图片服务器域名 */
private String imgAddress;
/* 单页黑白A4尺寸 */
private BigDecimal normalSingle;
/* 单页彩色A4尺寸 */
private BigDecimal colorfulSingle;
/* 双页黑白A4尺寸 */
private BigDecimal normalDouble;
/* 双页彩色A4尺寸 */
private BigDecimal colorfulDouble;
/* 0:在营业 1:不营业 */
private Integer status;
}
| [
"liuurick@gmail.com"
] | liuurick@gmail.com |
6837163755a9b1ba4d719a701238700507f81fb9 | f27a2f4c51e7233cbcf3041c119597ccf67837ea | /src/main/java/chao/design_pattern/adapter/implementation2/VlcPlayer.java | d791f8cc2998524fe31aafb624c232702cc0b7da | [] | no_license | chao-guo/test | f83308ff3ad8b8db63de012c2ccb6d44b0738116 | ae4e79470a52826ee0c0af20dc0868fb32eb1499 | refs/heads/master | 2022-12-26T01:56:49.065615 | 2021-03-03T06:41:11 | 2021-03-03T06:41:11 | 216,770,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package chao.design_pattern.adapter.implementation2;
/**
* @author chao.guo
* @version 1.0.0
* @ClassName VlcPlayer.java
* @Description TODO
* @createTime 2020年06月15日 14:30:00
*/
public class VlcPlayer implements AdvancedMediaPlayer {
@Override
public void playVlc(String fileName) {
System.out.println("Playing vlc file. Name:" + fileName);
}
@Override
public void playMp4(String fileName) {
//do nothing
}
}
| [
"wsgcwaxx@126.com"
] | wsgcwaxx@126.com |
832adc688fa7c524e92277008b6ea1b2839e1826 | b30e1d78c8edabe1fcc91acc9d1b64e1971d71fc | /service/system/src/main/java/com/adouge/service/system/mapper/RoleMapper.java | 61d0483fe4a3d602912d77c42a98a078a14a721b | [
"MIT"
] | permissive | adougebabi/adouge | 2796776f180761b24ec5e6ee19e38c8065fb6cd6 | 3f3c3ffeb72110bbf30d6a92e39645cdb00a2dac | refs/heads/master | 2022-12-05T22:53:20.929426 | 2020-08-18T03:16:46 | 2020-08-18T03:17:24 | 279,881,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package com.adouge.service.system.mapper;
import com.adouge.service.system.entity.Role;
import com.adouge.service.system.vo.RoleVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 角色表 Mapper 接口
*
* @author AdougeBabi
* @since 2020-06-09
*/
public interface RoleMapper extends BaseMapper<Role> {
List<RoleVO> tree(String tenantId,String excludeRole);
}
| [
"646911949@qq.com"
] | 646911949@qq.com |
1332cbe4ff54bf1ed170de2bf4b588cfc52fc269 | c4a739f97014e642438d68ef1f62ab13bd8950e9 | /app/src/main/java/com/example/texttospeach/MainActivity.java | 745056aa1de3580aeba7f1c962138c171801044e | [] | no_license | DENNIS-CODES/Text-to-Speech | 431d33e1ca94d850f9f87ef92bd952cbbb161bf1 | a401c1a7b1b60d2ed9a36b6fcd92f6d526bb4f1b | refs/heads/master | 2023-03-22T03:18:52.064521 | 2021-03-19T09:47:37 | 2021-03-19T09:47:37 | 349,372,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,277 | java | package com.example.texttospeach;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
public class MainActivity extends Activity implements TextToSpeech.OnInitListener {
/** Called when the activity is first created.*/
private TextToSpeech tts;
private Button buttonSpeak;
private EditText editText;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tts = newTextToSpeech(this, this);
buttonSpeak = (Button) findViewById(R.id.button1);
editText = (EditText) findViewById(R.id.editText1);
buttonSpeak.setOnClickListener(newView.OnClickListener() {
@Override
public void onClick(View arg0) {
speakOut();
}
});
}
@Override
public void onDestroy() {
// Don't forget to shutdown tts!
if (tts != null) {
tts.stop();
tts.shutdown();
}
super.onDestroy();
}
@Override
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
int result = tts.setLanguage(Locale.US);
if (result == TextToSpeech.LANG_MISSING_DATA
|| result == TextToSpeech.LANG_NOT_SUPPORTED) {
Log.e("TTS","This Language is not supported");
} else {
buttonSpeak.setEnabled(true);
speakOut();
}
} else {
Log.e("TTS","Initilization Failed!");
}
}
private void speakOut() {
String text = editText.getText().toString();
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
} | [
"dennistrevor06@gmail.com"
] | dennistrevor06@gmail.com |
2d26bc9283fd71f6d13b095ca5855f8200d2d3a5 | 3a47d7d1d6968daea4f2154de479ac18b17ad7db | /com.sg.vim/src/com/sg/vim/service/vidc/UploadDeleteEntResponse.java | f2a828e92364294b829917f521678bc1b14fe178 | [] | no_license | sgewuhan/vim | ef64fce49f9ab481521a21901157c81910e57e5e | d7d193f5be3b357bace4e0f7b703281ade15ae7f | refs/heads/master | 2021-01-19T03:12:56.079503 | 2013-06-26T00:51:24 | 2013-06-26T00:51:24 | 9,443,167 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,767 | java | package com.sg.vim.service.vidc;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.sg.vim.service.OperateResult;
/**
* <p>
* Java class for anonymous complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="UploadDelete_EntResult" type="{http://www.vidc.info/certificate/operation/}OperateResult" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "uploadDeleteEntResult" })
@XmlRootElement(name = "UploadDelete_EntResponse")
public class UploadDeleteEntResponse {
@XmlElement(name = "UploadDelete_EntResult")
protected OperateResult uploadDeleteEntResult;
/**
* Gets the value of the uploadDeleteEntResult property.
*
* @return possible object is {@link OperateResult }
*
*/
public OperateResult getUploadDeleteEntResult() {
return uploadDeleteEntResult;
}
/**
* Sets the value of the uploadDeleteEntResult property.
*
* @param value
* allowed object is {@link OperateResult }
*
*/
public void setUploadDeleteEntResult(OperateResult value) {
this.uploadDeleteEntResult = value;
}
}
| [
"ghuazh@gmail.com"
] | ghuazh@gmail.com |
9023936006d1c95e4f35052a4e9f0caa0a478b52 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/protocal/protobuf/czs.java | 19ea2c8b4fb30e9c8713f8bf76bc8737179adb99 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 2,613 | java | package com.tencent.mm.protocal.protobuf;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.LinkedList;
public final class czs
extends com.tencent.mm.bx.a
{
public LinkedList<czr> aaFi;
public int cZV;
public czs()
{
AppMethodBeat.i(122508);
this.aaFi = new LinkedList();
this.cZV = -1;
AppMethodBeat.o(122508);
}
public final int op(int paramInt, Object... paramVarArgs)
{
AppMethodBeat.i(122509);
if (paramInt == 0)
{
paramVarArgs = (i.a.a.c.a)paramVarArgs[0];
paramVarArgs.e(1, 8, this.aaFi);
paramVarArgs.bS(2, this.cZV);
AppMethodBeat.o(122509);
return 0;
}
int i;
if (paramInt == 1)
{
paramInt = i.a.a.a.c(1, 8, this.aaFi);
i = i.a.a.b.b.a.cJ(2, this.cZV);
AppMethodBeat.o(122509);
return paramInt + 0 + i;
}
if (paramInt == 2)
{
paramVarArgs = (byte[])paramVarArgs[0];
this.aaFi.clear();
paramVarArgs = new i.a.a.a.a(paramVarArgs, unknownTagHandler);
for (paramInt = com.tencent.mm.bx.a.getNextFieldNumber(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.bx.a.getNextFieldNumber(paramVarArgs)) {
if (!super.populateBuilderWithField(paramVarArgs, this, paramInt)) {
paramVarArgs.kFT();
}
}
AppMethodBeat.o(122509);
return 0;
}
if (paramInt == 3)
{
Object localObject = (i.a.a.a.a)paramVarArgs[0];
czs localczs = (czs)paramVarArgs[1];
paramInt = ((Integer)paramVarArgs[2]).intValue();
switch (paramInt)
{
default:
AppMethodBeat.o(122509);
return -1;
case 1:
paramVarArgs = ((i.a.a.a.a)localObject).aMP(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject = (byte[])paramVarArgs.get(paramInt);
czr localczr = new czr();
if ((localObject != null) && (localObject.length > 0)) {
localczr.parseFrom((byte[])localObject);
}
localczs.aaFi.add(localczr);
paramInt += 1;
}
AppMethodBeat.o(122509);
return 0;
}
localczs.cZV = ((i.a.a.a.a)localObject).ajGk.aar();
AppMethodBeat.o(122509);
return 0;
}
AppMethodBeat.o(122509);
return -1;
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes5.jar
* Qualified Name: com.tencent.mm.protocal.protobuf.czs
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
f3716d0989ff40fd3373f0a60cc224d181198929 | 706629af3b0f5c0f1696516e66a478dfc388b68d | /consulting-web/src/main/java/com/quickasr/data/entity/UserQuery.java | bf4768c080400921196695bd06e9b2a658b3c76e | [] | no_license | himanshuvardhan/consulting-webapp | 795a144160683fc7f3b421a7ce3bab8753207e1b | 68658ae76e872221774f7c76f03004c755523538 | refs/heads/master | 2021-01-20T20:52:13.172151 | 2017-02-19T10:34:57 | 2017-02-19T10:34:57 | 60,475,969 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | package com.quickasr.data.entity;
import java.util.Date;
public class UserQuery implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private int queryId;
private String querySubject;
private String queryMessage;
private String userEmailId;
private String fullName;
private Date createdDt;
private Date updatedDt;
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public Date getCreatedDt() {
return createdDt;
}
public void setCreatedDt(Date createdDt) {
this.createdDt = createdDt;
}
public Date getUpdatedDt() {
return updatedDt;
}
public void setUpdatedDt(Date updatedDt) {
this.updatedDt = updatedDt;
}
public int getQueryId() {
return queryId;
}
public void setQueryId(int queryId) {
this.queryId = queryId;
}
public String getQuerySubject() {
return querySubject;
}
public void setQuerySubject(String querySubject) {
this.querySubject = querySubject;
}
public String getQueryMessage() {
return queryMessage;
}
public void setQueryMessage(String queryMessage) {
this.queryMessage = queryMessage;
}
public String getUserEmailId() {
return userEmailId;
}
public void setUserEmailId(String userEmailId) {
this.userEmailId = userEmailId;
}
}
| [
"vardhan@vardhan-PC"
] | vardhan@vardhan-PC |
ecd645fd1aee0fd9c97ac033a5fdd922c39cdac5 | ee1c15e432f64bcc57eb912b07dd3b4fcc06dbed | /app/src/main/java/com/zzh/uidemo/choose/bean/Area.java | edebf6c8251239089f2553581ce3f27b67797a82 | [] | no_license | zzh0123/UIDemo | f63cd322ce0ce767f354b0818d022a86af5ea6a5 | ee42ab1b4208d4071829ea995860f1970a89f5fe | refs/heads/master | 2023-03-21T01:17:19.742135 | 2021-03-25T07:05:41 | 2021-03-25T07:05:41 | 321,374,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 493 | java | package com.zzh.uidemo.choose.bean;
import java.io.Serializable;
/**
* @author: zzh
* data : 2020/6/29
* description:区县
*/
public class Area implements Serializable {
private String code;
private String name;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"18311004536@163.com"
] | 18311004536@163.com |
692fafe09ece35f6e2ec4976031171f94d1558b7 | 3f5fbf59a0cd063aee565e5fa9c8f186bca802af | /FactoryModel/src/product/impl/AlibabaPythonCourse.java | 29b72a5ade2e108f0e7f1e5c66045788eebb8855 | [] | no_license | tyl12300/designMode | 9a546bdbf9dc0cbeda8b66c4363f47343e3d8f7c | d9b739765206d6b564a56c49e197573cf814fa0b | refs/heads/master | 2020-05-02T14:44:22.102658 | 2019-04-10T14:51:26 | 2019-04-10T14:51:26 | 178,019,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 261 | java | package product.impl;
import product.IPythonCourse;
/**
* @Author tyl
* @Date 2019-03-27
*/
public class AlibabaPythonCourse implements IPythonCourse {
@Override
public void learn() {
System.out.println("学Python为了去阿里");
}
}
| [
"topxt@vip.qq.com"
] | topxt@vip.qq.com |
48d1e9b291cf0eb9157d0bc5624544c4d3ddb468 | eb0f8d85747691df253d3e571ea657aacce205e9 | /Урок_1_ООП/09122019/09122019/src/Lesson_1/Marathon/Main.java | 4a5d065bae9537f40d3a01e364cc77595fde6fa8 | [] | no_license | efimovrostislav/GeekBrains_Java_2_Lessons_HomeWorks | 7aa68ba71154be1e254b5e4c291079809155e779 | 18a3e210d5b707e0533dc19b37c20a75ef6ae572 | refs/heads/master | 2022-11-10T11:48:27.077540 | 2020-06-24T13:45:25 | 2020-06-24T13:46:05 | 274,679,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package Lesson_1.Marathon;
public class Main {
public static void main(String[] args) {
Competitor[] competitors = {new Human("Боб"), new Cat("Барсик"), new Dog("Бобик")};
Obstacle[] course = {new Cross(80), new Wall(2), new Water(50), new Cross(120)};
for (Competitor c : competitors) {
for (Obstacle o : course) {
o.doIt(c);
if (!c.isOnDistance()) break;
}
}
for (Competitor c : competitors) {
c.info();
}
}
}
| [
"rostslav.efimov97@mail.ru"
] | rostslav.efimov97@mail.ru |
e336750472d22b86a89c77c950008a37c798876b | f9354a52ced3090aea1a6b4969278fc88f937dce | /database/src/main/java/net/sourceforge/javydreamercsw/msm/controller/ServiceInstanceJpaController.java | 3753f3e2736fc412d069812d57b91e5aa2f186d3 | [] | no_license | javydreamercsw/medical-service-management | 1f3511ffaf6b2a324cbb9646ed69d7523affb0b8 | 11878768b41aa53fda851cb95352c18ed9d4dc5f | refs/heads/master | 2022-10-15T06:19:12.611524 | 2022-01-23T23:14:03 | 2022-01-23T23:14:03 | 85,077,996 | 0 | 0 | null | 2022-10-05T21:44:46 | 2017-03-15T13:49:55 | Java | UTF-8 | Java | false | false | 16,729 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package net.sourceforge.javydreamercsw.msm.controller;
import java.io.Serializable;
import javax.persistence.Query;
import javax.persistence.EntityNotFoundException;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import net.sourceforge.javydreamercsw.msm.db.Service;
import net.sourceforge.javydreamercsw.msm.db.InstanceField;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import net.sourceforge.javydreamercsw.msm.controller.exceptions.IllegalOrphanException;
import net.sourceforge.javydreamercsw.msm.controller.exceptions.NonexistentEntityException;
import net.sourceforge.javydreamercsw.msm.db.PersonHasService;
import net.sourceforge.javydreamercsw.msm.db.ServiceInstance;
/**
*
* @author Javier A. Ortiz Bultron javier.ortiz.78@gmail.com
*/
public class ServiceInstanceJpaController implements Serializable {
public ServiceInstanceJpaController(EntityManagerFactory emf) {
this.emf = emf;
}
private EntityManagerFactory emf = null;
public EntityManager getEntityManager() {
return emf.createEntityManager();
}
public void create(ServiceInstance serviceInstance) {
if (serviceInstance.getInstanceFieldList() == null) {
serviceInstance.setInstanceFieldList(new ArrayList<InstanceField>());
}
if (serviceInstance.getPersonHasServiceList() == null) {
serviceInstance.setPersonHasServiceList(new ArrayList<PersonHasService>());
}
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Service serviceId = serviceInstance.getServiceId();
if (serviceId != null) {
serviceId = em.getReference(serviceId.getClass(), serviceId.getId());
serviceInstance.setServiceId(serviceId);
}
List<InstanceField> attachedInstanceFieldList = new ArrayList<InstanceField>();
for (InstanceField instanceFieldListInstanceFieldToAttach : serviceInstance.getInstanceFieldList()) {
instanceFieldListInstanceFieldToAttach = em.getReference(instanceFieldListInstanceFieldToAttach.getClass(), instanceFieldListInstanceFieldToAttach.getInstanceFieldPK());
attachedInstanceFieldList.add(instanceFieldListInstanceFieldToAttach);
}
serviceInstance.setInstanceFieldList(attachedInstanceFieldList);
List<PersonHasService> attachedPersonHasServiceList = new ArrayList<PersonHasService>();
for (PersonHasService personHasServiceListPersonHasServiceToAttach : serviceInstance.getPersonHasServiceList()) {
personHasServiceListPersonHasServiceToAttach = em.getReference(personHasServiceListPersonHasServiceToAttach.getClass(), personHasServiceListPersonHasServiceToAttach.getPersonHasServicePK());
attachedPersonHasServiceList.add(personHasServiceListPersonHasServiceToAttach);
}
serviceInstance.setPersonHasServiceList(attachedPersonHasServiceList);
em.persist(serviceInstance);
if (serviceId != null) {
serviceId.getServiceInstanceList().add(serviceInstance);
serviceId = em.merge(serviceId);
}
for (InstanceField instanceFieldListInstanceField : serviceInstance.getInstanceFieldList()) {
ServiceInstance oldServiceInstanceOfInstanceFieldListInstanceField = instanceFieldListInstanceField.getServiceInstance();
instanceFieldListInstanceField.setServiceInstance(serviceInstance);
instanceFieldListInstanceField = em.merge(instanceFieldListInstanceField);
if (oldServiceInstanceOfInstanceFieldListInstanceField != null) {
oldServiceInstanceOfInstanceFieldListInstanceField.getInstanceFieldList().remove(instanceFieldListInstanceField);
oldServiceInstanceOfInstanceFieldListInstanceField = em.merge(oldServiceInstanceOfInstanceFieldListInstanceField);
}
}
for (PersonHasService personHasServiceListPersonHasService : serviceInstance.getPersonHasServiceList()) {
ServiceInstance oldServiceInstanceOfPersonHasServiceListPersonHasService = personHasServiceListPersonHasService.getServiceInstance();
personHasServiceListPersonHasService.setServiceInstance(serviceInstance);
personHasServiceListPersonHasService = em.merge(personHasServiceListPersonHasService);
if (oldServiceInstanceOfPersonHasServiceListPersonHasService != null) {
oldServiceInstanceOfPersonHasServiceListPersonHasService.getPersonHasServiceList().remove(personHasServiceListPersonHasService);
oldServiceInstanceOfPersonHasServiceListPersonHasService = em.merge(oldServiceInstanceOfPersonHasServiceListPersonHasService);
}
}
em.getTransaction().commit();
} finally {
if (em != null) {
em.close();
}
}
}
public void edit(ServiceInstance serviceInstance) throws IllegalOrphanException, NonexistentEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
ServiceInstance persistentServiceInstance = em.find(ServiceInstance.class, serviceInstance.getId());
Service serviceIdOld = persistentServiceInstance.getServiceId();
Service serviceIdNew = serviceInstance.getServiceId();
List<InstanceField> instanceFieldListOld = persistentServiceInstance.getInstanceFieldList();
List<InstanceField> instanceFieldListNew = serviceInstance.getInstanceFieldList();
List<PersonHasService> personHasServiceListOld = persistentServiceInstance.getPersonHasServiceList();
List<PersonHasService> personHasServiceListNew = serviceInstance.getPersonHasServiceList();
List<String> illegalOrphanMessages = null;
for (InstanceField instanceFieldListOldInstanceField : instanceFieldListOld) {
if (!instanceFieldListNew.contains(instanceFieldListOldInstanceField)) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("You must retain InstanceField " + instanceFieldListOldInstanceField + " since its serviceInstance field is not nullable.");
}
}
for (PersonHasService personHasServiceListOldPersonHasService : personHasServiceListOld) {
if (!personHasServiceListNew.contains(personHasServiceListOldPersonHasService)) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("You must retain PersonHasService " + personHasServiceListOldPersonHasService + " since its serviceInstance field is not nullable.");
}
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
if (serviceIdNew != null) {
serviceIdNew = em.getReference(serviceIdNew.getClass(), serviceIdNew.getId());
serviceInstance.setServiceId(serviceIdNew);
}
List<InstanceField> attachedInstanceFieldListNew = new ArrayList<InstanceField>();
for (InstanceField instanceFieldListNewInstanceFieldToAttach : instanceFieldListNew) {
instanceFieldListNewInstanceFieldToAttach = em.getReference(instanceFieldListNewInstanceFieldToAttach.getClass(), instanceFieldListNewInstanceFieldToAttach.getInstanceFieldPK());
attachedInstanceFieldListNew.add(instanceFieldListNewInstanceFieldToAttach);
}
instanceFieldListNew = attachedInstanceFieldListNew;
serviceInstance.setInstanceFieldList(instanceFieldListNew);
List<PersonHasService> attachedPersonHasServiceListNew = new ArrayList<PersonHasService>();
for (PersonHasService personHasServiceListNewPersonHasServiceToAttach : personHasServiceListNew) {
personHasServiceListNewPersonHasServiceToAttach = em.getReference(personHasServiceListNewPersonHasServiceToAttach.getClass(), personHasServiceListNewPersonHasServiceToAttach.getPersonHasServicePK());
attachedPersonHasServiceListNew.add(personHasServiceListNewPersonHasServiceToAttach);
}
personHasServiceListNew = attachedPersonHasServiceListNew;
serviceInstance.setPersonHasServiceList(personHasServiceListNew);
serviceInstance = em.merge(serviceInstance);
if (serviceIdOld != null && !serviceIdOld.equals(serviceIdNew)) {
serviceIdOld.getServiceInstanceList().remove(serviceInstance);
serviceIdOld = em.merge(serviceIdOld);
}
if (serviceIdNew != null && !serviceIdNew.equals(serviceIdOld)) {
serviceIdNew.getServiceInstanceList().add(serviceInstance);
serviceIdNew = em.merge(serviceIdNew);
}
for (InstanceField instanceFieldListNewInstanceField : instanceFieldListNew) {
if (!instanceFieldListOld.contains(instanceFieldListNewInstanceField)) {
ServiceInstance oldServiceInstanceOfInstanceFieldListNewInstanceField = instanceFieldListNewInstanceField.getServiceInstance();
instanceFieldListNewInstanceField.setServiceInstance(serviceInstance);
instanceFieldListNewInstanceField = em.merge(instanceFieldListNewInstanceField);
if (oldServiceInstanceOfInstanceFieldListNewInstanceField != null && !oldServiceInstanceOfInstanceFieldListNewInstanceField.equals(serviceInstance)) {
oldServiceInstanceOfInstanceFieldListNewInstanceField.getInstanceFieldList().remove(instanceFieldListNewInstanceField);
oldServiceInstanceOfInstanceFieldListNewInstanceField = em.merge(oldServiceInstanceOfInstanceFieldListNewInstanceField);
}
}
}
for (PersonHasService personHasServiceListNewPersonHasService : personHasServiceListNew) {
if (!personHasServiceListOld.contains(personHasServiceListNewPersonHasService)) {
ServiceInstance oldServiceInstanceOfPersonHasServiceListNewPersonHasService = personHasServiceListNewPersonHasService.getServiceInstance();
personHasServiceListNewPersonHasService.setServiceInstance(serviceInstance);
personHasServiceListNewPersonHasService = em.merge(personHasServiceListNewPersonHasService);
if (oldServiceInstanceOfPersonHasServiceListNewPersonHasService != null && !oldServiceInstanceOfPersonHasServiceListNewPersonHasService.equals(serviceInstance)) {
oldServiceInstanceOfPersonHasServiceListNewPersonHasService.getPersonHasServiceList().remove(personHasServiceListNewPersonHasService);
oldServiceInstanceOfPersonHasServiceListNewPersonHasService = em.merge(oldServiceInstanceOfPersonHasServiceListNewPersonHasService);
}
}
}
em.getTransaction().commit();
} catch (Exception ex) {
String msg = ex.getLocalizedMessage();
if (msg == null || msg.length() == 0) {
Integer id = serviceInstance.getId();
if (findServiceInstance(id) == null) {
throw new NonexistentEntityException("The serviceInstance with id " + id + " no longer exists.");
}
}
throw ex;
} finally {
if (em != null) {
em.close();
}
}
}
public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
ServiceInstance serviceInstance;
try {
serviceInstance = em.getReference(ServiceInstance.class, id);
serviceInstance.getId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The serviceInstance with id " + id + " no longer exists.", enfe);
}
List<String> illegalOrphanMessages = null;
List<InstanceField> instanceFieldListOrphanCheck = serviceInstance.getInstanceFieldList();
for (InstanceField instanceFieldListOrphanCheckInstanceField : instanceFieldListOrphanCheck) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("This ServiceInstance (" + serviceInstance + ") cannot be destroyed since the InstanceField " + instanceFieldListOrphanCheckInstanceField + " in its instanceFieldList field has a non-nullable serviceInstance field.");
}
List<PersonHasService> personHasServiceListOrphanCheck = serviceInstance.getPersonHasServiceList();
for (PersonHasService personHasServiceListOrphanCheckPersonHasService : personHasServiceListOrphanCheck) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("This ServiceInstance (" + serviceInstance + ") cannot be destroyed since the PersonHasService " + personHasServiceListOrphanCheckPersonHasService + " in its personHasServiceList field has a non-nullable serviceInstance field.");
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
Service serviceId = serviceInstance.getServiceId();
if (serviceId != null) {
serviceId.getServiceInstanceList().remove(serviceInstance);
serviceId = em.merge(serviceId);
}
em.remove(serviceInstance);
em.getTransaction().commit();
} finally {
if (em != null) {
em.close();
}
}
}
public List<ServiceInstance> findServiceInstanceEntities() {
return findServiceInstanceEntities(true, -1, -1);
}
public List<ServiceInstance> findServiceInstanceEntities(int maxResults, int firstResult) {
return findServiceInstanceEntities(false, maxResults, firstResult);
}
private List<ServiceInstance> findServiceInstanceEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(ServiceInstance.class));
Query q = em.createQuery(cq);
if (!all) {
q.setMaxResults(maxResults);
q.setFirstResult(firstResult);
}
return q.getResultList();
} finally {
em.close();
}
}
public ServiceInstance findServiceInstance(Integer id) {
EntityManager em = getEntityManager();
try {
return em.find(ServiceInstance.class, id);
} finally {
em.close();
}
}
public int getServiceInstanceCount() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<ServiceInstance> rt = cq.from(ServiceInstance.class);
cq.select(em.getCriteriaBuilder().count(rt));
Query q = em.createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
}
| [
"javier.ortiz.78@gmail.com"
] | javier.ortiz.78@gmail.com |
976b168f7f0adad90d4a62d355ded97952281dbc | 76690cdffaf905bbf2e10b2159001142833e7e57 | /loop.java | ee54998a57fb00761ca9cfbc5ba332e832bdcf05 | [] | no_license | NINJAMUSICIAN/loops | 42136b532881cee87b8112b555e0ec13c305adbd | 486d42feae9aa171a0ccb049a4ee19d99b95745e | refs/heads/master | 2016-09-16T13:51:01.898047 | 2013-09-10T13:48:50 | 2013-09-10T13:48:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 98 | java | public class loop{
public static void main(String[] args) {
System.out.println("loops");
}
} | [
"apcs@mvhs-imac03u528.dcsdk12.org"
] | apcs@mvhs-imac03u528.dcsdk12.org |
db9a6f7e8e8c4fba80c0f2bdd215ec6603c9f7c0 | 389e9d69906d076b57a4357fa8d73cf4c7ee6d2e | /Lesson5/iocode/IOCode.java | 3ff0040318d400da7f77144ca6bf18c12798b43b | [] | no_license | davidoster/AfDEMP-Java-PY | 9a74fc3371cd45e2bf445b2961250fd6764bb14e | 6a4fcdb77b5673485fb92176f899b6d3f8088899 | refs/heads/master | 2021-11-03T16:32:37.764974 | 2019-04-03T03:45:03 | 2019-04-03T03:45:03 | 109,941,775 | 11 | 21 | null | 2017-12-15T22:19:36 | 2017-11-08T07:21:52 | Java | UTF-8 | Java | false | false | 2,194 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package iocode;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Spyros
*/
public class IOCode {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws FileNotFoundException {
// Do it with Scanner class
// ScannerImpl sci = new ScannerImpl();
// sci.readfrom();
// Do it with Buffer class
// BufferImpl bi = new BufferImpl();
// try {
// bi.readBuffer();
// } catch (IOException e) {
// e.printStackTrace();
// }
// ---------------Read File with BufferedReader ------------------
// try {
//
// //br = new BufferedReader(new FileReader(FILENAME));
// BufferedReader br = new BufferedReader(new FileReader("C:\\Users\\Spyros\\Documents\\test.txt"));
// String sCurrentLine;
//
// while ((sCurrentLine = br.readLine()) != null) {
// System.out.println(sCurrentLine);
// }
//
// } catch (IOException e) {
//
// e.printStackTrace();
// }
// ---------------Read File with Scanner ------------------
// File file = new File("C:\\Users\\Spyros\\Documents\\test.txt");
// Scanner sc = new Scanner(file);
// while (sc.hasNextLine()) {
// String line = sc.nextLine();
// System.out.println(line);
// }
// sc.close();
//-------------------Write to file -------------------
PrintWriter writer;
try {
writer = new PrintWriter("the-file-name.txt", "UTF-8");
writer.println("The first line");
writer.println("The second line");
writer.close();
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(IOCode.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"info@eletter.gr"
] | info@eletter.gr |
b5e76ab5a7301edb6bcde0350ce42bb3b3fca567 | 24fc055e81825ce54b69040240dab54ac3f4b10f | /fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/error/NotFoundErrorPage.java | d597861be720cc9f290a3883df0307cb6194b3f7 | [
"Apache-2.0",
"CC-BY-2.5"
] | permissive | kidaak/fiftyfive-wicket | e372ef455281dbaa4fa2b15c51ff75be9edc75d8 | e0b63ce6e3251b7bbb3fd6c751030eb35b04e15b | refs/heads/master | 2021-01-22T00:29:55.727384 | 2015-12-11T06:24:46 | 2015-12-11T06:24:46 | 47,809,005 | 0 | 0 | null | 2015-12-11T06:18:07 | 2015-12-11T06:18:05 | Java | UTF-8 | Java | false | false | 185 | java | package ${package}.error;
public class NotFoundErrorPage extends BaseErrorPage
{
/**
* Returns 404.
*/
protected int getErrorCode()
{
return 404;
}
}
| [
"matt@55minutes.com"
] | matt@55minutes.com |
9ce596d6890fef503f4c724bfe298643acab4640 | 03837941c1edcff80bd88f17dea897f38ac6cf51 | /out-put/ibatis3/java_src/com/quanjing/yd/model/query/TcommunicationQuery.java | 9c586789b0340c8466d80ee68a2ed509c5f4810d | [] | no_license | tanxiaolong77/rapid-Generator | ef62980e8cb7f13883ab548581c9fcc1c101b7ed | d365c83d242c8b537fe5f7a70b938c62135374e6 | refs/heads/master | 2020-09-21T06:24:06.731393 | 2016-09-05T07:22:17 | 2016-09-05T07:22:17 | 67,397,286 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,162 | java | /*
* Powered By [rapid-framework]
* Web Site: http://www.rapid-framework.org.cn
* Google Code: http://code.google.com/p/rapid-framework/
* Since 2008 - 2016
*/
package com.quanjing.yd.model;
import com.quanjing.util.framework.BaseQuery;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import java.util.List;
import com.quanjing.yd.model.*;
import com.quanjing.yd.vo.query.*;
/**
* @author xiaolong.tan
* @version 1.0
* @since 1.0
*/
public class TcommunicationQuery extends BaseQuery implements java.io.Serializable {
private static final long serialVersionUID = 5454155825314635342L;
//columns START
/** id **/
private java.lang.Long id;
/** userId **/
private java.lang.Long userId;
/** communicationPhone **/
private java.lang.String communicationPhone;
//columns END
public void setId(java.lang.Long value) {
this.id = value;
}
public java.lang.Long getId() {
return this.id;
}
public void setUserId(java.lang.Long value) {
this.userId = value;
}
public java.lang.Long getUserId() {
return this.userId;
}
public void setCommunicationPhone(java.lang.String value) {
this.communicationPhone = value;
}
public java.lang.String getCommunicationPhone() {
return this.communicationPhone;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("Id",getId())
.append("UserId",getUserId())
.append("CommunicationPhone",getCommunicationPhone())
.toString();
}
public int hashCode() {
return new HashCodeBuilder()
.append(getId())
.toHashCode();
}
public boolean equals(Object obj) {
if(obj instanceof Tcommunication == false) return false;
if(this == obj) return true;
TcommunicationQuery other = (TcommunicationQuery)obj;
return new EqualsBuilder()
.append(getId(),other.getId())
.isEquals();
}
}
| [
"tanxl@quanjing.com"
] | tanxl@quanjing.com |
3dde79544a8149b85c9ba701b5c73d59ec9deb6f | 5129be2ca51a1e332741e579f8579631acf0fc62 | /nemo-tools/sandbox/src/main/java/org/opendaylight/nemo/tool/sandbox/northbound/SandboxNorthbound.java | ba8e2c87b4d5166aab32415a67bd063dd0e944c8 | [] | no_license | opendaylight/nemo | 51aad3292f0f20cc3946aaa10d8ec4d7331d34bf | 7ac687dee771bd44dbf521361a15e7efe3865b7f | refs/heads/master | 2023-06-24T19:26:47.778002 | 2020-07-12T00:51:55 | 2020-07-12T00:51:55 | 39,530,768 | 9 | 6 | null | 2020-10-16T11:10:06 | 2015-07-22T21:15:46 | Java | UTF-8 | Java | false | false | 5,017 | java | /*
* Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.nemo.tool.sandbox.northbound;
import org.codehaus.enunciate.jaxrs.ResponseCode;
import org.codehaus.enunciate.jaxrs.StatusCodes;
import org.codehaus.enunciate.jaxrs.TypeHint;
import org.opendaylight.nemo.tool.sandbox.SandBoxManager;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import java.util.ArrayList;
import java.util.List;
/**
* Created by hj on 12/12/15.
*/
/**
* Root resource (exposed at "myresource" path)
*/
@Path("/nemo/sandbox")
public class SandboxNorthbound {
@Path("/create")
@POST
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({MediaType.TEXT_PLAIN})
@StatusCodes
({
@ResponseCode(code = 201, condition = "???"),
@ResponseCode(code = 409, condition = "")
})
public String create(
@Context UriInfo uriInfo,
String request) {
List<String> formattedCommands = format(request);
return "" + SandBoxManager.getInstance().createNetwork(formattedCommands);
}
private List<String> format(String request) {
String[] arrays = request.split("\n");
List<String> list = new ArrayList<String>();
for (String command : arrays) {
if (!command.trim().equals("")) {
list.add(command);
}
}
return list;
}
// @Path("/create")
// @POST
// @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
// @Produces({MediaType.TEXT_PLAIN})
// @StatusCodes
// ({
// @ResponseCode(code = 201, condition = "???"),
// @ResponseCode(code = 409, condition = "")
// })
// public Response create(
// @Context UriInfo uriInfo,
// @TypeHint(CreateRequest.class) CreateRequest request) {
// //TODO:Generate List<String> by the request.
//
// return Response.created(uriInfo.getRequestUri()).status(409).build();
// }
@Path("/execute")
@POST
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({MediaType.TEXT_PLAIN})
@StatusCodes
({
@ResponseCode(code = 201, condition = "???"),
@ResponseCode(code = 409, condition = "")
})
public String create(
@Context UriInfo uriInfo,
@TypeHint(ExecuteRequest.class) ExecuteRequest executeRequest) {
String result = SandBoxManager.getInstance().execute(executeRequest.getHostName(), executeRequest.getCommand());
return result;
}
@Path("/destroy")
@POST
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({MediaType.TEXT_PLAIN})
@StatusCodes
({
@ResponseCode(code = 201, condition = "???"),
@ResponseCode(code = 409, condition = "")
})
public String destroy(@Context UriInfo uriInfo) {
//TODO:Generate List<String> by the request.
return SandBoxManager.getInstance().destroyNetwork() + "";
}
@Path("/crossdomain.xml")
@GET
@Produces({MediaType.TEXT_XML})
@StatusCodes({
@ResponseCode(code = 200, condition = "Operation successful")})
public String getXml() {
System.out.println("getHosts running");
return "<?xml version=\"1.0\"?> <cross-domain-policy><allow-access-from domain=\"*\"/>" +
"<allow-http-request-headers-from domain=\"*\" headers=\"*\"/></cross-domain-policy>";
}
@Path("/hosts")
@GET
@Produces({MediaType.APPLICATION_JSON})
@StatusCodes({
@ResponseCode(code = 200, condition = "Operation successful")})
public String getHosts() {
return SandBoxManager.getInstance().getHosts();
}
@Path("/switches")
@GET
@Produces({MediaType.APPLICATION_JSON})
@StatusCodes({
@ResponseCode(code = 200, condition = "Operation successful")})
public String getSwitches() {
return SandBoxManager.getInstance().getSwitches();
}
@Path("/links")
@GET
@Produces({MediaType.APPLICATION_JSON})
@StatusCodes({
@ResponseCode(code = 200, condition = "Operation successful")})
public String getLinks() {
return SandBoxManager.getInstance().getLinks();
}
@Path("/externals")
@GET
@Produces({MediaType.APPLICATION_JSON})
@StatusCodes({
@ResponseCode(code = 200, condition = "Operation successful")})
public String getExternals() {
return SandBoxManager.getInstance().getExternals();
}
}
| [
"jizhigang@huawei.com"
] | jizhigang@huawei.com |
9d44263fdc321001b7d8c2ed7c890dc003f3931f | c408f926110a83540e3b4efb98ea21a5b02dd549 | /app/src/main/java/com/example/bridgelabz/newiplproject/Interface/DemoInterface.java | cef35e7ecc73638206f318495ec8b05b51d0f703 | [] | no_license | priyanka163/ipl | 807429c34e4299409fe47c32eacfe7581ca63cb5 | 7e9e1ec33a2e0ad9f7bba64f891fec9031308d52 | refs/heads/master | 2020-05-23T10:13:47.528650 | 2017-01-30T08:49:16 | 2017-01-30T08:49:16 | 80,405,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 289 | java | package com.example.bridgelabz.newiplproject.Interface;
import com.example.bridgelabz.newiplproject.Model.TeamModel;
import java.util.ArrayList;
/**
* Created by bridgelabz on 24/11/16.
*/
public interface DemoInterface {
public void requireData(ArrayList<TeamModel> array);
}
| [
"cheryalabalram123@gmail.com"
] | cheryalabalram123@gmail.com |
37c677571183881eda488b18cf7cb88cadfee401 | 09516f22d657506ff59b0a9683d6592a02c5832b | /java/core/ar/aggregates/wrappers/TouchedBoundsWrapper.java | 1c5749de851f084457f51e48c14391aa87ad93e1 | [
"BSD-3-Clause-Open-MPI"
] | permissive | JosephCottam/AbstractRendering | 4a3e91d1b2945d846bbb6b40576d2385c8a49954 | 0ed380719d9857768eda045d9f8314f71fdda075 | refs/heads/master | 2020-12-24T14:35:28.853658 | 2015-08-20T17:21:27 | 2015-08-20T17:21:58 | 9,526,106 | 16 | 4 | null | 2015-09-22T16:11:41 | 2013-04-18T16:17:30 | Java | UTF-8 | Java | false | false | 2,304 | java | package ar.aggregates.wrappers;
import java.util.Iterator;
import ar.Aggregates;
import ar.aggregates.Iterator2D;
import ar.util.Util;
/**Report min/max X/Y based on values set in the set-able region (instead of just the set-able region.)**/
public class TouchedBoundsWrapper<A> implements Aggregates<A> {
private final Aggregates<A> base;
private int lowX = Integer.MAX_VALUE;
private int lowY = Integer.MAX_VALUE;
private int highX = Integer.MIN_VALUE;
private int highY = Integer.MIN_VALUE;
public TouchedBoundsWrapper(Aggregates<A> base) {this(base, true);}
public TouchedBoundsWrapper(Aggregates<A> base, boolean discoverTouched) {
this.base = base;
if (discoverTouched) {
for (int x=base.lowX(); x<base.highX(); x++) {
for (int y= base.lowY(); y<base.highY(); y++) {
if (!Util.isEqual(base.get(x,y), base.defaultValue())) {
lowX = Math.min(lowX, x);
lowY = Math.min(lowY, y);
highX = Math.max(highX, x+1);
highY = Math.max(highY, y+1);
}
}
}
}
}
/**Return the backing aggregate set that this class wraps.**/
public Aggregates<A> base() {return base;}
/**True if nothing was changed on the base aggregates via this wrapper.**/
@Override public boolean empty() {return lowX == Integer.MAX_VALUE && lowY == Integer.MAX_VALUE && highX == Integer.MIN_VALUE && highY == Integer.MIN_VALUE;}
@Override public Iterator<A> iterator() {return new Iterator2D<>(this);}
@Override public A get(int x, int y) {return base.get(x, y);}
@Override public void set(int x, int y, A val) {
base.set(x,y, val);
if (x >= base.lowX() && x < base.highX()
&& y >= base.lowY() && y < base.highY()) {
lowX = Math.min(x, lowX);
lowY = Math.min(y, lowY);
highX = Math.max(x+1, highX);
highY = Math.max(y+1, highY);
}
}
@Override public A defaultValue() {return base.defaultValue();}
@Override public int lowX() {return Math.max(lowX, base.lowX());}
@Override public int lowY() {return Math.max(lowY, base.lowY());}
@Override public int highX() {return Math.min(highX, base.highX());}
@Override public int highY() {return Math.min(highY, base.highY());}
@Override public String toString() {return String.format("Touched Bounds (Wrapped) Aggregates from (%d, %d) to (%d, %d).", lowX, lowY, highX,highY);}
}
| [
"jcottam@indiana.edu"
] | jcottam@indiana.edu |
751a8c3b9861557dd67f4dd62d2b4d9d4fa28c9c | 4f2d98bf8a7e1edf37a8f58b4775cab48d598960 | /GoogleCloudMessaging/src/com/adb/gcm/GoogleCloud.java | e4df67cf3ac5a59aa40a74f6288f0b4b8cbde1ea | [] | no_license | Bhavdip/TakeUseof | 87d2ce590e469b3b1d4885c8db083355dc240c4a | 754aa8ffa12760f93d73cdf1ca6413e6bc55e7b1 | refs/heads/master | 2021-01-20T23:32:13.876943 | 2012-08-31T12:54:32 | 2012-08-31T12:54:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,147 | java | package com.adb.gcm;
import com.adb.gcm.services.RegisteringGCMService;
import com.adb.gcm.utility.Constance;
import com.adb.gcm.utility.Pref;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;
public class GoogleCloud extends Activity {
private String TAG = GoogleCloud.class.getCanonicalName();
private TextView textView_registrationID;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_google_cloude);
Constance.CONTEXT = this;
textView_registrationID = (TextView)findViewById(R.id.textView_registrationID);
textView_registrationID.setText(Pref.getValue(Constance.PREF_REGISTRATION_ID,""));
Log.d(TAG,"[ onCreate ]");
startService( new Intent(getApplicationContext(),RegisteringGCMService.class ) );
}
@Override
protected void onStart() {
super.onStart();
Log.d(TAG,"[ onStart ]");
IntentFilter iff = new IntentFilter();
iff.addAction(Constance.INTENT_UPDATE_UI);
registerReceiver(mUIReceiver, iff);
}
@Override
protected void onPause() {
super.onPause();
Log.d(TAG,"[ onPause ]");
unregisterReceiver(mUIReceiver);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_google_cloude, menu);
return true;
}
private BroadcastReceiver mUIReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String meesage = intent.getStringExtra("Message");
if(intent.getStringExtra("Message") != null ){
Log.d(TAG,"[ ********** UI UPDATE ***********]");
runOnUiThread(new Runnable() {
public void run() {
if(meesage != null)
textView_registrationID.setText(meesage);
}
});
}
}
};
}
| [
"bhavdip.pathar@gmail.com"
] | bhavdip.pathar@gmail.com |
f91f4d459ef14c9d9c45d2159ca20f4f5a065038 | a25b0de9ca23b2408496bd31803870d0f99a5ab5 | /spring-boot-rest-client-in-action/src/main/java/com/github/renuevo/webclient/config/WebClientQueryEncoder.java | c1f63fa4e0322ca90bd636b4a3f63a6b14e97f9d | [] | no_license | renuevo/spring-boot-in-action | 2dc5b34ecfa8719c3cb1138d22481634848f33e2 | b4fa45930084f3902b3d065bb0f3c7aab8554cb0 | refs/heads/master | 2022-11-09T17:51:05.131732 | 2022-11-04T11:17:13 | 2022-11-04T11:17:13 | 227,105,606 | 17 | 7 | null | 2020-04-30T14:50:14 | 2019-12-10T11:40:53 | Java | UTF-8 | Java | false | false | 811 | java | package com.github.renuevo.webclient.config;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.util.Map;
@RequiredArgsConstructor
@Component
public class WebClientQueryEncoder {
private final ObjectMapper objectMapper;
public MultiValueMap<String, String> getQueryEncode(Object queryDto) {
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
Map<String, String> queryMap = objectMapper.convertValue(queryDto, new TypeReference<>() {
});
params.setAll(queryMap);
return params;
}
}
| [
"renuevo0110@gmail.com"
] | renuevo0110@gmail.com |
9b349540831c6527bd86e52191b74d80ea6cb4bd | eff914f677578b2f283263e8ae788d60761b49aa | /src/main/java/com/example/officeoa/service/NoticeService.java | f188d9bf82f1cb8a26e5f50f4ac73fd10a44db12 | [] | no_license | lixinye99/office_oa | c9eabc10bd3dd4ff011565204c0718f6f71ed806 | 8703f469f40f58fc6b96065534a8f553fd5c7050 | refs/heads/master | 2023-04-10T14:00:52.294031 | 2021-03-25T04:54:38 | 2021-03-25T04:54:38 | 351,297,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 779 | java | package com.example.officeoa.service;
import com.example.officeoa.model.NoticeInfo;
import java.util.List;
/**
* @Author: LiXinYe
* @Description:
* @Date: Create in 10:21 2021/3/22
*/
public interface NoticeService {
/**
* 插入一条新的通知信息
* @param noticeInfo
* @return
*/
Boolean insertNoticeInfo(NoticeInfo noticeInfo);
/**
* 查询所有的通知消息
* @return
*/
List<NoticeInfo> queryAllNoticeInfo();
/**
* 根据nid列表删除公告
* @param noticeNidList
* @return
*/
Boolean deleteNoticeInfoByNidList(Integer[] noticeNidList);
/**
* 更新公告信息
* @param noticeInfo
* @return
*/
Boolean updateNoticeInfo(NoticeInfo noticeInfo);
}
| [
"you@example.com"
] | you@example.com |
275aa0653441ace099bedae033ff2270e093d6a8 | c4965335b0d4131ec403506fea6720d2b51b4b39 | /springBootApi/src/test/java/com/example/spring/SpringBootApiApplicationTests.java | 7f8cb27d039ed1e2a3ea1198ad4e8fa87aa54306 | [] | no_license | shivanisarthi/SpringBootApplication | 21fa1fc4d59adf42363ca3d69a463add3ee9789f | 570888c38240da60e06a348ba854aa6eae486d7b | refs/heads/master | 2023-03-29T00:17:10.493513 | 2021-03-28T18:52:54 | 2021-03-28T18:52:54 | 352,408,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 920 | java | package com.example.spring;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.util.Date;
@SpringBootTest
class SpringBootApiApplicationTests {
@Test
void apiMethod(){
Date ObjectOfDate= new Date();
SpringBootApiApplication springObject = new SpringBootApiApplication();
DateFormat time = new SimpleDateFormat("hh:mm:ss");
String timeResult= springObject.apiMethod();
assertEquals(timeResult,"Running time :- "+time.format( ObjectOfDate));
}
@Test
void apiMethodNegative(){
Date ObjectOfDate= new Date();
DateFormat time = new SimpleDateFormat("hh:mm:ss");
String timeResult= String.valueOf(LocalTime.now());
assertNotEquals(timeResult,"Running time :- "+time.format( ObjectOfDate));
}
}
| [
"shivani.sarthi@knoldus.com"
] | shivani.sarthi@knoldus.com |
b7b299041319c9b9623a3837ae6496329100e07a | 2e03ec95d2b8d0312f336e5b23e19b85a6714b15 | /app/src/main/java/com/example/zhangyipeng/anwerdemo/bean/QuestionEntry.java | dab5607d3aec8d14bcc3bb17b8236238a6110447 | [
"Apache-2.0"
] | permissive | yufeilong92/AnswerEffect-master | cb6bb7154bdea163639ec5b24a3776be245c569f | 79aa04e8977422f5bef2d43569419471db848147 | refs/heads/master | 2020-03-30T07:38:40.913669 | 2018-09-30T10:12:13 | 2018-09-30T10:12:13 | 150,955,357 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,557 | java | package com.example.zhangyipeng.anwerdemo.bean;
import java.util.List;
/**
* Created by zhangyipeng on 16/7/27.
*/
public class QuestionEntry {
/**
* explain : “违反道路交通安全法”,违反法律法规即为违法行为。官方已无违章/违规的说法。
* question : 驾驶机动车在道路上违反道路交通安全法的行为,属于什么行为?
* questionid : 1
* mediatype : 0
* mediacontent :
* optiontype : 1
* answer : 2
* chapterid : 1
* answer_arr : ["2"]
* answers : ["违章行为","违法行为","过失行为","违规行为"]
*/
private String explain;
private String question;
private String questionid;
private String mediatype;
private String mediacontent;
private String optiontype;
private String answer;
private String chapterid;
private List<String> answer_arr;
private List<String> answers;
public String getExplain() {
return explain;
}
public void setExplain(String explain) {
this.explain = explain;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getQuestionid() {
return questionid;
}
public void setQuestionid(String questionid) {
this.questionid = questionid;
}
public String getMediatype() {
return mediatype;
}
public void setMediatype(String mediatype) {
this.mediatype = mediatype;
}
public String getMediacontent() {
return mediacontent;
}
public void setMediacontent(String mediacontent) {
this.mediacontent = mediacontent;
}
public String getOptiontype() {
return optiontype;
}
public void setOptiontype(String optiontype) {
this.optiontype = optiontype;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getChapterid() {
return chapterid;
}
public void setChapterid(String chapterid) {
this.chapterid = chapterid;
}
public List<String> getAnswer_arr() {
return answer_arr;
}
public void setAnswer_arr(List<String> answer_arr) {
this.answer_arr = answer_arr;
}
public List<String> getAnswers() {
return answers;
}
public void setAnswers(List<String> answers) {
this.answers = answers;
}
}
| [
"931697478@qq.com"
] | 931697478@qq.com |
1c694dd7d63738dfd82a03576d79b698ea33619d | 91c80994fa6393fa9848ec6671acda9811090afd | /src/main/java/com/shd/model/pojo/SysMenuExample.java | a6a5e39e5ee65ba95cf8e53059c2910cb1d7c306 | [] | no_license | 534344228/hospital | 81070c8e559b3eb2f68acffc610576956e224bf3 | 0744326455e3b3289f5bfdab1812bed2f0488f48 | refs/heads/master | 2020-03-06T14:29:44.136660 | 2018-03-29T10:03:12 | 2018-03-29T10:03:12 | 126,936,881 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 36,761 | java | package com.shd.model.pojo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysMenuExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysMenuExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
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 andMenuIdIsNull() {
addCriterion("MENU_ID is null");
return (Criteria) this;
}
public Criteria andMenuIdIsNotNull() {
addCriterion("MENU_ID is not null");
return (Criteria) this;
}
public Criteria andMenuIdEqualTo(String value) {
addCriterion("MENU_ID =", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdNotEqualTo(String value) {
addCriterion("MENU_ID <>", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdGreaterThan(String value) {
addCriterion("MENU_ID >", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdGreaterThanOrEqualTo(String value) {
addCriterion("MENU_ID >=", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdLessThan(String value) {
addCriterion("MENU_ID <", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdLessThanOrEqualTo(String value) {
addCriterion("MENU_ID <=", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdLike(String value) {
addCriterion("MENU_ID like", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdNotLike(String value) {
addCriterion("MENU_ID not like", value, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdIn(List<String> values) {
addCriterion("MENU_ID in", values, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdNotIn(List<String> values) {
addCriterion("MENU_ID not in", values, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdBetween(String value1, String value2) {
addCriterion("MENU_ID between", value1, value2, "menuId");
return (Criteria) this;
}
public Criteria andMenuIdNotBetween(String value1, String value2) {
addCriterion("MENU_ID not between", value1, value2, "menuId");
return (Criteria) this;
}
public Criteria andMenuNameIsNull() {
addCriterion("MENU_NAME is null");
return (Criteria) this;
}
public Criteria andMenuNameIsNotNull() {
addCriterion("MENU_NAME is not null");
return (Criteria) this;
}
public Criteria andMenuNameEqualTo(String value) {
addCriterion("MENU_NAME =", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameNotEqualTo(String value) {
addCriterion("MENU_NAME <>", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameGreaterThan(String value) {
addCriterion("MENU_NAME >", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameGreaterThanOrEqualTo(String value) {
addCriterion("MENU_NAME >=", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameLessThan(String value) {
addCriterion("MENU_NAME <", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameLessThanOrEqualTo(String value) {
addCriterion("MENU_NAME <=", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameLike(String value) {
addCriterion("MENU_NAME like", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameNotLike(String value) {
addCriterion("MENU_NAME not like", value, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameIn(List<String> values) {
addCriterion("MENU_NAME in", values, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameNotIn(List<String> values) {
addCriterion("MENU_NAME not in", values, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameBetween(String value1, String value2) {
addCriterion("MENU_NAME between", value1, value2, "menuName");
return (Criteria) this;
}
public Criteria andMenuNameNotBetween(String value1, String value2) {
addCriterion("MENU_NAME not between", value1, value2, "menuName");
return (Criteria) this;
}
public Criteria andMenuParentIdIsNull() {
addCriterion("MENU_PARENT_ID is null");
return (Criteria) this;
}
public Criteria andMenuParentIdIsNotNull() {
addCriterion("MENU_PARENT_ID is not null");
return (Criteria) this;
}
public Criteria andMenuParentIdEqualTo(String value) {
addCriterion("MENU_PARENT_ID =", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdNotEqualTo(String value) {
addCriterion("MENU_PARENT_ID <>", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdGreaterThan(String value) {
addCriterion("MENU_PARENT_ID >", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdGreaterThanOrEqualTo(String value) {
addCriterion("MENU_PARENT_ID >=", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdLessThan(String value) {
addCriterion("MENU_PARENT_ID <", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdLessThanOrEqualTo(String value) {
addCriterion("MENU_PARENT_ID <=", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdLike(String value) {
addCriterion("MENU_PARENT_ID like", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdNotLike(String value) {
addCriterion("MENU_PARENT_ID not like", value, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdIn(List<String> values) {
addCriterion("MENU_PARENT_ID in", values, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdNotIn(List<String> values) {
addCriterion("MENU_PARENT_ID not in", values, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdBetween(String value1, String value2) {
addCriterion("MENU_PARENT_ID between", value1, value2, "menuParentId");
return (Criteria) this;
}
public Criteria andMenuParentIdNotBetween(String value1, String value2) {
addCriterion("MENU_PARENT_ID not between", value1, value2, "menuParentId");
return (Criteria) this;
}
public Criteria andIsLeafIsNull() {
addCriterion("IS_LEAF is null");
return (Criteria) this;
}
public Criteria andIsLeafIsNotNull() {
addCriterion("IS_LEAF is not null");
return (Criteria) this;
}
public Criteria andIsLeafEqualTo(String value) {
addCriterion("IS_LEAF =", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafNotEqualTo(String value) {
addCriterion("IS_LEAF <>", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafGreaterThan(String value) {
addCriterion("IS_LEAF >", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafGreaterThanOrEqualTo(String value) {
addCriterion("IS_LEAF >=", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafLessThan(String value) {
addCriterion("IS_LEAF <", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafLessThanOrEqualTo(String value) {
addCriterion("IS_LEAF <=", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafLike(String value) {
addCriterion("IS_LEAF like", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafNotLike(String value) {
addCriterion("IS_LEAF not like", value, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafIn(List<String> values) {
addCriterion("IS_LEAF in", values, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafNotIn(List<String> values) {
addCriterion("IS_LEAF not in", values, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafBetween(String value1, String value2) {
addCriterion("IS_LEAF between", value1, value2, "isLeaf");
return (Criteria) this;
}
public Criteria andIsLeafNotBetween(String value1, String value2) {
addCriterion("IS_LEAF not between", value1, value2, "isLeaf");
return (Criteria) this;
}
public Criteria andMenuUrlIsNull() {
addCriterion("MENU_URL is null");
return (Criteria) this;
}
public Criteria andMenuUrlIsNotNull() {
addCriterion("MENU_URL is not null");
return (Criteria) this;
}
public Criteria andMenuUrlEqualTo(String value) {
addCriterion("MENU_URL =", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlNotEqualTo(String value) {
addCriterion("MENU_URL <>", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlGreaterThan(String value) {
addCriterion("MENU_URL >", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlGreaterThanOrEqualTo(String value) {
addCriterion("MENU_URL >=", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlLessThan(String value) {
addCriterion("MENU_URL <", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlLessThanOrEqualTo(String value) {
addCriterion("MENU_URL <=", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlLike(String value) {
addCriterion("MENU_URL like", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlNotLike(String value) {
addCriterion("MENU_URL not like", value, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlIn(List<String> values) {
addCriterion("MENU_URL in", values, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlNotIn(List<String> values) {
addCriterion("MENU_URL not in", values, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlBetween(String value1, String value2) {
addCriterion("MENU_URL between", value1, value2, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuUrlNotBetween(String value1, String value2) {
addCriterion("MENU_URL not between", value1, value2, "menuUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlIsNull() {
addCriterion("MENU_ICON_URL is null");
return (Criteria) this;
}
public Criteria andMenuIconUrlIsNotNull() {
addCriterion("MENU_ICON_URL is not null");
return (Criteria) this;
}
public Criteria andMenuIconUrlEqualTo(String value) {
addCriterion("MENU_ICON_URL =", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlNotEqualTo(String value) {
addCriterion("MENU_ICON_URL <>", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlGreaterThan(String value) {
addCriterion("MENU_ICON_URL >", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlGreaterThanOrEqualTo(String value) {
addCriterion("MENU_ICON_URL >=", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlLessThan(String value) {
addCriterion("MENU_ICON_URL <", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlLessThanOrEqualTo(String value) {
addCriterion("MENU_ICON_URL <=", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlLike(String value) {
addCriterion("MENU_ICON_URL like", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlNotLike(String value) {
addCriterion("MENU_ICON_URL not like", value, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlIn(List<String> values) {
addCriterion("MENU_ICON_URL in", values, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlNotIn(List<String> values) {
addCriterion("MENU_ICON_URL not in", values, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlBetween(String value1, String value2) {
addCriterion("MENU_ICON_URL between", value1, value2, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuIconUrlNotBetween(String value1, String value2) {
addCriterion("MENU_ICON_URL not between", value1, value2, "menuIconUrl");
return (Criteria) this;
}
public Criteria andMenuDescIsNull() {
addCriterion("MENU_DESC is null");
return (Criteria) this;
}
public Criteria andMenuDescIsNotNull() {
addCriterion("MENU_DESC is not null");
return (Criteria) this;
}
public Criteria andMenuDescEqualTo(String value) {
addCriterion("MENU_DESC =", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescNotEqualTo(String value) {
addCriterion("MENU_DESC <>", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescGreaterThan(String value) {
addCriterion("MENU_DESC >", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescGreaterThanOrEqualTo(String value) {
addCriterion("MENU_DESC >=", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescLessThan(String value) {
addCriterion("MENU_DESC <", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescLessThanOrEqualTo(String value) {
addCriterion("MENU_DESC <=", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescLike(String value) {
addCriterion("MENU_DESC like", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescNotLike(String value) {
addCriterion("MENU_DESC not like", value, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescIn(List<String> values) {
addCriterion("MENU_DESC in", values, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescNotIn(List<String> values) {
addCriterion("MENU_DESC not in", values, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescBetween(String value1, String value2) {
addCriterion("MENU_DESC between", value1, value2, "menuDesc");
return (Criteria) this;
}
public Criteria andMenuDescNotBetween(String value1, String value2) {
addCriterion("MENU_DESC not between", value1, value2, "menuDesc");
return (Criteria) this;
}
public Criteria andSortKeyIsNull() {
addCriterion("SORT_KEY is null");
return (Criteria) this;
}
public Criteria andSortKeyIsNotNull() {
addCriterion("SORT_KEY is not null");
return (Criteria) this;
}
public Criteria andSortKeyEqualTo(Integer value) {
addCriterion("SORT_KEY =", value, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyNotEqualTo(Integer value) {
addCriterion("SORT_KEY <>", value, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyGreaterThan(Integer value) {
addCriterion("SORT_KEY >", value, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyGreaterThanOrEqualTo(Integer value) {
addCriterion("SORT_KEY >=", value, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyLessThan(Integer value) {
addCriterion("SORT_KEY <", value, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyLessThanOrEqualTo(Integer value) {
addCriterion("SORT_KEY <=", value, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyIn(List<Integer> values) {
addCriterion("SORT_KEY in", values, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyNotIn(List<Integer> values) {
addCriterion("SORT_KEY not in", values, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyBetween(Integer value1, Integer value2) {
addCriterion("SORT_KEY between", value1, value2, "sortKey");
return (Criteria) this;
}
public Criteria andSortKeyNotBetween(Integer value1, Integer value2) {
addCriterion("SORT_KEY not between", value1, value2, "sortKey");
return (Criteria) this;
}
public Criteria andRecordIdIsNull() {
addCriterion("RECORD_ID is null");
return (Criteria) this;
}
public Criteria andRecordIdIsNotNull() {
addCriterion("RECORD_ID is not null");
return (Criteria) this;
}
public Criteria andRecordIdEqualTo(String value) {
addCriterion("RECORD_ID =", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotEqualTo(String value) {
addCriterion("RECORD_ID <>", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdGreaterThan(String value) {
addCriterion("RECORD_ID >", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdGreaterThanOrEqualTo(String value) {
addCriterion("RECORD_ID >=", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLessThan(String value) {
addCriterion("RECORD_ID <", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLessThanOrEqualTo(String value) {
addCriterion("RECORD_ID <=", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLike(String value) {
addCriterion("RECORD_ID like", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotLike(String value) {
addCriterion("RECORD_ID not like", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdIn(List<String> values) {
addCriterion("RECORD_ID in", values, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotIn(List<String> values) {
addCriterion("RECORD_ID not in", values, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdBetween(String value1, String value2) {
addCriterion("RECORD_ID between", value1, value2, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotBetween(String value1, String value2) {
addCriterion("RECORD_ID not between", value1, value2, "recordId");
return (Criteria) this;
}
public Criteria andCreateUserIsNull() {
addCriterion("CREATE_USER is null");
return (Criteria) this;
}
public Criteria andCreateUserIsNotNull() {
addCriterion("CREATE_USER is not null");
return (Criteria) this;
}
public Criteria andCreateUserEqualTo(String value) {
addCriterion("CREATE_USER =", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotEqualTo(String value) {
addCriterion("CREATE_USER <>", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThan(String value) {
addCriterion("CREATE_USER >", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
addCriterion("CREATE_USER >=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThan(String value) {
addCriterion("CREATE_USER <", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThanOrEqualTo(String value) {
addCriterion("CREATE_USER <=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLike(String value) {
addCriterion("CREATE_USER like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotLike(String value) {
addCriterion("CREATE_USER not like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserIn(List<String> values) {
addCriterion("CREATE_USER in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotIn(List<String> values) {
addCriterion("CREATE_USER not in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserBetween(String value1, String value2) {
addCriterion("CREATE_USER between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotBetween(String value1, String value2) {
addCriterion("CREATE_USER not between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("CREATE_TIME is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("CREATE_TIME is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("CREATE_TIME =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("CREATE_TIME <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("CREATE_TIME >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("CREATE_TIME >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("CREATE_TIME <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("CREATE_TIME <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("CREATE_TIME in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("CREATE_TIME not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("CREATE_TIME between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("CREATE_TIME not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateUserIsNull() {
addCriterion("UPDATE_USER is null");
return (Criteria) this;
}
public Criteria andUpdateUserIsNotNull() {
addCriterion("UPDATE_USER is not null");
return (Criteria) this;
}
public Criteria andUpdateUserEqualTo(String value) {
addCriterion("UPDATE_USER =", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotEqualTo(String value) {
addCriterion("UPDATE_USER <>", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThan(String value) {
addCriterion("UPDATE_USER >", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThanOrEqualTo(String value) {
addCriterion("UPDATE_USER >=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThan(String value) {
addCriterion("UPDATE_USER <", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThanOrEqualTo(String value) {
addCriterion("UPDATE_USER <=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLike(String value) {
addCriterion("UPDATE_USER like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotLike(String value) {
addCriterion("UPDATE_USER not like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserIn(List<String> values) {
addCriterion("UPDATE_USER in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotIn(List<String> values) {
addCriterion("UPDATE_USER not in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserBetween(String value1, String value2) {
addCriterion("UPDATE_USER between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotBetween(String value1, String value2) {
addCriterion("UPDATE_USER not between", value1, value2, "updateUser");
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 static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
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);
}
}
} | [
"534344228@qq.com"
] | 534344228@qq.com |
b5e3f3e0696fecb2595e55d6dd0c9f6f08221343 | d5cc29e91e22c8b61925dbd645056666ff87ca3f | /sample/src/main/java/ru/digipeople/loggersample/MainActivity.java | 935afabcf4b760b73668ada64e4945810f61ad6e | [] | no_license | DigiPeopleInc/Logger | 0423714bec7637a99f439d7df8296ff634495fef | d007fecc1d791f3eff3441a2fcfd69f706a15666 | refs/heads/master | 2020-04-02T10:46:32.865964 | 2019-03-11T17:16:43 | 2019-03-11T17:16:43 | 154,354,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package ru.digipeople.loggersample;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import ru.digipeople.logger.Logger;
import ru.digipeople.logger.LoggerFactory;
/**
* @author Aleksandr Brazhkin
*/
public class MainActivity extends AppCompatActivity {
private static final Logger logger = LoggerFactory.getLogger(MainActivity.class);
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
logger.trace("onCreate");
}
@Override
protected void onStart() {
super.onStart();
logger.info("onStart");
}
@Override
protected void onResume() {
super.onResume();
logger.error("onResume");
}
}
| [
"brajkin@digipeople.ru"
] | brajkin@digipeople.ru |
fa57b92c9136c63af67da0f6a4449ad054640b0f | 59ec82e1d24b67118149026383a5bb6601a6d9f5 | /xdclass-shiro/src/main/java/net/xdclass/xdclassshiro/config/ShiroConfig.java | 3ad1cd8daf7967a12e55ca626b6ed82f1b94b932 | [] | no_license | liuch0228/shiro-learn | 4a035fea2b56cc1b9a9f2211d6c791526f2dc09e | e6b144e1d40edac9afe18d26b9fa10a5b31d9167 | refs/heads/master | 2022-03-02T11:54:49.923310 | 2019-12-25T14:25:01 | 2019-12-25T14:25:01 | 223,405,995 | 0 | 0 | null | 2022-02-09T22:20:27 | 2019-11-22T13:10:52 | Java | UTF-8 | Java | false | false | 7,178 | java | package net.xdclass.xdclassshiro.config;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.crazycake.shiro.RedisCacheManager;
import org.crazycake.shiro.RedisManager;
import org.crazycake.shiro.RedisSessionDAO;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Filter;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* ShiroFilterFactoryBean配置,要加@Configuration注解
*
*/
@Configuration
public class ShiroConfig {
/**
* @param securityManager
* @return
* @Bean是一个方法级别上的注解,主要用在@Configuration注解的类里,也可以用在@Component注解的类里。添加的bean的id为方法名 等同于xml配置中的<bean id = " shiroFilter " class = " org.apache.shiro.spring.web.ShiroFilterFactoryBean " />
*/
@Bean
public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
System.out.println("ShiroFilterFactoryBean.shiroFilter");
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
// 设置securityManager
shiroFilterFactoryBean.setSecurityManager(securityManager);
// 如果访问配置的这个接口时用户还未登录,则调用该接口登录
shiroFilterFactoryBean.setLoginUrl("/pub/need_login");
// 登录成功后重定向url 前后端分离的,没有这个调用
shiroFilterFactoryBean.setSuccessUrl("/");
// 没有页面访问权限(登录了,未授权),调用该接口
shiroFilterFactoryBean.setUnauthorizedUrl("/pub/not_permit");
// 设置自定义Filter
Map<String, Filter> filterMap = new LinkedHashMap<>();
filterMap.put("roleOrFilter", new CustomRolesAuthorizationFilter());
// 绑定
shiroFilterFactoryBean.setFilters(filterMap);
// 注意,这里必须使用有序的LinkedHashMap,过滤器链是从上往下顺序执行,一般将/**放在最后,否则部分路径无法拦截
Map<String,String> filterChainDefinitionMap = new LinkedHashMap<>();
// 登出过滤器
filterChainDefinitionMap.put("/logout", "logout");
// 匿名访问过滤器(游客访问)
filterChainDefinitionMap.put("/pub/**", "anon");
// 登陆用户访问
filterChainDefinitionMap.put("/authc/**", "authc");
// 设置自定义Filter,只要是管理员角色或者root角色就能访问
filterChainDefinitionMap.put("/admin/**", "roleOrFilter[admin,root]");
// 管理员角色才能访问
// filterChainDefinitionMap.put("/admin/**", "roles[admin]");
// 有编辑权限才可以访问 /video/update是数据库配置的权限路径
filterChainDefinitionMap.put("/video/update", "perms[video_update]");
// authc: 定义的url必须通过认证才可以访问 anon: url可以匿名访问
filterChainDefinitionMap.put("/**", "authc");
// 这里没设置,过滤器不生效!!!
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return shiroFilterFactoryBean;
}
@Bean
public SecurityManager securityManager() {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
// 错误写法:securityManager.setRealm(new CustomRealm());
// 不是前后端分离项目,这里可以不用设置sessionmanager
securityManager.setSessionManager(sessionManager());
// 使用自定义的cacheManager
securityManager.setCacheManager(cacheManager());
// 必须通过spring实例化CustomRealm的实例之后,这里再通过customRealm()进行注入
securityManager.setRealm(customRealm());
return securityManager;
}
/**
* 注入realm
* @return
*/
@Bean
public CustomRealm customRealm(){
CustomRealm customRealm = new CustomRealm();
// 设置密码验证器 使用明文密码进行登录测试时,需要将这里注释掉,或者在数据库存储new SimpleHash("md5",pwd,null,2)加密过的密码
//数据库修改二当家小D的密码为4280d89a5a03f812751f504cc10ee8a5,这里密码验证注释放开,使用明文密码访问http://localhost:8080/pub/login,能够登录成功
customRealm.setCredentialsMatcher(hashedCredentialsMatcher());
return customRealm;
}
/**
* 注入自定义sessionManager
* @return
*/
@Bean
public SessionManager sessionManager(){
CustomSessionManager sessionManager = new CustomSessionManager();
// 设置session过期时间,不设置默认是30分钟,单位ms
sessionManager.setGlobalSessionTimeout(200000);
// 设置session持久化到redis中,这样服务器重启后,用户还可以通过之前的session进行操作
sessionManager.setSessionDAO(redisSessionDAO());
return sessionManager;
}
/**
* 密码加解密规则
* @return
*/
@Bean
public HashedCredentialsMatcher hashedCredentialsMatcher(){
HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
// 设置散列算法,进行加解密
credentialsMatcher.setHashAlgorithmName("md5");
// 设置散列迭代次数,2 表示 hash之后再次hash
credentialsMatcher.setHashIterations(2);
return credentialsMatcher;
}
/**
* 配置redisManager
* @return
*/
public RedisManager getRedisManager(){
RedisManager redisManager = new RedisManager();
// redisManager.setHost("192.168.5.112");
redisManager.setHost("192.168.0.114");
redisManager.setPort(8007);
return redisManager;
}
/**
* 配置缓存管理器具体实习类,然后添加到securityManager里面
* @return
*/
public RedisCacheManager cacheManager(){
RedisCacheManager redisCacheManager = new RedisCacheManager();
redisCacheManager.setRedisManager(getRedisManager());
// 设置缓存过期时间,单位秒
redisCacheManager.setExpire(1800);
return redisCacheManager;
}
/**
* 1.通过shiro redis插件自定义session持久化
* 2.在shiro的sessionManager中配置session持久化
* @return
*/
public RedisSessionDAO redisSessionDAO(){
RedisSessionDAO redisSessionDao = new RedisSessionDAO();
redisSessionDao.setRedisManager(getRedisManager());
// session持久化的过期时间,单位s,如果不设置,默认使用session的过期时间,如果设置了,则使用这里设置的过期时间
redisSessionDao.setExpire(1800);
//设置自定义sessionId生成
redisSessionDao.setSessionIdGenerator(new CustomSessionIdGenerator());
return redisSessionDao;
}
}
| [
"1402828263@qq.com"
] | 1402828263@qq.com |
e0093a197968cb6afdc8edd280e4e9328ed5b939 | be1c49fd5411aabad0318a2c90a6c821e853aa61 | /src/main/java/resume/microservice/elastic/ProfileSearchRepository.java | 3d84f16d56f7357e118a60cfc0433e0fc4001f8f | [] | no_license | DenDugin/MicroService | ad03d8278d873f74abc362919ad873b2c606869a | 8f38aaf5b30453ebf8c3c1a1ca272f84072dc10f | refs/heads/master | 2022-12-10T23:27:48.098473 | 2020-06-21T13:57:16 | 2020-06-21T13:57:16 | 265,778,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 843 | java | //package resume.microservice.com.ResumeService.elastic;
//
//
//import org.springframework.data.domain.Page;
//import org.springframework.data.domain.Pageable;
//import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
//import resume.microservice.com.ResumeService.entity.Profile;
//
//
//
//public interface ProfileSearchRepository extends ElasticsearchRepository<Profile, Long> {
//
//
// // поиск слова в указанных категориях
// Page<Profile> findByObjectiveLikeOrSummaryLikeOrPracticsCompanyLikeOrPracticsPositionLike(
// String objective, String summary, String practicCompany, String practicPosition, Pageable pageable);
//
//
// Page<Profile> findByFirstNameLikeOrLastNameLike(
// String firstName, String lastName, Pageable pageable);
//
//
//
//} | [
"xp.denis@mal.ru"
] | xp.denis@mal.ru |
b6ed410d2708e4dbe883d9bb4b1a659fcd0c807e | 1b7cefde652eb7a065d924560482be2f9f743f7e | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/graphics/drawable/R.java | 4543ef2e23c84abeeee41803cfcc9628c306f10f | [] | no_license | obi10/OtisApp | 965d7fe15e592e72ef18de73e6ecac53ca93aea4 | 76a768f9533871a39adef32b7c0b61c4e48f4cb8 | refs/heads/master | 2020-04-23T11:13:09.608564 | 2019-03-06T03:50:46 | 2019-03-06T03:50:46 | 171,128,683 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,406 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.graphics.drawable;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f030027;
public static final int coordinatorLayoutStyle = 0x7f0300a7;
public static final int font = 0x7f0300da;
public static final int fontProviderAuthority = 0x7f0300dc;
public static final int fontProviderCerts = 0x7f0300dd;
public static final int fontProviderFetchStrategy = 0x7f0300de;
public static final int fontProviderFetchTimeout = 0x7f0300df;
public static final int fontProviderPackage = 0x7f0300e0;
public static final int fontProviderQuery = 0x7f0300e1;
public static final int fontStyle = 0x7f0300e2;
public static final int fontVariationSettings = 0x7f0300e3;
public static final int fontWeight = 0x7f0300e4;
public static final int keylines = 0x7f030112;
public static final int layout_anchor = 0x7f030117;
public static final int layout_anchorGravity = 0x7f030118;
public static final int layout_behavior = 0x7f030119;
public static final int layout_dodgeInsetEdges = 0x7f030145;
public static final int layout_insetEdge = 0x7f03014e;
public static final int layout_keyline = 0x7f03014f;
public static final int statusBarBackground = 0x7f0301ac;
public static final int ttcIndex = 0x7f03020e;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f050076;
public static final int notification_icon_bg_color = 0x7f050077;
public static final int ripple_material_light = 0x7f050082;
public static final int secondary_text_default_material_light = 0x7f050084;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f06004e;
public static final int compat_button_inset_vertical_material = 0x7f06004f;
public static final int compat_button_padding_horizontal_material = 0x7f060050;
public static final int compat_button_padding_vertical_material = 0x7f060051;
public static final int compat_control_corner_material = 0x7f060052;
public static final int compat_notification_large_icon_max_height = 0x7f060053;
public static final int compat_notification_large_icon_max_width = 0x7f060054;
public static final int notification_action_icon_size = 0x7f0600ca;
public static final int notification_action_text_size = 0x7f0600cb;
public static final int notification_big_circle_margin = 0x7f0600cc;
public static final int notification_content_margin_start = 0x7f0600cd;
public static final int notification_large_icon_height = 0x7f0600ce;
public static final int notification_large_icon_width = 0x7f0600cf;
public static final int notification_main_column_padding_top = 0x7f0600d0;
public static final int notification_media_narrow_margin = 0x7f0600d1;
public static final int notification_right_icon_size = 0x7f0600d2;
public static final int notification_right_side_padding_top = 0x7f0600d3;
public static final int notification_small_icon_background_padding = 0x7f0600d4;
public static final int notification_small_icon_size_as_large = 0x7f0600d5;
public static final int notification_subtext_size = 0x7f0600d6;
public static final int notification_top_pad = 0x7f0600d7;
public static final int notification_top_pad_large_text = 0x7f0600d8;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f07008a;
public static final int notification_bg = 0x7f07008b;
public static final int notification_bg_low = 0x7f07008c;
public static final int notification_bg_low_normal = 0x7f07008d;
public static final int notification_bg_low_pressed = 0x7f07008e;
public static final int notification_bg_normal = 0x7f07008f;
public static final int notification_bg_normal_pressed = 0x7f070090;
public static final int notification_icon_background = 0x7f070091;
public static final int notification_template_icon_bg = 0x7f070092;
public static final int notification_template_icon_low_bg = 0x7f070093;
public static final int notification_tile_bg = 0x7f070094;
public static final int notify_panel_notification_icon_bg = 0x7f070095;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f08000e;
public static final int action_divider = 0x7f080010;
public static final int action_image = 0x7f080011;
public static final int action_text = 0x7f080017;
public static final int actions = 0x7f080018;
public static final int async = 0x7f080020;
public static final int blocking = 0x7f080024;
public static final int bottom = 0x7f080025;
public static final int chronometer = 0x7f080032;
public static final int end = 0x7f08004c;
public static final int forever = 0x7f080059;
public static final int icon = 0x7f080061;
public static final int icon_group = 0x7f080062;
public static final int info = 0x7f080068;
public static final int italic = 0x7f08006a;
public static final int left = 0x7f08006e;
public static final int line1 = 0x7f080070;
public static final int line3 = 0x7f080071;
public static final int none = 0x7f080083;
public static final int normal = 0x7f080084;
public static final int notification_background = 0x7f080085;
public static final int notification_main_column = 0x7f080086;
public static final int notification_main_column_container = 0x7f080087;
public static final int right = 0x7f080098;
public static final int right_icon = 0x7f080099;
public static final int right_side = 0x7f08009a;
public static final int start = 0x7f0800c1;
public static final int tag_transition_group = 0x7f0800c7;
public static final int tag_unhandled_key_event_manager = 0x7f0800c8;
public static final int tag_unhandled_key_listeners = 0x7f0800c9;
public static final int text = 0x7f0800ca;
public static final int text2 = 0x7f0800cb;
public static final int time = 0x7f0800df;
public static final int title = 0x7f0800e0;
public static final int top = 0x7f0800e4;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f09000f;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0b0037;
public static final int notification_action_tombstone = 0x7f0b0038;
public static final int notification_template_custom_big = 0x7f0b003f;
public static final int notification_template_icon_group = 0x7f0b0040;
public static final int notification_template_part_chronometer = 0x7f0b0044;
public static final int notification_template_part_time = 0x7f0b0045;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0e0057;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0f011a;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0f011b;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f011d;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0f0120;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0f0122;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0f01ce;
public static final int Widget_Compat_NotificationActionText = 0x7f0f01cf;
public static final int Widget_Support_CoordinatorLayout = 0x7f0f01fe;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] CoordinatorLayout = { 0x7f030112, 0x7f0301ac };
public static final int CoordinatorLayout_keylines = 0;
public static final int CoordinatorLayout_statusBarBackground = 1;
public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f030117, 0x7f030118, 0x7f030119, 0x7f030145, 0x7f03014e, 0x7f03014f };
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0;
public static final int CoordinatorLayout_Layout_layout_anchor = 1;
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2;
public static final int CoordinatorLayout_Layout_layout_behavior = 3;
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
public static final int CoordinatorLayout_Layout_layout_insetEdge = 5;
public static final int CoordinatorLayout_Layout_layout_keyline = 6;
public static final int[] FontFamily = { 0x7f0300dc, 0x7f0300dd, 0x7f0300de, 0x7f0300df, 0x7f0300e0, 0x7f0300e1 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300da, 0x7f0300e2, 0x7f0300e3, 0x7f0300e4, 0x7f03020e };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"y.palomino@pucp.pe"
] | y.palomino@pucp.pe |
9c0fec51c2a5ede9ea57451d0c80af05c4c42d6a | 63fc85149e2b27225423f084c7cf6baf2bae6f7f | /bootdo/src/main/java/com/bootdo/test/service/TestService.java | 771a11207d06acd2c6994203d744aeb18ed020a8 | [] | no_license | 2015Y/20-01-11 | 91d08866f678d2e14333b0745204abb3223ec2b1 | c98bb019b55968cdb44a08bad4247237a2ea9ca0 | refs/heads/master | 2022-11-01T22:08:52.072080 | 2020-08-08T02:02:47 | 2020-08-08T02:02:47 | 233,243,175 | 0 | 0 | null | 2022-10-12T20:36:06 | 2020-01-11T14:19:29 | JavaScript | UTF-8 | Java | false | false | 482 | java | package com.bootdo.test.service;
import com.bootdo.test.domain.TestDO;
import java.util.List;
import java.util.Map;
/**
*
*
* @author chglee
* @email 1992lcg@163.com
* @date 2017-09-26 10:54:46
*/
public interface TestService {
TestDO get(Integer testId);
List<TestDO> list(Map<String, Object> map);
int count(Map<String, Object> map);
int save(TestDO test);
int update(TestDO test);
int remove(Integer testId);
int batchRemove(Integer[] testIds);
}
| [
"2384179771@qq.com"
] | 2384179771@qq.com |
36f144215fc8e75b227c5bba167c1237d18f15df | 55198905555db7de06a5ed6e743b9087560ee82e | /ThirdLib/OkHttpLib/src/main/java/okhttp3/internal/connection/RealConnectionPool.java | 435cd89ba025391aa6ae4993f227cc9ab5f3193c | [
"Apache-2.0"
] | permissive | Mario0o/LifeHelper | c68ebe76e50283403587558dfdfdddd418667943 | 83c22ffbd61186aa86d29a325755e5f796d1e117 | refs/heads/master | 2023-08-17T05:49:25.116555 | 2023-08-14T23:51:17 | 2023-08-14T23:51:17 | 190,854,495 | 0 | 0 | null | 2023-08-15T08:02:23 | 2019-06-08T06:37:35 | Java | UTF-8 | Java | false | false | 9,754 | 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 okhttp3.internal.connection;
import java.io.IOException;
import java.lang.ref.Reference;
import java.net.Proxy;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import androidx.annotation.Nullable;
import okhttp3.Address;
import okhttp3.Route;
import okhttp3.internal.Util;
import okhttp3.internal.connection.Transmitter.TransmitterReference;
import okhttp3.internal.platform.Platform;
import static okhttp3.internal.Util.closeQuietly;
public final class RealConnectionPool {
/**
* Background threads are used to cleanup expired connections. There will be at most a single
* thread running per connection pool. The thread pool executor permits the pool itself to be
* garbage collected.
*/
private static final Executor executor = new ThreadPoolExecutor(0 /* corePoolSize */,
Integer.MAX_VALUE /* maximumPoolSize */, 60L /* keepAliveTime */, TimeUnit.SECONDS,
new SynchronousQueue<>(), Util.threadFactory("OkHttp ConnectionPool", true));
/** The maximum number of idle connections for each address. */
private final int maxIdleConnections;
private final long keepAliveDurationNs;
private final Runnable cleanupRunnable = () -> {
while (true) {
long waitNanos = cleanup(System.nanoTime());
if (waitNanos == -1) return;
if (waitNanos > 0) {
long waitMillis = waitNanos / 1000000L;
waitNanos -= (waitMillis * 1000000L);
synchronized (RealConnectionPool.this) {
try {
RealConnectionPool.this.wait(waitMillis, (int) waitNanos);
} catch (InterruptedException ignored) {
}
}
}
}
};
private final Deque<RealConnection> connections = new ArrayDeque<>();
final RouteDatabase routeDatabase = new RouteDatabase();
boolean cleanupRunning;
public RealConnectionPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit) {
this.maxIdleConnections = maxIdleConnections;
this.keepAliveDurationNs = timeUnit.toNanos(keepAliveDuration);
// Put a floor on the keep alive duration, otherwise cleanup will spin loop.
if (keepAliveDuration <= 0) {
throw new IllegalArgumentException("keepAliveDuration <= 0: " + keepAliveDuration);
}
}
public synchronized int idleConnectionCount() {
int total = 0;
for (RealConnection connection : connections) {
if (connection.transmitters.isEmpty()) total++;
}
return total;
}
public synchronized int connectionCount() {
return connections.size();
}
/**
* Attempts to acquire a recycled connection to {@code address} for {@code transmitter}. Returns
* true if a connection was acquired.
*
* <p>If {@code routes} is non-null these are the resolved routes (ie. IP addresses) for the
* connection. This is used to coalesce related domains to the same HTTP/2 connection, such as
* {@code square.com} and {@code square.ca}.
*/
boolean transmitterAcquirePooledConnection(Address address, Transmitter transmitter,
@Nullable List<Route> routes, boolean requireMultiplexed) {
assert (Thread.holdsLock(this));
for (RealConnection connection : connections) {
if (requireMultiplexed && !connection.isMultiplexed()) continue;
if (!connection.isEligible(address, routes)) continue;
transmitter.acquireConnectionNoEvents(connection);
return true;
}
return false;
}
void put(RealConnection connection) {
assert (Thread.holdsLock(this));
if (!cleanupRunning) {
cleanupRunning = true;
executor.execute(cleanupRunnable);
}
connections.add(connection);
}
/**
* Notify this pool that {@code connection} has become idle. Returns true if the connection has
* been removed from the pool and should be closed.
*/
boolean connectionBecameIdle(RealConnection connection) {
assert (Thread.holdsLock(this));
if (connection.noNewExchanges || maxIdleConnections == 0) {
connections.remove(connection);
return true;
} else {
notifyAll(); // Awake the cleanup thread: we may have exceeded the idle connection limit.
return false;
}
}
public void evictAll() {
List<RealConnection> evictedConnections = new ArrayList<>();
synchronized (this) {
for (Iterator<RealConnection> i = connections.iterator(); i.hasNext(); ) {
RealConnection connection = i.next();
if (connection.transmitters.isEmpty()) {
connection.noNewExchanges = true;
evictedConnections.add(connection);
i.remove();
}
}
}
for (RealConnection connection : evictedConnections) {
closeQuietly(connection.socket());
}
}
/**
* Performs maintenance on this pool, evicting the connection that has been idle the longest if
* either it has exceeded the keep alive limit or the idle connections limit.
*
* <p>Returns the duration in nanos to sleep until the next scheduled call to this method. Returns
* -1 if no further cleanups are required.
*/
long cleanup(long now) {
int inUseConnectionCount = 0;
int idleConnectionCount = 0;
RealConnection longestIdleConnection = null;
long longestIdleDurationNs = Long.MIN_VALUE;
// Find either a connection to evict, or the time that the next eviction is due.
synchronized (this) {
for (Iterator<RealConnection> i = connections.iterator(); i.hasNext(); ) {
RealConnection connection = i.next();
// If the connection is in use, keep searching.
if (pruneAndGetAllocationCount(connection, now) > 0) {
inUseConnectionCount++;
continue;
}
idleConnectionCount++;
// If the connection is ready to be evicted, we're done.
long idleDurationNs = now - connection.idleAtNanos;
if (idleDurationNs > longestIdleDurationNs) {
longestIdleDurationNs = idleDurationNs;
longestIdleConnection = connection;
}
}
if (longestIdleDurationNs >= this.keepAliveDurationNs
|| idleConnectionCount > this.maxIdleConnections) {
// We've found a connection to evict. Remove it from the list, then close it below (outside
// of the synchronized block).
connections.remove(longestIdleConnection);
} else if (idleConnectionCount > 0) {
// A connection will be ready to evict soon.
return keepAliveDurationNs - longestIdleDurationNs;
} else if (inUseConnectionCount > 0) {
// All connections are in use. It'll be at least the keep alive duration 'til we run again.
return keepAliveDurationNs;
} else {
// No connections, idle or in use.
cleanupRunning = false;
return -1;
}
}
closeQuietly(longestIdleConnection.socket());
// Cleanup again immediately.
return 0;
}
/**
* Prunes any leaked transmitters and then returns the number of remaining live transmitters on
* {@code connection}. Transmitters are leaked if the connection is tracking them but the
* application code has abandoned them. Leak detection is imprecise and relies on garbage
* collection.
*/
private int pruneAndGetAllocationCount(RealConnection connection, long now) {
List<Reference<Transmitter>> references = connection.transmitters;
for (int i = 0; i < references.size(); ) {
Reference<Transmitter> reference = references.get(i);
if (reference.get() != null) {
i++;
continue;
}
// We've discovered a leaked transmitter. This is an application bug.
TransmitterReference transmitterRef = (TransmitterReference) reference;
String message = "A connection to " + connection.route().address().url()
+ " was leaked. Did you forget to close a response body?";
Platform.get().logCloseableLeak(message, transmitterRef.callStackTrace);
references.remove(i);
connection.noNewExchanges = true;
// If this was the last allocation, the connection is eligible for immediate eviction.
if (references.isEmpty()) {
connection.idleAtNanos = now - keepAliveDurationNs;
return 0;
}
}
return references.size();
}
/** Track a bad route in the route database. Other routes will be attempted first. */
public void connectFailed(Route failedRoute, IOException failure) {
// Tell the proxy selector when we fail to connect on a fresh connection.
if (failedRoute.proxy().type() != Proxy.Type.DIRECT) {
Address address = failedRoute.address();
address.proxySelector().connectFailed(
address.url().uri(), failedRoute.proxy().address(), failure);
}
routeDatabase.failed(failedRoute);
}
}
| [
"yangchong211@163.com"
] | yangchong211@163.com |
0863be07f7b68e0bf0ea6c184afe382cf1d9265e | f4b77a66589c4602e362b66fa4a24b9c820521d0 | /src/test/java/com/demoqa/test/stepdefinition/PracticeTextBoxStepDefinitions.java | 2fa0522b3440b71bdcaf42c44ea8fd10beb9cc02 | [] | no_license | DianitaOsorio/MyPrimerProyectoPOM | 1b86beaeb783159f4ce5655fe4f4b7aba34661d4 | 93a6d9a00e32e4ebf6ffeae2f11eb049565edd7c | refs/heads/master | 2023-06-14T11:18:24.448770 | 2021-07-10T03:03:32 | 2021-07-10T03:03:32 | 384,595,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,070 | java | package com.demoqa.test.stepdefinition;
import com.demoqa.automation.steps.TextBoxPageSteps;
import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import net.thucydides.core.annotations.Steps;
public class PracticeTextBoxStepDefinitions {
@Steps
TextBoxPageSteps textBoxPageSteps;
@Given("^a web user wants to enter text box$")
public void aWebUserWantsToEnterTextBox() {
// Write code here that turns the phrase above into concrete actions
textBoxPageSteps.openBrowser();
}
@When("^he fills all the requested fields in the Text Box section$")
public void heFillsAllTheRequestedFieldsInTheTextBoxSection() throws InterruptedException {
// Write code here that turns the phrase above into concrete actions
textBoxPageSteps.fillTexBox();
}
@Then("^he should see hem data down$")
public void heShouldSeeHemDataDown() {
// Write code here that turns the phrase above into concrete actions
}
}
| [
"86800161+MaluDG11@users.noreply.github.com"
] | 86800161+MaluDG11@users.noreply.github.com |
271b0718eac2150bed33593fb2d4691b0d192e9a | d6f13631a99e2cbf18011af07fa3924a2b28e8d9 | /src/main/java/com/swiggy/restaurent/controller/RestaurentController.java | 98ae39ec6b98d25cedb05150c7955acd02cf8112 | [] | no_license | PrasadSankrana/swiggyRestServices | c9a0d7d916c6666c80bbe3b44dca7ccf71ba1d29 | 53cb59e58f79201377934dc17ed858ee8e6d9c39 | refs/heads/master | 2023-02-20T05:12:28.210877 | 2021-01-24T17:09:46 | 2021-01-24T17:09:46 | 332,507,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,241 | java | package com.swiggy.restaurent.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.swiggy.restaurent.entity.RestaurentEntity;
import com.swiggy.restaurent.service.RestaurentService;
@RestController
public class RestaurentController {
@Autowired
RestaurentService service;
@GetMapping(value="/restaurents",produces= {MediaType.APPLICATION_JSON_VALUE})
public ResponseEntity<List<RestaurentEntity>> getRestaurents() {
List<RestaurentEntity> list = service.getRestaurents();
return new ResponseEntity<List<RestaurentEntity>>(list, HttpStatus.OK);
}
@GetMapping(value="/restaurents/online", produces= {MediaType.APPLICATION_JSON_VALUE})
public ResponseEntity<List<RestaurentEntity>> getAvailableRestaurents() {
List<RestaurentEntity> list = service.getOnlineRestaurents();
return new ResponseEntity<List<RestaurentEntity>>(list, HttpStatus.OK);
}
}
| [
"leelaprasad512@gmail.com"
] | leelaprasad512@gmail.com |
a5184080fcf74482ed3c7270f9e97775ed924051 | 5e3f2ffb7798cb9493e0ed4bd4a63a4f795e53cc | /src/Arrays/lengthofarray.java | f1c4bd152f633bfc069f6c127334cecba3e4105f | [] | no_license | sarandev88/Projectjava | 8d823ae41ce73cf1f5c430c33240356e063d6c6e | fe5ffcabfc67b6f97cd99223508e50d095bd5185 | refs/heads/master | 2023-09-04T10:53:45.399748 | 2021-09-12T10:04:10 | 2021-09-12T10:04:10 | 405,606,068 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package Arrays;
public class lengthofarray {
public static void main(String[] args) {
int a[]= new int[5];
a[0]=10;
a[1]=20;
a[2]=30;
a[3]=40;
a[4]=50;
int length = a.length; //return type first give a.length and take return type
System.out.println("Length of the array is:" + length); // length it prints the assigned one [5] if we give someother value also it prints this only
}
}
| [
"saranyamahadevan1988@gmail.com"
] | saranyamahadevan1988@gmail.com |
cae529df5cebc380ba36ca2bf29f8bb8edd9f4c0 | e56247b9cccf0ba6ff13b21786fe3bafca1a227c | /poo/lista1/src/lista1/Retangulo.java | 9334a6e1e194921d4ee7dfd386781ea7bb8170d5 | [] | no_license | alcalcides/exerciciosUFBA | 1c06500d6ceba20da237e4067b8fbd0b9049e7e4 | 759e7b8e0ae54bffe1c7f1930f5788e2f98e844a | refs/heads/master | 2020-04-29T20:03:28.386273 | 2019-08-20T17:49:04 | 2019-08-20T17:49:04 | 176,373,919 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 961 | java | package lista1;
public class Retangulo {
private double largura;
private double altura;
public Retangulo(double largura, double altura) {
this.largura = largura;
this.altura = altura;
}
public Retangulo() {
this.largura = 1;
this.altura = 1;
}
public double getLargura() {
return largura;
}
public void setLargura(double largura) {
this.largura = largura;
}
public double getAltura() {
return altura;
}
public void setAltura(double altura) {
this.altura = altura;
}
public double calculaArea() {
return this.altura*this.largura;
}
public double calculaPerimetro() {
return 2*this.altura + 2*this.largura;
}
// public static void main(String[] args) {
// Retangulo bege = new Retangulo();
// System.out.println("Largura " + bege.largura);
// System.out.println("Altura " + bege.altura);
// System.out.println("Perimetro " + bege.calculaPerimetro());
// System.out.println("Area " + bege.calculaArea());
// }
}
| [
"alcalcides@hotmail.com"
] | alcalcides@hotmail.com |
b5ff1381d6ea59f66fc4c6c488e8e449fde59ceb | 9430bdf488ccab433a3f3578e608d0871f9bb3ed | /app/src/main/java/com/huanpet/huanpet/view/activity/pet/MyPetActivity.java | d554219a496c1f23b0f7a5e00f71ccf6fd26ff97 | [] | no_license | wl19930525/HuanPet | 8ac3144fc5282dd9d45b6b5ee6e6ef4746a13b43 | 026b30772a92b501640d5382485ef3b0de96352a | refs/heads/master | 2021-04-15T16:37:48.937039 | 2018-04-04T01:44:15 | 2018-04-04T01:44:15 | 126,459,021 | 0 | 0 | null | 2018-04-02T00:57:17 | 2018-03-23T08:58:14 | Java | UTF-8 | Java | false | false | 1,666 | java | package com.huanpet.huanpet.view.activity.pet;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import com.huanpet.huanpet.R;
import com.huanpet.huanpet.bean.MyPetBean;
import com.huanpet.huanpet.view.adapter.MyPetAdapter;
public class MyPetActivity extends AppCompatActivity {
private RecyclerView MyPet_Recycler;
private MyPetAdapter myPetAdapter;
private TextView ChongwuTianjia;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_pet);
initView();
initData();
initListener();
}
private void initListener() {
ChongwuTianjia.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MyPetActivity.this,Add_PetsActivity.class);
startActivity(intent);
}
});
}
private void initData() {
MyPetBean myPetBean = new MyPetBean();
myPetAdapter = new MyPetAdapter(this, myPetBean);
MyPet_Recycler.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
MyPet_Recycler.setAdapter(myPetAdapter);
}
private void initView() {
MyPet_Recycler = (RecyclerView) findViewById(R.id.MyPet_Recycler);
ChongwuTianjia = (TextView) findViewById(R.id.ChongwuTianjia);
}
}
| [
"958337798@qq.com"
] | 958337798@qq.com |
1f641af58ead3338b154e9c238c9a0a2e55ad148 | 20c52953b5b99f5f857e2a9f6b1bfed6d01c0071 | /belajar-aplikasi/src/main/java/id/co/quadras/strawberryshop/worker/StrawberryBrownies.java | 61b4eca70e852a0552edb7f06aa13aa5ad76f9d0 | [] | no_license | hdrsmr/lab | 46da1902e4c617bf883ae3c126828158094a454a | 40c9f16425ae418a1fccab59017471c01d8412a3 | refs/heads/master | 2020-12-27T21:36:30.206340 | 2014-05-09T23:39:31 | 2014-05-09T23:39:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package id.co.quadras.strawberryshop.worker;
/**
* Created by achmad on 5/8/2014.
*/
class StrawberryBrownies extends StrawberryFood {
@Override
public byte getId() {
return 4;
}
@Override
public String getName() {
return null;
}
@Override
public Double getPrice() {
return null;
}
}
| [
"achmads0808@yahoo.com"
] | achmads0808@yahoo.com |
7d956d0b9759b6874c3884df12c38afb97336894 | b327a374de29f80d9b2b3841db73f3a6a30e5f0d | /out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/main_files/dot/junit/opcodes/return_wide/Main_testVFE1.java | 31234bbe0db38b49a92ade87f086397df00647a1 | [] | no_license | nikoltu/aosp | 6409c386ed6d94c15d985dd5be2c522fefea6267 | f99d40c9d13bda30231fb1ac03258b6b6267c496 | refs/heads/master | 2021-01-22T09:26:24.152070 | 2011-09-27T15:10:30 | 2011-09-27T15:10:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 518 | java | //autogenerated by util.build.BuildDalvikSuite, do not change
package dot.junit.opcodes.return_wide;
import dot.junit.opcodes.return_wide.d.*;
import dot.junit.*;
public class Main_testVFE1 extends DxAbstractMain {
public static void main(String[] args) throws Exception {
try {
Class.forName("dot.junit.opcodes.return_wide.d.T_return_wide_5");
fail("expected a verification exception");
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
}
}
| [
"fred.faust@gmail.com"
] | fred.faust@gmail.com |
873e2b45c47377d7b6ec47fc3ae162e865932e75 | 940579011a113ee36c0520da5f2df305a17f1eb6 | /gymify/src/main/java/com/gav/sqlmodel/Exercise.java | ce4fcf8ae48dede37be1bd9440dd8b6119f36103 | [] | no_license | gavlaaaaaaaa/Gymify-for-Android | 03f1a7a41e0c08afb3edddac5c4df5d348a76694 | 7e8a1fbbe02daaab84c39f521f7f8ac2779dbfd8 | refs/heads/master | 2021-01-17T08:12:10.890054 | 2016-05-21T13:34:33 | 2016-05-21T13:34:33 | 21,982,099 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,024 | java | package com.gav.sqlmodel;
import com.google.gson.Gson;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Exercise {
private int id;
private String name;
private String exerciseType;
private String exerciseArea;
private String description;
private int noSets;
private double distanceGoal;
private List<Set> sets;
private List<Set> lastSets;
public static String [] mgroups = {"Chest", "Biceps", "Triceps", "Back", "Shoulders", "Abs", "Legs"};
public static String [] cgroups = {"Run", "Cycle", "Row"};
public Exercise(){
id = 0; name = ""; exerciseType=""; description = "";
}
public Exercise(int id, String name, String exerciseArea, String description, int noSets) {
this.id = id;
this.name = name;
this.exerciseType = "WEIGHT";
this.description = description;
this.exerciseArea = exerciseArea;
this.noSets = noSets;
}
public Exercise(String name, String exerciseArea, String description, int noSets) {
this.name = name;
this.exerciseType = "WEIGHT";
this.description = description;
this.exerciseArea = exerciseArea;
this.noSets = noSets;
}
public Exercise(int id, String name, String exerciseArea, String description, double distanceGoal) {
this.id = id;
this.name = name;
this.exerciseType = "CARDIO";
this.description = description;
this.exerciseArea = exerciseArea;
this.distanceGoal = distanceGoal;
}
public Exercise(String name, String exerciseArea, String description, double distanceGoal) {
this.name = name;
this.exerciseType = "CARDIO";
this.description = description;
this.exerciseArea = exerciseArea;
this.distanceGoal = distanceGoal;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getExerciseType() {
return exerciseType;
}
public void setExerciseType(String type) {
this.exerciseType = type;
}
public String getExerciseArea() {
return exerciseArea;
}
public void setExerciseArea(String exerciseArea) {
this.exerciseArea = exerciseArea;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getNoSets() {
return noSets;
}
public void setNoSets(int noSets) {
this.noSets = noSets;
}
public void addSet(Set s){
sets.add(s);
}
public void removeSet(Set s){
sets.remove(s);
}
public double getDistanceGoal() {
return distanceGoal;
}
public void setDistanceGoal(double distanceGoal) {
this.distanceGoal = distanceGoal;
}
public List<Set> getSets(){
return sets;
}
public void setLastSets(List<Set> lastSets){
this.lastSets = new ArrayList<Set>(lastSets);
}
public List<Set> getLastsSets(){
return lastSets;
}
public void setSets(List<Set> sets) {
this.sets = sets;
}
public String toString(){
return this.name;
}
}
| [
"gavlaaaaa5@googlemail.com"
] | gavlaaaaa5@googlemail.com |
39259955240e7a2234f89baa11b682b3f1bcec57 | d6493c5040063cc019704f9e169e012626c2774a | /src/main/java/project/controller/cardsfactory/Anagrafic.java | b74d2d2a686c5b1911a683200ac67f2014f457c9 | [] | no_license | federicoBetti/Lorenzo_Magnifico_Java | ff508a722153a742eff9057da99b1a869bfbf696 | cc725e0a1cdd48117a3b9e8d56d9c50e4ef67b34 | refs/heads/master | 2021-03-16T05:28:32.326170 | 2019-04-30T21:02:56 | 2019-04-30T21:02:56 | 87,735,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,248 | java | package project.controller.cardsfactory;
/**
* This class is used in the CardFromJson objects for storing the card's anagrafic characteristics
*/
public class Anagrafic {
private String type;
private String name;
private int period;
private boolean choicePe;
private Object[] cost;
/**
* Get cost variable
*
* @return cost
*/
public Object getCost() {
return cost;
}
/**
* Set cost varibale
*
* @param cost cost
*/
public void setCost(Object[] cost) {
this.cost = cost;
}
/**
* Get type variable
*
* @return type
*/
public String getType() {
return type;
}
/**
* get name variable
*
* @return name
*/
public String getName() {
return name;
}
/**
* Set name varibale
*
* @param name name
*/
public void setName(String name) {
this.name = name;
}
/**
* Get period variable
*
* @return period
*/
public int getPeriod() {
return period;
}
/**
* Get choicePe variable
*
* @return choicePE
*/
public boolean isChoicePe() {
return choicePe;
}
}
| [
"raffaele.bongo@mail.polimi.it"
] | raffaele.bongo@mail.polimi.it |
0b61648b57fe7e0ac450eb809daeeabe0f63ebc5 | da4c910c15e79edcd13d12ef2aeee348f71fac08 | /src/main/java/com/docusign/controller/eSignature/examples/EG015ControllerGetTabValues.java | 18001930592ec1c533771893b03bc0ef799544e3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | prafullkotecha/docusign-hackathon | 6c3f73518d3a2aeed1018b4ca5131347ccf4e549 | 4ed463d41983301d5421921b9b4f02a790ec264f | refs/heads/main | 2023-06-26T23:40:00.638449 | 2021-08-01T13:46:30 | 2021-08-01T13:46:30 | 390,871,672 | 0 | 0 | MIT | 2021-07-29T23:12:37 | 2021-07-29T23:10:43 | null | UTF-8 | Java | false | false | 2,078 | java | package com.docusign.controller.eSignature.examples;
import com.docusign.DSConfiguration;
import com.docusign.common.WorkArguments;
import com.docusign.core.model.DoneExample;
import com.docusign.core.model.Session;
import com.docusign.core.model.User;
import com.docusign.esign.api.EnvelopesApi;
import com.docusign.esign.client.ApiException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletResponse;
/**
* List an envelope's recipients and their status.<br />
* List the envelope's recipients, including their current status.
*/
@Controller
@RequestMapping("/eg015")
public class EG015ControllerGetTabValues extends AbstractEsignatureController {
private final Session session;
private final User user;
@Autowired
public EG015ControllerGetTabValues(DSConfiguration config, Session session, User user) {
super(config, "eg015", "Get Envelope Tabs");
this.session = session;
this.user = user;
}
@Override
protected void onInitModel(WorkArguments args, ModelMap model) throws Exception {
super.onInitModel(args, model);
model.addAttribute(MODEL_ENVELOPE_OK, StringUtils.isNotBlank(session.getEnvelopeId()));
}
@Override
// ***DS.snippet.0.start
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws ApiException {
// Step 1. get envelope recipients
EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken());
DoneExample.createDefault(title)
.withJsonObject(envelopesApi.getFormData(session.getAccountId(), session.getEnvelopeId()))
.withMessage("Results from the Envelope::GetFormData method:")
.addToModel(model);
return DONE_EXAMPLE_PAGE;
}
// ***DS.snippet.0.end
}
| [
"prafull.kotecha@gmail.com"
] | prafull.kotecha@gmail.com |
de521b135b9c9208bb66ffa02691df5bf204d40c | a85d74ef2840ba17feae921543e5a3d9e91c6498 | /tmp/drakongen/DrakonUtils.java | 525c7a7c89ecb706820a39f4daf38f82137dd663 | [] | no_license | danmas/drakongen | f6209982fa6a6d426148352084ca37e628d4ad7f | b0e1283fa2ef1d391ee824573f6e87889779aeb7 | refs/heads/master | 2021-01-19T14:37:01.535294 | 2017-06-08T05:22:21 | 2017-06-08T05:22:29 | 26,286,874 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,890 | java |
//-- Класс DrakonUtils
//-- упоминание о DrakonGen2
/**
* Этот текст сгенерирован программой DrakonGen2
* @author Erv +
*/
//-- package//-- imports
package ru.erv.drakongen;
import com.tinkerpop.blueprints.pgm.Edge;
import com.tinkerpop.blueprints.pgm.Graph;
import com.tinkerpop.blueprints.pgm.Vertex;
import ru.erv.drakongen.utils.*;
//-- class DrakonUtils
public class DrakonUtils {
//-- константы
public final static String DI_EXT_NEXT = "next";
public final static String DI_DG_BEG = "DG_BEG";
public final static String DI_SI_BEG = "SI_BEG";
public final static String DI_SI_END = "SI_END";
public final static String DI_CLASS_END = "CLASS_END";
public final static String DI_COMPIL_BEG = "COMPIL_BEG";
public final static String DI_COMPIL_END = "COMPIL_END";
public final static String DI_SH_BEG = "SH_BEG";
public final static String DI_SH_END = "SH_END";
public final static String DI_PROC_BEG = "PROC_BEG";
public final static String DI_PROC_END = "PROC_END";
public final static String DI_WR_RES_FILE = "WR_RES_FILE";
public final static String DI_AC = "AC";
public final static String DI_ACTION = "ACTION";
public final static String DI_SUB_COMPIL = "SUB_COMPIL";
public final static String DI_IF = "IF";
public final static String DI_RY = "RY";
public final static String DI_DN = "DN";
public final static String DI_EI = "EI";
public final static String DI_UK = "UK";
public final static String DI_FOR_BEG = "FOR_BEG";
public final static String FOR_EACH_BEG = "FOR_EACH_BEG";
public final static String DI_FOR_END = "FOR_END";
public final static String DI_REF = "REF";
public final static String DI_BREAK = "BREAK";
public final static String DI_CASE = "CASE";
public final static String DI_DEFAULT = "DEFAULT";
public final static String DI_SW = "SWITCH";
public final static String DI_RETURN = "RETURN";
public final static String DI_INSERT = "INSERT";
public final static String DI_OUTPUT = "OUTPUT";
public final static String DI_START_ACTS = "START_ACTS";
public final static String DI_NATIVE_CODE = "NATIVE_CODE";
public static final String REM_TRY = "DI_TRY";
public static final String REM_CATCH = "DI_CATCH";
public static final String REM_PROC_DOC = "DI_PROC_DOC";
public static final String REM_CALL_PROC = "DI_CALL_PROC";
public final static String RELEASE_TYPE_CODE_JAVA = "CODE_JAVA";
public final static String RELEASE_TYPE_CODE_AS = "CODE_AS";
public static enum IcTypes {
DI_EXT_NEXT,
DI_DG_BEG,
DI_SI_BEG,
DI_SI_END,
DI_CLASS_END,
DI_COMPIL_BEG,
DI_COMPIL_END,
DI_SH_BEG,
DI_SH_END,
DI_PROC_BEG,
DI_PROC_END,
DI_WR_RES_FILE,
DI_AC,
DI_ACTION,
DI_SUB_COMPIL,
DI_IF,
DI_RY,
DI_DN,
DI_EI,
DI_UK,
DI_FOR_BEG,
FOR_EACH_BEG,
DI_FOR_END,
DI_REF,
DI_BREAK,
DI_CASE,
DI_DEFAULT,
DI_SW,
DI_RETURN,
DI_INSERT,
DI_OUTPUT,
DI_START_ACTS,
DI_NATIVE_CODE,
REM_TRY,
REM_CATCH,
REM_PROC_DOC,
REM_CALL_PROC;
};
//-- переменные
//-- Конструктор
public DrakonUtils() {
//-- //--
}
//-- Получение маркера кода
public static String getCodeMark(Vertex node) {
//-- получаем маркер кода
if(node==null)
return "";
String type = (String) node.getProperty("code_mark") ;
if(type==null)
type = "";
//-- маркер
return type;
}
//-- Получение типа иконы узла
public static String getIconType(Vertex node) {
//-- получаем иконый тип
if(node==null)
return "";
String type = (String) node.getProperty("type") ;
if(type==null)
type = "";
//-- тип
return type;
}
//-- Получение комента из узла
public static String getComment(Vertex node) {
//-- получаем коментарий
if(node==null)
return "";
String ret = (String) node.getProperty("comment") ;
//-- ком.
return ret;
}
//-- Возвращает код из узла
public static String getCode(Vertex node) {
//-- строим код
if(node == null)
return "";
return (String)node.getProperty("code") ;
//-- //--
}
//-- message()
public static void message(String str) {
//-- строим код
System.out.println(str);
//-- //--
}
//-- error()
public static void error(String str) {
//-- строим код
System.err.println(str);
//-- //--
}
//-- debug()
public static void debug(String str) {
//-- строим код
if(Settings.isDebug())
System.out.println(str);
//-- //--
}
//-- getInDegree()
public static int getInDegree(Vertex v) {
//-- строим код
int i = 0;
for (Edge e : v.getInEdges()) {
if(!DrakonUtils.isReferenceEdge(e))
i++;
}
return i;
//-- //--
}
//-- getOutDegree()
public static int getOutDegree(Vertex v) {
//-- строим код
int i = 0;
for (Edge e : v.getOutEdges()) {
if(!DrakonUtils.isReferenceEdge(e))
i++;
}
return i;
//-- //--
}
//-- getInNode()
public static Vertex getInNode(Vertex v, int num) {
//-- строим код
if(v == null)
return null;
int i = 0;
for (Edge e : v.getInEdges()) {
if(DrakonUtils.isReferenceEdge(e))
continue;
if(i==num)
return e.getOutVertex();
i++;
}
return null;
//-- //--
}
//-- getOutNode()
public static Vertex getOutNode(Vertex v, int num) {
//-- строим код
if(v == null)
return null;
int i = 0;
for (Edge e : v.getOutEdges()) {
if(DrakonUtils.isReferenceEdge(e))
continue;
if(i==num)
return e.getInVertex();
i++;
}
return null;
//-- //--
}
//-- getOutEdge()
public static Edge getOutEdge(Vertex v, int num) {
//-- строим код
if(v == null)
return null;
int i = 0;
for (Edge e : v.getOutEdges()) {
if(DrakonUtils.isReferenceEdge(e))
continue;
if(i==num)
return e;
i++;
}
return null;
//-- //--
}
//-- isEdgeYes()
public static boolean isEdgeYes(Edge edge) {
//-- строим код
if(edge == null)
return false;
String di_type_edge = (String)edge.getProperty("dglabel");
if(di_type_edge == null) return false;
if(di_type_edge.toUpperCase().equals("ДА") ||
di_type_edge.toUpperCase().equals("YES"))
return true;
return false;
//-- //--
}
//-- isReferenceEdge()
public static boolean isReferenceEdge(Edge edge) {
//-- строим код
if(edge == null)
return false;
String di_type_edge = (String)edge.getProperty("type");
if(di_type_edge == null) return false;
if(di_type_edge.toUpperCase().equals("REF") )
return true;
return false;
//-- //--
}
//-- main
public static void main(String[] args) {
//-- //--
}
//--
} //-- конец класса
| [
"netconfex@gmail.com"
] | netconfex@gmail.com |
a495e43f84ffa64220391a5749a79cb69a055d21 | d165b5fcfaafdf8e7da969b3a29246b48b3d392e | /Mars/src/Caller.java | 4692e50c1749d0d45a3b0442d26fdcb7cf9b49eb | [] | no_license | mixiaopa/Mars | a8d5425f10d7ae3bfa6dffcfb6b4e3f6e6ba3136 | c5b74ba799b1ed37be07430c7b17315f7b1b3d2c | refs/heads/master | 2021-01-22T01:34:11.368342 | 2013-09-18T14:45:44 | 2013-09-18T14:45:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 462 | java | public class Caller {
public static void main(String[] args) {
Rover rover = new Rover("N", 0, 0);
MoveForward moveForward = new MoveForward(rover, 3);
Turn turn = new Turn(rover, "L");
Control control = new Control();
control.doMove(moveForward);
control.doMove(turn);
System.out.println("( " + rover.positionX + " , " + rover.positionY + " )");
System.out.println(rover.direction);
}
}
| [
"gao_303407@163.com"
] | gao_303407@163.com |
09727825716e84cbe38349e89abf163fc444d814 | 9325cef84aa32d2e0a2f2359d025a3da5408e23f | /debezium-api/src/main/java/io/debezium/engine/format/ChangeEventFormat.java | 43e1b39da763879eb084435c5305e465e6ac7a1e | [
"MIT",
"Apache-2.0",
"Artistic-1.0-Perl",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"Zlib",
"LGPL-2.1-only",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"Apache-1.1",
"GPL-3.0-only",
"GPL-2.0-only",
"Artisti... | permissive | debezium/debezium | 344a48d9c89e9a2819661e2e0ac392731b7ee7d2 | a0c67aa0e8779a0b9de757ac02da19320109ea18 | refs/heads/main | 2023-09-03T15:15:15.638098 | 2023-08-31T22:55:51 | 2023-08-31T23:13:55 | 50,205,233 | 9,199 | 2,563 | Apache-2.0 | 2023-09-14T20:02:37 | 2016-01-22T20:17:05 | Java | UTF-8 | Java | false | false | 607 | java | /*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.engine.format;
/**
* Describes a change event output format comprising just of a single value.
*/
public interface ChangeEventFormat<V extends SerializationFormat<?>> {
/**
* Creates a change event format representing key and value in a single object.
*/
static <V extends SerializationFormat<?>> ChangeEventFormat<V> of(Class<V> format) {
return () -> format;
}
Class<V> getValueFormat();
}
| [
"jpechane@redhat.com"
] | jpechane@redhat.com |
0638eb9bcf4e8f664b76239a77b4b7239c30eb4f | 163503e11a71ec7421c3b0bef0ec0c61dddd213a | /src/main/java/com/zgm/myscrum/service/impl/ScrumServiceImpl.java | 9e00abf94b5f7d9d4c2fdfbb4716e6bc317a598a | [] | no_license | guomzh/my-scrum | d98c3f5c4bc78ad5da42d515cf88b4548b04dcf5 | e18ee3f0e0c07fec221c24927630efcbadc1ff43 | refs/heads/master | 2021-04-03T07:53:14.576173 | 2018-08-12T06:02:18 | 2018-08-12T06:02:18 | 124,885,374 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,256 | java | package com.zgm.myscrum.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zgm.myscrum.dao.ScrumMapper;
import com.zgm.myscrum.entity.Scrum;
import com.zgm.myscrum.service.ScrumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.List;
@Service
public class ScrumServiceImpl implements ScrumService {
@Autowired
private ScrumMapper scrumMapper;
@Override
public JSONArray selectScrumsAll(String nickName) {
List<Scrum> scrums=scrumMapper.select(nickName);
SimpleDateFormat formatter=new SimpleDateFormat("MM-dd HH:mm:ss");
JSONArray array=new JSONArray();
for (Scrum scrum : scrums) {
JSONObject jsonObject=new JSONObject();
jsonObject.fluentPut("task",scrum.getTask()).fluentPut("id",scrum.getId())
.fluentPut("createTime",formatter.format(scrum.getCreateTime()))
.fluentPut("lastModifyTime",formatter.format(scrum.getLastModifyTime()))
.fluentPut("status",scrum.getStatus());
array.add(jsonObject);
}
return array;
}
@Override
public Scrum selectScrumById(Long id) {
return scrumMapper.selectById(id);
}
@Override
public boolean updateScrum(Scrum scrum) {
int count = scrumMapper.update(scrum);
if(count==1)
return true;
else return false;
}
@Override
public boolean deleteScrum(Long id,String nickName) {
int count= scrumMapper.delete(id,nickName);
if(count==1)
return true;
else return false;
}
@Override
public boolean insertScrum(Scrum scrum) {
int count=scrumMapper.insert(scrum);
if(count==1)
return true;
return false;
}
@Override
public boolean changeStatus(Long id ,String nickName,Integer status) {
int count;
if (status==1){
count=scrumMapper.change(id ,nickName,2);
}
else {
count=scrumMapper.change(id,nickName,1);
}
if(count==1)
return true;
return false;
}
}
| [
"1361097727@qq.com"
] | 1361097727@qq.com |
785ca65a11bdd940fcf00d8f57825969078bd1ca | 33064f0f0bd69d1458275ea586e93c4504521b08 | /awrest/src/main/java/com/aw/rest/vo/ErrorVo.java | 825433f22e62a6d94c62cd5cc52202e40b8fc486 | [
"MIT"
] | permissive | rawnics/api | ef7a4aa3954634510c6b6717aa5f6c8bbf207ff5 | d04474b66f63c400a23245930a2b648ad7a6835b | refs/heads/master | 2021-01-09T11:34:46.085539 | 2016-08-12T08:19:46 | 2016-08-12T08:19:46 | 60,145,467 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | /**
*
*/
package com.aw.rest.vo;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "error")
public class ErrorVo implements Serializable{
private static final long serialVersionUID = 1L;
public enum ErrorEnum {
ERROR,
SUCCESS,
INFO,
UNAUTHORIZED
}
private String errorCode;
private String description;
/**
*
*/
public ErrorVo() {
// TODO Auto-generated constructor stub
}
public ErrorVo(String errorCode,String description) {
this.errorCode = errorCode;
this.description = description;
}
/**
* @return the errorCode
*/
public String getErrorCode() {
return errorCode;
}
/**
* @param errorCode the errorCode to set
*/
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "Error [errorCode=" + errorCode + ", description=" + description
+ "]";
}
}
| [
"rahul@awnics.com"
] | rahul@awnics.com |
9ee52de57dd4a58bdfde6ac78de2a94cb9e2ae73 | d61fa052b50c0de047e799d90d9706f72859f011 | /src/org/dhenry/samples/main/FileReadAction.java | e4a260992b230dbb2cd553e2536d135c915a8586 | [] | no_license | dhenry0/samples | 58b38b2de8796b49864bbfd070958683cd23f57d | d01629a16496159f7553a4bf26baba2202f94596 | refs/heads/master | 2022-02-27T02:19:47.100659 | 2019-09-23T14:23:32 | 2019-09-23T14:23:32 | 112,746,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,032 | java | package org.dhenry.samples.main;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
import java.util.concurrent.RecursiveAction;
import java.util.concurrent.atomic.LongAdder;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Stream;
/** This is part of WordCounter */
public class FileReadAction extends RecursiveAction {
private static final long serialVersionUID = 1L;
private static final Logger log = Logger.getLogger(FileReadAction.class.getName());
private Path path;
private Map<String,LongAdder> counts;
public FileReadAction(Path path, Map<String,LongAdder> counts) {
this.path = path;
this.counts = counts;
}
protected void compute() {
Stream<String> stream = null;
try {
stream = Files.lines(path);
stream.forEach(l -> invokeAll(new WordCountAction(l, counts)));
} catch (IOException ex) {
log.log(Level.WARNING, "", ex);
} finally {
if (stream != null) {
stream.close();
}
}
}
}
| [
"[dave.henry0@gmail.com]"
] | [dave.henry0@gmail.com] |
7f2b36e8bb81c204511f982f838bfd5cf72e5872 | f107afa64a519cd2ee3d3be946ca3b8c12884b01 | /src/InheritanceDemo/Inheritance.java | 0f483658a3ad6e2ba1fe21f96ac574cb33810df4 | [] | no_license | Raghvendra-choubey/thread-2 | 3eb9964b2ce88f69376094cf2569b50f06291165 | a5cf038f6cb09f1df12d4ce3733df302c02565f9 | refs/heads/master | 2021-01-20T20:47:32.892319 | 2016-07-04T14:30:13 | 2016-07-04T14:30:13 | 62,567,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | package InheritanceDemo;
public class Inheritance {
public static void main(String[] args) {
B ob = new B();
ob.a();
ob.x();
// ob.y();
ob.Z();
}
}
class A
{
public void a()
{
System.out.println("a");
}
public void x()
{
System.out.println("X");
}
public final void Z()
{
System.out.println("Z");
}
}
class B extends A
{
@Override
public void a()
{
System.out.println("b");
}
public void y()
{
System.out.println("y");
}
}
| [
"raghvendra.choubey@diasparkindia.com"
] | raghvendra.choubey@diasparkindia.com |
9b974e253789491c819e36d996dc8cdcb92a5607 | 702e39258244572c76a51029974b82cf49fecd63 | /src/main/java/bitcamp/java89/ems2/servlet/code/CodeUpdateServlet.java | fd0252272518cb505b4e12584391d2438ba0d4fe | [] | no_license | joelweon/bit-team | fe8e250963cf974032581b55580475eac7494dc4 | c0c4dc07f44829c4cb7f8b8ecde80b528dabfa1c | refs/heads/master | 2021-01-13T12:01:51.460365 | 2017-02-02T09:59:04 | 2017-02-02T09:59:04 | 77,897,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,486 | java | package bitcamp.java89.ems2.servlet.code;
import java.io.IOException;
import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import bitcamp.java89.ems2.dao.CodeDao;
import bitcamp.java89.ems2.dao.ContentDao;
import bitcamp.java89.ems2.dao.TagDao;
import bitcamp.java89.ems2.domain.Code;
import bitcamp.java89.ems2.domain.Member;
import bitcamp.java89.ems2.domain.Tag;
import bitcamp.java89.ems2.listener.ContextLoaderListener;
import bitcamp.java89.ems2.util.MultipartUtil;
@WebServlet("/code/update")
public class CodeUpdateServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
Map<String,String> dataMap = MultipartUtil.parse(request);
Code code = new Code();
Tag tag = new Tag();
tag.setTagName(dataMap.get("tagName"));
code.setContentNo(Integer.parseInt(dataMap.get("contentNo")));
code.setCode(dataMap.get("conts"));
code.setProgLanguage(dataMap.get("pl"));
response.setContentType("text/html;charset=UTF-8");
CodeDao codeDao = (CodeDao)ContextLoaderListener.applicationContext.getBean("codeDao");
TagDao tagDao = (TagDao)ContextLoaderListener.applicationContext.getBean("tagDao");
Member member = (Member)request.getSession().getAttribute("member");
if (member != null) {
code.setMemberNo(member.getMemberNo());
ContentDao contentDao = (ContentDao)ContextLoaderListener.applicationContext.getBean("contentDao");
contentDao.update(code);
tag.setContentNo(code.getContentNo());
codeDao.update(code);
tagDao.delete(tag.getContentNo());
tagDao.insert(tag);
RequestDispatcher rd = request.getRequestDispatcher("/code/update.jsp");
rd.include(request, response);
} else {
throw new Exception("로그인 후 글쓰기가 가능합니다.");
}
} catch (Exception e) {
e.printStackTrace();
// RequestDispatcher rd = request.getRequestDispatcher("/error");
// rd.forward(request, response);
// return;
}
}
} | [
"joel.weon@gmail.com"
] | joel.weon@gmail.com |
a73f378871e07b1e71dba404a2a1335f90734c73 | 88e626f71e66c09b21bac7e8fdf3db8c75ac467e | /MyCardView/app/src/test/java/com/example/mycardview/ExampleUnitTest.java | 2a2ec32f52a3023fec060688e1f82cb915175e48 | [] | no_license | DomMorello/AndroidTutorial | bb408096b8b172eaba29f23a53a2a231694c7eda | fcff22dcd4862043590f67d7cc0298477cd5238b | refs/heads/master | 2020-08-06T19:24:11.917765 | 2020-01-02T08:17:48 | 2020-01-02T08:17:48 | 213,120,645 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.example.mycardview;
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);
}
} | [
"zuzudnf@gmail.com"
] | zuzudnf@gmail.com |
9fa8831e2364715cd773ed2feebefd8ab54001f0 | 94408d97e6df9d09acff58abc4fe447eeb28640a | /core/src/main/java/PracticeApp10/core/listeners/SimpleResourceListener.java | 1644aabced06e2a6aabc9bb7524e07cb3512c175 | [] | no_license | varsha-deora/TTN-AEM-H1-2020-Workflows | 1cc67ac2f713d998e803f35164f7e9c6e78b37c3 | aeeaeb8f8ac14b12dbc199fa2adff940bdd2b9d4 | refs/heads/main | 2022-12-19T23:06:31.906646 | 2020-10-06T06:28:14 | 2020-10-06T06:28:14 | 301,633,418 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,937 | java | /*
* Copyright 2015 Adobe Systems Incorporated
*
* 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 PracticeApp10.core.listeners;
import org.apache.sling.api.SlingConstants;
import org.osgi.framework.Constants;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A service to demonstrate how changes in the resource tree
* can be listened for. It registers an event handler service.
* The component is activated immediately after the bundle is
* started through the immediate flag.
* Please note, that apart from EventHandler services,
* the immediate flag should not be set on a service.
*/
@Component(service = EventHandler.class,
immediate = true,
property = {
Constants.SERVICE_DESCRIPTION + "=Demo to listen on changes in the resource tree",
EventConstants.EVENT_TOPIC + "=org/apache/sling/api/resource/Resource/*"
})
public class SimpleResourceListener implements EventHandler {
private final Logger logger = LoggerFactory.getLogger(getClass());
public void handleEvent(final Event event) {
logger.debug("Resource event: {} at: {}", event.getTopic(), event.getProperty(SlingConstants.PROPERTY_PATH));
}
}
| [
"varsha.deora@tothew.com"
] | varsha.deora@tothew.com |
2d709280aa26257e6e9d0e28d0c17d0601d20a5b | dc4ecec0145d18291d80c1c4fdbd4cdfd724433f | /app/src/main/java/com/example/actualoscoursework_ng00367/MainActivity.java | 357de1b0e5c4f28701f0fe86c2b7130dbde83585 | [] | no_license | pearepeater30/MultiThreadApp | 7289c3eb2f6b17eaf77511c8b7f2fa74bffd67d0 | b33c6cff82f4375f529cb4ea09c0f4dbdb6fab10 | refs/heads/master | 2020-12-20T22:12:12.398056 | 2020-01-25T20:04:21 | 2020-01-25T20:04:21 | 236,222,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,179 | java | package com.example.actualoscoursework_ng00367;
import android.Manifest;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.TextView;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
public class MainActivity extends AppCompatActivity {
public final String[] EXTERNAL_PERMS = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE};
public final int EXTERNAL_REQUEST = 138;
public final File sourceFolder = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ File.separator + "sourceFolder");
public final File destinationFolder = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ File.separator + "destinationFolder");
private int filesCopied = 0;
File[] filesBeingCopied = sourceFolder.listFiles();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
askForPermission(getApplicationContext());
}
//class which initializes a thread which copies files and increments a counter and updates it to UI
public synchronized void startProgress(final int beginning, final int end){
ActivityManager.MemoryInfo memoryInfo = getAvailableMemory();
final Handler mHandler = new Handler();
if (!memoryInfo.lowMemory) {
new Thread(new Runnable() {
public void run() {
for(int i = beginning; i < end; i++){
try{
Files.copy(filesBeingCopied[i].toPath(), new File(destinationFolder.getAbsolutePath() + File.separator +filesBeingCopied[i].getName()).toPath(), StandardCopyOption.REPLACE_EXISTING);
}
catch (IOException e){
e.printStackTrace();
}
mHandler.post(new Runnable() {
@Override
public void run() {
filesCopied++;
((TextView) findViewById(R.id.fileCounter)).setText(String.valueOf(filesCopied));
}
});
}
}
}).start();
}
}
//class that is run when button is clicked to begin copying files
public void buttonClick(final View view){
if (sourceFolder.isDirectory()){
if (filesBeingCopied.length > 0) {
startProgress(0, filesBeingCopied.length/2);
startProgress(filesBeingCopied.length/2, filesBeingCopied.length);
}
}
}
//class which asks for permission to read and write files
public boolean askForPermission (Context context){
boolean isPermissionOn = true;
final int version = Build.VERSION.SDK_INT;
if (version >= 23) {
if (!accessSD(context)) {
isPermissionOn = false;
requestPermissions(EXTERNAL_PERMS, EXTERNAL_REQUEST);
}
}
return isPermissionOn;
}
//class which gets memory info
private ActivityManager.MemoryInfo getAvailableMemory(){
ActivityManager activityManager = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
activityManager.getMemoryInfo(memoryInfo);
return memoryInfo;
}
public boolean accessSD (Context context){
return (hasPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, context));
}
private boolean hasPermission (String permmission, Context context){
return (PackageManager.PERMISSION_GRANTED == context.checkSelfPermission(permmission));
}
}
| [
"nathancgu@gmail.com"
] | nathancgu@gmail.com |
10caccdba46a64b8d34be681925c88b3af9f071b | 4412744658c9653f1d7e817e92b78fee751e86ec | /dlmu/mislab/fup/validation/field/show_type.java | d89f003ac319a453128ad95be106ca4dc0122f54 | [] | no_license | albertgrain/GrFup | 6a2bbcebdcd7ada9a526fcc03ec8e27aa650c013 | 7a5321f3b28374e38bd1f0a7aed43e4c3f31ccc9 | refs/heads/master | 2020-05-13T15:47:45.415568 | 2019-04-16T07:21:04 | 2019-04-16T07:21:04 | 181,635,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | // By GuRui on 2015-2-17 下午6:18:09
package dlmu.mislab.fup.validation.field;
import dlmu.mislab.common.LogicError;
import dlmu.mislab.fup.FupDict;
import dlmu.mislab.validation.FieldString;
import dlmu.mislab.validation.ValidationError;
public class show_type extends FieldString {
private static final String SHOW_TYPE_LINK=FupDict.FUP_DOCUMENT_TYPE_IMAGE;
private static final String SHOW_TYPE_IMG=FupDict.FUP_DOCUMENT_TYPE_IMAGE;
@Override
public LogicError validate() {
LogicError rtn=super.validate();
if(rtn!=null){
if(!SHOW_TYPE_LINK.equals(this.val) && !SHOW_TYPE_IMG.equals(this.val)){
rtn= new ValidationError("show_type",FupDict.dict.get(FupDict.TAG_SHOW_TYPE)+"不正确");
}
}
return rtn;
}
public show_type(String val) {
super(val);
this.setMinLength(1);
this.setMaxLength(4);
}
}
| [
"albertgrain@users.noreply.github.com"
] | albertgrain@users.noreply.github.com |
e8092cf9d36e993a03fe4f842119fc44661675d7 | e3c912687a56e48fc7c6db2e95b644183f40b8f0 | /src/main/java/iurii/job/interview/yandex/bencode/utils/CharacterInputStreamIterator.java | 394ebba55f55b1927ec43e967f3b866d908b7dca | [
"MIT"
] | permissive | dataronio/algorithms-1 | 00e11b0483eef96ab1b39bd39e00ab412d8e1e2c | ab3e08bd16203b077f4a600e31794d6d73303d68 | refs/heads/master | 2022-02-06T19:43:57.936282 | 2021-09-18T22:47:01 | 2021-09-18T22:47:01 | 158,045,329 | 0 | 0 | MIT | 2020-03-09T22:06:21 | 2018-11-18T03:07:59 | Java | UTF-8 | Java | false | false | 1,008 | java | package iurii.job.interview.yandex.bencode.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
/**
* Iterator for symbols that encapsulates input stream and works with files
* Created by iurii.dziuban on 02/06/2017.
*/
public class CharacterInputStreamIterator implements Iterator<Character> {
private final InputStream is;
private Integer current;
public CharacterInputStreamIterator(InputStream is) {
this.is = is;
}
@Override
public boolean hasNext() {
if (current == null) {
try {
current = is.read();
} catch (IOException e) {
throw new IllegalStateException();
}
}
return current != -1;
}
@Override
public Character next() {
Integer cur = current;
current = null;
return (char)(int) cur;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
}
| [
"ydzyuban@gmail.com"
] | ydzyuban@gmail.com |
67be56ae40ea5017a1e7d1a085c89173c0249e3a | e26a8434566b1de6ea6cbed56a49fdb2abcba88b | /model-sese-mx/src/generated/java/com/prowidesoftware/swift/model/mx/MxSese03800204.java | 610fe478498206f0eff9f3ae94ca840375958b73 | [
"Apache-2.0"
] | permissive | adilkangerey/prowide-iso20022 | 6476c9eb8fafc1b1c18c330f606b5aca7b8b0368 | 3bbbd6804eb9dc4e1440680e5f9f7a1726df5a61 | refs/heads/master | 2023-09-05T21:41:47.480238 | 2021-10-03T20:15:26 | 2021-10-03T20:15:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,636 | java |
package com.prowidesoftware.swift.model.mx;
import com.prowidesoftware.swift.model.mx.dic.*;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.prowidesoftware.swift.model.MxSwiftMessage;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import com.prowidesoftware.swift.model.mx.MxRead;
import com.prowidesoftware.swift.model.mx.MxReadImpl;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* Class for sese.038.002.04 ISO 20022 message.
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Document", propOrder = {
"sctiesSttlmTxModReq"
})
@XmlRootElement(name = "Document", namespace = "urn:iso:std:iso:20022:tech:xsd:sese.038.002.04")
public class MxSese03800204
extends AbstractMX
{
@XmlElement(name = "SctiesSttlmTxModReq", required = true)
protected SecuritiesSettlementTransactionModificationRequest002V04 sctiesSttlmTxModReq;
public final static transient String BUSINESS_PROCESS = "sese";
public final static transient int FUNCTIONALITY = 38;
public final static transient int VARIANT = 2;
public final static transient int VERSION = 4;
@SuppressWarnings("rawtypes")
public final static transient Class[] _classes = new Class[] {AffirmationStatus1Code.class, AffirmationStatus9Choice.class, AlternatePartyIdentification9 .class, AmountAndDirection58 .class, AmountAndDirection67 .class, AmountAndDirection85 .class, BeneficialOwnership5Choice.class, CashAccountIdentification6Choice.class, CashParties30 .class, CashSettlementSystem2Code.class, CashSettlementSystem5Choice.class, CentralCounterPartyEligibility5Choice.class, ClassificationType33Choice.class, Counterparty10Choice.class, CreditDebitCode.class, CurrencyToBuyOrSell1Choice.class, DateAndDateTimeChoice.class, DateType3Code.class, DeliveryReceiptType2Code.class, DeliveryReturn1Code.class, DeliveryReturn4Choice.class, DocumentNumber6Choice.class, Eligibility1Code.class, EventFrequency3Code.class, ExposureType17Choice.class, ExposureType4Code.class, FXStandingInstruction5Choice.class, FinancialInstrumentAttributes78 .class, FinancialInstrumentQuantity15Choice.class, ForeignExchangeTerms27 .class, FormOfSecurity1Code.class, FormOfSecurity7Choice.class, Frequency27Choice.class, GenericIdentification18 .class, GenericIdentification39 .class, GenericIdentification47 .class, GenericIdentification84 .class, GenericIdentification85 .class, GenericIdentification86 .class, IdentificationSource4Choice.class, IdentificationType44Choice.class, InterestComputationMethod2Code.class, InterestComputationMethodFormat5Choice.class, InvestorCapacity5Choice.class, LetterOfGuarantee5Choice.class, Linkages48 .class, Linkages49 .class, MarketClientSide5Choice.class, MarketClientSideCode.class, MarketIdentification2Choice.class, MarketIdentification4Choice.class, MarketIdentification90 .class, MarketType16Choice.class, MarketType2Code.class, MatchingStatus1Code.class, MatchingStatus28Choice.class, ModificationCancellationAllowed5Choice.class, MxSese03800204 .class, NameAndAddress12 .class, NettingEligibility5Choice.class, Number23Choice.class, OpeningClosing1Code.class, OpeningClosing4Choice.class, OptionStyle2Code.class, OptionStyle9Choice.class, OptionType1Code.class, OptionType7Choice.class, OriginalAndCurrentQuantities4 .class, OriginatorRole2Code.class, OtherAmounts35 .class, OtherIdentification2 .class, OtherParties29 .class, OwnershipLegalRestrictions1Code.class, PairedOrTurnedQuantity4Choice.class, PartyIdentification103 .class, PartyIdentification104Choice.class, PartyIdentification108 .class, PartyIdentification109 .class, PartyIdentification110 .class, PartyIdentification111 .class, PartyIdentification113Choice.class, PartyIdentification114Choice.class, PartyIdentification115Choice.class, PartyIdentification58Choice.class, PartyIdentificationAndAccount131 .class, PartyIdentificationAndAccount133 .class, PartyIdentificationAndAccount134 .class, PartyIdentificationAndAccount135 .class, PartyIdentificationAndAccount136 .class, PartyIdentificationAndAccount137 .class, PartyIdentificationAndAccount146 .class, PartyTextInformation3 .class, PartyTextInformation4 .class, PlaceOfClearingIdentification1 .class, PlaceOfTradeIdentification2 .class, Price3 .class, PriceRateOrAmount1Choice.class, PriceType2Choice.class, PriceValueType1Code.class, ProcessingPosition10Choice.class, ProcessingPosition3Code.class, Quantity10Choice.class, QuantityAndAccount54 .class, QuantityAndAccount55 .class, QuantityBreakdown38 .class, ReceiveDelivery1Code.class, References58Choice.class, Registration11Choice.class, Registration1Code.class, RegistrationParameters5 .class, Reporting2Code.class, Reporting9Choice.class, RestrictedFINActiveCurrencyAndAmount.class, RestrictedFINActiveOrHistoricCurrencyAnd13DecimalAmount.class, RestrictedFINActiveOrHistoricCurrencyAndAmount.class, Restriction6Choice.class, SafeKeepingPlace2 .class, SafekeepingPlace1Code.class, SafekeepingPlace3Code.class, SafekeepingPlaceFormat17Choice.class, SafekeepingPlaceTypeAndAnyBICIdentifier1 .class, SafekeepingPlaceTypeAndText15 .class, SecuritiesAccount27 .class, SecuritiesAccount30 .class, SecuritiesCertificate5 .class, SecuritiesPaymentStatus1Code.class, SecuritiesPaymentStatus6Choice.class, SecuritiesSettlementTransactionDetails23 .class, SecuritiesSettlementTransactionDetails24 .class, SecuritiesSettlementTransactionDetails25 .class, SecuritiesSettlementTransactionModificationRequest002V04 .class, SecuritiesTradeDetails65 .class, SecuritiesTradeDetails66 .class, SecuritiesTransactionType25Choice.class, SecuritiesTransactionType7Code.class, SecurityIdentification20 .class, SettlementDate12Choice.class, SettlementDate4Code.class, SettlementDateCode9Choice.class, SettlementDetails113 .class, SettlementParties44 .class, SettlementParties49 .class, SettlementParties58 .class, SettlementStandingInstructionDatabase1Code.class, SettlementStandingInstructionDatabase5Choice.class, SettlementTransactionCondition10Code.class, SettlementTransactionCondition28Choice.class, SettlementTypeAndAdditionalParameters17 .class, SettlementTypeAndAdditionalParameters18 .class, SettlementTypeAndIdentification22 .class, SettlingCapacity2Code.class, SettlingCapacity8Choice.class, StandingSettlementInstruction12 .class, SupplementaryData1 .class, SupplementaryDataEnvelope1 .class, TaxCapacityParty5Choice.class, TaxLiability1Code.class, Tracking5Choice.class, TradeDate6Choice.class, TradeDateCode4Choice.class, TradeOriginator4Choice.class, TradeTransactionCondition4Code.class, TradeTransactionCondition6Choice.class, TransactionDetails83 .class, TransactionDetails85 .class, TypeOfIdentification1Code.class, TypeOfPrice14Code.class, TypeOfPrice32Choice.class, UpdateType22Choice.class, YieldedOrValueType1Choice.class };
public final static transient String NAMESPACE = "urn:iso:std:iso:20022:tech:xsd:sese.038.002.04";
public MxSese03800204() {
super();
}
/**
* Creates the MX object parsing the parameter String with the XML content
*
*/
public MxSese03800204(final String xml) {
this();
MxSese03800204 tmp = parse(xml);
sctiesSttlmTxModReq = tmp.getSctiesSttlmTxModReq();
}
/**
* Creates the MX object parsing the raw content from the parameter MxSwiftMessage
*
*/
public MxSese03800204(final MxSwiftMessage mxSwiftMessage) {
this(mxSwiftMessage.message());
}
/**
* Gets the value of the sctiesSttlmTxModReq property.
*
* @return
* possible object is
* {@link SecuritiesSettlementTransactionModificationRequest002V04 }
*
*/
public SecuritiesSettlementTransactionModificationRequest002V04 getSctiesSttlmTxModReq() {
return sctiesSttlmTxModReq;
}
/**
* Sets the value of the sctiesSttlmTxModReq property.
*
* @param value
* allowed object is
* {@link SecuritiesSettlementTransactionModificationRequest002V04 }
*
*/
public MxSese03800204 setSctiesSttlmTxModReq(SecuritiesSettlementTransactionModificationRequest002V04 value) {
this.sctiesSttlmTxModReq = value;
return this;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
}
@Override
public boolean equals(Object that) {
return EqualsBuilder.reflectionEquals(this, that);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public String getBusinessProcess() {
return BUSINESS_PROCESS;
}
@Override
public int getFunctionality() {
return FUNCTIONALITY;
}
@Override
public int getVariant() {
return VARIANT;
}
@Override
public int getVersion() {
return VERSION;
}
/**
* Creates the MX object parsing the raw content from the parameter XML
*
*/
public static MxSese03800204 parse(String xml) {
return ((MxSese03800204) MxReadImpl.parse(MxSese03800204 .class, xml, _classes));
}
/**
* Creates the MX object parsing the raw content from the parameter XML with injected read implementation
* @since 9.0.1
*
* @param parserImpl an MX unmarshall implementation
*/
public static MxSese03800204 parse(String xml, MxRead parserImpl) {
return ((MxSese03800204) parserImpl.read(MxSese03800204 .class, xml, _classes));
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
@SuppressWarnings("rawtypes")
public Class[] getClasses() {
return _classes;
}
/**
* Creates an MxSese03800204 messages from its JSON representation.
* <p>
* For generic conversion of JSON into the corresponding MX instance
* see {@link AbstractMX#fromJson(String)}
*
* @since 7.10.2
*
* @param json a JSON representation of an MxSese03800204 message
* @return
* a new instance of MxSese03800204
*/
public final static MxSese03800204 fromJson(String json) {
return AbstractMX.fromJson(json, MxSese03800204 .class);
}
}
| [
"sebastian@prowidesoftware.com"
] | sebastian@prowidesoftware.com |
3318e6f4f818b8f47a5dc0d281c6aa0c655b3092 | 37118bb488bc65a505deef8e439302471c61c909 | /app/src/main/java/com/zenglb/framework/updateinstaller/MainActivity.java | de74c57d0a33904a3c39dfef325ede82c869d262 | [] | no_license | lbj38057473/DownloadInstaller | cd352972ffef1b95be43b4ea96e7298f7ded6ba7 | ee6a33e9e3b0361f202690042c62b779a948214e | refs/heads/master | 2021-02-28T19:56:11.305065 | 2020-02-28T02:30:04 | 2020-02-28T02:30:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,147 | java | package com.zenglb.framework.updateinstaller;
import android.Manifest;
import android.graphics.Color;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.daimajia.numberprogressbar.NumberProgressBar;
import com.zenglb.downloadinstaller.DownloadInstaller;
import com.zenglb.downloadinstaller.DownloadProgressCallBack;
import java.util.List;
import pub.devrel.easypermissions.EasyPermissions;
/**
* app 内部升级
*/
public class MainActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks {
private String apkDownLoadUrlCOPY = "http://pro-app-qn.fir.im/a129a8163c341efa174432c0f9dcb9e81423a0d3.apk?attname=module_news-release.apk_1.1.apk&e=1561691950&token=LOvmia8oXF4xnLh0IdH05XMYpH6ENHNpARlmPc-T:NNyBMuVUdUSlHQKnWEVt1UN31IU=";
//URL 下载有时间效益
private String apkDownLoadUrl= "http://img.4009515151.com//2019/06/26/15/7ace8dd995-comvankewyguide_3.8.6_0e3f3e28-39b0-543b-a847-6c70999d3b68.apk";
private String apkDownLoadUrl2 = "https://ali-fir-pro-binary.fir.im/ea7df71390403635b5f744d82d28c13fc865c325.apk?auth_key=1557455233-0-0-2b4c71ac353961eab7fa2a65ec641bb4";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/**
* 测试升级安装
*/
findViewById(R.id.update).setOnClickListener(v -> showUpdateDialog("1.升级后App 会自动攒钱\n2.还可以做白日梦", true, apkDownLoadUrl));
/**
* 测试升级安装2,无效下载链接
*/
findViewById(R.id.update2).setOnClickListener(v -> showUpdateDialog("1.升级后App 会自动攒钱\n2.还可以做白日梦", false, apkDownLoadUrl2));
methodRequiresPermission();
}
/**
* 显示下载的对话框,是否要强制的升级还是正常的升级
*
* @param UpdateMsg 升级信息
* @param isForceUpdate 是否是强制升级
* @param downloadUrl APK 下载URL
*/
private void showUpdateDialog(String UpdateMsg, boolean isForceUpdate, String downloadUrl) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
final LayoutInflater inflater = LayoutInflater.from(this);
View updateView = inflater.inflate(R.layout.update_layout, null);
NumberProgressBar progressBar = updateView.findViewById(R.id.tips_progress);
TextView updateMsg = updateView.findViewById(R.id.update_mess_txt);
updateMsg.setText(UpdateMsg);
builder.setTitle("发现新版本");
String negativeBtnStr = "以后再说";
if (isForceUpdate) {
builder.setTitle("强制升级");
negativeBtnStr = "退出应用";
}
builder.setView(updateView);
builder.setNegativeButton(negativeBtnStr, null);
builder.setPositiveButton(R.string.apk_update_yes, null);
AlertDialog downloadDialog = builder.create();
downloadDialog.setCanceledOnTouchOutside(false);
downloadDialog.setCancelable(false);
downloadDialog.show();
downloadDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
if (isForceUpdate) {
progressBar.setVisibility(View.VISIBLE);
//新加 isForceGrantUnKnowSource 参数
//如果是企业内部应用升级,肯定是要这个权限,其他情况不要太流氓,TOAST 提示
//这里演示要强制安装
new DownloadInstaller(this, downloadUrl, true, new DownloadProgressCallBack() {
@Override
public void downloadProgress(int progress) {
runOnUiThread(() -> progressBar.setProgress(progress));
if (progress==100){
downloadDialog.dismiss();
}
}
@Override
public void downloadException(Exception e) {
}
@Override
public void onInstallStart() {
downloadDialog.dismiss();
}
}).start();
//升级按钮变灰色
downloadDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.GRAY);
} else {
new DownloadInstaller(this, downloadUrl).start();
downloadDialog.dismiss();
}
});
downloadDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> {
if (isForceUpdate) {
MainActivity.this.finish();
} else {
downloadDialog.dismiss();
}
});
}
/**
* 请求权限,创建目录的权限
*/
private void methodRequiresPermission() {
String[] perms = {Manifest.permission.WRITE_EXTERNAL_STORAGE};
if (EasyPermissions.hasPermissions(this, perms)) {
// Already have permission, do the thing
// ...
} else {
// Do not have permissions, request them now
EasyPermissions.requestPermissions(MainActivity.this, "App 升级需要储存权限", 10086, perms);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
// Forward results to EasyPermissions
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
}
@Override
public void onPermissionsGranted(int requestCode, List<String> list) {
// Some permissions have been granted
// ...
}
@Override
public void onPermissionsDenied(int requestCode, List<String> list) {
// Some permissions have been denied
// ...
}
}
| [
"zenglb@vanke.com"
] | zenglb@vanke.com |
f3bc8f079ff20d338e9e5baa6f365efae1e0d233 | afe57363a87c60c5418434609b1f4c65a986cc6f | /src/main/java/cn/itxdl/circle/CircleLinkedList.java | 57300f618fd9c8c4f93fea9db736978e12732a32 | [] | no_license | ltz805670569/Linked_List | 6e83317026f7b398e3614598b3c1cfba1957e85f | dcd77ac2c43f12bcc2e1d258e6dbb6a4f691f751 | refs/heads/master | 2020-11-23T19:48:06.322629 | 2019-12-13T08:47:13 | 2019-12-13T08:47:13 | 227,795,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,336 | java | package cn.itxdl.circle;
/**
* 单向循环链表
* @param <E>
*/
public class CircleLinkedList<E> {
private Node<E> head;
/**
* 从头部添加
* @param e
*/
public void addFirst(E e){
Node<E> newNode = new Node(e);
Node<E> temp = head;
if(head == null){
head = newNode;
return;
}else if(head.next == null){
newNode.next = temp;
head = newNode;
temp.next = head;
return;
}else{
while(temp.next != head){
temp = temp.next;
}
newNode.next = head;
head = newNode;
temp.next = head;
}
}
/**
* 从末尾添加
* @param e
*/
public void add(E e){
Node<E> newNode = new Node(e);
Node<E> temp = head;
if(head == null){
newNode.next = head;
head = newNode;
}else if(head.next == null){
head.next = newNode;
newNode.next = head;
}else{
while(temp.next != head){
temp = temp.next;
}
temp.next = newNode;
newNode.next = head;
}
}
/**
* 通过索引,从中间或尾部或头部插入添加
* @param index
* @param e
*/
public void add(int index,E e){
if(index == 0){
addFirst(e);
return;
}
Node<E> newNode = new Node(e);
Node<E> upNode = get(index);
Node<E> downNode = get(index+1);
newNode.next = downNode;
upNode.next = newNode;
// if(index<0 || index>(size()-1)){
// throw new RuntimeException("下角标越界");
// }
// Node<E> upNode = head;
// Node<E> downNode = head;
// for(int i=0;i<index-1;i++){
// upNode = upNode.next;
// }
// for(int i=0;i<index;i++){
// downNode = downNode.next;
// }
// if(downNode == head){
// upNode.next = newNode;
// newNode.next = head;
// }else{
// upNode.next = newNode;
// newNode.next = downNode;
// }
}
/**
* 通过索引,获取元素
* @param index
* @return
*/
public Node get(int index){
Node e = null;
Node<E> temp = head;
int lt = index%size();
if(lt == 0){
while(temp.next != head){
temp = temp.next;
}
e = temp;
}else if(lt == 1){
e = head;
}else{
for(int i = 1;i<lt;i++){
temp = temp.next;
}
e = temp;
}
return e;
// if(index<0 || index>(size()-1)){
// throw new RuntimeException("下角标越界");
// }
// if(index == 0){
// e = head;
// return e;
// }
// Node<E> temp = head;
// for(int i=0;i<index;i++){
// temp = temp.next;
// }
// e = temp;
// return e;
}
/**
* 通过索引,删除元素,返回删除的元素值
* @param index
* @return
*/
public E remove(int index){
E e = null;
// Node<E> temp = head;
// while (temp.next != head){
// temp = temp.next;
// }
if(index == 0){
e = head.data;
head = head.next;
// temp.next = head;
return e;
}
Node<E> rmNode = get(index);
Node<E> upNode = get(index-1);
Node<E> downNode = get(index+1);
e = rmNode.data;
rmNode = null;
upNode.next = downNode;
return e;
// if(index<0 || index>(size()-1)){
// throw new RuntimeException("下角标越界");
// }
// else if(index == (size()-1)){
// Node<E> pre = head;
// for(int i=0;i<index-1;i++){
// pre = pre.next;
// }
// pre.next = head;
// e = temp.data;
// return e;
// }else{
// Node<E> upNode = head;
// Node<E> downNode = head;
// Node<E> rmNode = head;
// for(int i=0;i<index-1;i++){
// upNode = upNode.next;
// }
// for(int i=0;i<index+1;i++){
// downNode = downNode.next;
// }
// for(int i=0;i<index;i++){
// rmNode = rmNode.next;
// }
// upNode.next = downNode;
// e = rmNode.data;
// return e;
// }
}
/**
*
* @param index
* @param data
* @return
*/
public E set(int index,E data){
E e = null;
if(index == 0){
e = head.data;
head.data = data;
return e;
}else{
Node<E> temp = head;
for(int i=0;i<index;i++){
temp = temp.next;
}
e = temp.data;
temp.data = data;
return e;
}
// if(index<0 || index>(size()-1)){
// throw new RuntimeException("下角标越界");
// }
}
/**
* 获取链表大小
* @return
*/
public int size(){
int size = 1;
Node<E> temp = head;
if(temp == null){
return 0;
}else if(temp.next == null){
return size;
}else{
while(true){
if(temp.next == head){
return size;
}
temp = temp.next;
size++;
}
}
}
/**
* 打印链表
* @return
*/
public String toString(){
Node<E> curNode = head;
StringBuilder sb = new StringBuilder("[");
sb.append(head.data);
if(head.next == null){
sb.append("]");
}else{
sb.append(",");
while ((curNode = curNode.next) != head){
if(curNode.next == head){
sb.append(curNode.data).append("]");
return sb.toString();
}
sb.append(curNode.data).append(",");
}
}
return sb.toString();
}
}
| [
"805670569@qq.com"
] | 805670569@qq.com |
a346c464478fcd84ce56fcb4fe57836910b8c02a | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/zxing/2017/4/RSS14Reader.java | 4ec7053519a1dce895f62eade905114a7a5d56c2 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 14,977 | java | /*
* Copyright 2009 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.oned.rss;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.NotFoundException;
import com.google.zxing.Result;
import com.google.zxing.ResultPoint;
import com.google.zxing.ResultPointCallback;
import com.google.zxing.common.BitArray;
import com.google.zxing.common.detector.MathUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* Decodes RSS-14, including truncated and stacked variants. See ISO/IEC 24724:2006.
*/
public final class RSS14Reader extends AbstractRSSReader {
private static final int[] OUTSIDE_EVEN_TOTAL_SUBSET = {1,10,34,70,126};
private static final int[] INSIDE_ODD_TOTAL_SUBSET = {4,20,48,81};
private static final int[] OUTSIDE_GSUM = {0,161,961,2015,2715};
private static final int[] INSIDE_GSUM = {0,336,1036,1516};
private static final int[] OUTSIDE_ODD_WIDEST = {8,6,4,3,1};
private static final int[] INSIDE_ODD_WIDEST = {2,4,6,8};
private static final int[][] FINDER_PATTERNS = {
{3,8,2,1},
{3,5,5,1},
{3,3,7,1},
{3,1,9,1},
{2,7,4,1},
{2,5,6,1},
{2,3,8,1},
{1,5,7,1},
{1,3,9,1},
};
private final List<Pair> possibleLeftPairs;
private final List<Pair> possibleRightPairs;
public RSS14Reader() {
possibleLeftPairs = new ArrayList<>();
possibleRightPairs = new ArrayList<>();
}
@Override
public Result decodeRow(int rowNumber,
BitArray row,
Map<DecodeHintType,?> hints) throws NotFoundException {
Pair leftPair = decodePair(row, false, rowNumber, hints);
addOrTally(possibleLeftPairs, leftPair);
row.reverse();
Pair rightPair = decodePair(row, true, rowNumber, hints);
addOrTally(possibleRightPairs, rightPair);
row.reverse();
for (Pair left : possibleLeftPairs) {
if (left.getCount() > 1) {
for (Pair right : possibleRightPairs) {
if (right.getCount() > 1) {
if (checkChecksum(left, right)) {
return constructResult(left, right);
}
}
}
}
}
throw NotFoundException.getNotFoundInstance();
}
private static void addOrTally(Collection<Pair> possiblePairs, Pair pair) {
if (pair == null) {
return;
}
boolean found = false;
for (Pair other : possiblePairs) {
if (other.getValue() == pair.getValue()) {
other.incrementCount();
found = true;
break;
}
}
if (!found) {
possiblePairs.add(pair);
}
}
@Override
public void reset() {
possibleLeftPairs.clear();
possibleRightPairs.clear();
}
private static Result constructResult(Pair leftPair, Pair rightPair) {
long symbolValue = 4537077L * leftPair.getValue() + rightPair.getValue();
String text = String.valueOf(symbolValue);
StringBuilder buffer = new StringBuilder(14);
for (int i = 13 - text.length(); i > 0; i--) {
buffer.append('0');
}
buffer.append(text);
int checkDigit = 0;
for (int i = 0; i < 13; i++) {
int digit = buffer.charAt(i) - '0';
checkDigit += (i & 0x01) == 0 ? 3 * digit : digit;
}
checkDigit = 10 - (checkDigit % 10);
if (checkDigit == 10) {
checkDigit = 0;
}
buffer.append(checkDigit);
ResultPoint[] leftPoints = leftPair.getFinderPattern().getResultPoints();
ResultPoint[] rightPoints = rightPair.getFinderPattern().getResultPoints();
return new Result(
buffer.toString(),
null,
new ResultPoint[] { leftPoints[0], leftPoints[1], rightPoints[0], rightPoints[1], },
BarcodeFormat.RSS_14);
}
private static boolean checkChecksum(Pair leftPair, Pair rightPair) {
//int leftFPValue = leftPair.getFinderPattern().getValue();
//int rightFPValue = rightPair.getFinderPattern().getValue();
//if ((leftFPValue == 0 && rightFPValue == 8) ||
// (leftFPValue == 8 && rightFPValue == 0)) {
//}
int checkValue = (leftPair.getChecksumPortion() + 16 * rightPair.getChecksumPortion()) % 79;
int targetCheckValue =
9 * leftPair.getFinderPattern().getValue() + rightPair.getFinderPattern().getValue();
if (targetCheckValue > 72) {
targetCheckValue--;
}
if (targetCheckValue > 8) {
targetCheckValue--;
}
return checkValue == targetCheckValue;
}
private Pair decodePair(BitArray row, boolean right, int rowNumber, Map<DecodeHintType,?> hints) {
try {
int[] startEnd = findFinderPattern(row, right);
FinderPattern pattern = parseFoundFinderPattern(row, rowNumber, right, startEnd);
ResultPointCallback resultPointCallback = hints == null ? null :
(ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
if (resultPointCallback != null) {
float center = (startEnd[0] + startEnd[1]) / 2.0f;
if (right) {
// row is actually reversed
center = row.getSize() - 1 - center;
}
resultPointCallback.foundPossibleResultPoint(new ResultPoint(center, rowNumber));
}
DataCharacter outside = decodeDataCharacter(row, pattern, true);
DataCharacter inside = decodeDataCharacter(row, pattern, false);
return new Pair(1597 * outside.getValue() + inside.getValue(),
outside.getChecksumPortion() + 4 * inside.getChecksumPortion(),
pattern);
} catch (NotFoundException ignored) {
return null;
}
}
private DataCharacter decodeDataCharacter(BitArray row, FinderPattern pattern, boolean outsideChar)
throws NotFoundException {
int[] counters = getDataCharacterCounters();
counters[0] = 0;
counters[1] = 0;
counters[2] = 0;
counters[3] = 0;
counters[4] = 0;
counters[5] = 0;
counters[6] = 0;
counters[7] = 0;
if (outsideChar) {
recordPatternInReverse(row, pattern.getStartEnd()[0], counters);
} else {
recordPattern(row, pattern.getStartEnd()[1] + 1, counters);
// reverse it
for (int i = 0, j = counters.length - 1; i < j; i++, j--) {
int temp = counters[i];
counters[i] = counters[j];
counters[j] = temp;
}
}
int numModules = outsideChar ? 16 : 15;
float elementWidth = MathUtils.sum(counters) / (float) numModules;
int[] oddCounts = this.getOddCounts();
int[] evenCounts = this.getEvenCounts();
float[] oddRoundingErrors = this.getOddRoundingErrors();
float[] evenRoundingErrors = this.getEvenRoundingErrors();
for (int i = 0; i < counters.length; i++) {
float value = counters[i] / elementWidth;
int count = (int) (value + 0.5f); // Round
if (count < 1) {
count = 1;
} else if (count > 8) {
count = 8;
}
int offset = i / 2;
if ((i & 0x01) == 0) {
oddCounts[offset] = count;
oddRoundingErrors[offset] = value - count;
} else {
evenCounts[offset] = count;
evenRoundingErrors[offset] = value - count;
}
}
adjustOddEvenCounts(outsideChar, numModules);
int oddSum = 0;
int oddChecksumPortion = 0;
for (int i = oddCounts.length - 1; i >= 0; i--) {
oddChecksumPortion *= 9;
oddChecksumPortion += oddCounts[i];
oddSum += oddCounts[i];
}
int evenChecksumPortion = 0;
int evenSum = 0;
for (int i = evenCounts.length - 1; i >= 0; i--) {
evenChecksumPortion *= 9;
evenChecksumPortion += evenCounts[i];
evenSum += evenCounts[i];
}
int checksumPortion = oddChecksumPortion + 3 * evenChecksumPortion;
if (outsideChar) {
if ((oddSum & 0x01) != 0 || oddSum > 12 || oddSum < 4) {
throw NotFoundException.getNotFoundInstance();
}
int group = (12 - oddSum) / 2;
int oddWidest = OUTSIDE_ODD_WIDEST[group];
int evenWidest = 9 - oddWidest;
int vOdd = RSSUtils.getRSSvalue(oddCounts, oddWidest, false);
int vEven = RSSUtils.getRSSvalue(evenCounts, evenWidest, true);
int tEven = OUTSIDE_EVEN_TOTAL_SUBSET[group];
int gSum = OUTSIDE_GSUM[group];
return new DataCharacter(vOdd * tEven + vEven + gSum, checksumPortion);
} else {
if ((evenSum & 0x01) != 0 || evenSum > 10 || evenSum < 4) {
throw NotFoundException.getNotFoundInstance();
}
int group = (10 - evenSum) / 2;
int oddWidest = INSIDE_ODD_WIDEST[group];
int evenWidest = 9 - oddWidest;
int vOdd = RSSUtils.getRSSvalue(oddCounts, oddWidest, true);
int vEven = RSSUtils.getRSSvalue(evenCounts, evenWidest, false);
int tOdd = INSIDE_ODD_TOTAL_SUBSET[group];
int gSum = INSIDE_GSUM[group];
return new DataCharacter(vEven * tOdd + vOdd + gSum, checksumPortion);
}
}
private int[] findFinderPattern(BitArray row, boolean rightFinderPattern)
throws NotFoundException {
int[] counters = getDecodeFinderCounters();
counters[0] = 0;
counters[1] = 0;
counters[2] = 0;
counters[3] = 0;
int width = row.getSize();
boolean isWhite = false;
int rowOffset = 0;
while (rowOffset < width) {
isWhite = !row.get(rowOffset);
if (rightFinderPattern == isWhite) {
// Will encounter white first when searching for right finder pattern
break;
}
rowOffset++;
}
int counterPosition = 0;
int patternStart = rowOffset;
for (int x = rowOffset; x < width; x++) {
if (row.get(x) != isWhite) {
counters[counterPosition]++;
} else {
if (counterPosition == 3) {
if (isFinderPattern(counters)) {
return new int[]{patternStart, x};
}
patternStart += counters[0] + counters[1];
counters[0] = counters[2];
counters[1] = counters[3];
counters[2] = 0;
counters[3] = 0;
counterPosition--;
} else {
counterPosition++;
}
counters[counterPosition] = 1;
isWhite = !isWhite;
}
}
throw NotFoundException.getNotFoundInstance();
}
private FinderPattern parseFoundFinderPattern(BitArray row, int rowNumber, boolean right, int[] startEnd)
throws NotFoundException {
// Actually we found elements 2-5
boolean firstIsBlack = row.get(startEnd[0]);
int firstElementStart = startEnd[0] - 1;
// Locate element 1
while (firstElementStart >= 0 && firstIsBlack != row.get(firstElementStart)) {
firstElementStart--;
}
firstElementStart++;
int firstCounter = startEnd[0] - firstElementStart;
// Make 'counters' hold 1-4
int[] counters = getDecodeFinderCounters();
System.arraycopy(counters, 0, counters, 1, counters.length - 1);
counters[0] = firstCounter;
int value = parseFinderValue(counters, FINDER_PATTERNS);
int start = firstElementStart;
int end = startEnd[1];
if (right) {
// row is actually reversed
start = row.getSize() - 1 - start;
end = row.getSize() - 1 - end;
}
return new FinderPattern(value, new int[] {firstElementStart, startEnd[1]}, start, end, rowNumber);
}
private void adjustOddEvenCounts(boolean outsideChar, int numModules) throws NotFoundException {
int oddSum = MathUtils.sum(getOddCounts());
int evenSum = MathUtils.sum(getEvenCounts());
boolean incrementOdd = false;
boolean decrementOdd = false;
boolean incrementEven = false;
boolean decrementEven = false;
if (outsideChar) {
if (oddSum > 12) {
decrementOdd = true;
} else if (oddSum < 4) {
incrementOdd = true;
}
if (evenSum > 12) {
decrementEven = true;
} else if (evenSum < 4) {
incrementEven = true;
}
} else {
if (oddSum > 11) {
decrementOdd = true;
} else if (oddSum < 5) {
incrementOdd = true;
}
if (evenSum > 10) {
decrementEven = true;
} else if (evenSum < 4) {
incrementEven = true;
}
}
int mismatch = oddSum + evenSum - numModules;
boolean oddParityBad = (oddSum & 0x01) == (outsideChar ? 1 : 0);
boolean evenParityBad = (evenSum & 0x01) == 1;
/*if (mismatch == 2) {
if (!(oddParityBad && evenParityBad)) {
throw ReaderException.getInstance();
}
decrementOdd = true;
decrementEven = true;
} else if (mismatch == -2) {
if (!(oddParityBad && evenParityBad)) {
throw ReaderException.getInstance();
}
incrementOdd = true;
incrementEven = true;
} else */ if (mismatch == 1) {
if (oddParityBad) {
if (evenParityBad) {
throw NotFoundException.getNotFoundInstance();
}
decrementOdd = true;
} else {
if (!evenParityBad) {
throw NotFoundException.getNotFoundInstance();
}
decrementEven = true;
}
} else if (mismatch == -1) {
if (oddParityBad) {
if (evenParityBad) {
throw NotFoundException.getNotFoundInstance();
}
incrementOdd = true;
} else {
if (!evenParityBad) {
throw NotFoundException.getNotFoundInstance();
}
incrementEven = true;
}
} else if (mismatch == 0) {
if (oddParityBad) {
if (!evenParityBad) {
throw NotFoundException.getNotFoundInstance();
}
// Both bad
if (oddSum < evenSum) {
incrementOdd = true;
decrementEven = true;
} else {
decrementOdd = true;
incrementEven = true;
}
} else {
if (evenParityBad) {
throw NotFoundException.getNotFoundInstance();
}
// Nothing to do!
}
} else {
throw NotFoundException.getNotFoundInstance();
}
if (incrementOdd) {
if (decrementOdd) {
throw NotFoundException.getNotFoundInstance();
}
increment(getOddCounts(), getOddRoundingErrors());
}
if (decrementOdd) {
decrement(getOddCounts(), getOddRoundingErrors());
}
if (incrementEven) {
if (decrementEven) {
throw NotFoundException.getNotFoundInstance();
}
increment(getEvenCounts(), getOddRoundingErrors());
}
if (decrementEven) {
decrement(getEvenCounts(), getEvenRoundingErrors());
}
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.