blob_id
stringlengths 40
40
| __id__
int64 225
39,780B
| directory_id
stringlengths 40
40
| path
stringlengths 6
313
| content_id
stringlengths 40
40
| detected_licenses
list | license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| repo_url
stringlengths 25
151
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
70
| visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 7.28k
689M
⌀ | star_events_count
int64 0
131k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 23
values | gha_fork
bool 2
classes | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_updated_at
timestamp[ns] | gha_pushed_at
timestamp[ns] | gha_size
int64 0
40.4M
⌀ | gha_stargazers_count
int32 0
112k
⌀ | gha_forks_count
int32 0
39.4k
⌀ | gha_open_issues_count
int32 0
11k
⌀ | gha_language
stringlengths 1
21
⌀ | gha_archived
bool 2
classes | gha_disabled
bool 1
class | content
stringlengths 7
4.37M
| src_encoding
stringlengths 3
16
| language
stringclasses 1
value | length_bytes
int64 7
4.37M
| extension
stringclasses 24
values | filename
stringlengths 4
174
| language_id
stringclasses 1
value | entities
list | contaminating_dataset
stringclasses 0
values | malware_signatures
list | redacted_content
stringlengths 7
4.37M
| redacted_length_bytes
int64 7
4.37M
| alphanum_fraction
float32 0.25
0.94
| alpha_fraction
float32 0.25
0.94
| num_lines
int32 1
84k
| avg_line_length
float32 0.76
99.9
| std_line_length
float32 0
220
| max_line_length
int32 5
998
| is_vendor
bool 2
classes | is_generated
bool 1
class | max_hex_length
int32 0
319
| hex_fraction
float32 0
0.38
| max_unicode_length
int32 0
408
| unicode_fraction
float32 0
0.36
| max_base64_length
int32 0
506
| base64_fraction
float32 0
0.5
| avg_csv_sep_count
float32 0
4
| is_autogen_header
bool 1
class | is_empty_html
bool 1
class | shard
stringclasses 16
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
952087c56b33731082dfd202a984c1d0ea4ff654 | 29,669,634,136,941 | 548374c53507132347a79e2381b27256063b7f58 | /assign4/Message.java | 417be548c1ccfcf0d2af1b8613b72eff3217e51b | []
| no_license | jared-wallace/OOP-Assignment4 | https://github.com/jared-wallace/OOP-Assignment4 | 973efad229f957b07a2ebec6a79f73825c914d94 | 23012efbb004d2e67976d1381602aa2546e8ecb4 | refs/heads/master | 2015-08-14T09:55:01.632000 | 2014-12-06T03:37:31 | 2014-12-06T03:37:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package assign4;
import java.util.Date;
/**
* A message object has an associated user (the customer, presumably), and
* a message text along with the date the message was created.
*/
class Message {
private final User _user;
private final String _msgText;
private final Date _date;
/**
* The constructor for the Message class.
*
* @param user The user making the message.
* @param text The actual text of the message.
* @param date The date the message was created.
*/
public Message(User user, String text, Date date) {
this._user = user;
this._msgText = text;
this._date = date;
}
/**
* The alternative constructor, which is used for when employees respond
* to a customer message. The additional field holds a reference to the original
* customer message.
*
* @param user The employee responding to the message.
* @param text The text of the response.
* @param date The date of the response.
* @param responseTo The reference to the original customer message.
*/
public Message(User user, String text, Date date, Message responseTo) {
this._user = user;
this._msgText = text;
this._date = date;
Message _inResponseTo = responseTo;
}
/**
* Returns the text of the specified message.
*
* @return The text of the message in question.
*/
public String toString(){
return _msgText + "\n";
}
} | UTF-8 | Java | 1,497 | java | Message.java | Java | []
| null | []
| package assign4;
import java.util.Date;
/**
* A message object has an associated user (the customer, presumably), and
* a message text along with the date the message was created.
*/
class Message {
private final User _user;
private final String _msgText;
private final Date _date;
/**
* The constructor for the Message class.
*
* @param user The user making the message.
* @param text The actual text of the message.
* @param date The date the message was created.
*/
public Message(User user, String text, Date date) {
this._user = user;
this._msgText = text;
this._date = date;
}
/**
* The alternative constructor, which is used for when employees respond
* to a customer message. The additional field holds a reference to the original
* customer message.
*
* @param user The employee responding to the message.
* @param text The text of the response.
* @param date The date of the response.
* @param responseTo The reference to the original customer message.
*/
public Message(User user, String text, Date date, Message responseTo) {
this._user = user;
this._msgText = text;
this._date = date;
Message _inResponseTo = responseTo;
}
/**
* Returns the text of the specified message.
*
* @return The text of the message in question.
*/
public String toString(){
return _msgText + "\n";
}
} | 1,497 | 0.632599 | 0.631931 | 53 | 27.264151 | 24.048811 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.45283 | false | false | 9 |
15572255d76131ffebf0b54148b66781ef32df20 | 35,055,523,077,129 | 1fbb0dd53648fd4e4c354d08952302917c0c7d5f | /product-oil/wechat/src/main/java/com/sinochem/crude/trade/wechat/service/impl/AccessTokenServiceImpl.java | d9a65483132f4b91682d97bff051cdad47f0ecc4 | []
| no_license | wang-shun/transaction | https://github.com/wang-shun/transaction | 2a68d96e4197bbdd71d05f0e6e91b1914e395ebc | 8a3bd4af7180d9fbafbb01ab1739702798430441 | refs/heads/master | 2020-04-04T18:10:33.235000 | 2018-11-05T02:27:57 | 2018-11-05T02:27:57 | 156,152,857 | 0 | 1 | null | true | 2018-11-05T03:03:30 | 2018-11-05T03:03:29 | 2018-11-05T02:33:15 | 2018-11-05T02:32:38 | 0 | 0 | 0 | 0 | null | false | null | package com.sinochem.crude.trade.wechat.service.impl;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.sinochem.crude.trade.wechat.constant.AccessTokenUtil;
import com.sinochem.crude.trade.wechat.constant.UrlMapping;
import com.sinochem.crude.trade.wechat.constant.WechatConstant;
import com.sinochem.crude.trade.wechat.domain.UserInfo;
import com.sinochem.crude.trade.wechat.helper.HttpHelper;
import com.sinochem.crude.trade.wechat.helper.StringHelper;
import org.apache.commons.lang.time.DateUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.sinochem.crude.trade.wechat.dao.AccessTokenMapper;
import com.sinochem.crude.trade.wechat.domain.AccessToken;
import com.sinochem.crude.trade.wechat.domain.AccessTokenClazz;
import com.sinochem.crude.trade.wechat.service.AccessTokenService;
@Service
public class AccessTokenServiceImpl implements AccessTokenService{
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private AccessTokenMapper accessTokenMapper;
@Autowired
@Value("${wechat.appid}")
String appid;
@Value("${wechat.appsecret}")
String appsecret;
@Override
public void saveAccessToken(AccessToken accessToken,int type) {
AccessTokenClazz accessTokenClazz = new AccessTokenClazz();
if(accessToken != null){
accessTokenClazz.setAccessToken(accessToken.getAccess_token());
accessTokenClazz.setCreateDate(new Date());
accessTokenClazz.setTokentype(type);
}
accessTokenMapper.insertAccessToken(accessTokenClazz);
}
/**
* 获取微信jstoken并存在mysql;
* 115分钟内jstoken有效;
*regain 是否强制重新获取token;
*/
@Override
public String getJSToken(boolean regain) {
//先判断当前jstoken是否过期;
String jstoken="";
AccessTokenClazz argac=new AccessTokenClazz();
argac.setTokentype(1);
AccessTokenClazz accessTokenClazz= accessTokenMapper.findvolidAccessToken(argac);
if(accessTokenClazz==null||regain) {
try {
AccessToken accessToken = getWXJSToken(false);
if (accessToken != null && accessToken.getErrcode() != null && (accessToken.getErrcode().equals("42001") || accessToken.getErrcode().equals("40001"))) {
accessToken = getWXJSToken( true);
}
if(accessToken!=null) {
jstoken=accessToken.getTicket();
}
} catch (Exception e) {
e.printStackTrace();
}
return jstoken;
}
return accessTokenClazz.getAccessToken();
}
Gson gson=new Gson();
/**
*获取微信jstoken
*/
public AccessToken getWXJSToken(boolean regain) throws Exception{
String token=getToken(regain);
String tickestr ="";
HttpHelper helper=new HttpHelper();
Map<String, String> map = new HashMap<>();
map.put("access_token",token);
map.put("type","jsapi");
String json=helper.GetWXServiceMap(UrlMapping.WECHAT_TICKET,map);
AccessToken tick= gson.fromJson(json, AccessToken.class);
if(tick!=null && tick.getErrcode().equals("0")) {
tick.setAccess_token(tick.getTicket());
saveAccessToken(tick, 1);
// tickestr = tick.getTicket();
}
return tick;
}
/**
* 获取微信token并存在mysql;
* 115分钟内token有效;
*regain 是否强制重新获取token;
*/
@Override
public String getToken(boolean regain) {
//先判断当前token是否过期;
AccessTokenClazz argac=new AccessTokenClazz();
argac.setTokentype(0);
AccessTokenClazz accessTokenClazz= accessTokenMapper.findvolidAccessToken(argac);
if(accessTokenClazz==null||regain) {
AccessToken accessToken = null;
try {
accessToken = getAccessToken();//AccessTokenUtil.getAccessToken();
} catch (Exception e) {
e.printStackTrace();
}
if (accessToken != null) {
saveAccessToken(accessToken,0);
}
return accessToken.getAccess_token();
}
return accessTokenClazz.getAccessToken();
}
/**
*获取access_token
*/
public AccessToken getAccessToken() throws Exception{
//AccessToken at = null;
Map<String, String> map = new HashMap<>();
map.put("appid",appid);
map.put("secret", appsecret);
map.put("grant_type", "client_credential");
HttpHelper httpHelper = new HttpHelper();
String wu = httpHelper.GetWXServiceMap(UrlMapping.GET_ACCESSTOKEN_URL, map);
Gson gson = new Gson();
AccessToken at = gson.fromJson(wu, AccessToken.class);
return at;
}
@Override
public AccessTokenClazz findAnAccessToken() {
return accessTokenMapper.findAnAccessToken();
}
@Override
public void deleteAccessToken() {
accessTokenMapper.deleteAccessToken();
}
}
| UTF-8 | Java | 5,046 | java | AccessTokenServiceImpl.java | Java | []
| null | []
| package com.sinochem.crude.trade.wechat.service.impl;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.sinochem.crude.trade.wechat.constant.AccessTokenUtil;
import com.sinochem.crude.trade.wechat.constant.UrlMapping;
import com.sinochem.crude.trade.wechat.constant.WechatConstant;
import com.sinochem.crude.trade.wechat.domain.UserInfo;
import com.sinochem.crude.trade.wechat.helper.HttpHelper;
import com.sinochem.crude.trade.wechat.helper.StringHelper;
import org.apache.commons.lang.time.DateUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.sinochem.crude.trade.wechat.dao.AccessTokenMapper;
import com.sinochem.crude.trade.wechat.domain.AccessToken;
import com.sinochem.crude.trade.wechat.domain.AccessTokenClazz;
import com.sinochem.crude.trade.wechat.service.AccessTokenService;
@Service
public class AccessTokenServiceImpl implements AccessTokenService{
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private AccessTokenMapper accessTokenMapper;
@Autowired
@Value("${wechat.appid}")
String appid;
@Value("${wechat.appsecret}")
String appsecret;
@Override
public void saveAccessToken(AccessToken accessToken,int type) {
AccessTokenClazz accessTokenClazz = new AccessTokenClazz();
if(accessToken != null){
accessTokenClazz.setAccessToken(accessToken.getAccess_token());
accessTokenClazz.setCreateDate(new Date());
accessTokenClazz.setTokentype(type);
}
accessTokenMapper.insertAccessToken(accessTokenClazz);
}
/**
* 获取微信jstoken并存在mysql;
* 115分钟内jstoken有效;
*regain 是否强制重新获取token;
*/
@Override
public String getJSToken(boolean regain) {
//先判断当前jstoken是否过期;
String jstoken="";
AccessTokenClazz argac=new AccessTokenClazz();
argac.setTokentype(1);
AccessTokenClazz accessTokenClazz= accessTokenMapper.findvolidAccessToken(argac);
if(accessTokenClazz==null||regain) {
try {
AccessToken accessToken = getWXJSToken(false);
if (accessToken != null && accessToken.getErrcode() != null && (accessToken.getErrcode().equals("42001") || accessToken.getErrcode().equals("40001"))) {
accessToken = getWXJSToken( true);
}
if(accessToken!=null) {
jstoken=accessToken.getTicket();
}
} catch (Exception e) {
e.printStackTrace();
}
return jstoken;
}
return accessTokenClazz.getAccessToken();
}
Gson gson=new Gson();
/**
*获取微信jstoken
*/
public AccessToken getWXJSToken(boolean regain) throws Exception{
String token=getToken(regain);
String tickestr ="";
HttpHelper helper=new HttpHelper();
Map<String, String> map = new HashMap<>();
map.put("access_token",token);
map.put("type","jsapi");
String json=helper.GetWXServiceMap(UrlMapping.WECHAT_TICKET,map);
AccessToken tick= gson.fromJson(json, AccessToken.class);
if(tick!=null && tick.getErrcode().equals("0")) {
tick.setAccess_token(tick.getTicket());
saveAccessToken(tick, 1);
// tickestr = tick.getTicket();
}
return tick;
}
/**
* 获取微信token并存在mysql;
* 115分钟内token有效;
*regain 是否强制重新获取token;
*/
@Override
public String getToken(boolean regain) {
//先判断当前token是否过期;
AccessTokenClazz argac=new AccessTokenClazz();
argac.setTokentype(0);
AccessTokenClazz accessTokenClazz= accessTokenMapper.findvolidAccessToken(argac);
if(accessTokenClazz==null||regain) {
AccessToken accessToken = null;
try {
accessToken = getAccessToken();//AccessTokenUtil.getAccessToken();
} catch (Exception e) {
e.printStackTrace();
}
if (accessToken != null) {
saveAccessToken(accessToken,0);
}
return accessToken.getAccess_token();
}
return accessTokenClazz.getAccessToken();
}
/**
*获取access_token
*/
public AccessToken getAccessToken() throws Exception{
//AccessToken at = null;
Map<String, String> map = new HashMap<>();
map.put("appid",appid);
map.put("secret", appsecret);
map.put("grant_type", "client_credential");
HttpHelper httpHelper = new HttpHelper();
String wu = httpHelper.GetWXServiceMap(UrlMapping.GET_ACCESSTOKEN_URL, map);
Gson gson = new Gson();
AccessToken at = gson.fromJson(wu, AccessToken.class);
return at;
}
@Override
public AccessTokenClazz findAnAccessToken() {
return accessTokenMapper.findAnAccessToken();
}
@Override
public void deleteAccessToken() {
accessTokenMapper.deleteAccessToken();
}
}
| 5,046 | 0.754794 | 0.750102 | 160 | 29.637501 | 24.298531 | 156 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.0125 | false | false | 9 |
8a3a348db40f4498b8b74fbda22956ef4247615a | 28,647,431,894,098 | d773b713f19781d3353348b5a10be0b8a6080009 | /Durgesh_PE4/src/main/test/com/stackroute/unittest/pe4/RegexMatchingTest.java | e5e366d5ad7039d2e0e6a691e028f447ed84b76f | []
| no_license | durgeshkc/JavaPractice | https://github.com/durgeshkc/JavaPractice | ec8b3d52482ae4cdabf722f99f3b00f3b48913a2 | 8334f0adde734f3ec72728070e23a663ecfc74b5 | refs/heads/master | 2020-04-12T05:28:33.989000 | 2019-01-03T06:14:40 | 2019-01-03T06:14:40 | 162,247,580 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.stackroute.unittest.pe4;
import org.junit.Test;
import static org.junit.Assert.*;
public class RegexMatchingTest {
RegexMatching match = new RegexMatching();
@Test
public void matching() {
assertTrue("true",match.matching("This is Harry","Harry"));
assertTrue("true",match.matching("This is Harry from Us ","Harry"));
assertTrue("true",match.matching("This is Harry from Indiana","Harry"));
}
@Test
public void checkForNotNull() {
String s = null;
assertNotNull("its not null",match.matching("its Harry","Harry"));
//assertNull("its null",match.matching(s,"Harry"));
}
} | UTF-8 | Java | 666 | java | RegexMatchingTest.java | Java | [
{
"context": "\n assertTrue(\"true\",match.matching(\"This is Harry\",\"Harry\"));\n assertTrue(\"true\",match.match",
"end": 272,
"score": 0.9532346725463867,
"start": 267,
"tag": "NAME",
"value": "Harry"
},
{
"context": "assertTrue(\"true\",match.matching(\"This is Harry\",\"Harry\"));\n assertTrue(\"true\",match.matching(\"Thi",
"end": 280,
"score": 0.9586445689201355,
"start": 275,
"tag": "NAME",
"value": "Harry"
},
{
"context": "\n assertTrue(\"true\",match.matching(\"This is Harry from Us \",\"Harry\"));\n assertTrue(\"true\",ma",
"end": 340,
"score": 0.894006609916687,
"start": 335,
"tag": "NAME",
"value": "Harry"
},
{
"context": "e(\"true\",match.matching(\"This is Harry from Us \",\"Harry\"));\n assertTrue(\"true\",match.matching(\"Thi",
"end": 357,
"score": 0.8512753248214722,
"start": 352,
"tag": "NAME",
"value": "Harry"
},
{
"context": "\n assertTrue(\"true\",match.matching(\"This is Harry from Indiana\",\"Harry\"));\n }\n\n @Test\n pub",
"end": 417,
"score": 0.9187453985214233,
"start": 412,
"tag": "NAME",
"value": "Harry"
},
{
"context": "rue\",match.matching(\"This is Harry from Indiana\",\"Harry\"));\n }\n\n @Test\n public void checkForNotN",
"end": 438,
"score": 0.8002469539642334,
"start": 433,
"tag": "NAME",
"value": "Harry"
},
{
"context": " assertNotNull(\"its not null\",match.matching(\"its Harry\",\"Harry\"));\n //assertNull(\"its null\",",
"end": 579,
"score": 0.8381045460700989,
"start": 578,
"tag": "NAME",
"value": "H"
},
{
"context": "otNull(\"its not null\",match.matching(\"its Harry\",\"Harry\"));\n //assertNull(\"its null\",match.matchi",
"end": 591,
"score": 0.8424289226531982,
"start": 586,
"tag": "NAME",
"value": "Harry"
},
{
"context": " //assertNull(\"its null\",match.matching(s,\"Harry\"));\n\n\n }\n}",
"end": 652,
"score": 0.7854301929473877,
"start": 647,
"tag": "NAME",
"value": "Harry"
}
]
| null | []
| package com.stackroute.unittest.pe4;
import org.junit.Test;
import static org.junit.Assert.*;
public class RegexMatchingTest {
RegexMatching match = new RegexMatching();
@Test
public void matching() {
assertTrue("true",match.matching("This is Harry","Harry"));
assertTrue("true",match.matching("This is Harry from Us ","Harry"));
assertTrue("true",match.matching("This is Harry from Indiana","Harry"));
}
@Test
public void checkForNotNull() {
String s = null;
assertNotNull("its not null",match.matching("its Harry","Harry"));
//assertNull("its null",match.matching(s,"Harry"));
}
} | 666 | 0.645646 | 0.644144 | 25 | 25.68 | 26.878571 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.8 | false | false | 9 |
95b2e5f8561bd6608e49bc27ebdd0d4386bb2e80 | 25,795,573,615,498 | 89040b40fbc5b6e96c87c88fe984ce071ed3a858 | /src/com/wangrollin/qqtang/element/Ball.java | 3cabd8e773535bf55e13c721ff0d1db00b382942 | []
| no_license | userdong1997/QQTang4.0 | https://github.com/userdong1997/QQTang4.0 | ffcf9f1ffdd93f1e19787a615368a72e8adf4333 | 79669b0d3af6ffad08396acce9c7f2e06be345ed | refs/heads/master | 2022-12-03T15:06:51.788000 | 2020-08-21T09:01:17 | 2020-08-21T09:01:17 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.wangrollin.qqtang.element;
import com.wangrollin.qqtang.player.Player;
import javax.swing.*;
public class Ball {
//哪个格子
private int heng, shu;
//威力大小
private int power;
//炸弹计时
private int timeCounter = 0;
//不爆炸的时间
private static final int MAX_TIME = 500;
//动态图
private ImageIcon ballIcon;
//谁放的
private Player player;
//事先预警
private Explosion just;
private Maps maps;
public Ball(Player player, int heng, int shu, int power, ImageIcon icon, Maps maps) {
this.player = player;
player.incUsedBallCount();
this.heng = heng;
this.shu = shu;
this.power = power;
this.ballIcon = icon;
this.maps = maps;
//maps.setBall(this);
this.just = maps.getExplosion(heng, shu);
}
public int getPower() {
return power;
}
public ImageIcon getBallIcon() {
return ballIcon;
}
public int getHeng() {
return heng;
}
public int getShu() {
return shu;
}
public void addTime() {
timeCounter += 1;
if (timeCounter == MAX_TIME
|| (maps.isExplosion(heng, shu) && just != maps.getExplosion(heng, shu))) {
booit();
removeBallSelf();
}
}
private void booit() {
MusicTool.BALL_EXPLODE.play();
//maps.getExplosionMap()[heng][shu] = new Explosion(heng, shu, "oo", maps);
maps.setExplosion(new Explosion(heng, shu, "oo", maps));
//0能炸过去 1遇到了墙能炸碎 2遇到了便边界 或者炸不碎的墙
//s
for (int i = 1; i <= power; i++) {
if (canExplodeDown(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng, shu + i, "s", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng, shu + i, "zs", maps));
}
maps.removeItem(heng, shu + i);
}
if (canExplodeDown(i) == 1) {
maps.getWall(heng, shu + i).beRuined();
maps.setExplosion(new Explosion(heng, shu + i, "ss", maps));
break;
}
if (canExplodeDown(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng, shu + i - 1, "zs", maps));
}
break;
}
}
//w
for (int i = 1; i <= power; i++) {
if (canExplodeUp(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng, shu - i, "w", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng, shu - i, "zw", maps));
}
maps.removeItem(heng, shu - i);
}
if (canExplodeUp(i) == 1) {
maps.getWall(heng, shu - i).beRuined();
maps.setExplosion(new Explosion(heng, shu - i, "sw", maps));
break;
}
if (canExplodeUp(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng, shu - i + 1, "zw", maps));
}
break;
}
}
//a
for (int i = 1; i <= power; i++) {
if (canExplodeLeft(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng - i, shu, "a", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng - i, shu, "za", maps));
}
maps.removeItem(heng - i, shu);
}
if (canExplodeLeft(i) == 1) {
maps.getWall(heng - i, shu).beRuined();
maps.setExplosion(new Explosion(heng - i, shu, "sa", maps));
break;
}
if (canExplodeLeft(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng - i + 1, shu, "za", maps));
}
break;
}
}
//d
for (int i = 1; i <= power; i++) {
if (canExplodeRight(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng + i, shu, "d", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng + i, shu, "zd", maps));
}
maps.removeItem(heng + i, shu);
}
if (canExplodeRight(i) == 1) {
maps.getWall(heng + i, shu).beRuined();
maps.setExplosion(new Explosion(heng + i, shu, "sd", maps));
break;
}
if (canExplodeRight(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng + i - 1, shu, "zd", maps));
}
break;
}
}
}
private void removeBallSelf() {
this.maps.removeBall(heng, shu);
this.player.decUsedBallCount();
}
//返回 int 0能炸过去 1遇到了墙能炸碎 2遇到了便边界 或者炸不碎的墙
private int canExplodeUp(int i) {
if (shu - i >= 0 && (!maps.isWall(heng, shu - i)))
return 0;
else if (shu - i >= 0 && maps.isWall(heng, shu - i) && maps.getWall(heng, shu - i).isBreakable())
return 1;
else
return 2;
}
private int canExplodeDown(int i) { //墙 和边界
if (shu + i <= 7 && (!maps.isWall(heng, shu + i)))
return 0;
else if (shu + i <= 7 && maps.isWall(heng, shu + i) && maps.getWall(heng, shu + i).isBreakable())
return 1;
else
return 2;
}
private int canExplodeLeft(int i) {
if (heng - i >= 0 && (!maps.isWall(heng - i, shu)))
return 0;
else if (heng - i >= 0 && maps.isWall(heng - i, shu) && maps.getWall(heng - i, shu).isBreakable())
return 1;
else
return 2;
}
private int canExplodeRight(int i) {
if (heng + i <= 12 && (!maps.isWall(heng + i, shu)))
return 0;
else if (heng + i <= 12 && maps.isWall(heng + i, shu) && maps.getWall(heng + i, shu).isBreakable())
return 1;
else
return 2;
}
}
| UTF-8 | Java | 6,537 | java | Ball.java | Java | []
| null | []
| package com.wangrollin.qqtang.element;
import com.wangrollin.qqtang.player.Player;
import javax.swing.*;
public class Ball {
//哪个格子
private int heng, shu;
//威力大小
private int power;
//炸弹计时
private int timeCounter = 0;
//不爆炸的时间
private static final int MAX_TIME = 500;
//动态图
private ImageIcon ballIcon;
//谁放的
private Player player;
//事先预警
private Explosion just;
private Maps maps;
public Ball(Player player, int heng, int shu, int power, ImageIcon icon, Maps maps) {
this.player = player;
player.incUsedBallCount();
this.heng = heng;
this.shu = shu;
this.power = power;
this.ballIcon = icon;
this.maps = maps;
//maps.setBall(this);
this.just = maps.getExplosion(heng, shu);
}
public int getPower() {
return power;
}
public ImageIcon getBallIcon() {
return ballIcon;
}
public int getHeng() {
return heng;
}
public int getShu() {
return shu;
}
public void addTime() {
timeCounter += 1;
if (timeCounter == MAX_TIME
|| (maps.isExplosion(heng, shu) && just != maps.getExplosion(heng, shu))) {
booit();
removeBallSelf();
}
}
private void booit() {
MusicTool.BALL_EXPLODE.play();
//maps.getExplosionMap()[heng][shu] = new Explosion(heng, shu, "oo", maps);
maps.setExplosion(new Explosion(heng, shu, "oo", maps));
//0能炸过去 1遇到了墙能炸碎 2遇到了便边界 或者炸不碎的墙
//s
for (int i = 1; i <= power; i++) {
if (canExplodeDown(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng, shu + i, "s", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng, shu + i, "zs", maps));
}
maps.removeItem(heng, shu + i);
}
if (canExplodeDown(i) == 1) {
maps.getWall(heng, shu + i).beRuined();
maps.setExplosion(new Explosion(heng, shu + i, "ss", maps));
break;
}
if (canExplodeDown(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng, shu + i - 1, "zs", maps));
}
break;
}
}
//w
for (int i = 1; i <= power; i++) {
if (canExplodeUp(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng, shu - i, "w", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng, shu - i, "zw", maps));
}
maps.removeItem(heng, shu - i);
}
if (canExplodeUp(i) == 1) {
maps.getWall(heng, shu - i).beRuined();
maps.setExplosion(new Explosion(heng, shu - i, "sw", maps));
break;
}
if (canExplodeUp(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng, shu - i + 1, "zw", maps));
}
break;
}
}
//a
for (int i = 1; i <= power; i++) {
if (canExplodeLeft(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng - i, shu, "a", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng - i, shu, "za", maps));
}
maps.removeItem(heng - i, shu);
}
if (canExplodeLeft(i) == 1) {
maps.getWall(heng - i, shu).beRuined();
maps.setExplosion(new Explosion(heng - i, shu, "sa", maps));
break;
}
if (canExplodeLeft(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng - i + 1, shu, "za", maps));
}
break;
}
}
//d
for (int i = 1; i <= power; i++) {
if (canExplodeRight(i) == 0) {
if (i == power) {
maps.setExplosion(new Explosion(heng + i, shu, "d", maps));
}
if (i != power) {
maps.setExplosion(new Explosion(heng + i, shu, "zd", maps));
}
maps.removeItem(heng + i, shu);
}
if (canExplodeRight(i) == 1) {
maps.getWall(heng + i, shu).beRuined();
maps.setExplosion(new Explosion(heng + i, shu, "sd", maps));
break;
}
if (canExplodeRight(i) == 2) {
if (i != 1) {
maps.setExplosion(new Explosion(heng + i - 1, shu, "zd", maps));
}
break;
}
}
}
private void removeBallSelf() {
this.maps.removeBall(heng, shu);
this.player.decUsedBallCount();
}
//返回 int 0能炸过去 1遇到了墙能炸碎 2遇到了便边界 或者炸不碎的墙
private int canExplodeUp(int i) {
if (shu - i >= 0 && (!maps.isWall(heng, shu - i)))
return 0;
else if (shu - i >= 0 && maps.isWall(heng, shu - i) && maps.getWall(heng, shu - i).isBreakable())
return 1;
else
return 2;
}
private int canExplodeDown(int i) { //墙 和边界
if (shu + i <= 7 && (!maps.isWall(heng, shu + i)))
return 0;
else if (shu + i <= 7 && maps.isWall(heng, shu + i) && maps.getWall(heng, shu + i).isBreakable())
return 1;
else
return 2;
}
private int canExplodeLeft(int i) {
if (heng - i >= 0 && (!maps.isWall(heng - i, shu)))
return 0;
else if (heng - i >= 0 && maps.isWall(heng - i, shu) && maps.getWall(heng - i, shu).isBreakable())
return 1;
else
return 2;
}
private int canExplodeRight(int i) {
if (heng + i <= 12 && (!maps.isWall(heng + i, shu)))
return 0;
else if (heng + i <= 12 && maps.isWall(heng + i, shu) && maps.getWall(heng + i, shu).isBreakable())
return 1;
else
return 2;
}
}
| 6,537 | 0.443747 | 0.434803 | 208 | 29.639423 | 24.951294 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.817308 | false | false | 9 |
2c86653e6ec21122707361e1d37daae78c612fe9 | 25,795,573,613,524 | 78b0d70c825cfc8b91c750a9f56cdd78da456257 | /SpringWithObjectMapper/src/main/java/com/programsji/config/ServletConfig.java | e7f96770d09692fdd9db0545e6398122453ec459 | []
| no_license | rejwan052/smallExamples | https://github.com/rejwan052/smallExamples | 5be6365cc3a356d95580151bf27197e299576fd8 | e01e899cf4ff5392e12bb654cfe38620a92e1221 | refs/heads/master | 2021-06-21T15:36:57.038000 | 2017-08-02T08:11:49 | 2017-08-02T08:11:49 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.programsji.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
@EnableWebMvc
@ComponentScan({ "com.programsji" })
public class ServletConfig extends WebMvcConfigurerAdapter {
@Bean
public InternalResourceViewResolver internalResourceViewResolver() {
InternalResourceViewResolver internalResourceViewResolver = new InternalResourceViewResolver();
internalResourceViewResolver.setRedirectHttp10Compatible(false);
internalResourceViewResolver.setOrder(1);
internalResourceViewResolver.setPrefix("/WEB-INF/pages/");
internalResourceViewResolver.setSuffix(".jsp");
return internalResourceViewResolver;
}
}
| UTF-8 | Java | 1,083 | java | ServletConfig.java | Java | []
| null | []
| package com.programsji.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
@EnableWebMvc
@ComponentScan({ "com.programsji" })
public class ServletConfig extends WebMvcConfigurerAdapter {
@Bean
public InternalResourceViewResolver internalResourceViewResolver() {
InternalResourceViewResolver internalResourceViewResolver = new InternalResourceViewResolver();
internalResourceViewResolver.setRedirectHttp10Compatible(false);
internalResourceViewResolver.setOrder(1);
internalResourceViewResolver.setPrefix("/WEB-INF/pages/");
internalResourceViewResolver.setSuffix(".jsp");
return internalResourceViewResolver;
}
}
| 1,083 | 0.857802 | 0.855032 | 26 | 40.653847 | 30.208178 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.115385 | false | false | 9 |
8c999508d06b747d54a426a4092ab2cf9b1b3fe7 | 36,344,013,280,780 | f322db4dbee2abbe280bcc89be75322aa018432f | /module_main/src/main/java/com/wss/module/main/ui/page/navigation/bean/City.java | 8634eb46d30d397f68690cd07d06152a814b0d35 | []
| no_license | wutq/AndroidModuleDemo | https://github.com/wutq/AndroidModuleDemo | fdf8a40a84e5d0ebf6e99a374f16b5b627b803c9 | ad8b78174d24dbb5432bc4c3a01c1c72b6c91bfa | refs/heads/master | 2022-01-31T04:07:45.634000 | 2022-01-19T09:18:56 | 2022-01-19T09:18:56 | 153,975,934 | 404 | 103 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.wss.module.main.ui.page.navigation.bean;
import com.wss.common.base.bean.BaseBean;
import lombok.Getter;
import lombok.Setter;
/**
* Describe:城市
* Created by 吴天强 on 2020/8/20.
*/
@Getter
@Setter
public class City extends BaseBean {
private String initials;
private String name;
public City(String initials, String name) {
this.initials = initials;
this.name = name;
}
@Override
public String toString() {
return "City{" +
"initials='" + initials + '\'' +
", name='" + name + '\'' +
'}';
}
}
| UTF-8 | Java | 624 | java | City.java | Java | [
{
"context": " lombok.Setter;\n\n/**\n * Describe:城市\n * Created by 吴天强 on 2020/8/20.\n */\n@Getter\n@Setter\npublic class Ci",
"end": 178,
"score": 0.9997742772102356,
"start": 175,
"tag": "NAME",
"value": "吴天强"
}
]
| null | []
| package com.wss.module.main.ui.page.navigation.bean;
import com.wss.common.base.bean.BaseBean;
import lombok.Getter;
import lombok.Setter;
/**
* Describe:城市
* Created by 吴天强 on 2020/8/20.
*/
@Getter
@Setter
public class City extends BaseBean {
private String initials;
private String name;
public City(String initials, String name) {
this.initials = initials;
this.name = name;
}
@Override
public String toString() {
return "City{" +
"initials='" + initials + '\'' +
", name='" + name + '\'' +
'}';
}
}
| 624 | 0.575163 | 0.563725 | 31 | 18.741936 | 16.455154 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.354839 | false | false | 9 |
8101574b85912d435a717bede9ade33078fe986a | 25,185,688,286,847 | f30590c45e647823d920f6d5761f920533251b6d | /hadoop/mapreduce-api/src/main/java/com/mapreduce/join/reducejoin/TableBean.java | dddabd3b38f6667fd682af191ecc9648b9a270c2 | []
| no_license | hengyufxh1/hadoop | https://github.com/hengyufxh1/hadoop | e8bf49185777350bf0b239d33b9fb8c311274c44 | 7439c514531937282606ffa937a41fc0a218c592 | refs/heads/master | 2022-07-08T23:29:47.908000 | 2020-10-30T09:52:14 | 2020-10-30T09:52:14 | 193,515,306 | 0 | 0 | null | false | 2022-06-17T02:28:49 | 2019-06-24T13:53:12 | 2020-10-30T09:52:18 | 2022-06-17T02:28:47 | 1,200 | 0 | 0 | 14 | Java | false | false | package com.mapreduce.join.reducejoin;
import lombok.Getter;
import lombok.Setter;
import org.apache.hadoop.io.Writable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
/**
* $功能描述: TableBean
*
* @author :smart-dxw
* @version : 2019/6/17 20:12 v1.0
*/
@Getter
@Setter
public class TableBean implements Writable {
// 订单id
private String order_id;
// 产品id
private String p_id;
// 产品数量
private int amount;
// 产品名称
private String pname;
// 表的标记
private String flag;
public TableBean() {
}
@Override
public void write(DataOutput dataOutput) throws IOException {
dataOutput.writeUTF(this.order_id);
dataOutput.writeUTF(this.p_id);
dataOutput.writeInt(this.amount);
dataOutput.writeUTF(this.pname);
dataOutput.writeUTF(this.flag);
}
@Override
public void readFields(DataInput dataInput) throws IOException {
this.order_id = dataInput.readUTF();
this.p_id = dataInput.readUTF();
this.amount = dataInput.readInt();
this.pname = dataInput.readUTF();
this.flag = dataInput.readUTF();
}
@Override
public String toString() {
return order_id +"\t" + p_id + "\t" + amount +"\t" + pname;
}
}
| UTF-8 | Java | 1,345 | java | TableBean.java | Java | [
{
"context": "xception;\n\n/**\n * $功能描述: TableBean\n *\n * @author :smart-dxw\n * @version : 2019/6/17 20:12 v1.0\n */\n\n@Getter\n@",
"end": 253,
"score": 0.9996759295463562,
"start": 244,
"tag": "USERNAME",
"value": "smart-dxw"
}
]
| null | []
| package com.mapreduce.join.reducejoin;
import lombok.Getter;
import lombok.Setter;
import org.apache.hadoop.io.Writable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
/**
* $功能描述: TableBean
*
* @author :smart-dxw
* @version : 2019/6/17 20:12 v1.0
*/
@Getter
@Setter
public class TableBean implements Writable {
// 订单id
private String order_id;
// 产品id
private String p_id;
// 产品数量
private int amount;
// 产品名称
private String pname;
// 表的标记
private String flag;
public TableBean() {
}
@Override
public void write(DataOutput dataOutput) throws IOException {
dataOutput.writeUTF(this.order_id);
dataOutput.writeUTF(this.p_id);
dataOutput.writeInt(this.amount);
dataOutput.writeUTF(this.pname);
dataOutput.writeUTF(this.flag);
}
@Override
public void readFields(DataInput dataInput) throws IOException {
this.order_id = dataInput.readUTF();
this.p_id = dataInput.readUTF();
this.amount = dataInput.readInt();
this.pname = dataInput.readUTF();
this.flag = dataInput.readUTF();
}
@Override
public String toString() {
return order_id +"\t" + p_id + "\t" + amount +"\t" + pname;
}
}
| 1,345 | 0.636644 | 0.626636 | 59 | 21.016949 | 18.339077 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.38983 | false | false | 9 |
de1ba33c4182f9baa66b2cca37cdc081bde1c72a | 25,022,479,513,449 | 1ec83af19efad872e6b3050c99ba46bc77b0e1f0 | /component/common/src/main/java/com/ycg/ksh/common/extend/spring/DateStringFormatter.java | 1ee5bed01cd2b4e397a0a258d5e8adf83e4dd0d1 | []
| no_license | amao886/QRTMS | https://github.com/amao886/QRTMS | 8e306d1493a2f29ecca1ea3aeb666347d12f58fa | c781eef8850304e1a58414ff77e3ac6437c421a8 | refs/heads/master | 2022-03-05T20:17:52.135000 | 2020-06-30T10:29:36 | 2020-06-30T10:29:36 | 191,539,553 | 0 | 2 | null | false | 2022-02-09T23:52:20 | 2019-06-12T09:23:59 | 2020-06-30T10:30:27 | 2022-02-09T23:52:19 | 23,633 | 0 | 2 | 19 | JavaScript | false | false | package com.ycg.ksh.common.extend.spring;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.format.Formatter;
import java.text.ParseException;
import java.util.Date;
import java.util.Locale;
/**
* 日期时间和字符串双向转换
* <p>
* @developer Create by <a href="mailto:110686@ycgwl.com">dingxf</a> at 2017-06-14 16:12:14
*/
public class DateStringFormatter implements Formatter<java.util.Date> {
protected final Logger logger = LoggerFactory.getLogger(getClass());
private String pattern;
private String[] patterns = new String[]{ "yyyy-MM-dd", "yyyy-MM-dd HH", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mm:ss" };
public DateStringFormatter(String pattern) {
super();
this.pattern = pattern;
}
/*
* <p>将时间转换成字符串</p>
* @param object 日期时间
* @param locale
* @return 格式化之后的日期时间字符串
* @see org.springframework.format.Printer#print(java.lang.Object, java.util.Locale)
*/
@Override
public String print(Date object, Locale locale) {
String dateString = null;
try {
dateString = DateFormatUtils.format(object, pattern, locale);
logger.info("Date to String [{}] -> [{}]", object, dateString);
} catch (Exception e) {
logger.error("Date to String [{}]", object, e);
}
return dateString;
}
/*
* <p>将字符串转换成时间</p>
* @param text 时间日期字符串
* @param locale
* @return 转换后的时间对象
* @throws ParseException
* @see org.springframework.format.Parser#parse(java.lang.String, java.util.Locale)
*/
@Override
public Date parse(String text, Locale locale) throws ParseException {
Date date = null;
try {
date = DateUtils.parseDateStrictly(text, patterns);
logger.info("String to Date [{}] -> [{}]", text, date);
} catch (Exception e) {
logger.error("String to Date [{}]", text, e);
}
return date;
}
}
| UTF-8 | Java | 2,019 | java | DateStringFormatter.java | Java | [
{
"context": "转换\n * <p>\n * @developer Create by <a href=\"mailto:110686@ycgwl.com\">dingxf</a> at 2017-06-14 16:12:14\n */\npublic cla",
"end": 411,
"score": 0.9999217987060547,
"start": 395,
"tag": "EMAIL",
"value": "110686@ycgwl.com"
},
{
"context": "loper Create by <a href=\"mailto:110686@ycgwl.com\">dingxf</a> at 2017-06-14 16:12:14\n */\npublic class DateS",
"end": 419,
"score": 0.9044063687324524,
"start": 413,
"tag": "USERNAME",
"value": "dingxf"
}
]
| null | []
| package com.ycg.ksh.common.extend.spring;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.format.Formatter;
import java.text.ParseException;
import java.util.Date;
import java.util.Locale;
/**
* 日期时间和字符串双向转换
* <p>
* @developer Create by <a href="mailto:<EMAIL>">dingxf</a> at 2017-06-14 16:12:14
*/
public class DateStringFormatter implements Formatter<java.util.Date> {
protected final Logger logger = LoggerFactory.getLogger(getClass());
private String pattern;
private String[] patterns = new String[]{ "yyyy-MM-dd", "yyyy-MM-dd HH", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mm:ss" };
public DateStringFormatter(String pattern) {
super();
this.pattern = pattern;
}
/*
* <p>将时间转换成字符串</p>
* @param object 日期时间
* @param locale
* @return 格式化之后的日期时间字符串
* @see org.springframework.format.Printer#print(java.lang.Object, java.util.Locale)
*/
@Override
public String print(Date object, Locale locale) {
String dateString = null;
try {
dateString = DateFormatUtils.format(object, pattern, locale);
logger.info("Date to String [{}] -> [{}]", object, dateString);
} catch (Exception e) {
logger.error("Date to String [{}]", object, e);
}
return dateString;
}
/*
* <p>将字符串转换成时间</p>
* @param text 时间日期字符串
* @param locale
* @return 转换后的时间对象
* @throws ParseException
* @see org.springframework.format.Parser#parse(java.lang.String, java.util.Locale)
*/
@Override
public Date parse(String text, Locale locale) throws ParseException {
Date date = null;
try {
date = DateUtils.parseDateStrictly(text, patterns);
logger.info("String to Date [{}] -> [{}]", text, date);
} catch (Exception e) {
logger.error("String to Date [{}]", text, e);
}
return date;
}
}
| 2,010 | 0.688654 | 0.677045 | 70 | 26.071428 | 26.622396 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.614286 | false | false | 9 |
e8f8aa65bc9f856eb68d03099afe93bff9b3e63a | 1,082,331,794,953 | 8e3def56041d9794b28970d938d9cb6a46ac9850 | /backup/TFSMaster.java | 48d272c10ee638e060f3ceeeb680ef28c269642b | []
| no_license | dmaulik/TFS | https://github.com/dmaulik/TFS | 91a1422e390c573214102d731fa805244f6403c8 | d3b9b4de3920b587b9f8c1c648d6b67122aa0c03 | refs/heads/master | 2021-01-10T19:19:05.768000 | 2014-04-28T20:15:43 | 2014-04-28T20:15:43 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package TFS;
import java.util.*;
import java.util.List;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
public class TFSMaster implements Serializable{
private ObjectOutputStream outputToClient;
private ObjectInputStream inputFromClient;
private PrintWriter pw;
private BufferedReader br;
private ServerSocket serverSocket;
public MyObject obj;
//array of clients
private TreeMap<Integer, HandleAClient> clients = new TreeMap<Integer, HandleAClient>();
private int numOfChunkservers = 4;
public int chunkSize = 64;
public int chunkRobin = 0;
public Sequence counter = new Sequence();
private Map<Integer, TFSChunkserver> chunkserverTable; // Map chunkloc id to chunkserver id
private Map<String, List<Integer>> fileTable; // Map filename to chunk ids
private Map<Integer, Integer> chunkTable; // Map chunk id to chunkloc id
private Map<String, Integer> folderTable; // Map foldername to chunkloc id
private List<String> folderList;
//public static void main(String[] args) throws IOException{
// new TFSMaster();
//}
public TFSMaster() throws IOException {
obj = new MyObject();
fileTable = new HashMap<String, List<Integer>>();
chunkserverTable = new HashMap<Integer, TFSChunkserver>();
chunkTable = new HashMap<Integer, Integer>();
folderList = new ArrayList<String>();
folderTable = new HashMap<String,Integer>();
for(int i = 0; i < this.numOfChunkservers; i++){
TFSChunkserver cs = new TFSChunkserver(""+i);
chunkserverTable.put (i, cs);
}
//Populate files
String line = "";
BufferedReader br = new BufferedReader(new FileReader("config.csv"));
line = br.readLine();
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
List<Integer> IDs = new ArrayList<Integer>();
for(int i= 1; i<filenames.length ; i++){
IDs.add(Integer.parseInt(filenames[i]));
}
fileTable.put(filenames[0], IDs);
}
br.close();
//Populate folders
line = "";
br = new BufferedReader(new FileReader("dirconfig.csv"));
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
folderList.add(filenames[0]);
folderTable.put(filenames[0], Integer.parseInt(filenames[1]));
}
br.close();
//Populate chunkID -> chunkLoc mapping
line = "";
br = new BufferedReader(new FileReader("chconfig.csv"));
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
chunkTable.put(Integer.parseInt(filenames[0]), Integer.parseInt(filenames[1]));
int i = counter.nextValue(); //so that chunkID are still unique
}
br.close();
//Start the server
/*
try{
serverSocket = new ServerSocket(7500);
System.out.println("Server started");
}
catch(Exception ex){
ex.printStackTrace();
System.exit(0);
}*/
//Wait for Clients
/*
try{
while(true){
Socket socket = serverSocket.accept();
System.out.println("Got client");
//create an input stream and an output stream from the socket
outputToClient = new ObjectOutputStream(socket.getOutputStream());
inputFromClient = new ObjectInputStream(socket.getInputStream());
try{
Integer clientNo = (Integer)inputFromClient.readObject();
System.out.println((Integer)clientNo);
switch(clientNo){
//Client
case 0://TODO
//ChunkServers
case 1: ChunkServerHandler csHandler = new ChunkServerHandler(socket, this);
clients.put(clientNo,csHandler);
new Thread(csHandler).start();
break;
/*
case 2: KitsManagerHandler kitsManHandler = new KitsManagerHandler(socket, this);
clients.put(clientNo,kitsManHandler);
new Thread(kitsManHandler).start();
break;
case 3: FactoryProductionHandler factoryProdHandler = new FactoryProductionHandler(socket, this);
clients.put(clientNo,factoryProdHandler);
new Thread(factoryProdHandler).start();
break;
case 4: GantryRobotManHandler gantryRobotHandler = new GantryRobotManHandler(socket, this);
clients.put(clientNo,gantryRobotHandler);
new Thread(gantryRobotHandler).start();
break;
case 5: LaneHandler lanehandler = new LaneHandler(socket,this);
clients.put(clientNo, lanehandler);
new Thread(lanehandler).start();
break;
case 6: PandKHandler pandkHandler = new PandKHandler(socket,this);
clients.put(clientNo, pandkHandler);
new Thread(pandkHandler).start();
break;
default:
}
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
catch(IOException ex){
ex.printStackTrace();
}*/
}
protected Map getServers(){
return this.chunkserverTable;
}
protected List<String> folderInDirectory(String folderName){
List<String>arr = new ArrayList<String>();
for(int i = 0; i < folderList.size(); i++){
String name = folderList.get(i);
if(folderName.length() < name.length()){
if(folderName.equals(name.substring(0, folderName.length()))){
arr.add(name);
}
}
}
return arr;
}
protected void allocateFolder(String folderName) throws IOException{
int serverloc = chunkRobin;
chunkRobin = (chunkRobin +1)%numOfChunkservers;
folderList.add(folderName);
folderTable.put(folderName, serverloc);
System.out.println(folderName + " is created");
FileWriter fw = new FileWriter("dirconfig.csv", true);
String s = folderName + "," + serverloc + "\r\n";
fw.append(s);
fw.flush();
fw.close();
}
protected List allocate(String filename, int numChunks) throws IOException{
FileWriter fw = new FileWriter("config.csv", true);
List<Integer> chunkuuids = allocateChunks(numChunks);
fileTable.put (filename, chunkuuids);
System.out.println(filename + " is created");
String s = "\r\n" + filename;
for(int i = 0; i < chunkuuids.size(); i++){
s += "," + chunkuuids.get(i);
}
fw.append(s);
fw.flush();
fw.close();
return chunkuuids;
}
protected List allocateChunks(int numChunks) throws IOException{
List<Integer> chunkuuids = new ArrayList<Integer>();
FileWriter fw = new FileWriter("chconfig.csv", true);
String s = "";
for(int i = 0; i < numChunks; i++){
int chunkuuid = counter.nextValue();
int chunkloc = chunkRobin;
chunkTable.put (chunkuuid, chunkloc);
chunkuuids.add(chunkuuid);
chunkRobin = (chunkRobin +1)%numOfChunkservers;
s += chunkuuid + "," + chunkloc + "\r\n";
fw.flush();
}
fw.append(s);
fw.flush();
fw.close();
return chunkuuids;
}
protected List alloc_append(String filename, int numChunks) throws IOException{
List<Integer> uuids = this.fileTable.get(filename);
List<Integer> append_uuids = allocateChunks(numChunks);
uuids.addAll(append_uuids);
//Modify the config file
/*
String line = "";
BufferedReader br = new BufferedReader(new FileReader("config.csv"));
line = br.readLine();
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
if(filenames[0].equals(filename)){
for(int i = 0; i<append_uuids.size(); i++){
line += "," + append_uuids.get(i);
}
}
}
br.close();
*/
//FIX Filetable
fileTable.remove(filename);
fileTable.put(filename, uuids);
//Rewrite config.csv
File f = new File("config.csv");
f.delete();
f.createNewFile();
FileWriter fw = new FileWriter(f);
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
String s = "\r\n" + e.getKey();
for(int i = 0; i < e.getValue().size(); i++){
s += "," + e.getValue().get(i);
}
fw.append(s);
fw.flush();
}
fw.close();
return append_uuids;
}
protected int getLocation(int uuid){
return this.chunkTable.get(uuid);
}
protected int getFolderLocation(String foldername){
return this.folderTable.get(foldername);
}
protected List<Integer> getUUIDS(String filename){
return this.fileTable.get(filename);
}
protected boolean exists(String filename){
return fileTable.containsKey(filename);
}
protected boolean folderExists(String foldername){
return folderTable.containsKey(foldername);
//File dir = new File(foldername);
//return dir.exists();
//return folderList.contains(foldername);
}
protected void deleteDirectory(String folderName) throws IOException{
//System.out.println("Size:"+ folderList.size());
List<String>arr = new ArrayList<String>();
for(int i = 0; i < folderList.size(); i++){
String name = folderList.get(i);
if(folderName.length() <= name.length()){
//System.out.println("Foldername: " + folderName);
//System.out.println("Ss: " + name.substring(0, folderName.length()));
if(folderName.equals(name.substring(0, folderName.length()))){
arr.add(name);
}
}
}
for (int i = 0; i < arr.size(); i++){
System.out.println("Deleting: " + arr.get(i));
folderList.remove(arr.get(i));
folderTable.remove(arr.get(i));
}
File f = new File("dirconfig.csv");
f.delete();
f.createNewFile();
FileWriter fw = new FileWriter(f);
for(int i =0; i< folderList.size(); i++){
String s = folderList.get(i) + "," + folderTable.get(folderList.get(i)) + "\r\n";
fw.append(s);
fw.flush();
}
fw.close();
List<String>temp = new ArrayList<String>();
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
if(folderName.equals(e.getKey().substring(0, folderName.length()))){
temp.add(e.getKey());
}
}
for(int i=0; i< temp.size(); i++){
System.out.println("Deleting: " + temp.get(i));
delete(temp.get(i));
}
}
protected void delete(String filename) throws IOException{
List<Integer> uuids = this.fileTable.get(filename);
this.fileTable.remove(filename);
//remove chconfig log
File f0 = new File("chconfig.csv");
f0.delete();
f0.createNewFile();
FileWriter fw0 = new FileWriter("chconfig.csv", true);
String s0 = "";
for(int i=0 ; i<uuids.size(); i++){
int chunkLoc = chunkTable.get(uuids.get(i));
TFSChunkserver cs = chunkserverTable.get(chunkLoc);
cs.removeChunk(uuids.get(i));
chunkTable.remove(uuids.get(i));
}
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
s0 += e.getKey() + "," + e.getValue() + "\r\n";
fw0.append(s0);
fw0.flush();
}
fw0.close();
//remove config log
File f = new File("config.csv");
f.delete();
f.createNewFile();
FileWriter fw = new FileWriter(f);
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
String s = "\r\n" + e.getKey();
for(int i = 0; i < e.getValue().size(); i++){
s += "," + e.getValue().get(i);
}
fw.append(s);
fw.flush();
}
fw.close();
//Date date= new java.util.Date();
//Timestamp ts = new Timestamp(date.getTime());
//String deleted_filename = "/hidden/deleted/" + ts + filename;
//fileTable.put(deleted_filename, uuids);
//System.out.println("Deleted file: " + filename + " renamed to " + deleted_filename + " ready for gc ");
}
/*
public void dump_metadata() throws IOException{
System.out.println("Filetable: ");
for(Map.Entry entry : fileTable.entrySet()){
System.out.println(entry.getKey().toString() + entry.getValue().toString()); // ?????
}
System.out.println("Chunkservers: " + chunkserverTable.size());
System.out.println("Chunkserver Data: ");
for(Map.Entry entry : chunkTable.entrySet()){
int chunkLoc = (int)(entry.getValue());
int chunkID = (int)(entry.getKey());
String ch = chunkserverTable.get(chunkLoc).read(chunkID);
System.out.println(" "+ entry.getValue().toString() + ", " + entry.getKey().toString() + "," + ch);// prints chunkLoc, chunkID, ch
}
}*/
public ObjectOutputStream getOutput(){
return outputToClient;
}
public ObjectInputStream getInput(){
return inputFromClient;
}
}
| UTF-8 | Java | 13,656 | java | TFSMaster.java | Java | []
| null | []
| package TFS;
import java.util.*;
import java.util.List;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
public class TFSMaster implements Serializable{
private ObjectOutputStream outputToClient;
private ObjectInputStream inputFromClient;
private PrintWriter pw;
private BufferedReader br;
private ServerSocket serverSocket;
public MyObject obj;
//array of clients
private TreeMap<Integer, HandleAClient> clients = new TreeMap<Integer, HandleAClient>();
private int numOfChunkservers = 4;
public int chunkSize = 64;
public int chunkRobin = 0;
public Sequence counter = new Sequence();
private Map<Integer, TFSChunkserver> chunkserverTable; // Map chunkloc id to chunkserver id
private Map<String, List<Integer>> fileTable; // Map filename to chunk ids
private Map<Integer, Integer> chunkTable; // Map chunk id to chunkloc id
private Map<String, Integer> folderTable; // Map foldername to chunkloc id
private List<String> folderList;
//public static void main(String[] args) throws IOException{
// new TFSMaster();
//}
public TFSMaster() throws IOException {
obj = new MyObject();
fileTable = new HashMap<String, List<Integer>>();
chunkserverTable = new HashMap<Integer, TFSChunkserver>();
chunkTable = new HashMap<Integer, Integer>();
folderList = new ArrayList<String>();
folderTable = new HashMap<String,Integer>();
for(int i = 0; i < this.numOfChunkservers; i++){
TFSChunkserver cs = new TFSChunkserver(""+i);
chunkserverTable.put (i, cs);
}
//Populate files
String line = "";
BufferedReader br = new BufferedReader(new FileReader("config.csv"));
line = br.readLine();
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
List<Integer> IDs = new ArrayList<Integer>();
for(int i= 1; i<filenames.length ; i++){
IDs.add(Integer.parseInt(filenames[i]));
}
fileTable.put(filenames[0], IDs);
}
br.close();
//Populate folders
line = "";
br = new BufferedReader(new FileReader("dirconfig.csv"));
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
folderList.add(filenames[0]);
folderTable.put(filenames[0], Integer.parseInt(filenames[1]));
}
br.close();
//Populate chunkID -> chunkLoc mapping
line = "";
br = new BufferedReader(new FileReader("chconfig.csv"));
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
chunkTable.put(Integer.parseInt(filenames[0]), Integer.parseInt(filenames[1]));
int i = counter.nextValue(); //so that chunkID are still unique
}
br.close();
//Start the server
/*
try{
serverSocket = new ServerSocket(7500);
System.out.println("Server started");
}
catch(Exception ex){
ex.printStackTrace();
System.exit(0);
}*/
//Wait for Clients
/*
try{
while(true){
Socket socket = serverSocket.accept();
System.out.println("Got client");
//create an input stream and an output stream from the socket
outputToClient = new ObjectOutputStream(socket.getOutputStream());
inputFromClient = new ObjectInputStream(socket.getInputStream());
try{
Integer clientNo = (Integer)inputFromClient.readObject();
System.out.println((Integer)clientNo);
switch(clientNo){
//Client
case 0://TODO
//ChunkServers
case 1: ChunkServerHandler csHandler = new ChunkServerHandler(socket, this);
clients.put(clientNo,csHandler);
new Thread(csHandler).start();
break;
/*
case 2: KitsManagerHandler kitsManHandler = new KitsManagerHandler(socket, this);
clients.put(clientNo,kitsManHandler);
new Thread(kitsManHandler).start();
break;
case 3: FactoryProductionHandler factoryProdHandler = new FactoryProductionHandler(socket, this);
clients.put(clientNo,factoryProdHandler);
new Thread(factoryProdHandler).start();
break;
case 4: GantryRobotManHandler gantryRobotHandler = new GantryRobotManHandler(socket, this);
clients.put(clientNo,gantryRobotHandler);
new Thread(gantryRobotHandler).start();
break;
case 5: LaneHandler lanehandler = new LaneHandler(socket,this);
clients.put(clientNo, lanehandler);
new Thread(lanehandler).start();
break;
case 6: PandKHandler pandkHandler = new PandKHandler(socket,this);
clients.put(clientNo, pandkHandler);
new Thread(pandkHandler).start();
break;
default:
}
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
catch(IOException ex){
ex.printStackTrace();
}*/
}
protected Map getServers(){
return this.chunkserverTable;
}
protected List<String> folderInDirectory(String folderName){
List<String>arr = new ArrayList<String>();
for(int i = 0; i < folderList.size(); i++){
String name = folderList.get(i);
if(folderName.length() < name.length()){
if(folderName.equals(name.substring(0, folderName.length()))){
arr.add(name);
}
}
}
return arr;
}
protected void allocateFolder(String folderName) throws IOException{
int serverloc = chunkRobin;
chunkRobin = (chunkRobin +1)%numOfChunkservers;
folderList.add(folderName);
folderTable.put(folderName, serverloc);
System.out.println(folderName + " is created");
FileWriter fw = new FileWriter("dirconfig.csv", true);
String s = folderName + "," + serverloc + "\r\n";
fw.append(s);
fw.flush();
fw.close();
}
protected List allocate(String filename, int numChunks) throws IOException{
FileWriter fw = new FileWriter("config.csv", true);
List<Integer> chunkuuids = allocateChunks(numChunks);
fileTable.put (filename, chunkuuids);
System.out.println(filename + " is created");
String s = "\r\n" + filename;
for(int i = 0; i < chunkuuids.size(); i++){
s += "," + chunkuuids.get(i);
}
fw.append(s);
fw.flush();
fw.close();
return chunkuuids;
}
protected List allocateChunks(int numChunks) throws IOException{
List<Integer> chunkuuids = new ArrayList<Integer>();
FileWriter fw = new FileWriter("chconfig.csv", true);
String s = "";
for(int i = 0; i < numChunks; i++){
int chunkuuid = counter.nextValue();
int chunkloc = chunkRobin;
chunkTable.put (chunkuuid, chunkloc);
chunkuuids.add(chunkuuid);
chunkRobin = (chunkRobin +1)%numOfChunkservers;
s += chunkuuid + "," + chunkloc + "\r\n";
fw.flush();
}
fw.append(s);
fw.flush();
fw.close();
return chunkuuids;
}
protected List alloc_append(String filename, int numChunks) throws IOException{
List<Integer> uuids = this.fileTable.get(filename);
List<Integer> append_uuids = allocateChunks(numChunks);
uuids.addAll(append_uuids);
//Modify the config file
/*
String line = "";
BufferedReader br = new BufferedReader(new FileReader("config.csv"));
line = br.readLine();
while((line = br.readLine()) != null){
String[] filenames = line.split(",");
if(filenames[0].equals(filename)){
for(int i = 0; i<append_uuids.size(); i++){
line += "," + append_uuids.get(i);
}
}
}
br.close();
*/
//FIX Filetable
fileTable.remove(filename);
fileTable.put(filename, uuids);
//Rewrite config.csv
File f = new File("config.csv");
f.delete();
f.createNewFile();
FileWriter fw = new FileWriter(f);
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
String s = "\r\n" + e.getKey();
for(int i = 0; i < e.getValue().size(); i++){
s += "," + e.getValue().get(i);
}
fw.append(s);
fw.flush();
}
fw.close();
return append_uuids;
}
protected int getLocation(int uuid){
return this.chunkTable.get(uuid);
}
protected int getFolderLocation(String foldername){
return this.folderTable.get(foldername);
}
protected List<Integer> getUUIDS(String filename){
return this.fileTable.get(filename);
}
protected boolean exists(String filename){
return fileTable.containsKey(filename);
}
protected boolean folderExists(String foldername){
return folderTable.containsKey(foldername);
//File dir = new File(foldername);
//return dir.exists();
//return folderList.contains(foldername);
}
protected void deleteDirectory(String folderName) throws IOException{
//System.out.println("Size:"+ folderList.size());
List<String>arr = new ArrayList<String>();
for(int i = 0; i < folderList.size(); i++){
String name = folderList.get(i);
if(folderName.length() <= name.length()){
//System.out.println("Foldername: " + folderName);
//System.out.println("Ss: " + name.substring(0, folderName.length()));
if(folderName.equals(name.substring(0, folderName.length()))){
arr.add(name);
}
}
}
for (int i = 0; i < arr.size(); i++){
System.out.println("Deleting: " + arr.get(i));
folderList.remove(arr.get(i));
folderTable.remove(arr.get(i));
}
File f = new File("dirconfig.csv");
f.delete();
f.createNewFile();
FileWriter fw = new FileWriter(f);
for(int i =0; i< folderList.size(); i++){
String s = folderList.get(i) + "," + folderTable.get(folderList.get(i)) + "\r\n";
fw.append(s);
fw.flush();
}
fw.close();
List<String>temp = new ArrayList<String>();
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
if(folderName.equals(e.getKey().substring(0, folderName.length()))){
temp.add(e.getKey());
}
}
for(int i=0; i< temp.size(); i++){
System.out.println("Deleting: " + temp.get(i));
delete(temp.get(i));
}
}
protected void delete(String filename) throws IOException{
List<Integer> uuids = this.fileTable.get(filename);
this.fileTable.remove(filename);
//remove chconfig log
File f0 = new File("chconfig.csv");
f0.delete();
f0.createNewFile();
FileWriter fw0 = new FileWriter("chconfig.csv", true);
String s0 = "";
for(int i=0 ; i<uuids.size(); i++){
int chunkLoc = chunkTable.get(uuids.get(i));
TFSChunkserver cs = chunkserverTable.get(chunkLoc);
cs.removeChunk(uuids.get(i));
chunkTable.remove(uuids.get(i));
}
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
s0 += e.getKey() + "," + e.getValue() + "\r\n";
fw0.append(s0);
fw0.flush();
}
fw0.close();
//remove config log
File f = new File("config.csv");
f.delete();
f.createNewFile();
FileWriter fw = new FileWriter(f);
for(Map.Entry<String, List<Integer>> e : fileTable.entrySet()){
String s = "\r\n" + e.getKey();
for(int i = 0; i < e.getValue().size(); i++){
s += "," + e.getValue().get(i);
}
fw.append(s);
fw.flush();
}
fw.close();
//Date date= new java.util.Date();
//Timestamp ts = new Timestamp(date.getTime());
//String deleted_filename = "/hidden/deleted/" + ts + filename;
//fileTable.put(deleted_filename, uuids);
//System.out.println("Deleted file: " + filename + " renamed to " + deleted_filename + " ready for gc ");
}
/*
public void dump_metadata() throws IOException{
System.out.println("Filetable: ");
for(Map.Entry entry : fileTable.entrySet()){
System.out.println(entry.getKey().toString() + entry.getValue().toString()); // ?????
}
System.out.println("Chunkservers: " + chunkserverTable.size());
System.out.println("Chunkserver Data: ");
for(Map.Entry entry : chunkTable.entrySet()){
int chunkLoc = (int)(entry.getValue());
int chunkID = (int)(entry.getKey());
String ch = chunkserverTable.get(chunkLoc).read(chunkID);
System.out.println(" "+ entry.getValue().toString() + ", " + entry.getKey().toString() + "," + ch);// prints chunkLoc, chunkID, ch
}
}*/
public ObjectOutputStream getOutput(){
return outputToClient;
}
public ObjectInputStream getInput(){
return inputFromClient;
}
}
| 13,656 | 0.58802 | 0.584212 | 422 | 31.357821 | 23.933308 | 137 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.898104 | false | false | 9 |
21e94ee31e210ab1f2e91dce8ab9bca045a7e22e | 25,692,494,392,806 | 28bbd0650b94ef6866315b3681b2be16eefbff39 | /src/main/java/com/image/service/controller/S3Controller.java | c7b40b4ef84db8b2dda7ecad976076b69844f68a | []
| no_license | arisusantolie/ImageResizingService | https://github.com/arisusantolie/ImageResizingService | e45232a4f3c3b3f3e924a58a9c0cdb7971db137c | e499bad7d4df7215a8af2d187c87f9cad821177c | refs/heads/master | 2023-03-17T23:14:19.585000 | 2018-06-18T09:47:10 | 2018-06-18T09:47:10 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.image.service.controller;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
@RestController
public class S3Controller {
private final static String SOURCE_IMG_BUCKET = "bucket-10/resources/sourceImages";
private final static String RESIZED_IMG_BUCKET = "bucket-10/resources/resizedImages";
private final static String ACCESS_KEY = ""; //put your AWS access key here
private final static String SECRET_KEY = ""; //put your AWS secret key here
private final static String S3_REGION = "eu-west-2";
@PostMapping("/upload")
public String uploadImageFileToS3(@RequestParam("file") MultipartFile file) {
AWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY);
AmazonS3 s3client = AmazonS3Client.builder()
.withRegion(S3_REGION)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
try {
File tmpFile = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + file.getOriginalFilename());
file.transferTo(tmpFile);
//save on s3 with public read access
s3client.putObject(new PutObjectRequest(SOURCE_IMG_BUCKET, file.getOriginalFilename(), tmpFile).withCannedAcl(CannedAccessControlList.PublicRead));
} catch (Exception e) {
e.printStackTrace();
}
return "file uploaded to S3";
}
}
| UTF-8 | Java | 1,947 | java | S3Controller.java | Java | []
| null | []
| package com.image.service.controller;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
@RestController
public class S3Controller {
private final static String SOURCE_IMG_BUCKET = "bucket-10/resources/sourceImages";
private final static String RESIZED_IMG_BUCKET = "bucket-10/resources/resizedImages";
private final static String ACCESS_KEY = ""; //put your AWS access key here
private final static String SECRET_KEY = ""; //put your AWS secret key here
private final static String S3_REGION = "eu-west-2";
@PostMapping("/upload")
public String uploadImageFileToS3(@RequestParam("file") MultipartFile file) {
AWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY);
AmazonS3 s3client = AmazonS3Client.builder()
.withRegion(S3_REGION)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
try {
File tmpFile = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + file.getOriginalFilename());
file.transferTo(tmpFile);
//save on s3 with public read access
s3client.putObject(new PutObjectRequest(SOURCE_IMG_BUCKET, file.getOriginalFilename(), tmpFile).withCannedAcl(CannedAccessControlList.PublicRead));
} catch (Exception e) {
e.printStackTrace();
}
return "file uploaded to S3";
}
}
| 1,947 | 0.727273 | 0.717 | 48 | 39.5625 | 36.371868 | 159 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5625 | false | false | 9 |
9aa6aae7581066fc798bf6d863210c4fd23c5ca9 | 34,703,335,779,677 | a0a601d62fd1243008ef288a4bf495646e789cf5 | /INMETData/src/main/java/br/embrapa/cnpaf/inmetdata/entity/InmetHourlyDataEntity.java | 351473c9ceee1d1647a9c89a1dd8da4fca2c7ba9 | []
| no_license | FelipheStival/INMETJava | https://github.com/FelipheStival/INMETJava | a1c15a75fbc61a6e84e5b820010a004ec2269c43 | d82944151352286ab86f8c5769f901d23fe0474f | refs/heads/master | 2022-12-07T09:49:16.227000 | 2020-08-24T18:04:55 | 2020-08-24T18:04:55 | 258,793,165 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.embrapa.cnpaf.inmetdata.entity;
import java.io.Serializable;
import java.time.LocalDate;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import br.embrapa.cnpaf.inmetdata.enumerate.MessageEnum;
import br.embrapa.cnpaf.inmetdata.exception.ParameterValueInvalidException;
import br.embrapa.cnpaf.inmetdata.util.ErrorUtil;
import br.embrapa.cnpaf.inmetdata.util.JsonUtil;
import br.embrapa.cnpaf.inmetdata.util.NetworkUtil;
import br.embrapa.cnpaf.inmetdata.util.StringUtil;
import br.embrapa.cnpaf.inmetdata.util.TimeUtil;
/**
* <br>
* <p>
* <b>Entity containing the information of an module.</b>
* </p>
* <p>
* Each module of the system is capable of controlling a soil column or a set of
* climatic devices.
* </p>
* <br>
*
* @author Rubens de Castro Pereira and Sergio Lopes Jr.
* @version 0.1
* @since 03/03/2020 (creation date)
*
*/
public class InmetHourlyDataEntity implements Serializable, Comparable<InmetHourlyDataEntity> {
private static final long serialVersionUID = 1L;
@Expose
@SerializedName("id")
private Long id;
@Expose
@SerializedName("entilyStation")
private InmetStationEntity entilyStation;
@Expose
@SerializedName("DT_MEDICAO")
private LocalDate measurementDate;
@Expose
@SerializedName("HR_MEDICAO")
private String measureTime;
@Expose
@SerializedName("TEM_MIN")
private float minimumTemperature;
@Expose
@SerializedName("TEM_MAX")
private float maximumTemperature;
@Expose
@SerializedName("TEM_INS")
private float instantTemperature;
@Expose
@SerializedName("PRE_MIN")
private float minimumPrecipitation;
@Expose
@SerializedName("PRE_MAX")
private float maximumPrecipitation;
@Expose
@SerializedName("PRE_INS")
private float instantPrecipitation;
@Expose
@SerializedName("UMD_MIN")
private float minimumRelativeAirHumidity;
@Expose
@SerializedName("UMD_MAX")
private float maximumRelativeAirHumidity;
@Expose
@SerializedName("UMD_INS")
private float instantRelativeAirHumidity;
@Expose
@SerializedName("VEN_VEL")
private float windSpeed;
@Expose
@SerializedName("VEN_DIR")
private int windDirection;
@Expose
@SerializedName("VEN_RAJ")
private float blast;
@Expose
@SerializedName("RAD_GLO")
private float globalRadiation;
@Expose
@SerializedName("PTO_MIN")
private float minimumDewPoint;
@Expose
@SerializedName("PTO_MAX")
private float maximumDewPoint;
@Expose
@SerializedName("PTO_INS")
private float instantDewPoint;
@Expose
@SerializedName("CHUVA")
private float rain;
/**
* Public constructor without parameters.
*
*/
public InmetHourlyDataEntity() {
super();
}
/**
* @param id
* @param entilyStation
* @param measurementDate
* @param measureTime
* @param minimumTemperature
* @param maximumTemperature
* @param instantTemperature
* @param minimumPrecipitation
* @param maximumPrecipitation
* @param instantPrecipitation
* @param minimumRelativeAirHumidity
* @param maximumRelativeAirHumidity
* @param instantRelativeAirHumidity
* @param windSpeed
* @param windDirection
* @param blast
* @param globalRadiation
* @param minimumDewPoint
* @param maximumDewPoint
* @param instantDewPoint
* @param rain
*/
public InmetHourlyDataEntity(Long id, InmetStationEntity entilyStation, LocalDate measurementDate,
String measureTime, float minimumTemperature, float maximumTemperature, float instantTemperature,
float minimumPrecipitation, float maximumPrecipitation, float instantPrecipitation,
float minimumRelativeAirHumidity, float maximumRelativeAirHumidity, float instantRelativeAirHumidity,
float windSpeed, int windDirection, float blast, float globalRadiation, float minimumDewPoint,
float maximumDewPoint, float instantDewPoint, float rain) {
super();
this.id = id;
this.entilyStation = entilyStation;
this.measurementDate = measurementDate;
this.measureTime = measureTime;
this.minimumTemperature = minimumTemperature;
this.maximumTemperature = maximumTemperature;
this.instantTemperature = instantTemperature;
this.minimumPrecipitation = minimumPrecipitation;
this.maximumPrecipitation = maximumPrecipitation;
this.instantPrecipitation = instantPrecipitation;
this.minimumRelativeAirHumidity = minimumRelativeAirHumidity;
this.maximumRelativeAirHumidity = maximumRelativeAirHumidity;
this.instantRelativeAirHumidity = instantRelativeAirHumidity;
this.windSpeed = windSpeed;
this.windDirection = windDirection;
this.blast = blast;
this.globalRadiation = globalRadiation;
this.minimumDewPoint = minimumDewPoint;
this.maximumDewPoint = maximumDewPoint;
this.instantDewPoint = instantDewPoint;
this.rain = rain;
}
/**
* @return the entilyStation
*/
public InmetStationEntity getEntilyStation() {
return entilyStation;
}
/**
* @param entilyStation the entilyStation to set
*/
public void setEntilyStation(InmetStationEntity entilyStation) {
this.entilyStation = entilyStation;
}
/**
* @return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return the measurementDate
*/
public LocalDate getMeasurementDate() {
return measurementDate;
}
/**
* @param measurementDate the measurementDate to set
*/
public void setMeasurementDate(LocalDate measurementDate) {
this.measurementDate = measurementDate;
}
/**
* @return the measureTime
*/
public String getMeasureTime() {
return measureTime;
}
/**
* @param measureTime the measureTime to set
*/
public void setMeasureTime(String measureTime) {
this.measureTime = measureTime;
}
/**
* @return the minimumTemperature
*/
public float getMinimumTemperature() {
return minimumTemperature;
}
/**
* @param minimumTemperature the minimumTemperature to set
*/
public void setMinimumTemperature(float minimumTemperature) {
this.minimumTemperature = minimumTemperature;
}
/**
* @return the maximumTemperature
*/
public float getMaximumTemperature() {
return maximumTemperature;
}
/**
* @param maximumTemperature the maximumTemperature to set
*/
public void setMaximumTemperature(float maximumTemperature) {
this.maximumTemperature = maximumTemperature;
}
/**
* @return the instantTemperature
*/
public float getInstantTemperature() {
return instantTemperature;
}
/**
* @param instantTemperature the instantTemperature to set
*/
public void setInstantTemperature(float instantTemperature) {
this.instantTemperature = instantTemperature;
}
/**
* @return the minimumPrecipitation
*/
public float getMinimumPrecipitation() {
return minimumPrecipitation;
}
/**
* @param minimumPrecipitation the minimumPrecipitation to set
*/
public void setMinimumPrecipitation(float minimumPrecipitation) {
this.minimumPrecipitation = minimumPrecipitation;
}
/**
* @return the maximumPrecipitation
*/
public float getMaximumPrecipitation() {
return maximumPrecipitation;
}
/**
* @param maximumPrecipitation the maximumPrecipitation to set
*/
public void setMaximumPrecipitation(float maximumPrecipitation) {
this.maximumPrecipitation = maximumPrecipitation;
}
/**
* @return the instantPrecipitation
*/
public float getInstantPrecipitation() {
return instantPrecipitation;
}
/**
* @param instantPrecipitation the instantPrecipitation to set
*/
public void setInstantPrecipitation(float instantPrecipitation) {
this.instantPrecipitation = instantPrecipitation;
}
/**
* @return the minimumRelativeAirHumidity
*/
public float getMinimumRelativeAirHumidity() {
return minimumRelativeAirHumidity;
}
/**
* @param minimumRelativeAirHumidity the minimumRelativeAirHumidity to set
*/
public void setMinimumRelativeAirHumidity(float minimumRelativeAirHumidity) {
this.minimumRelativeAirHumidity = minimumRelativeAirHumidity;
}
/**
* @return the maximumRelativeAirHumidity
*/
public float getMaximumRelativeAirHumidity() {
return maximumRelativeAirHumidity;
}
/**
* @param maximumRelativeAirHumidity the maximumRelativeAirHumidity to set
*/
public void setMaximumRelativeAirHumidity(float maximumRelativeAirHumidity) {
this.maximumRelativeAirHumidity = maximumRelativeAirHumidity;
}
/**
* @return the instantRelativeAirHumidity
*/
public float getInstantRelativeAirHumidity() {
return instantRelativeAirHumidity;
}
/**
* @param instantRelativeAirHumidity the instantRelativeAirHumidity to set
*/
public void setInstantRelativeAirHumidity(float instantRelativeAirHumidity) {
this.instantRelativeAirHumidity = instantRelativeAirHumidity;
}
/**
* @return the windSpeed
*/
public float getWindSpeed() {
return windSpeed;
}
/**
* @param windSpeed the windSpeed to set
*/
public void setWindSpeed(float windSpeed) {
this.windSpeed = windSpeed;
}
/**
* @return the windDirection
*/
public int getWindDirection() {
return windDirection;
}
/**
* @param windDirection the windDirection to set
*/
public void setWindDirection(int windDirection) {
this.windDirection = windDirection;
}
/**
* @return the blast
*/
public float getBlast() {
return blast;
}
/**
* @param blast the blast to set
*/
public void setBlast(float blast) {
this.blast = blast;
}
/**
* @return the globalRadiation
*/
public float getGlobalRadiation() {
return globalRadiation;
}
/**
* @param globalRadiation the globalRadiation to set
*/
public void setGlobalRadiation(float globalRadiation) {
this.globalRadiation = globalRadiation;
}
/**
* @return the minimumDewPoint
*/
public float getMinimumDewPoint() {
return minimumDewPoint;
}
/**
* @param minimumDewPoint the minimumDewPoint to set
*/
public void setMinimumDewPoint(float minimumDewPoint) {
this.minimumDewPoint = minimumDewPoint;
}
/**
* @return the maximumDewPoint
*/
public float getMaximumDewPoint() {
return maximumDewPoint;
}
/**
* @param maximumDewPoint the maximumDewPoint to set
*/
public void setMaximumDewPoint(float maximumDewPoint) {
this.maximumDewPoint = maximumDewPoint;
}
/**
* @return the instantDewPoint
*/
public float getInstantDewPoint() {
return instantDewPoint;
}
/**
* @param instantDewPoint the instantDewPoint to set
*/
public void setInstantDewPoint(float instantDewPoint) {
this.instantDewPoint = instantDewPoint;
}
/**
* @return the rain
*/
public float getRain() {
return rain;
}
/**
* @param rain the rain to set
*/
public void setRain(float rain) {
this.rain = rain;
}
/**
* Retrieve the object from the json string.
*
* @param json Json string of the object.
* @return Object retrieved from the json string.
* @throws ParameterValueInvalidException Error in the retrieving the object
* from the json string
*/
public static InmetHourlyDataEntity valueOf(final String json) throws ParameterValueInvalidException {
try {
// creating the object from json
InmetHourlyDataEntity entity = JsonUtil.getJsonConverter().fromJson(json, InmetHourlyDataEntity.class);
return entity;
} catch (Throwable e) {
throw ErrorUtil.getParameterValueInvalidExceptionError(NetworkUtil.getLocalIpAddress(),
MessageEnum.INMET_HOURLY_DATA_ENTITY_ERROR_JSON_PARSING,
InmetDiarlyDataEntity.class.getSimpleName(), "valueOf", e.getMessage(), null, json);
}
}
/**
* Convert the object in a json string.
*
* @return Json string of the object.
*/
public String toString() {
try {
JsonParser parse = new JsonParser();
String json = JsonUtil.getJsonConverterWithExposeAnnotation().toJson(this);
JsonObject jsonObject = (JsonObject) parse.parse(json);
jsonObject.remove("entilyStation");
jsonObject.addProperty("CD_ESTACAO", entilyStation.getCode());
return jsonObject.toString();
} catch (Throwable e) {
}
return null;
}
@Override
public int compareTo(InmetHourlyDataEntity entity) {
// For ascending order
String ownEntity = StringUtil.removeAccent(this.getEntilyStation().getCode() + ";"
+ TimeUtil.formatterLocalDateToYYYYMMDD(this.getMeasurementDate()));
String otherEntity = StringUtil.removeAccent(this.getEntilyStation().getCode() + ";"
+ TimeUtil.formatterLocalDateToYYYYMMDD(entity.getMeasurementDate()));
return ownEntity.compareTo(otherEntity);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Float.floatToIntBits(blast);
result = prime * result + ((entilyStation == null) ? 0 : entilyStation.hashCode());
result = prime * result + Float.floatToIntBits(globalRadiation);
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + Float.floatToIntBits(instantDewPoint);
result = prime * result + Float.floatToIntBits(instantPrecipitation);
result = prime * result + Float.floatToIntBits(instantRelativeAirHumidity);
result = prime * result + Float.floatToIntBits(instantTemperature);
result = prime * result + Float.floatToIntBits(maximumDewPoint);
result = prime * result + Float.floatToIntBits(maximumPrecipitation);
result = prime * result + Float.floatToIntBits(maximumRelativeAirHumidity);
result = prime * result + Float.floatToIntBits(maximumTemperature);
result = prime * result + ((measureTime == null) ? 0 : measureTime.hashCode());
result = prime * result + ((measurementDate == null) ? 0 : measurementDate.hashCode());
result = prime * result + Float.floatToIntBits(minimumDewPoint);
result = prime * result + Float.floatToIntBits(minimumPrecipitation);
result = prime * result + Float.floatToIntBits(minimumRelativeAirHumidity);
result = prime * result + Float.floatToIntBits(minimumTemperature);
result = prime * result + Float.floatToIntBits(rain);
result = prime * result + windDirection;
result = prime * result + Float.floatToIntBits(windSpeed);
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
InmetHourlyDataEntity other = (InmetHourlyDataEntity) obj;
if (Float.floatToIntBits(blast) != Float.floatToIntBits(other.blast))
return false;
if (entilyStation == null) {
if (other.entilyStation != null)
return false;
} else if (!entilyStation.equals(other.entilyStation))
return false;
if (Float.floatToIntBits(globalRadiation) != Float.floatToIntBits(other.globalRadiation))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (Float.floatToIntBits(instantDewPoint) != Float.floatToIntBits(other.instantDewPoint))
return false;
if (Float.floatToIntBits(instantPrecipitation) != Float.floatToIntBits(other.instantPrecipitation))
return false;
if (Float.floatToIntBits(instantRelativeAirHumidity) != Float.floatToIntBits(other.instantRelativeAirHumidity))
return false;
if (Float.floatToIntBits(instantTemperature) != Float.floatToIntBits(other.instantTemperature))
return false;
if (Float.floatToIntBits(maximumDewPoint) != Float.floatToIntBits(other.maximumDewPoint))
return false;
if (Float.floatToIntBits(maximumPrecipitation) != Float.floatToIntBits(other.maximumPrecipitation))
return false;
if (Float.floatToIntBits(maximumRelativeAirHumidity) != Float.floatToIntBits(other.maximumRelativeAirHumidity))
return false;
if (Float.floatToIntBits(maximumTemperature) != Float.floatToIntBits(other.maximumTemperature))
return false;
if (measureTime == null) {
if (other.measureTime != null)
return false;
} else if (!measureTime.equals(other.measureTime))
return false;
if (measurementDate == null) {
if (other.measurementDate != null)
return false;
} else if (!measurementDate.equals(other.measurementDate))
return false;
if (Float.floatToIntBits(minimumDewPoint) != Float.floatToIntBits(other.minimumDewPoint))
return false;
if (Float.floatToIntBits(minimumPrecipitation) != Float.floatToIntBits(other.minimumPrecipitation))
return false;
if (Float.floatToIntBits(minimumRelativeAirHumidity) != Float.floatToIntBits(other.minimumRelativeAirHumidity))
return false;
if (Float.floatToIntBits(minimumTemperature) != Float.floatToIntBits(other.minimumTemperature))
return false;
if (Float.floatToIntBits(rain) != Float.floatToIntBits(other.rain))
return false;
if (windDirection != other.windDirection)
return false;
if (Float.floatToIntBits(windSpeed) != Float.floatToIntBits(other.windSpeed))
return false;
return true;
}
}
| UTF-8 | Java | 17,403 | java | InmetHourlyDataEntity.java | Java | [
{
"context": "imatic devices.\r\n * </p>\r\n * <br>\r\n * \r\n * @author Rubens de Castro Pereira and Sergio Lopes Jr.\r\n * @version 0.1\r\n * @since ",
"end": 928,
"score": 0.9998801946640015,
"start": 904,
"tag": "NAME",
"value": "Rubens de Castro Pereira"
},
{
"context": "<br>\r\n * \r\n * @author Rubens de Castro Pereira and Sergio Lopes Jr.\r\n * @version 0.1\r\n * @since 03/03/2020 (creation",
"end": 948,
"score": 0.9991995096206665,
"start": 933,
"tag": "NAME",
"value": "Sergio Lopes Jr"
}
]
| null | []
| package br.embrapa.cnpaf.inmetdata.entity;
import java.io.Serializable;
import java.time.LocalDate;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import br.embrapa.cnpaf.inmetdata.enumerate.MessageEnum;
import br.embrapa.cnpaf.inmetdata.exception.ParameterValueInvalidException;
import br.embrapa.cnpaf.inmetdata.util.ErrorUtil;
import br.embrapa.cnpaf.inmetdata.util.JsonUtil;
import br.embrapa.cnpaf.inmetdata.util.NetworkUtil;
import br.embrapa.cnpaf.inmetdata.util.StringUtil;
import br.embrapa.cnpaf.inmetdata.util.TimeUtil;
/**
* <br>
* <p>
* <b>Entity containing the information of an module.</b>
* </p>
* <p>
* Each module of the system is capable of controlling a soil column or a set of
* climatic devices.
* </p>
* <br>
*
* @author <NAME> and <NAME>.
* @version 0.1
* @since 03/03/2020 (creation date)
*
*/
public class InmetHourlyDataEntity implements Serializable, Comparable<InmetHourlyDataEntity> {
private static final long serialVersionUID = 1L;
@Expose
@SerializedName("id")
private Long id;
@Expose
@SerializedName("entilyStation")
private InmetStationEntity entilyStation;
@Expose
@SerializedName("DT_MEDICAO")
private LocalDate measurementDate;
@Expose
@SerializedName("HR_MEDICAO")
private String measureTime;
@Expose
@SerializedName("TEM_MIN")
private float minimumTemperature;
@Expose
@SerializedName("TEM_MAX")
private float maximumTemperature;
@Expose
@SerializedName("TEM_INS")
private float instantTemperature;
@Expose
@SerializedName("PRE_MIN")
private float minimumPrecipitation;
@Expose
@SerializedName("PRE_MAX")
private float maximumPrecipitation;
@Expose
@SerializedName("PRE_INS")
private float instantPrecipitation;
@Expose
@SerializedName("UMD_MIN")
private float minimumRelativeAirHumidity;
@Expose
@SerializedName("UMD_MAX")
private float maximumRelativeAirHumidity;
@Expose
@SerializedName("UMD_INS")
private float instantRelativeAirHumidity;
@Expose
@SerializedName("VEN_VEL")
private float windSpeed;
@Expose
@SerializedName("VEN_DIR")
private int windDirection;
@Expose
@SerializedName("VEN_RAJ")
private float blast;
@Expose
@SerializedName("RAD_GLO")
private float globalRadiation;
@Expose
@SerializedName("PTO_MIN")
private float minimumDewPoint;
@Expose
@SerializedName("PTO_MAX")
private float maximumDewPoint;
@Expose
@SerializedName("PTO_INS")
private float instantDewPoint;
@Expose
@SerializedName("CHUVA")
private float rain;
/**
* Public constructor without parameters.
*
*/
public InmetHourlyDataEntity() {
super();
}
/**
* @param id
* @param entilyStation
* @param measurementDate
* @param measureTime
* @param minimumTemperature
* @param maximumTemperature
* @param instantTemperature
* @param minimumPrecipitation
* @param maximumPrecipitation
* @param instantPrecipitation
* @param minimumRelativeAirHumidity
* @param maximumRelativeAirHumidity
* @param instantRelativeAirHumidity
* @param windSpeed
* @param windDirection
* @param blast
* @param globalRadiation
* @param minimumDewPoint
* @param maximumDewPoint
* @param instantDewPoint
* @param rain
*/
public InmetHourlyDataEntity(Long id, InmetStationEntity entilyStation, LocalDate measurementDate,
String measureTime, float minimumTemperature, float maximumTemperature, float instantTemperature,
float minimumPrecipitation, float maximumPrecipitation, float instantPrecipitation,
float minimumRelativeAirHumidity, float maximumRelativeAirHumidity, float instantRelativeAirHumidity,
float windSpeed, int windDirection, float blast, float globalRadiation, float minimumDewPoint,
float maximumDewPoint, float instantDewPoint, float rain) {
super();
this.id = id;
this.entilyStation = entilyStation;
this.measurementDate = measurementDate;
this.measureTime = measureTime;
this.minimumTemperature = minimumTemperature;
this.maximumTemperature = maximumTemperature;
this.instantTemperature = instantTemperature;
this.minimumPrecipitation = minimumPrecipitation;
this.maximumPrecipitation = maximumPrecipitation;
this.instantPrecipitation = instantPrecipitation;
this.minimumRelativeAirHumidity = minimumRelativeAirHumidity;
this.maximumRelativeAirHumidity = maximumRelativeAirHumidity;
this.instantRelativeAirHumidity = instantRelativeAirHumidity;
this.windSpeed = windSpeed;
this.windDirection = windDirection;
this.blast = blast;
this.globalRadiation = globalRadiation;
this.minimumDewPoint = minimumDewPoint;
this.maximumDewPoint = maximumDewPoint;
this.instantDewPoint = instantDewPoint;
this.rain = rain;
}
/**
* @return the entilyStation
*/
public InmetStationEntity getEntilyStation() {
return entilyStation;
}
/**
* @param entilyStation the entilyStation to set
*/
public void setEntilyStation(InmetStationEntity entilyStation) {
this.entilyStation = entilyStation;
}
/**
* @return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return the measurementDate
*/
public LocalDate getMeasurementDate() {
return measurementDate;
}
/**
* @param measurementDate the measurementDate to set
*/
public void setMeasurementDate(LocalDate measurementDate) {
this.measurementDate = measurementDate;
}
/**
* @return the measureTime
*/
public String getMeasureTime() {
return measureTime;
}
/**
* @param measureTime the measureTime to set
*/
public void setMeasureTime(String measureTime) {
this.measureTime = measureTime;
}
/**
* @return the minimumTemperature
*/
public float getMinimumTemperature() {
return minimumTemperature;
}
/**
* @param minimumTemperature the minimumTemperature to set
*/
public void setMinimumTemperature(float minimumTemperature) {
this.minimumTemperature = minimumTemperature;
}
/**
* @return the maximumTemperature
*/
public float getMaximumTemperature() {
return maximumTemperature;
}
/**
* @param maximumTemperature the maximumTemperature to set
*/
public void setMaximumTemperature(float maximumTemperature) {
this.maximumTemperature = maximumTemperature;
}
/**
* @return the instantTemperature
*/
public float getInstantTemperature() {
return instantTemperature;
}
/**
* @param instantTemperature the instantTemperature to set
*/
public void setInstantTemperature(float instantTemperature) {
this.instantTemperature = instantTemperature;
}
/**
* @return the minimumPrecipitation
*/
public float getMinimumPrecipitation() {
return minimumPrecipitation;
}
/**
* @param minimumPrecipitation the minimumPrecipitation to set
*/
public void setMinimumPrecipitation(float minimumPrecipitation) {
this.minimumPrecipitation = minimumPrecipitation;
}
/**
* @return the maximumPrecipitation
*/
public float getMaximumPrecipitation() {
return maximumPrecipitation;
}
/**
* @param maximumPrecipitation the maximumPrecipitation to set
*/
public void setMaximumPrecipitation(float maximumPrecipitation) {
this.maximumPrecipitation = maximumPrecipitation;
}
/**
* @return the instantPrecipitation
*/
public float getInstantPrecipitation() {
return instantPrecipitation;
}
/**
* @param instantPrecipitation the instantPrecipitation to set
*/
public void setInstantPrecipitation(float instantPrecipitation) {
this.instantPrecipitation = instantPrecipitation;
}
/**
* @return the minimumRelativeAirHumidity
*/
public float getMinimumRelativeAirHumidity() {
return minimumRelativeAirHumidity;
}
/**
* @param minimumRelativeAirHumidity the minimumRelativeAirHumidity to set
*/
public void setMinimumRelativeAirHumidity(float minimumRelativeAirHumidity) {
this.minimumRelativeAirHumidity = minimumRelativeAirHumidity;
}
/**
* @return the maximumRelativeAirHumidity
*/
public float getMaximumRelativeAirHumidity() {
return maximumRelativeAirHumidity;
}
/**
* @param maximumRelativeAirHumidity the maximumRelativeAirHumidity to set
*/
public void setMaximumRelativeAirHumidity(float maximumRelativeAirHumidity) {
this.maximumRelativeAirHumidity = maximumRelativeAirHumidity;
}
/**
* @return the instantRelativeAirHumidity
*/
public float getInstantRelativeAirHumidity() {
return instantRelativeAirHumidity;
}
/**
* @param instantRelativeAirHumidity the instantRelativeAirHumidity to set
*/
public void setInstantRelativeAirHumidity(float instantRelativeAirHumidity) {
this.instantRelativeAirHumidity = instantRelativeAirHumidity;
}
/**
* @return the windSpeed
*/
public float getWindSpeed() {
return windSpeed;
}
/**
* @param windSpeed the windSpeed to set
*/
public void setWindSpeed(float windSpeed) {
this.windSpeed = windSpeed;
}
/**
* @return the windDirection
*/
public int getWindDirection() {
return windDirection;
}
/**
* @param windDirection the windDirection to set
*/
public void setWindDirection(int windDirection) {
this.windDirection = windDirection;
}
/**
* @return the blast
*/
public float getBlast() {
return blast;
}
/**
* @param blast the blast to set
*/
public void setBlast(float blast) {
this.blast = blast;
}
/**
* @return the globalRadiation
*/
public float getGlobalRadiation() {
return globalRadiation;
}
/**
* @param globalRadiation the globalRadiation to set
*/
public void setGlobalRadiation(float globalRadiation) {
this.globalRadiation = globalRadiation;
}
/**
* @return the minimumDewPoint
*/
public float getMinimumDewPoint() {
return minimumDewPoint;
}
/**
* @param minimumDewPoint the minimumDewPoint to set
*/
public void setMinimumDewPoint(float minimumDewPoint) {
this.minimumDewPoint = minimumDewPoint;
}
/**
* @return the maximumDewPoint
*/
public float getMaximumDewPoint() {
return maximumDewPoint;
}
/**
* @param maximumDewPoint the maximumDewPoint to set
*/
public void setMaximumDewPoint(float maximumDewPoint) {
this.maximumDewPoint = maximumDewPoint;
}
/**
* @return the instantDewPoint
*/
public float getInstantDewPoint() {
return instantDewPoint;
}
/**
* @param instantDewPoint the instantDewPoint to set
*/
public void setInstantDewPoint(float instantDewPoint) {
this.instantDewPoint = instantDewPoint;
}
/**
* @return the rain
*/
public float getRain() {
return rain;
}
/**
* @param rain the rain to set
*/
public void setRain(float rain) {
this.rain = rain;
}
/**
* Retrieve the object from the json string.
*
* @param json Json string of the object.
* @return Object retrieved from the json string.
* @throws ParameterValueInvalidException Error in the retrieving the object
* from the json string
*/
public static InmetHourlyDataEntity valueOf(final String json) throws ParameterValueInvalidException {
try {
// creating the object from json
InmetHourlyDataEntity entity = JsonUtil.getJsonConverter().fromJson(json, InmetHourlyDataEntity.class);
return entity;
} catch (Throwable e) {
throw ErrorUtil.getParameterValueInvalidExceptionError(NetworkUtil.getLocalIpAddress(),
MessageEnum.INMET_HOURLY_DATA_ENTITY_ERROR_JSON_PARSING,
InmetDiarlyDataEntity.class.getSimpleName(), "valueOf", e.getMessage(), null, json);
}
}
/**
* Convert the object in a json string.
*
* @return Json string of the object.
*/
public String toString() {
try {
JsonParser parse = new JsonParser();
String json = JsonUtil.getJsonConverterWithExposeAnnotation().toJson(this);
JsonObject jsonObject = (JsonObject) parse.parse(json);
jsonObject.remove("entilyStation");
jsonObject.addProperty("CD_ESTACAO", entilyStation.getCode());
return jsonObject.toString();
} catch (Throwable e) {
}
return null;
}
@Override
public int compareTo(InmetHourlyDataEntity entity) {
// For ascending order
String ownEntity = StringUtil.removeAccent(this.getEntilyStation().getCode() + ";"
+ TimeUtil.formatterLocalDateToYYYYMMDD(this.getMeasurementDate()));
String otherEntity = StringUtil.removeAccent(this.getEntilyStation().getCode() + ";"
+ TimeUtil.formatterLocalDateToYYYYMMDD(entity.getMeasurementDate()));
return ownEntity.compareTo(otherEntity);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Float.floatToIntBits(blast);
result = prime * result + ((entilyStation == null) ? 0 : entilyStation.hashCode());
result = prime * result + Float.floatToIntBits(globalRadiation);
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + Float.floatToIntBits(instantDewPoint);
result = prime * result + Float.floatToIntBits(instantPrecipitation);
result = prime * result + Float.floatToIntBits(instantRelativeAirHumidity);
result = prime * result + Float.floatToIntBits(instantTemperature);
result = prime * result + Float.floatToIntBits(maximumDewPoint);
result = prime * result + Float.floatToIntBits(maximumPrecipitation);
result = prime * result + Float.floatToIntBits(maximumRelativeAirHumidity);
result = prime * result + Float.floatToIntBits(maximumTemperature);
result = prime * result + ((measureTime == null) ? 0 : measureTime.hashCode());
result = prime * result + ((measurementDate == null) ? 0 : measurementDate.hashCode());
result = prime * result + Float.floatToIntBits(minimumDewPoint);
result = prime * result + Float.floatToIntBits(minimumPrecipitation);
result = prime * result + Float.floatToIntBits(minimumRelativeAirHumidity);
result = prime * result + Float.floatToIntBits(minimumTemperature);
result = prime * result + Float.floatToIntBits(rain);
result = prime * result + windDirection;
result = prime * result + Float.floatToIntBits(windSpeed);
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
InmetHourlyDataEntity other = (InmetHourlyDataEntity) obj;
if (Float.floatToIntBits(blast) != Float.floatToIntBits(other.blast))
return false;
if (entilyStation == null) {
if (other.entilyStation != null)
return false;
} else if (!entilyStation.equals(other.entilyStation))
return false;
if (Float.floatToIntBits(globalRadiation) != Float.floatToIntBits(other.globalRadiation))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (Float.floatToIntBits(instantDewPoint) != Float.floatToIntBits(other.instantDewPoint))
return false;
if (Float.floatToIntBits(instantPrecipitation) != Float.floatToIntBits(other.instantPrecipitation))
return false;
if (Float.floatToIntBits(instantRelativeAirHumidity) != Float.floatToIntBits(other.instantRelativeAirHumidity))
return false;
if (Float.floatToIntBits(instantTemperature) != Float.floatToIntBits(other.instantTemperature))
return false;
if (Float.floatToIntBits(maximumDewPoint) != Float.floatToIntBits(other.maximumDewPoint))
return false;
if (Float.floatToIntBits(maximumPrecipitation) != Float.floatToIntBits(other.maximumPrecipitation))
return false;
if (Float.floatToIntBits(maximumRelativeAirHumidity) != Float.floatToIntBits(other.maximumRelativeAirHumidity))
return false;
if (Float.floatToIntBits(maximumTemperature) != Float.floatToIntBits(other.maximumTemperature))
return false;
if (measureTime == null) {
if (other.measureTime != null)
return false;
} else if (!measureTime.equals(other.measureTime))
return false;
if (measurementDate == null) {
if (other.measurementDate != null)
return false;
} else if (!measurementDate.equals(other.measurementDate))
return false;
if (Float.floatToIntBits(minimumDewPoint) != Float.floatToIntBits(other.minimumDewPoint))
return false;
if (Float.floatToIntBits(minimumPrecipitation) != Float.floatToIntBits(other.minimumPrecipitation))
return false;
if (Float.floatToIntBits(minimumRelativeAirHumidity) != Float.floatToIntBits(other.minimumRelativeAirHumidity))
return false;
if (Float.floatToIntBits(minimumTemperature) != Float.floatToIntBits(other.minimumTemperature))
return false;
if (Float.floatToIntBits(rain) != Float.floatToIntBits(other.rain))
return false;
if (windDirection != other.windDirection)
return false;
if (Float.floatToIntBits(windSpeed) != Float.floatToIntBits(other.windSpeed))
return false;
return true;
}
}
| 17,376 | 0.71821 | 0.717175 | 623 | 25.934189 | 26.304987 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.529695 | false | false | 9 |
b401646089ed977201d50f17a0862f9f4c7167e1 | 36,816,459,679,946 | cde022754f0c07fe023b15f16bb0ce50c613c5c5 | /sprpc-provider/src/main/java/com/srp/factory/ServerFactoryBean.java | ce3c186c8eade33718885ea66a51da9231ec2637 | []
| no_license | RuipengSu/sprpc | https://github.com/RuipengSu/sprpc | 85be12957cadc3ed49a90163d1ed588b5b2e917f | 10b445fdcca443cf8d495a4edb0d810a950ba03a | refs/heads/master | 2020-04-09T11:30:01.836000 | 2018-12-04T06:56:46 | 2018-12-04T06:56:46 | 160,312,073 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.srp.factory;
import com.srp.bootstrap.ServerBuilder;
import com.srp.server.Server;
import lombok.Data;
import org.springframework.beans.factory.FactoryBean;
import javax.annotation.PreDestroy;
/**
* @ Author: Su RuiPeng
* @ Date: 2018/10/29
*/
@Data
public class ServerFactoryBean implements FactoryBean<Object> {
private Class<?> serviceInterface;
private Object serviceImpl;
private String ip;
private int port;
private String serviceName;
private String zkConn;
private Server rpcServer;
//服务注册并提供
public void start(){
rpcServer = ServerBuilder
.builder()
.serviceImpl(serviceImpl)
.serviceName(serviceName)
.zkConn(zkConn)
.port(port)
.build();
rpcServer.start();
}
//服务下线
@PreDestroy
public void serviceOffline(){
rpcServer.shutdown();
}
@Override
public Object getObject() throws Exception {
return this;
}
@Override
public Class<?> getObjectType() {
return this.getClass();
}
@Override
public boolean isSingleton() {
return true;
}
}
| UTF-8 | Java | 1,221 | java | ServerFactoryBean.java | Java | [
{
"context": "ort javax.annotation.PreDestroy;\n\n/**\n * @ Author: Su RuiPeng\n * @ Date: 2018/10/29\n */\n@Data\npublic class Serv",
"end": 235,
"score": 0.9998737573623657,
"start": 225,
"tag": "NAME",
"value": "Su RuiPeng"
}
]
| null | []
| package com.srp.factory;
import com.srp.bootstrap.ServerBuilder;
import com.srp.server.Server;
import lombok.Data;
import org.springframework.beans.factory.FactoryBean;
import javax.annotation.PreDestroy;
/**
* @ Author: <NAME>
* @ Date: 2018/10/29
*/
@Data
public class ServerFactoryBean implements FactoryBean<Object> {
private Class<?> serviceInterface;
private Object serviceImpl;
private String ip;
private int port;
private String serviceName;
private String zkConn;
private Server rpcServer;
//服务注册并提供
public void start(){
rpcServer = ServerBuilder
.builder()
.serviceImpl(serviceImpl)
.serviceName(serviceName)
.zkConn(zkConn)
.port(port)
.build();
rpcServer.start();
}
//服务下线
@PreDestroy
public void serviceOffline(){
rpcServer.shutdown();
}
@Override
public Object getObject() throws Exception {
return this;
}
@Override
public Class<?> getObjectType() {
return this.getClass();
}
@Override
public boolean isSingleton() {
return true;
}
}
| 1,217 | 0.616347 | 0.609675 | 55 | 20.799999 | 15.177016 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.345455 | false | false | 9 |
da9720e46da0ca659f4e060e06aed080d28195e6 | 37,417,755,095,715 | 65ce15af7359e6a5b5c46e7e0d3ad6f0318e79b0 | /dev_error_example/src/main/java/com/fantasybaby/dee/code/equals/Employee.java | e94ebc7f646cd837bcb110985fd354f2769d72f0 | []
| no_license | FantasybabyChange/javaSeWorkspace | https://github.com/FantasybabyChange/javaSeWorkspace | 9ca3979ca62b93984c158c4b0c5f8ae34adb1e52 | 3ae4223117ea8d1f405902624cce4c0492af9703 | refs/heads/master | 2021-01-19T04:28:06.879000 | 2021-01-18T10:06:37 | 2021-01-18T10:06:37 | 87,372,082 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.fantasybaby.dee.code.equals;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
/**
* @author fanta
* @Description
* @create 2021-01-14 23:01
*/
@Data
@Slf4j
@EqualsAndHashCode(callSuper = true)
public class Employee extends Person {
private String company;
public Employee(String name, String identity, String company) {
super(name, identity);
this.company = company;
}
public static void main(String[] args) {
Employee employee1 = new Employee("zhuye","001", "bkjk.com");
Employee employee2 = new Employee("Joseph","002", "bkjk.com");
log.info("employee1.equals(employee2) ? {}", employee1.equals(employee2));
}
} | UTF-8 | Java | 733 | java | Employee.java | Java | [
{
"context": "\nimport lombok.extern.slf4j.Slf4j;\n\n/**\n * @author fanta\n * @Description\n * @create 2021-01-14 23:01\n */\n\n",
"end": 150,
"score": 0.9955922961235046,
"start": 145,
"tag": "USERNAME",
"value": "fanta"
},
{
"context": "rgs) {\n Employee employee1 = new Employee(\"zhuye\",\"001\", \"bkjk.com\");\n Employee employee2 =",
"end": 550,
"score": 0.9783539175987244,
"start": 545,
"tag": "NAME",
"value": "zhuye"
},
{
"context": "com\");\n Employee employee2 = new Employee(\"Joseph\",\"002\", \"bkjk.com\");\n log.info(\"employee1.",
"end": 621,
"score": 0.9998356699943542,
"start": 615,
"tag": "NAME",
"value": "Joseph"
}
]
| null | []
| package com.fantasybaby.dee.code.equals;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
/**
* @author fanta
* @Description
* @create 2021-01-14 23:01
*/
@Data
@Slf4j
@EqualsAndHashCode(callSuper = true)
public class Employee extends Person {
private String company;
public Employee(String name, String identity, String company) {
super(name, identity);
this.company = company;
}
public static void main(String[] args) {
Employee employee1 = new Employee("zhuye","001", "bkjk.com");
Employee employee2 = new Employee("Joseph","002", "bkjk.com");
log.info("employee1.equals(employee2) ? {}", employee1.equals(employee2));
}
} | 733 | 0.676671 | 0.639836 | 30 | 23.466667 | 23.82818 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false | 9 |
d4a713195468deb095f5cead19954e279b66e293 | 403,726,977,821 | bca7edbc5b015a066884930efb00ec27c66fa128 | /app/src/main/java/com/dheeraj/auctionapp/Cars.java | 2304986996acb439eaa155c40b0e84589d32d39c | []
| no_license | dheerajb/AuctionApp | https://github.com/dheerajb/AuctionApp | 7e725e0671943e939d023e2b520be7b5f57c9889 | 9f82e8b52815191aedd7e613db0ffe9b4c42544a | refs/heads/master | 2016-09-06T14:14:04.154000 | 2015-06-16T11:25:49 | 2015-06-16T11:25:49 | 37,689,841 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.dheeraj.auctionapp;
import java.util.Map;
import java.util.Random;
/**
* Created by Subham Tyagi,
* on 15/Jun/2015,
* 1:28 PM
*/
public class Cars {
private static final Random RANDOM = new Random();
public static String[] urls = {
"http://images.askmen.com/top_10/cars/top-10-best-car-names_flash.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_10.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_9.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_8.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_7.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_6.jpg",
"http://images.askmen.com/top_10/cars/1301606035_top-10-best-car-names_5.jpg",
"http://images.askmen.com/top_10/cars/1301606035_top-10-best-car-names_4.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_3.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_2.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_1.jpg"
};
public static String getRandomCheeseDrawable() {
return urls[RANDOM.nextInt(10)];
}
}
| UTF-8 | Java | 1,278 | java | Cars.java | Java | [
{
"context": "l.Map;\nimport java.util.Random;\n\n/**\n * Created by Subham Tyagi,\n * on 15/Jun/2015,\n * 1:28 PM\n */\npublic class C",
"end": 111,
"score": 0.9998668432235718,
"start": 99,
"tag": "NAME",
"value": "Subham Tyagi"
}
]
| null | []
| package com.dheeraj.auctionapp;
import java.util.Map;
import java.util.Random;
/**
* Created by <NAME>,
* on 15/Jun/2015,
* 1:28 PM
*/
public class Cars {
private static final Random RANDOM = new Random();
public static String[] urls = {
"http://images.askmen.com/top_10/cars/top-10-best-car-names_flash.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_10.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_9.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_8.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_7.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_6.jpg",
"http://images.askmen.com/top_10/cars/1301606035_top-10-best-car-names_5.jpg",
"http://images.askmen.com/top_10/cars/1301606035_top-10-best-car-names_4.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_3.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_2.jpg",
"http://images.askmen.com/top_10/cars/top-10-best-car-names_1.jpg"
};
public static String getRandomCheeseDrawable() {
return urls[RANDOM.nextInt(10)];
}
}
| 1,272 | 0.630673 | 0.56338 | 34 | 36.588234 | 34.093399 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.529412 | false | false | 9 |
e95bbaca78254e03feb339f653d4e82b21216d4a | 6,193,342,882,911 | a26e1ee88f9f742efad8fff97a38218376b4ad5c | /app/src/main/java/com/example/guy/projectapp1/LoadApp.java | d1caabc756fa6808dcfafecbf71ad6fd5838d842 | []
| no_license | gfudim/math-is-fun | https://github.com/gfudim/math-is-fun | 9d20c446d29311ae1d541264f71fc98309ba220d | cb5b27cbc400db3a7326bf145842fb99a7940248 | refs/heads/master | 2021-07-04T12:23:26.425000 | 2020-09-25T14:59:48 | 2020-09-25T14:59:48 | 176,488,929 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.guy.projectapp1;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;
public class LoadApp extends Utils {
@Override
protected void onCreate(Bundle savedInstanceState) {
ProgressBar spinner;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_load_app);
spinner = findViewById(R.id.progressBar);
spinner.setVisibility(View.GONE);
spinner.setVisibility(View.VISIBLE);
loadUser();
if (user.mode == -1){
startActivity(new Intent(LoadApp.this, FirstAppPage.class));
}
else{
if (user.mode == MULTI_MODE){ // load login page
startActivity(new Intent(LoadApp.this, LoginPage.class));
}
else{ // load FirstApp page
saveUser(user);
saveUserToDevice(user);
Intent intent = new Intent(LoadApp.this, MainActivity.class);
intent.putExtra("new_connection",true);
startActivity(intent);
}
}
finish();
}
}
| UTF-8 | Java | 1,146 | java | LoadApp.java | Java | []
| null | []
| package com.example.guy.projectapp1;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;
public class LoadApp extends Utils {
@Override
protected void onCreate(Bundle savedInstanceState) {
ProgressBar spinner;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_load_app);
spinner = findViewById(R.id.progressBar);
spinner.setVisibility(View.GONE);
spinner.setVisibility(View.VISIBLE);
loadUser();
if (user.mode == -1){
startActivity(new Intent(LoadApp.this, FirstAppPage.class));
}
else{
if (user.mode == MULTI_MODE){ // load login page
startActivity(new Intent(LoadApp.this, LoginPage.class));
}
else{ // load FirstApp page
saveUser(user);
saveUserToDevice(user);
Intent intent = new Intent(LoadApp.this, MainActivity.class);
intent.putExtra("new_connection",true);
startActivity(intent);
}
}
finish();
}
}
| 1,146 | 0.609075 | 0.60733 | 37 | 29.918919 | 21.354635 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.648649 | false | false | 9 |
12d6f21b1b910ae766b63a5ed6c089f73aad1e01 | 2,430,951,556,577 | 0db6313a9fbdd4b4c92c04c46546759346beabce | /core/src/main/java/zemberek/core/text/TokenSequence.java | 031502fa1bb81e845e28afc04c9bc5f4f418fd28 | [
"Apache-2.0"
]
| permissive | COMU/zemberek-nlp | https://github.com/COMU/zemberek-nlp | 690537cd1cd1105a3e9ee99508aa1988622498c3 | 1533a96db5dbcd6b5a3236dc989a7a18578789cf | refs/heads/master | 2020-03-30T10:18:53.474000 | 2018-10-01T11:48:47 | 2018-10-01T11:48:47 | 151,114,896 | 4 | 1 | NOASSERTION | true | 2018-10-01T15:50:43 | 2018-10-01T15:50:42 | 2018-10-01T14:53:30 | 2018-10-01T11:49:09 | 49,918 | 0 | 0 | 0 | null | false | null | package zemberek.core.text;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
* a sequence of tokens. usually used for representing a sentence. this class is immutable
*/
public class TokenSequence {
public static final String SENTENCE_START = "<s>";
public static final String SENTENCE_END = "</s>";
final String[] words;
public TokenSequence(List<String> words) {
if (words == null) {
throw new IllegalArgumentException("cannot create a sequence with a null list.");
}
this.words = words.toArray(new String[words.size()]);
}
public TokenSequence(String[] words) {
if (words == null) {
throw new IllegalArgumentException("cannot create a sequence with a null list.");
}
this.words = words.clone();
}
public TokenSequence(String spaceSeparatedWords) {
this(Lists.newArrayList(separate(spaceSeparatedWords)));
}
public static Builder builder() {
return new Builder();
}
private static Iterable<String> separate(String spaceSeparatedWords) {
return Splitter.on(" ").omitEmptyStrings().trimResults().split(spaceSeparatedWords);
}
public static TokenSequence fromStartEndTaggedSequence(String spaceSeparatedWords) {
Iterator<String> it = separate(spaceSeparatedWords).iterator();
List<String> list = new ArrayList<>();
while (it.hasNext()) {
String s = it.next();
if (s.equalsIgnoreCase(SENTENCE_START) || s.equalsIgnoreCase(SENTENCE_END)) {
continue;
}
list.add(s);
}
return new TokenSequence(list);
}
public String[] getTokens() {
return words;
}
public String asString() {
return Joiner.on(" ").join(words);
}
public int size() {
return words.length;
}
public String get(int i) {
return words[i];
}
public boolean isEmpty() {
return words.length == 0;
}
public String last() {
if (isEmpty()) {
return "";
}
return words[words.length - 1];
}
public String first() {
if (isEmpty()) {
return "";
}
return words[0];
}
@Override
public String toString() {
return asString();
}
public List<String> getGrams(int gramSize) {
int size = size();
if (size < 2) {
return Collections.emptyList();
}
if (size < gramSize) {
return Lists.newArrayList(asString());
}
ArrayList<String> result = new ArrayList<>(size());
for (int i = 0; i < words.length - gramSize + 1; i++) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < gramSize; j++) {
sb.append(words[i + j]);
if (j != gramSize - 1) {
sb.append(" ");
}
}
result.add(sb.toString());
}
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TokenSequence sequence = (TokenSequence) o;
return Arrays.equals(words, sequence.words);
}
@Override
public int hashCode() {
return Arrays.hashCode(words);
}
public static class Builder {
List<String> tokens = new ArrayList<>();
public Builder add(String token) {
tokens.add(token);
return this;
}
public Builder add(String... tokenz) {
tokens.addAll(Arrays.asList(tokenz));
return this;
}
public TokenSequence build() {
return new TokenSequence(tokens);
}
}
}
| UTF-8 | Java | 3,633 | java | TokenSequence.java | Java | []
| null | []
| package zemberek.core.text;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
* a sequence of tokens. usually used for representing a sentence. this class is immutable
*/
public class TokenSequence {
public static final String SENTENCE_START = "<s>";
public static final String SENTENCE_END = "</s>";
final String[] words;
public TokenSequence(List<String> words) {
if (words == null) {
throw new IllegalArgumentException("cannot create a sequence with a null list.");
}
this.words = words.toArray(new String[words.size()]);
}
public TokenSequence(String[] words) {
if (words == null) {
throw new IllegalArgumentException("cannot create a sequence with a null list.");
}
this.words = words.clone();
}
public TokenSequence(String spaceSeparatedWords) {
this(Lists.newArrayList(separate(spaceSeparatedWords)));
}
public static Builder builder() {
return new Builder();
}
private static Iterable<String> separate(String spaceSeparatedWords) {
return Splitter.on(" ").omitEmptyStrings().trimResults().split(spaceSeparatedWords);
}
public static TokenSequence fromStartEndTaggedSequence(String spaceSeparatedWords) {
Iterator<String> it = separate(spaceSeparatedWords).iterator();
List<String> list = new ArrayList<>();
while (it.hasNext()) {
String s = it.next();
if (s.equalsIgnoreCase(SENTENCE_START) || s.equalsIgnoreCase(SENTENCE_END)) {
continue;
}
list.add(s);
}
return new TokenSequence(list);
}
public String[] getTokens() {
return words;
}
public String asString() {
return Joiner.on(" ").join(words);
}
public int size() {
return words.length;
}
public String get(int i) {
return words[i];
}
public boolean isEmpty() {
return words.length == 0;
}
public String last() {
if (isEmpty()) {
return "";
}
return words[words.length - 1];
}
public String first() {
if (isEmpty()) {
return "";
}
return words[0];
}
@Override
public String toString() {
return asString();
}
public List<String> getGrams(int gramSize) {
int size = size();
if (size < 2) {
return Collections.emptyList();
}
if (size < gramSize) {
return Lists.newArrayList(asString());
}
ArrayList<String> result = new ArrayList<>(size());
for (int i = 0; i < words.length - gramSize + 1; i++) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < gramSize; j++) {
sb.append(words[i + j]);
if (j != gramSize - 1) {
sb.append(" ");
}
}
result.add(sb.toString());
}
return result;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TokenSequence sequence = (TokenSequence) o;
return Arrays.equals(words, sequence.words);
}
@Override
public int hashCode() {
return Arrays.hashCode(words);
}
public static class Builder {
List<String> tokens = new ArrayList<>();
public Builder add(String token) {
tokens.add(token);
return this;
}
public Builder add(String... tokenz) {
tokens.addAll(Arrays.asList(tokenz));
return this;
}
public TokenSequence build() {
return new TokenSequence(tokens);
}
}
}
| 3,633 | 0.627856 | 0.625654 | 159 | 21.849056 | 21.592915 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.402516 | false | false | 9 |
2b2b13af45f94614796f733984b05981e213baeb | 36,747,740,218,184 | 07a71837812e75194c42f3f6c2943acac5ded5c4 | /ekartMS-master/notificationMS/src/main/java/com/infosys/ekart/notification/entity/NotificationEntity.java | 137c96e0af5da4fdfacc2fe8fd391154ba935776 | []
| no_license | PriMon-07/Ekart | https://github.com/PriMon-07/Ekart | aa3d850b2ed5e76f05f798f62538eb5679f96fab | ad129fd3007451b02245d8c4e60e1706bba175f0 | refs/heads/main | 2023-01-24T23:54:31.156000 | 2020-12-08T12:40:29 | 2020-12-08T12:40:29 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.infosys.ekart.notification.entity;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name = "NOTIFICATION")
public class NotificationEntity {
@Id
private int notificationId;
private String message;
private String messageType;
@Temporal(TemporalType.DATE)
private Date timeStamp;
private String userId;
private String readStatus;
public String getReadStatus() {
return readStatus;
}
public void setReadStatus(String readStatus) {
this.readStatus = readStatus;
}
public int getNotificationId() {
return notificationId;
}
public void setNotificationId(int notificationId) {
this.notificationId = notificationId;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public Date getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(Date timeStamp) {
this.timeStamp = timeStamp;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}
| UTF-8 | Java | 1,337 | java | NotificationEntity.java | Java | []
| null | []
| package com.infosys.ekart.notification.entity;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name = "NOTIFICATION")
public class NotificationEntity {
@Id
private int notificationId;
private String message;
private String messageType;
@Temporal(TemporalType.DATE)
private Date timeStamp;
private String userId;
private String readStatus;
public String getReadStatus() {
return readStatus;
}
public void setReadStatus(String readStatus) {
this.readStatus = readStatus;
}
public int getNotificationId() {
return notificationId;
}
public void setNotificationId(int notificationId) {
this.notificationId = notificationId;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public Date getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(Date timeStamp) {
this.timeStamp = timeStamp;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}
| 1,337 | 0.754675 | 0.754675 | 73 | 17.315069 | 16.076765 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.109589 | false | false | 9 |
aec5b58be1b54620422db9835f33170290cf9d6e | 39,402,029,981,384 | 28e4786ada14d6f10c52707c7da86e3459fd73e6 | /interviews/array/src/main/java/SearchMatrix.java | 1ac9ca386dd789e72989dcedf16e48dfcd77c053 | []
| no_license | ceezyyy/leetcode | https://github.com/ceezyyy/leetcode | f675f7719cfb28b57c5fcd15853ec3042046c894 | feb04d00b62f1debe79aea820db9d43bea1d4632 | refs/heads/master | 2023-04-06T04:18:27.687000 | 2021-04-23T03:11:45 | 2021-04-23T03:11:45 | 174,517,066 | 7 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* <p>
* 240. Search a 2D Matrix II (Medium)
* https://leetcode.com/problems/search-a-2d-matrix-ii/
* </p>
*
* @author ceezyyy
* @since 2021/4/22
*/
public class SearchMatrix {
public boolean searchMatrix(int[][] matrix, int target) {
// 1 <= n, m <= 300
int rows = matrix.length;
int cols = matrix[0].length;
// Upper-right
int i = 0;
int j = cols - 1;
while (i < rows && j >= 0) {
int cur = matrix[i][j];
if (target == cur) return true;
if (target < cur) j--;
if (target > cur) i++;
}
return false;
}
}
| UTF-8 | Java | 648 | java | SearchMatrix.java | Java | [
{
"context": "blems/search-a-2d-matrix-ii/\n * </p>\n *\n * @author ceezyyy\n * @since 2021/4/22\n */\npublic class SearchMatrix",
"end": 135,
"score": 0.9997060894966125,
"start": 128,
"tag": "USERNAME",
"value": "ceezyyy"
}
]
| null | []
| /**
* <p>
* 240. Search a 2D Matrix II (Medium)
* https://leetcode.com/problems/search-a-2d-matrix-ii/
* </p>
*
* @author ceezyyy
* @since 2021/4/22
*/
public class SearchMatrix {
public boolean searchMatrix(int[][] matrix, int target) {
// 1 <= n, m <= 300
int rows = matrix.length;
int cols = matrix[0].length;
// Upper-right
int i = 0;
int j = cols - 1;
while (i < rows && j >= 0) {
int cur = matrix[i][j];
if (target == cur) return true;
if (target < cur) j--;
if (target > cur) i++;
}
return false;
}
}
| 648 | 0.479938 | 0.449074 | 30 | 20.6 | 17.085276 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.366667 | false | false | 9 |
6ce252ffdd0ab272f15424f37cbb343a4df3cded | 39,178,691,708,286 | 65959aaa53925f7a91e3be31fc1529bc12c8741f | /app/src/main/java/android/com/bugmonitor/MainActivity.java | 28f5cd6aae2a48f09d1993650f708fb48c525921 | []
| no_license | lantier743865/kso | https://github.com/lantier743865/kso | 3f39cdf6d7c28eada0511b20d9d84d22e3d2bd89 | 9c6600e7a6f1167fd2ab0a0dc1d4ff28d7c1bed6 | refs/heads/master | 2021-03-31T00:22:41.784000 | 2018-03-13T09:44:55 | 2018-03-13T09:44:55 | 124,983,051 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package android.com.bugmonitor;
import android.Manifest;
import android.com.bugmonitor.base.BaseActivity;
import android.content.pm.PackageManager;
import android.os.BaseBundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import com.xiaomi.mipush.sdk.MiPushClient;
public class MainActivity extends BaseActivity {
private static final String TAG = "MainActivity";
public static final int REQUEST_CODE = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE
,Manifest.permission.WRITE_EXTERNAL_STORAGE
,Manifest.permission.ACCESS_WIFI_STATE},REQUEST_CODE);
initView();
String regId = MiPushClient.getRegId(this);
Log.e(TAG, "---->>regId: "+regId );
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == REQUEST_CODE) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Log.e(TAG, "---->>onRequestPermissionsResult: success" );
} else {
Log.e(TAG, "---->>onRequestPermissionsResult: false" );
}
}
}
private void initView() {
findViewById(R.id.bt_crash).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String s = null;
s.split("sd");
}
});
}
}
| UTF-8 | Java | 1,770 | java | MainActivity.java | Java | []
| null | []
| package android.com.bugmonitor;
import android.Manifest;
import android.com.bugmonitor.base.BaseActivity;
import android.content.pm.PackageManager;
import android.os.BaseBundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import com.xiaomi.mipush.sdk.MiPushClient;
public class MainActivity extends BaseActivity {
private static final String TAG = "MainActivity";
public static final int REQUEST_CODE = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE
,Manifest.permission.WRITE_EXTERNAL_STORAGE
,Manifest.permission.ACCESS_WIFI_STATE},REQUEST_CODE);
initView();
String regId = MiPushClient.getRegId(this);
Log.e(TAG, "---->>regId: "+regId );
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == REQUEST_CODE) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Log.e(TAG, "---->>onRequestPermissionsResult: success" );
} else {
Log.e(TAG, "---->>onRequestPermissionsResult: false" );
}
}
}
private void initView() {
findViewById(R.id.bt_crash).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String s = null;
s.split("sd");
}
});
}
}
| 1,770 | 0.649718 | 0.648023 | 54 | 31.777779 | 26.708763 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.592593 | false | false | 9 |
4cb46e258a2c6b596270a9fadfb3fd1d4eda9f84 | 39,247,411,163,711 | 6c650b3d776057f3bd81fe687657429c7e9a3fd4 | /Earth2300/src/ogpc/earth2300/resource/ResourceManager.java | d878ba2787a5b884bc89e1266e9566c556a4e267 | []
| no_license | jtwaugh/Platformer | https://github.com/jtwaugh/Platformer | 1e3d453fd731cce5ddf634c4006f1afcd781412b | 70e154e8e5b930fb86cbcfffa23b708e971b5784 | refs/heads/master | 2021-01-21T12:06:34.497000 | 2016-08-04T17:27:18 | 2016-08-04T17:27:18 | 20,814,484 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ogpc.earth2300.resource;
import java.awt.Color;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import ogpc.earth2300.entity.Projectile;
import ogpc.earth2300.game.Game;
import ogpc.earth2300.game.Level;
import ogpc.earth2300.game.LevelState;
import ogpc.earth2300.game.Map;
import ogpc.earth2300.game.Overworld;
import ogpc.earth2300.game.OverworldState;
import ogpc.earth2300.game.TitleScreen;
import ogpc.earth2300.graphics.Backdrop;
import ogpc.earth2300.graphics.Sprite;
import ogpc.earth2300.item.RangedWeapon;
import ogpc.earth2300.item.Weapon;
import ogpc.earth2300.visible.Block;
import ogpc.earth2300.visible.Scenery;
public class ResourceManager
{
private HashMap<String, Sprite> sprites;
private HashMap<String, Backdrop> backdrops;
private HashMap<String, Level> levels;
private HashMap<String, Projectile> projtypes;
private HashMap<String, Weapon> weapons;
private HashMap<Color, Scenery> scenery;
private HashMap<Color, Block> blocks;
private int numLoaded;
private FileReader reader;
public ResourceManager() throws IOException
{
reader = new FileReader();
numLoaded = 0;
sprites = new HashMap<String, Sprite>();
backdrops = new HashMap<String, Backdrop>();
levels = new HashMap<String, Level>();
projtypes = new HashMap<String, Projectile>();
weapons = new HashMap<String, Weapon>();
scenery = new HashMap <Color, Scenery>();
blocks = new HashMap<Color, Block>();
}
public int loadNext() throws IOException
{
switch (numLoaded)
{
case 0:
{
loadSprites();
break;
}
case 1:
{
loadBlocks();
break;
}
case 2:
{
loadScenery();
break;
}
case 3:
{
loadProjectiles();
break;
}
case 4:
{
loadWeapons();
break;
}
case 5:
{
loadBGs();
break;
}
case 6:
{
loadLevels();
break;
}
case 7:
{
Game.gameStates.put("level", new LevelState());
break;
}
case 8:
{
Game.gameStates.put("world", new OverworldState());
break;
}
case 9:
{
Game.gameStates.put("title screen", new TitleScreen());
break;
}
}
numLoaded++;
return numLoaded;
}
public void loadBlocks() throws IOException
{
reader.parseBlocksList(FileReader.drive + "blocks/BlocksList.txt", blocks);
}
public void loadBGs() throws IOException
{
reader.parseBackdropList(FileReader.drive + "background/BackgroundsList.txt", backdrops);
}
public void loadScenery() throws IOException
{
reader.parseSceneries(FileReader.drive + "scenery/SceneryList.txt", scenery);
}
public void loadWeapons() throws IOException
{
reader.getWeapons(FileReader.drive + "weapons/WeaponsList.txt", weapons);
}
public void loadSprites() throws IOException
{
reader.getSprites(FileReader.drive + "sprites/SpritesList.txt", sprites);
}
public void loadLevels() throws IOException
{
reader.getLevels(FileReader.drive + "levels/LevelsList.txt", levels);
}
public void loadProjectiles() throws IOException
{
reader.getProjectiles(FileReader.drive + "weapons/projectiles/ProjList.txt", projtypes);
}
public Block getBlock(Color key)
{
try
{
if (key.equals(new Color(255, 255, 255)))
{
return null;
}
return new Block(blocks.get(key));
}
catch (NullPointerException e)
{
return null;
}
}
public Scenery getScenery(Color key)
{
try
{
if (key.equals(new Color(255, 255, 255, 255)))
{
return null;
}
Scenery s = new Scenery(scenery.get(key), 0, 0);
//System.out.println("Added scenery with color value " + s.toString());
return s;
}
catch (NullPointerException e)
{
return null;
}
}
public Scenery getScenery (String name)
{
for (Color c : scenery.keySet())
{
if (scenery.get(c).name.equals(name))
{
return new Scenery(scenery.get(c), 0, 0);
}
}
return null;
}
public Sprite getSprite(String key)
{
return new Sprite(sprites.get(key));
}
public Level getLevel(String key) throws IOException
{
return levels.get(key);
}
public Projectile getProj(String key)
{
return new Projectile(projtypes.get(key));
}
public Backdrop getBG(String key)
{
if (key.equals("null"))
{
return null;
}
return backdrops.get(key);
}
public Weapon getWeapon(String key) throws IOException
{
if (key.equals("null"))
{
return null;
}
if (weapons.get(key).getClips() > 0)
{
return new RangedWeapon(weapons.get(key));
}
return new Weapon(weapons.get(key));
}
public void put(String key, Sprite pic)
{
sprites.put(key, pic);
}
public void loadSpriteFromFile(String filename) throws IOException
{
String key = filename.split(".")[0];
sprites.put(key, new Sprite(filename));
}
}
| UTF-8 | Java | 4,863 | java | ResourceManager.java | Java | []
| null | []
| package ogpc.earth2300.resource;
import java.awt.Color;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import ogpc.earth2300.entity.Projectile;
import ogpc.earth2300.game.Game;
import ogpc.earth2300.game.Level;
import ogpc.earth2300.game.LevelState;
import ogpc.earth2300.game.Map;
import ogpc.earth2300.game.Overworld;
import ogpc.earth2300.game.OverworldState;
import ogpc.earth2300.game.TitleScreen;
import ogpc.earth2300.graphics.Backdrop;
import ogpc.earth2300.graphics.Sprite;
import ogpc.earth2300.item.RangedWeapon;
import ogpc.earth2300.item.Weapon;
import ogpc.earth2300.visible.Block;
import ogpc.earth2300.visible.Scenery;
public class ResourceManager
{
private HashMap<String, Sprite> sprites;
private HashMap<String, Backdrop> backdrops;
private HashMap<String, Level> levels;
private HashMap<String, Projectile> projtypes;
private HashMap<String, Weapon> weapons;
private HashMap<Color, Scenery> scenery;
private HashMap<Color, Block> blocks;
private int numLoaded;
private FileReader reader;
public ResourceManager() throws IOException
{
reader = new FileReader();
numLoaded = 0;
sprites = new HashMap<String, Sprite>();
backdrops = new HashMap<String, Backdrop>();
levels = new HashMap<String, Level>();
projtypes = new HashMap<String, Projectile>();
weapons = new HashMap<String, Weapon>();
scenery = new HashMap <Color, Scenery>();
blocks = new HashMap<Color, Block>();
}
public int loadNext() throws IOException
{
switch (numLoaded)
{
case 0:
{
loadSprites();
break;
}
case 1:
{
loadBlocks();
break;
}
case 2:
{
loadScenery();
break;
}
case 3:
{
loadProjectiles();
break;
}
case 4:
{
loadWeapons();
break;
}
case 5:
{
loadBGs();
break;
}
case 6:
{
loadLevels();
break;
}
case 7:
{
Game.gameStates.put("level", new LevelState());
break;
}
case 8:
{
Game.gameStates.put("world", new OverworldState());
break;
}
case 9:
{
Game.gameStates.put("title screen", new TitleScreen());
break;
}
}
numLoaded++;
return numLoaded;
}
public void loadBlocks() throws IOException
{
reader.parseBlocksList(FileReader.drive + "blocks/BlocksList.txt", blocks);
}
public void loadBGs() throws IOException
{
reader.parseBackdropList(FileReader.drive + "background/BackgroundsList.txt", backdrops);
}
public void loadScenery() throws IOException
{
reader.parseSceneries(FileReader.drive + "scenery/SceneryList.txt", scenery);
}
public void loadWeapons() throws IOException
{
reader.getWeapons(FileReader.drive + "weapons/WeaponsList.txt", weapons);
}
public void loadSprites() throws IOException
{
reader.getSprites(FileReader.drive + "sprites/SpritesList.txt", sprites);
}
public void loadLevels() throws IOException
{
reader.getLevels(FileReader.drive + "levels/LevelsList.txt", levels);
}
public void loadProjectiles() throws IOException
{
reader.getProjectiles(FileReader.drive + "weapons/projectiles/ProjList.txt", projtypes);
}
public Block getBlock(Color key)
{
try
{
if (key.equals(new Color(255, 255, 255)))
{
return null;
}
return new Block(blocks.get(key));
}
catch (NullPointerException e)
{
return null;
}
}
public Scenery getScenery(Color key)
{
try
{
if (key.equals(new Color(255, 255, 255, 255)))
{
return null;
}
Scenery s = new Scenery(scenery.get(key), 0, 0);
//System.out.println("Added scenery with color value " + s.toString());
return s;
}
catch (NullPointerException e)
{
return null;
}
}
public Scenery getScenery (String name)
{
for (Color c : scenery.keySet())
{
if (scenery.get(c).name.equals(name))
{
return new Scenery(scenery.get(c), 0, 0);
}
}
return null;
}
public Sprite getSprite(String key)
{
return new Sprite(sprites.get(key));
}
public Level getLevel(String key) throws IOException
{
return levels.get(key);
}
public Projectile getProj(String key)
{
return new Projectile(projtypes.get(key));
}
public Backdrop getBG(String key)
{
if (key.equals("null"))
{
return null;
}
return backdrops.get(key);
}
public Weapon getWeapon(String key) throws IOException
{
if (key.equals("null"))
{
return null;
}
if (weapons.get(key).getClips() > 0)
{
return new RangedWeapon(weapons.get(key));
}
return new Weapon(weapons.get(key));
}
public void put(String key, Sprite pic)
{
sprites.put(key, pic);
}
public void loadSpriteFromFile(String filename) throws IOException
{
String key = filename.split(".")[0];
sprites.put(key, new Sprite(filename));
}
}
| 4,863 | 0.68723 | 0.667078 | 251 | 18.374502 | 20.280973 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.103586 | false | false | 9 |
cba76e7a61af9446ffb81d20eee3878400148bfd | 36,532,991,864,619 | c0849abb46cb3eb3ee84a8f89632a52762a8c99a | /Prototype5/Prototype3/app/src/main/java/com/example/prototype2/MainActivity.java | eae67d393bed81124e3504c9a6ba12c0e59ecdae | []
| no_license | rogicallab/prototype | https://github.com/rogicallab/prototype | 45dca59dfa73f564bcbcc6a3aeda521ce52e35f2 | a8313b1448c27db51aa63fc9450b672775c7670f | refs/heads/master | 2021-01-01T11:24:12.063000 | 2020-03-25T01:09:26 | 2020-03-25T01:09:26 | 239,257,895 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.prototype2;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.gson.Gson;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// bottomNavigationViewのセッティング
BottomNavigationView navView = findViewById(R.id.nav_view);
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.calendarFragment, R.id.toDoFragment, R.id.settingFragment)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
// テスト
//new ToDoPlan();
// テスト用カテゴリを作成し保存
sharedViewModel.category.add("カテゴリ1");
sharedViewModel.category.add("カテゴリ2");
sharedViewModel.category.add("カテゴリ3");
SharedPreferences data = getSharedPreferences("pref", Context.MODE_PRIVATE);
Gson gson = new Gson();
data.edit().putString("category",gson.toJson(sharedViewModel.category)).apply();
}
}
| UTF-8 | Java | 1,741 | java | MainActivity.java | Java | []
| null | []
| package com.example.prototype2;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.gson.Gson;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// bottomNavigationViewのセッティング
BottomNavigationView navView = findViewById(R.id.nav_view);
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.calendarFragment, R.id.toDoFragment, R.id.settingFragment)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
// テスト
//new ToDoPlan();
// テスト用カテゴリを作成し保存
sharedViewModel.category.add("カテゴリ1");
sharedViewModel.category.add("カテゴリ2");
sharedViewModel.category.add("カテゴリ3");
SharedPreferences data = getSharedPreferences("pref", Context.MODE_PRIVATE);
Gson gson = new Gson();
data.edit().putString("category",gson.toJson(sharedViewModel.category)).apply();
}
}
| 1,741 | 0.739052 | 0.736653 | 44 | 36.886364 | 28.835913 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.75 | false | false | 9 |
cb4430d53d7026bcee5398f5b0667484dd6c9789 | 36,326,833,434,554 | 0fa95d92b6b0c041a243e8d7787b68dded9e1700 | /pi/src/main/java/org/revo/ihear/pi/service/SchemaService.java | edbf4a1254cc3e405fce130e6aea7c57acc5bb1c | []
| no_license | ashraf-revo/ihear | https://github.com/ashraf-revo/ihear | c516d8c755cc3b33a50a1669cf7084a520ec2f56 | d8ee83fa67d54f5702fdbe2e303563924a6c12a5 | refs/heads/master | 2022-12-12T06:26:50.038000 | 2020-05-19T21:36:01 | 2020-05-19T21:36:01 | 201,517,734 | 0 | 0 | null | false | 2022-12-08T03:28:59 | 2019-08-09T18:03:49 | 2020-05-19T21:36:11 | 2022-12-08T03:28:59 | 3,513 | 0 | 0 | 4 | CSS | false | false | package org.revo.ihear.pi.service;
import org.revo.ihear.pi.domain.Schema;
import java.util.List;
import java.util.Optional;
public interface SchemaService {
Optional<Schema> findOneById(String id);
Schema save(Schema schema);
List<Schema> findAll();
}
| UTF-8 | Java | 270 | java | SchemaService.java | Java | []
| null | []
| package org.revo.ihear.pi.service;
import org.revo.ihear.pi.domain.Schema;
import java.util.List;
import java.util.Optional;
public interface SchemaService {
Optional<Schema> findOneById(String id);
Schema save(Schema schema);
List<Schema> findAll();
}
| 270 | 0.740741 | 0.740741 | 14 | 18.285715 | 16.489948 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 9 |
09ba90de3c05ba5b527f768f295a022565e08a5a | 35,991,825,984,578 | ba30d374f4f0c5acf10415b9660417644ac73272 | /app/src/main/java/orion/garon/gifsearcher/rest/GifMethods.java | ef9b70f5c7d75a6da3f95b5f5315473908db87a7 | []
| no_license | Garon147/GifSearcher | https://github.com/Garon147/GifSearcher | 505a1b06eb4adfcef898b9a1e2560e9082a25926 | 5a4188158a4cb8b42aa12009650abb8c304a3dca | refs/heads/master | 2021-01-18T20:16:24.759000 | 2017-04-05T09:32:12 | 2017-04-05T09:32:12 | 86,950,319 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package orion.garon.gifsearcher.rest;
import orion.garon.gifsearcher.rest.data.GifList;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.GET;
/**
* Created by VKI on 01.04.2017.
*/
public interface GifMethods {
@GET("v1/gifs/trending?api_key=dc6zaTOxFJmzC")
Call<GifList> gifs();
public static final Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://api.giphy.com/")
.addConverterFactory(GsonConverterFactory.create())
.build();
}
| UTF-8 | Java | 573 | java | GifMethods.java | Java | [
{
"context": "ory;\nimport retrofit2.http.GET;\n\n/**\n * Created by VKI on 01.04.2017.\n */\n\npublic interface GifMethods {",
"end": 242,
"score": 0.9979488849639893,
"start": 239,
"tag": "USERNAME",
"value": "VKI"
},
{
"context": " GifMethods {\n\n @GET(\"v1/gifs/trending?api_key=dc6zaTOxFJmzC\")\n Call<GifList> gifs();\n\n public static fi",
"end": 342,
"score": 0.9985219836235046,
"start": 329,
"tag": "KEY",
"value": "dc6zaTOxFJmzC"
}
]
| null | []
| package orion.garon.gifsearcher.rest;
import orion.garon.gifsearcher.rest.data.GifList;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.GET;
/**
* Created by VKI on 01.04.2017.
*/
public interface GifMethods {
@GET("v1/gifs/trending?api_key=<KEY>")
Call<GifList> gifs();
public static final Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://api.giphy.com/")
.addConverterFactory(GsonConverterFactory.create())
.build();
}
| 565 | 0.710297 | 0.685864 | 22 | 25.045454 | 21.757919 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.363636 | false | false | 9 |
a22e4db3f67286cbdd65e3d1b5819fb346f3414e | 37,237,366,492,307 | 0f165ea98020a7706a590c56d6e82c622088b256 | /src/main/java/security/diffie/SocketAliceObject.java | 86a89b9c3aa64ed865dd280bdfc3b87947452213 | []
| no_license | danielkaiser80/uebungen | https://github.com/danielkaiser80/uebungen | 4d3e6f18367f53f230e68dd4a1416b77edb85682 | 67198791f94cecb08b424cb5a9acd32918a6aedf | refs/heads/master | 2020-04-06T16:11:05.972000 | 2019-07-17T20:44:54 | 2019-07-17T20:44:54 | 157,609,261 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package security.diffie;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.agreement.DHAgreement;
import org.bouncycastle.crypto.generators.DHBasicKeyPairGenerator;
import org.bouncycastle.crypto.generators.DHParametersGenerator;
import org.bouncycastle.crypto.params.DHKeyGenerationParameters;
import org.bouncycastle.crypto.params.DHParameters;
import org.bouncycastle.crypto.params.DHPrivateKeyParameters;
import org.bouncycastle.crypto.params.DHPublicKeyParameters;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.math.BigInteger;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.SecureRandom;
class SocketAliceObject extends JFrame implements ActionListener {
private static final long serialVersionUID = 1L;
@Nonnull
private final JButton button;
private final JTextArea textArea = new JTextArea();
JLabel clicked;
@Nullable
private ObjectOutputStream out = null;
@Nullable
private ObjectInputStream in = null;
private SocketAliceObject() { // Begin Constructor
button = new JButton("Click Me");
button.addActionListener(this);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setBackground(Color.white);
getContentPane().add(panel);
JLabel text = new JLabel("Start des Diffie-Hellman-Schlüsselaustauschs");
panel.add("North", text);
panel.add("Center", textArea);
panel.add("South", button);
}
public static void main(String[] args) {
SocketAliceObject frame = new SocketAliceObject();
frame.setTitle("Diffie-Hellman-Schlüsselaustausch: Alice");
frame.setSize(800, 300);
WindowListener l = new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
};
frame.addWindowListener(l);
frame.setVisible(true);
frame.listenSocket();
}
@Override
public void actionPerformed(@Nonnull ActionEvent event) {
Object source = event.getSource();
if (source == button) {
// using new parameter generator
DHParametersGenerator dhpg = new DHParametersGenerator();
// size (bit), certain, new SecureRandom
dhpg.init(256, 10, new SecureRandom());
// generate parameters p and g
DHParameters dhParam = dhpg.generateParameters();
BigInteger p = dhParam.getP();
BigInteger g = dhParam.getG();
// use parameters with standard settings
dhParam = new DHParameters(p, g);
// initialize key generator & generate asymmetric key pair
DHKeyGenerationParameters kgp = new DHKeyGenerationParameters(new SecureRandom(), dhParam);
DHBasicKeyPairGenerator bkpg = new DHBasicKeyPairGenerator();
bkpg.init(kgp);
AsymmetricCipherKeyPair ackp = bkpg.generateKeyPair();
// divide key pair into public and private keys
DHPublicKeyParameters pubkp = (DHPublicKeyParameters) ackp.getPublic();
DHPrivateKeyParameters privkp = (DHPrivateKeyParameters) ackp.getPrivate();
// initialize Diffie Hellman Agreement with private key
DHAgreement dhba = new DHAgreement();
dhba.init(privkp);
// calculate A
BigInteger A = dhba.calculateMessage();
// get y from public key
BigInteger y = pubkp.getY();
try {
// Send data over socket
out.writeObject(A);
out.writeObject(p);
out.writeObject(g);
out.writeObject(y);
out.flush();
textArea.setText("Daten verschickt");
// Receive B and y (public key) from bob
BigInteger B = (BigInteger) in.readObject();
BigInteger y2 = (BigInteger) in.readObject();
// intialize diffie hellman parameters and calculate agreement
BigInteger Agreement = dhba.calculateAgreement(new DHPublicKeyParameters(y2, new DHParameters(p, g)),
B);
textArea.setText("Das ist Agreement ist: " + Agreement);
} catch (IOException e) {
System.err.println("Input or output error.");
System.err.println(e.getMessage());
} catch (ClassNotFoundException e) {
System.err.println("Class not found.");
System.err.println(e.getMessage());
}
}
}
public void listenSocket() {
// Create socket connection
try {
Socket socket = new Socket("localhost", 7777);
out = new ObjectOutputStream(socket.getOutputStream());
in = new ObjectInputStream(socket.getInputStream());
} catch (UnknownHostException e) {
System.err.println("Unknown host: localhost");
System.err.println(e.getMessage());
} catch (IOException e) {
System.err.println("No I/O");
System.err.println(e.getMessage());
}
}
}
| UTF-8 | Java | 4,633 | java | SocketAliceObject.java | Java | [
{
"context": "frame.setTitle(\"Diffie-Hellman-Schlüsselaustausch: Alice\");\n\t\tframe.setSize(800, 300);\n\t\tWindowListener l ",
"end": 1779,
"score": 0.717211902141571,
"start": 1774,
"tag": "NAME",
"value": "Alice"
}
]
| null | []
| package security.diffie;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.agreement.DHAgreement;
import org.bouncycastle.crypto.generators.DHBasicKeyPairGenerator;
import org.bouncycastle.crypto.generators.DHParametersGenerator;
import org.bouncycastle.crypto.params.DHKeyGenerationParameters;
import org.bouncycastle.crypto.params.DHParameters;
import org.bouncycastle.crypto.params.DHPrivateKeyParameters;
import org.bouncycastle.crypto.params.DHPublicKeyParameters;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.math.BigInteger;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.SecureRandom;
class SocketAliceObject extends JFrame implements ActionListener {
private static final long serialVersionUID = 1L;
@Nonnull
private final JButton button;
private final JTextArea textArea = new JTextArea();
JLabel clicked;
@Nullable
private ObjectOutputStream out = null;
@Nullable
private ObjectInputStream in = null;
private SocketAliceObject() { // Begin Constructor
button = new JButton("Click Me");
button.addActionListener(this);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setBackground(Color.white);
getContentPane().add(panel);
JLabel text = new JLabel("Start des Diffie-Hellman-Schlüsselaustauschs");
panel.add("North", text);
panel.add("Center", textArea);
panel.add("South", button);
}
public static void main(String[] args) {
SocketAliceObject frame = new SocketAliceObject();
frame.setTitle("Diffie-Hellman-Schlüsselaustausch: Alice");
frame.setSize(800, 300);
WindowListener l = new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
};
frame.addWindowListener(l);
frame.setVisible(true);
frame.listenSocket();
}
@Override
public void actionPerformed(@Nonnull ActionEvent event) {
Object source = event.getSource();
if (source == button) {
// using new parameter generator
DHParametersGenerator dhpg = new DHParametersGenerator();
// size (bit), certain, new SecureRandom
dhpg.init(256, 10, new SecureRandom());
// generate parameters p and g
DHParameters dhParam = dhpg.generateParameters();
BigInteger p = dhParam.getP();
BigInteger g = dhParam.getG();
// use parameters with standard settings
dhParam = new DHParameters(p, g);
// initialize key generator & generate asymmetric key pair
DHKeyGenerationParameters kgp = new DHKeyGenerationParameters(new SecureRandom(), dhParam);
DHBasicKeyPairGenerator bkpg = new DHBasicKeyPairGenerator();
bkpg.init(kgp);
AsymmetricCipherKeyPair ackp = bkpg.generateKeyPair();
// divide key pair into public and private keys
DHPublicKeyParameters pubkp = (DHPublicKeyParameters) ackp.getPublic();
DHPrivateKeyParameters privkp = (DHPrivateKeyParameters) ackp.getPrivate();
// initialize Diffie Hellman Agreement with private key
DHAgreement dhba = new DHAgreement();
dhba.init(privkp);
// calculate A
BigInteger A = dhba.calculateMessage();
// get y from public key
BigInteger y = pubkp.getY();
try {
// Send data over socket
out.writeObject(A);
out.writeObject(p);
out.writeObject(g);
out.writeObject(y);
out.flush();
textArea.setText("Daten verschickt");
// Receive B and y (public key) from bob
BigInteger B = (BigInteger) in.readObject();
BigInteger y2 = (BigInteger) in.readObject();
// intialize diffie hellman parameters and calculate agreement
BigInteger Agreement = dhba.calculateAgreement(new DHPublicKeyParameters(y2, new DHParameters(p, g)),
B);
textArea.setText("Das ist Agreement ist: " + Agreement);
} catch (IOException e) {
System.err.println("Input or output error.");
System.err.println(e.getMessage());
} catch (ClassNotFoundException e) {
System.err.println("Class not found.");
System.err.println(e.getMessage());
}
}
}
public void listenSocket() {
// Create socket connection
try {
Socket socket = new Socket("localhost", 7777);
out = new ObjectOutputStream(socket.getOutputStream());
in = new ObjectInputStream(socket.getInputStream());
} catch (UnknownHostException e) {
System.err.println("Unknown host: localhost");
System.err.println(e.getMessage());
} catch (IOException e) {
System.err.println("No I/O");
System.err.println(e.getMessage());
}
}
}
| 4,633 | 0.739581 | 0.735478 | 133 | 33.81955 | 21.062683 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.721805 | false | false | 9 |
a6361c674055efe59b302d6d44ef0d340a55349d | 37,632,503,480,079 | d6b9618bfd6852968876ff31950331258aa26ff9 | /backend/n2o/n2o-config/src/main/java/net/n2oapp/framework/config/metadata/compile/N2oCompileTransformerFactory.java | 225a2021cb7212ac09bd317434d42c73198bd389 | [
"Apache-2.0"
]
| permissive | i-novus-llc/n2o-framework | https://github.com/i-novus-llc/n2o-framework | 03c19201914e4f551cbdce6cb8a3d013fb700af2 | 172e7724fc9cdd029ee8dd5b25985aeb4bf30659 | refs/heads/master | 2023-08-09T13:50:28.451000 | 2023-08-09T13:26:56 | 2023-08-09T13:26:56 | 162,547,920 | 43 | 21 | Apache-2.0 | false | 2023-02-03T11:48:29 | 2018-12-20T08:16:02 | 2023-01-31T17:08:47 | 2023-02-03T11:48:28 | 92,302 | 36 | 16 | 122 | Java | false | false | package net.n2oapp.framework.config.metadata.compile;
import net.n2oapp.framework.api.metadata.Compiled;
import net.n2oapp.framework.api.metadata.compile.CompileContext;
import net.n2oapp.framework.api.metadata.compile.CompileProcessor;
import net.n2oapp.framework.api.metadata.compile.CompileTransformer;
import net.n2oapp.framework.api.metadata.compile.CompileTransformerFactory;
import net.n2oapp.framework.config.factory.BaseMetadataFactory;
import java.util.List;
import java.util.Map;
import static net.n2oapp.framework.config.factory.FactoryPredicates.isCompiledAssignableFrom;
import static net.n2oapp.framework.config.factory.FactoryPredicates.isOptionalContextAssignableFrom;
public class N2oCompileTransformerFactory extends BaseMetadataFactory<CompileTransformer<?, ?>> implements CompileTransformerFactory {
public N2oCompileTransformerFactory() {
}
public N2oCompileTransformerFactory(Map<String, CompileTransformer<?, ?>> beans) {
super(beans);
}
@SuppressWarnings("unchecked")
@Override
public <D extends Compiled> D transform(D compiled, CompileContext<?, ?> context, CompileProcessor p) {
List<CompileTransformer<?, ?>> transformers = produceList((g, d) ->
isCompiledAssignableFrom(g, d) && isOptionalContextAssignableFrom(g, context),
compiled);
D result = compiled;
for (CompileTransformer<?, ?> transformer : transformers) {
CompileTransformer<D, CompileContext<?, ?>> castedTransformer = (CompileTransformer<D, CompileContext<?, ?>>) transformer;
if (castedTransformer.matches(result, context))
result = castedTransformer.transform(result, context, p);
}
return result;
}
}
| UTF-8 | Java | 1,756 | java | N2oCompileTransformerFactory.java | Java | []
| null | []
| package net.n2oapp.framework.config.metadata.compile;
import net.n2oapp.framework.api.metadata.Compiled;
import net.n2oapp.framework.api.metadata.compile.CompileContext;
import net.n2oapp.framework.api.metadata.compile.CompileProcessor;
import net.n2oapp.framework.api.metadata.compile.CompileTransformer;
import net.n2oapp.framework.api.metadata.compile.CompileTransformerFactory;
import net.n2oapp.framework.config.factory.BaseMetadataFactory;
import java.util.List;
import java.util.Map;
import static net.n2oapp.framework.config.factory.FactoryPredicates.isCompiledAssignableFrom;
import static net.n2oapp.framework.config.factory.FactoryPredicates.isOptionalContextAssignableFrom;
public class N2oCompileTransformerFactory extends BaseMetadataFactory<CompileTransformer<?, ?>> implements CompileTransformerFactory {
public N2oCompileTransformerFactory() {
}
public N2oCompileTransformerFactory(Map<String, CompileTransformer<?, ?>> beans) {
super(beans);
}
@SuppressWarnings("unchecked")
@Override
public <D extends Compiled> D transform(D compiled, CompileContext<?, ?> context, CompileProcessor p) {
List<CompileTransformer<?, ?>> transformers = produceList((g, d) ->
isCompiledAssignableFrom(g, d) && isOptionalContextAssignableFrom(g, context),
compiled);
D result = compiled;
for (CompileTransformer<?, ?> transformer : transformers) {
CompileTransformer<D, CompileContext<?, ?>> castedTransformer = (CompileTransformer<D, CompileContext<?, ?>>) transformer;
if (castedTransformer.matches(result, context))
result = castedTransformer.transform(result, context, p);
}
return result;
}
}
| 1,756 | 0.743736 | 0.736902 | 40 | 42.900002 | 39.423851 | 134 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.9 | false | false | 9 |
88a88045afaa09505b811d6f5c138cc2916cf6ea | 35,820,027,296,907 | d07655750f5f850ef1acbedb4cc9d8dbc9f499eb | /chapter_005/src/main/java/list/dynamiclinkedlist/DynamicLinkList.java | 118cf24363c87c8dea7fbe37d6f704ff348963d6 | [
"Apache-2.0"
]
| permissive | maxvanny2010/job4j | https://github.com/maxvanny2010/job4j | e3da6de137a997411dd3b5dff9c3d0a8ba9818bf | bb158ad78ebef7fbaa0acaf3235ef80c0f5c9a2f | refs/heads/master | 2022-12-22T08:01:53.180000 | 2021-11-30T12:16:33 | 2021-11-30T12:16:33 | 162,292,097 | 0 | 0 | Apache-2.0 | false | 2022-12-16T15:44:05 | 2018-12-18T13:25:58 | 2021-11-30T12:16:38 | 2022-12-16T15:44:01 | 5,731 | 0 | 3 | 32 | Java | false | false | package list.dynamiclinkedlist;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
/**
* DynamicLinkList.
*
* @param <T> param T.
* @author Maxim Vanny
* @version 5.0
* @since 2/22/2019
*/
@SuppressWarnings("Duplicates")
public class DynamicLinkList<T> implements Iterable<T> {
/**
* Cursor.
*/
private int cursor;
/**
* First Node.
*/
private Node<T> first;
/**
* Method add.
*
* @param value value
*/
public final void add(final T value) {
Node<T> newNode = new Node<>(value);
newNode.next = this.first;
this.first = newNode;
this.cursor++;
}
/**
* Method return and delete first element in stack.
*
* @return new value.
*/
public final T removeFirst() {
if (this.first == null) {
throw new UnsupportedOperationException("Stack is empty");
}
T data = this.first.data;
this.first = this.first.next;
return data;
}
/**
* Method Get.
*
* @param index index
* @return data
*/
public final T get(final int index) {
if (index > this.cursor) {
throw new UnsupportedOperationException("Element missing");
}
Node<T> result = this.first;
for (int i = 0; i < index; i++) {
result = result.next;
}
return result.data;
}
@Override
public final Iterator<T> iterator() {
return new Iterator<>() {
private final int modificationCountMod = cursor;
private Node<T> temp = first;
@Override
public boolean hasNext() {
if (cursor != this.modificationCountMod) {
throw new ConcurrentModificationException();
}
return this.temp != null;
}
@Override
public T next() {
if (!this.hasNext()) {
throw new UnsupportedOperationException();
}
T data = this.temp.data;
this.temp = this.temp.next;
return data;
}
};
}
/**
* class Node.
*
* @param <T> any Т
*/
private static class Node<T> {
/**
* field data.
*/
private final T data;
/**
* field Node.
*/
private Node<T> next;
/**
* Constructor.
*
* @param aData data
*/
Node(final T aData) {
this.data = aData;
}
}
}
| UTF-8 | Java | 2,639 | java | DynamicLinkList.java | Java | [
{
"context": "amicLinkList.\n *\n * @param <T> param T.\n * @author Maxim Vanny\n * @version 5.0\n * @since 2/22/2019\n */\n@Suppress",
"end": 183,
"score": 0.9997549653053284,
"start": 172,
"tag": "NAME",
"value": "Maxim Vanny"
}
]
| null | []
| package list.dynamiclinkedlist;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
/**
* DynamicLinkList.
*
* @param <T> param T.
* @author <NAME>
* @version 5.0
* @since 2/22/2019
*/
@SuppressWarnings("Duplicates")
public class DynamicLinkList<T> implements Iterable<T> {
/**
* Cursor.
*/
private int cursor;
/**
* First Node.
*/
private Node<T> first;
/**
* Method add.
*
* @param value value
*/
public final void add(final T value) {
Node<T> newNode = new Node<>(value);
newNode.next = this.first;
this.first = newNode;
this.cursor++;
}
/**
* Method return and delete first element in stack.
*
* @return new value.
*/
public final T removeFirst() {
if (this.first == null) {
throw new UnsupportedOperationException("Stack is empty");
}
T data = this.first.data;
this.first = this.first.next;
return data;
}
/**
* Method Get.
*
* @param index index
* @return data
*/
public final T get(final int index) {
if (index > this.cursor) {
throw new UnsupportedOperationException("Element missing");
}
Node<T> result = this.first;
for (int i = 0; i < index; i++) {
result = result.next;
}
return result.data;
}
@Override
public final Iterator<T> iterator() {
return new Iterator<>() {
private final int modificationCountMod = cursor;
private Node<T> temp = first;
@Override
public boolean hasNext() {
if (cursor != this.modificationCountMod) {
throw new ConcurrentModificationException();
}
return this.temp != null;
}
@Override
public T next() {
if (!this.hasNext()) {
throw new UnsupportedOperationException();
}
T data = this.temp.data;
this.temp = this.temp.next;
return data;
}
};
}
/**
* class Node.
*
* @param <T> any Т
*/
private static class Node<T> {
/**
* field data.
*/
private final T data;
/**
* field Node.
*/
private Node<T> next;
/**
* Constructor.
*
* @param aData data
*/
Node(final T aData) {
this.data = aData;
}
}
}
| 2,634 | 0.486732 | 0.482942 | 119 | 21.168068 | 16.909706 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.260504 | false | false | 9 |
fc572ea5165f91a5c1e96a4ec0ad395bfffbdee0 | 19,602,230,763,010 | dbd4fe5eefcd3b58b42402036fcbbd7aacaa612b | /lesson3/Utils/Utils.java | 35781d06531f741f23b7a33d4b732c847d4ccddb | []
| no_license | autumnra1n/JavaExternal_06_03_2018 | https://github.com/autumnra1n/JavaExternal_06_03_2018 | b95e65da0985055afa51998251fa3ca203800a7e | 2ce6242f15e46fdec6e6430eb3e91ae43cf613dc | refs/heads/master | 2021-04-03T01:17:42.415000 | 2018-04-30T13:06:29 | 2018-04-30T13:06:29 | 124,435,416 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package lesson3.Utils;
import lesson3.model.CVehicle;
import java.util.Arrays;
/**
* Created by Михаил on 16.03.2018.
*/
public class Utils {
private final static int YEAR = 2012;
public static String highestPrice(DynamicVehicleArray vehicles){
int count = 0;
int maxPrice = 0;
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getPrice()>maxPrice) {
maxPrice = vehicles.getDynamicArray()[i].getPrice();
count = vehicles.getDynamicArray()[i].getPrice();
}
else
return "no vehicle found";
}
return (vehicles.getDynamicArray()[count].toString());
}
public static String lowestPrice(DynamicVehicleArray vehicles){
int count = 0;
int lowestPrice = vehicles.getDynamicArray()[0].getPrice();
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getYear()>=2000&&vehicles.getDynamicArray()[i].getYear()<=2005) {
if (vehicles.getDynamicArray()[i].getSpeed() > 150) {
if (vehicles.getDynamicArray()[i].getPrice() < lowestPrice) {
count = i;
}
else
return "no vehicle found";
}
}
else
return "no vehicle found";
}
return vehicles.getDynamicArray()[count].toString();
}
public static String youngCars(DynamicVehicleArray vehicles){
DynamicVehicleArray dynamicVehicleArray = new DynamicVehicleArray();
boolean exists = false;
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getClass().getName().equals("lesson3.model.CCar")&&vehicles.getDynamicArray()[i].getYear()>YEAR) {
dynamicVehicleArray.add(vehicles.getDynamicArray()[i]);
exists = true;
}
}
if(exists){
return dynamicVehicleArray.toString();
}
else {
return "no car found";
}
}
public static String ships(DynamicVehicleArray vehicles){
DynamicVehicleArray dynamicVehicleArray = new DynamicVehicleArray();
boolean exists = false;
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getClass().getName().equals("lesson3.model.CShip")) {
dynamicVehicleArray.add(vehicles.getDynamicArray()[i]);
exists = true;
}
}
if(exists){
CVehicle[] tempArray = dynamicVehicleArray.getDynamicArray();
for (int j = 0; j < tempArray.length - 1; j++) {
for (int k = j + 1; k < tempArray.length; k++) {
if (tempArray[j].getPrice()<tempArray[k].getPrice()) {
CVehicle temp = tempArray[k];
tempArray[k] = tempArray[j];
tempArray[j] = temp;
}
}
}
return Arrays.toString(tempArray);
}
else {
return "no ship found";
}
}
}
| UTF-8 | Java | 3,279 | java | Utils.java | Java | [
{
"context": "icle;\n\nimport java.util.Arrays;\n\n/**\n * Created by Михаил on 16.03.2018.\n */\npublic class Utils {\n priva",
"end": 106,
"score": 0.9998598694801331,
"start": 100,
"tag": "NAME",
"value": "Михаил"
}
]
| null | []
| package lesson3.Utils;
import lesson3.model.CVehicle;
import java.util.Arrays;
/**
* Created by Михаил on 16.03.2018.
*/
public class Utils {
private final static int YEAR = 2012;
public static String highestPrice(DynamicVehicleArray vehicles){
int count = 0;
int maxPrice = 0;
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getPrice()>maxPrice) {
maxPrice = vehicles.getDynamicArray()[i].getPrice();
count = vehicles.getDynamicArray()[i].getPrice();
}
else
return "no vehicle found";
}
return (vehicles.getDynamicArray()[count].toString());
}
public static String lowestPrice(DynamicVehicleArray vehicles){
int count = 0;
int lowestPrice = vehicles.getDynamicArray()[0].getPrice();
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getYear()>=2000&&vehicles.getDynamicArray()[i].getYear()<=2005) {
if (vehicles.getDynamicArray()[i].getSpeed() > 150) {
if (vehicles.getDynamicArray()[i].getPrice() < lowestPrice) {
count = i;
}
else
return "no vehicle found";
}
}
else
return "no vehicle found";
}
return vehicles.getDynamicArray()[count].toString();
}
public static String youngCars(DynamicVehicleArray vehicles){
DynamicVehicleArray dynamicVehicleArray = new DynamicVehicleArray();
boolean exists = false;
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getClass().getName().equals("lesson3.model.CCar")&&vehicles.getDynamicArray()[i].getYear()>YEAR) {
dynamicVehicleArray.add(vehicles.getDynamicArray()[i]);
exists = true;
}
}
if(exists){
return dynamicVehicleArray.toString();
}
else {
return "no car found";
}
}
public static String ships(DynamicVehicleArray vehicles){
DynamicVehicleArray dynamicVehicleArray = new DynamicVehicleArray();
boolean exists = false;
for (int i = 0; i<vehicles.getDynamicArray().length; i++){
if(vehicles.getDynamicArray()[i].getClass().getName().equals("lesson3.model.CShip")) {
dynamicVehicleArray.add(vehicles.getDynamicArray()[i]);
exists = true;
}
}
if(exists){
CVehicle[] tempArray = dynamicVehicleArray.getDynamicArray();
for (int j = 0; j < tempArray.length - 1; j++) {
for (int k = j + 1; k < tempArray.length; k++) {
if (tempArray[j].getPrice()<tempArray[k].getPrice()) {
CVehicle temp = tempArray[k];
tempArray[k] = tempArray[j];
tempArray[j] = temp;
}
}
}
return Arrays.toString(tempArray);
}
else {
return "no ship found";
}
}
}
| 3,279 | 0.539261 | 0.52765 | 87 | 36.620689 | 29.181257 | 143 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.505747 | false | false | 9 |
21e6d0e9b2e1ffd76082f072b1486e0ebd0c3048 | 8,332,236,587,996 | d92ea22d2f594fe9a07b92eeb6e345cc599842ff | /src/com/bclymer/jsonviewer/EventBus.java | 168cac75c71c36975a7c2e43fbbca99447ba19a1 | []
| no_license | bclymer/JsonViewer | https://github.com/bclymer/JsonViewer | 6f52b371c7bd9aa138684c5869bda61153f2c568 | 93da7a45f31e4d9fd357c00ec034b6315b0716ff | refs/heads/master | 2016-09-15T18:03:59.631000 | 2013-10-06T20:38:28 | 2013-10-06T20:38:28 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.bclymer.jsonviewer;
import java.lang.Thread.UncaughtExceptionHandler;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
/**
* Utility class to subscribe to events of any class.
* @author Brian Clymer
* @version 1.1
*/
public class EventBus {
private Map<Class<?>, List<Listener>> mSubcribers;
private Map<Class<?>, Object> mStickies;
private static final int CORE_POOL_SIZE = 1;
private static final int MAXIMUM_POOL_SIZE = 128;
private static final int KEEP_ALIVE = 1;
private static final AtomicInteger threadId = new AtomicInteger();
private static UncaughtExceptionHandler mExceptionHandler = new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
JsonApplication.reportException(ex);
}
};
private static final ThreadFactory mThreadFactory = new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setName("EventBus-" + threadId.getAndIncrement());
t.setUncaughtExceptionHandler(mExceptionHandler);
return t;
}
};
private static final BlockingQueue<Runnable> mPoolWorkQueue = new LinkedBlockingQueue<Runnable>();
private static final ThreadPoolExecutor mExecutor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, KEEP_ALIVE, TimeUnit.SECONDS, mPoolWorkQueue, mThreadFactory);
private static Handler mHandler;
private EventBus() {
mSubcribers = new HashMap<Class<?>, List<Listener>>();
mStickies = new HashMap<Class<?>, Object>();
mHandler = new Handler(Looper.getMainLooper());
}
private static class EventBusHolder {
public static final EventBus INSTANCE = new EventBus();
}
public static EventBus getInstance() {
return EventBusHolder.INSTANCE;
}
/**
* Subscribe the listeners to all the passed in classes
* @param eventListener Class implementing EventListener to subscribe to events.
* @param classes Classes to subscribe to events from.
*/
public void subscribe(EventListener eventListener, Class<?>... classes) {
subscribe(eventListener, ThreadMode.POSTING, false, classes);
}
/**
* Subscribe the listeners to all the passed in classes
* @param eventListener Class implementing EventListener to subscribe to events.
* @param threadMode Which thread to receive the event on.
* @param classes Classes to subscribe to events from.
*/
public void subscribe(EventListener eventListener, ThreadMode threadMode, Class<?>... classes) {
subscribe(eventListener, threadMode, false, classes);
}
/**
* Subscribe the listeners to all the passed in classes
* @param eventListener Class implementing EventListener to subscribe to events.
* @param threadMode Which thread to receive the event on.
* @param sticky Whether this class should immediately receive the most recent message of classes.
* @param classes Classes to subscribe to events from.
*/
public void subscribe(EventListener eventListener, ThreadMode threadMode, boolean sticky, Class<?>... classes) {
for (Class<?> clazz : classes) {
if (!mSubcribers.containsKey(clazz)) {
mSubcribers.put(clazz, new ArrayList<Listener>(1));
}
List<Listener> listenerRefs = mSubcribers.get(clazz);
for (int i = 0; i < listenerRefs.size(); i++) {
if (listenerRefs.get(i).eventListener.get() != null && listenerRefs.get(i).eventListener.get().equals(eventListener)) {
Log.w("EventBus", "Attempt to register the same object twice, object not registered second time.");
return;
}
}
mSubcribers.get(clazz).add(new Listener(threadMode, eventListener));
if (sticky && mStickies.containsKey(clazz)) {
post(mStickies.get(clazz), eventListener, threadMode);
}
}
}
/**
* Unsubscribe the listener from all passed in classes.
* @param eventListener Class implementing EventListener to unsubscribe from events.
* @param classes Classes to unsubscribe from.
*/
public void unsubscribe(EventListener eventListener, Class<?>... classes) {
for (Class<?> clazz : classes) {
if (!mSubcribers.containsKey(clazz)) {
Log.w("EventBus", "Attempt to unsubscribe without previously subscribing.");
continue;
}
boolean removed = false;
List<Listener> listenerRefs = mSubcribers.get(clazz);
for (int i = 0; i < listenerRefs.size(); i++) {
if (listenerRefs.get(i).eventListener.get() != null && listenerRefs.get(i).eventListener.get().equals(eventListener)) {
listenerRefs.remove(i);
removed = true;
break;
}
}
if (!removed) {
Log.w("EventBus", "Attempt to unsubscribe without previously subscribing.");
}
}
}
/**
* Post an event to all subscribed objects.
* @param event The event to post to all subscribers.
*/
public void post(Object event) {
if (!mSubcribers.containsKey(event.getClass())) {
return;
}
mStickies.put(event.getClass(), event);
List<Listener> listeners = mSubcribers.get(event.getClass());
List<Listener> toRemove = new ArrayList<Listener>(listeners.size());
for (Listener listener : listeners) {
EventListener eventListener = listener.eventListener.get();
if (eventListener == null) {
Log.w("EventBus", "Some subscription wasn't unregistered before getting deallocated.");
toRemove.add(listener);
continue;
}
post(event, eventListener, listener.threadMode);
}
listeners.removeAll(toRemove);
}
private void post(Object event, EventListener eventListener, ThreadMode threadMode) {
switch (threadMode) {
case POSTING:
eventListener.newEvent(event);
break;
case MAIN:
// If already on the main thread, post in now.
// mHandler.post will wait until the main thread is free
if (Looper.getMainLooper().getThread() == Thread.currentThread()) {
eventListener.newEvent(event);
} else {
mHandler.post(getRunnableForEvent(event, eventListener));
}
break;
case BACKGROUND:
// not checking if we're on a background thread already, mainly because
// the user likely called this so that the event is asynchronous, not purely so
// it's not on the main thread.
mExecutor.execute(getRunnableForEvent(event, eventListener));
break;
}
}
private Runnable getRunnableForEvent(final Object event, final EventListener eventListener) {
return new Runnable() {
@Override
public void run() {
eventListener.newEvent(event);
}
};
}
private class Listener {
ThreadMode threadMode;
WeakReference<EventListener> eventListener;
public Listener(ThreadMode threadMode, EventListener eventListener) {
this.threadMode = threadMode;
this.eventListener = new WeakReference<EventListener>(eventListener);
}
}
public enum ThreadMode {
POSTING,
MAIN,
BACKGROUND;
}
public interface EventListener {
public void newEvent(Object event);
}
}
| UTF-8 | Java | 7,189 | java | EventBus.java | Java | [
{
"context": "ss to subscribe to events of any class.\n * @author Brian Clymer\n * @version 1.1\n */\npublic class EventBus {\n\n\tpri",
"end": 650,
"score": 0.9997353553771973,
"start": 638,
"tag": "NAME",
"value": "Brian Clymer"
}
]
| null | []
| package com.bclymer.jsonviewer;
import java.lang.Thread.UncaughtExceptionHandler;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
/**
* Utility class to subscribe to events of any class.
* @author <NAME>
* @version 1.1
*/
public class EventBus {
private Map<Class<?>, List<Listener>> mSubcribers;
private Map<Class<?>, Object> mStickies;
private static final int CORE_POOL_SIZE = 1;
private static final int MAXIMUM_POOL_SIZE = 128;
private static final int KEEP_ALIVE = 1;
private static final AtomicInteger threadId = new AtomicInteger();
private static UncaughtExceptionHandler mExceptionHandler = new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
JsonApplication.reportException(ex);
}
};
private static final ThreadFactory mThreadFactory = new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setName("EventBus-" + threadId.getAndIncrement());
t.setUncaughtExceptionHandler(mExceptionHandler);
return t;
}
};
private static final BlockingQueue<Runnable> mPoolWorkQueue = new LinkedBlockingQueue<Runnable>();
private static final ThreadPoolExecutor mExecutor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, KEEP_ALIVE, TimeUnit.SECONDS, mPoolWorkQueue, mThreadFactory);
private static Handler mHandler;
private EventBus() {
mSubcribers = new HashMap<Class<?>, List<Listener>>();
mStickies = new HashMap<Class<?>, Object>();
mHandler = new Handler(Looper.getMainLooper());
}
private static class EventBusHolder {
public static final EventBus INSTANCE = new EventBus();
}
public static EventBus getInstance() {
return EventBusHolder.INSTANCE;
}
/**
* Subscribe the listeners to all the passed in classes
* @param eventListener Class implementing EventListener to subscribe to events.
* @param classes Classes to subscribe to events from.
*/
public void subscribe(EventListener eventListener, Class<?>... classes) {
subscribe(eventListener, ThreadMode.POSTING, false, classes);
}
/**
* Subscribe the listeners to all the passed in classes
* @param eventListener Class implementing EventListener to subscribe to events.
* @param threadMode Which thread to receive the event on.
* @param classes Classes to subscribe to events from.
*/
public void subscribe(EventListener eventListener, ThreadMode threadMode, Class<?>... classes) {
subscribe(eventListener, threadMode, false, classes);
}
/**
* Subscribe the listeners to all the passed in classes
* @param eventListener Class implementing EventListener to subscribe to events.
* @param threadMode Which thread to receive the event on.
* @param sticky Whether this class should immediately receive the most recent message of classes.
* @param classes Classes to subscribe to events from.
*/
public void subscribe(EventListener eventListener, ThreadMode threadMode, boolean sticky, Class<?>... classes) {
for (Class<?> clazz : classes) {
if (!mSubcribers.containsKey(clazz)) {
mSubcribers.put(clazz, new ArrayList<Listener>(1));
}
List<Listener> listenerRefs = mSubcribers.get(clazz);
for (int i = 0; i < listenerRefs.size(); i++) {
if (listenerRefs.get(i).eventListener.get() != null && listenerRefs.get(i).eventListener.get().equals(eventListener)) {
Log.w("EventBus", "Attempt to register the same object twice, object not registered second time.");
return;
}
}
mSubcribers.get(clazz).add(new Listener(threadMode, eventListener));
if (sticky && mStickies.containsKey(clazz)) {
post(mStickies.get(clazz), eventListener, threadMode);
}
}
}
/**
* Unsubscribe the listener from all passed in classes.
* @param eventListener Class implementing EventListener to unsubscribe from events.
* @param classes Classes to unsubscribe from.
*/
public void unsubscribe(EventListener eventListener, Class<?>... classes) {
for (Class<?> clazz : classes) {
if (!mSubcribers.containsKey(clazz)) {
Log.w("EventBus", "Attempt to unsubscribe without previously subscribing.");
continue;
}
boolean removed = false;
List<Listener> listenerRefs = mSubcribers.get(clazz);
for (int i = 0; i < listenerRefs.size(); i++) {
if (listenerRefs.get(i).eventListener.get() != null && listenerRefs.get(i).eventListener.get().equals(eventListener)) {
listenerRefs.remove(i);
removed = true;
break;
}
}
if (!removed) {
Log.w("EventBus", "Attempt to unsubscribe without previously subscribing.");
}
}
}
/**
* Post an event to all subscribed objects.
* @param event The event to post to all subscribers.
*/
public void post(Object event) {
if (!mSubcribers.containsKey(event.getClass())) {
return;
}
mStickies.put(event.getClass(), event);
List<Listener> listeners = mSubcribers.get(event.getClass());
List<Listener> toRemove = new ArrayList<Listener>(listeners.size());
for (Listener listener : listeners) {
EventListener eventListener = listener.eventListener.get();
if (eventListener == null) {
Log.w("EventBus", "Some subscription wasn't unregistered before getting deallocated.");
toRemove.add(listener);
continue;
}
post(event, eventListener, listener.threadMode);
}
listeners.removeAll(toRemove);
}
private void post(Object event, EventListener eventListener, ThreadMode threadMode) {
switch (threadMode) {
case POSTING:
eventListener.newEvent(event);
break;
case MAIN:
// If already on the main thread, post in now.
// mHandler.post will wait until the main thread is free
if (Looper.getMainLooper().getThread() == Thread.currentThread()) {
eventListener.newEvent(event);
} else {
mHandler.post(getRunnableForEvent(event, eventListener));
}
break;
case BACKGROUND:
// not checking if we're on a background thread already, mainly because
// the user likely called this so that the event is asynchronous, not purely so
// it's not on the main thread.
mExecutor.execute(getRunnableForEvent(event, eventListener));
break;
}
}
private Runnable getRunnableForEvent(final Object event, final EventListener eventListener) {
return new Runnable() {
@Override
public void run() {
eventListener.newEvent(event);
}
};
}
private class Listener {
ThreadMode threadMode;
WeakReference<EventListener> eventListener;
public Listener(ThreadMode threadMode, EventListener eventListener) {
this.threadMode = threadMode;
this.eventListener = new WeakReference<EventListener>(eventListener);
}
}
public enum ThreadMode {
POSTING,
MAIN,
BACKGROUND;
}
public interface EventListener {
public void newEvent(Object event);
}
}
| 7,183 | 0.729448 | 0.728057 | 214 | 32.593456 | 30.791857 | 173 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.359813 | false | false | 9 |
0922a6fdaa413bb37283e6fe4b662f6be3190ac5 | 32,341,103,766,773 | 789c76efed8365b39d8095e1afb5e84e42c677ac | /Chapter1TruongNgocTinhAnh/Task1.27-1.33DesignPattern/Task1.27DecoratorDrawShape/src/DecoratorShape/DecoratorPatternDemo.java | 056ede0450814b7f444d3f7c957bb4df82e4bd43 | []
| no_license | truongngoctinhanh/AdvancedJavaSource | https://github.com/truongngoctinhanh/AdvancedJavaSource | 0c0d30728a6841e859b16223758e59a058d44081 | df8d806a9cbb442a6d4c023fc902d62874d2b87f | refs/heads/master | 2020-07-02T09:40:47.816000 | 2016-10-05T04:25:10 | 2016-10-05T04:25:10 | 65,964,099 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package DecoratorShape;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author Truong Ngoc Tinh Anh
* @version 1.0
* @created 05-September-2016 10:40:53 AM
* @class for management draw shape
*/
public class DecoratorPatternDemo {
public static void main(String[] args) {
BufferedReader input = new BufferedReader(new InputStreamReader(
System.in));
try {
Circle circle = new Circle();
Rectangle rectangle = new Rectangle();
RedShapeDecorator shapeDecCir = new RedShapeDecorator(circle);
RedShapeDecorator shapeDecRec = new RedShapeDecorator(rectangle);
int check = 1;
while (check == 1) {
System.out.println("Shape: 1. Circle / 2. Rectangle ");
System.out.println("Please choose shape 1 / 2 ");
int replyShape = Integer.parseInt(input.readLine());
if (replyShape != 1 && replyShape != 2) {
throw new ArithmeticException(
"Invalid values! Please choose again!");
}
System.out.println("Do you want to choose the way to decorate (1. Yes / 2. No): ");
System.out.println("Please choose 1 / 2 ");
int replyDec = Integer.parseInt(input.readLine());
if (replyDec != 1 && replyDec != 2) {
throw new ArithmeticException(
"Invalid values! Please choose again!");
}
switch (replyShape) {
case 1:
if (replyDec == 2)
System.out.println(circle.draw() + "with normal border");
else
System.out.println(shapeDecCir.draw());
break;
case 2:
if (replyDec == 2)
System.out.println(rectangle.draw() + "with normal border");
else
System.out.println(shapeDecRec.draw());
break;
}
System.out.println("Do you want continue: \n1. Yes \n2. No ");
System.out.println("Please choose 1 / 2 ");
check = Integer.parseInt(input.readLine());
if (check != 1 && check != 2) {
throw new ArithmeticException(
"Invalid values! Please choose again!");
}
}
} catch (IOException | NumberFormatException | ArithmeticException ex) {
System.out.println("Error: " + ex.getMessage());
}
}
} | UTF-8 | Java | 2,121 | java | DecoratorPatternDemo.java | Java | [
{
"context": "\nimport java.io.InputStreamReader;\n\n/**\n * @author Truong Ngoc Tinh Anh\n * @version 1.0\n * @created 05-September-2016 10:",
"end": 154,
"score": 0.9998002648353577,
"start": 134,
"tag": "NAME",
"value": "Truong Ngoc Tinh Anh"
}
]
| null | []
| package DecoratorShape;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author <NAME>
* @version 1.0
* @created 05-September-2016 10:40:53 AM
* @class for management draw shape
*/
public class DecoratorPatternDemo {
public static void main(String[] args) {
BufferedReader input = new BufferedReader(new InputStreamReader(
System.in));
try {
Circle circle = new Circle();
Rectangle rectangle = new Rectangle();
RedShapeDecorator shapeDecCir = new RedShapeDecorator(circle);
RedShapeDecorator shapeDecRec = new RedShapeDecorator(rectangle);
int check = 1;
while (check == 1) {
System.out.println("Shape: 1. Circle / 2. Rectangle ");
System.out.println("Please choose shape 1 / 2 ");
int replyShape = Integer.parseInt(input.readLine());
if (replyShape != 1 && replyShape != 2) {
throw new ArithmeticException(
"Invalid values! Please choose again!");
}
System.out.println("Do you want to choose the way to decorate (1. Yes / 2. No): ");
System.out.println("Please choose 1 / 2 ");
int replyDec = Integer.parseInt(input.readLine());
if (replyDec != 1 && replyDec != 2) {
throw new ArithmeticException(
"Invalid values! Please choose again!");
}
switch (replyShape) {
case 1:
if (replyDec == 2)
System.out.println(circle.draw() + "with normal border");
else
System.out.println(shapeDecCir.draw());
break;
case 2:
if (replyDec == 2)
System.out.println(rectangle.draw() + "with normal border");
else
System.out.println(shapeDecRec.draw());
break;
}
System.out.println("Do you want continue: \n1. Yes \n2. No ");
System.out.println("Please choose 1 / 2 ");
check = Integer.parseInt(input.readLine());
if (check != 1 && check != 2) {
throw new ArithmeticException(
"Invalid values! Please choose again!");
}
}
} catch (IOException | NumberFormatException | ArithmeticException ex) {
System.out.println("Error: " + ex.getMessage());
}
}
} | 2,107 | 0.649222 | 0.631306 | 71 | 28.887323 | 22.884615 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.422535 | false | false | 9 |
8306d3e518afb6a639ea0c3e465bb51dfa1a9702 | 32,950,989,136,831 | f2a5494182a7b3f8e17443f85554d68aa07fdfb8 | /src/main/java/com/admarket/domain/AdvertiseOrder.java | 147905e0693f7abe62d31577cf564b3633730a32 | []
| no_license | Bogdaneshtu/abirzha | https://github.com/Bogdaneshtu/abirzha | dfcd46320ab7f96c26b0aa58ea52dc0a60488312 | 306ee1a7624ff8c0236157e9ffed480618ff71d9 | refs/heads/master | 2020-03-09T13:31:44.480000 | 2018-04-09T18:13:28 | 2018-04-09T18:13:28 | 128,813,444 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.admarket.domain;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;
import com.admarket.domain.enumeration.Valuta;
import com.admarket.domain.enumeration.OrderStatus;
import com.admarket.domain.enumeration.DurationUnit;
import com.admarket.utils.ZonedDateTimeConverter;
/**
* A AdvertiseOrder.
*/
@Entity
@Table(name = "advertise_order")
public class AdvertiseOrder implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@Column(name = "description")
private String description;
@Column(name = "text")
private String text;
@Column(name = "picture_url")
private String pictureUrl;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "valuta", nullable = false)
private Valuta valuta;
@NotNull
@DecimalMin(value = "0")
@Column(name = "price", nullable = false)
private Double price;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "status", nullable = false)
private OrderStatus status;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "duration_unit", nullable = false)
private DurationUnit durationUnit;
@NotNull
@DecimalMin(value = "0")
@Column(name = "duration_value", nullable = false)
private Integer durationValue;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "start_time_deviation_threshold", nullable = false)
private DurationUnit startTimeDeviationThreshold;
@NotNull
@DecimalMin(value = "0")
@Column(name = "start_time_deviation_theshold_value", nullable = false)
private Integer startTimeDeviationThesholdValue;
@NotNull
@Column(name = "creation_time", nullable = false)
private ZonedDateTime creationTime;
@Column(name = "start_time")
@Convert(converter = ZonedDateTimeConverter.class)
private ZonedDateTime startTime;
@Column(name = "end_time")
@Convert(converter = ZonedDateTimeConverter.class)
private ZonedDateTime endTime;
@ManyToOne
private User customer;
@ManyToOne
private SocialNetworkAccount socialNetworkAccount;
@ManyToOne
private PromotionalCampaign promotionalCampaign;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDescription() {
return description;
}
public AdvertiseOrder description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public String getText() {
return text;
}
public AdvertiseOrder text(String text) {
this.text = text;
return this;
}
public void setText(String text) {
this.text = text;
}
public String getPictureUrl() {
return pictureUrl;
}
public AdvertiseOrder pictureUrl(String pictureUrl) {
this.pictureUrl = pictureUrl;
return this;
}
public void setPictureUrl(String pictureUrl) {
this.pictureUrl = pictureUrl;
}
public Valuta getValuta() {
return valuta;
}
public AdvertiseOrder valuta(Valuta valuta) {
this.valuta = valuta;
return this;
}
public void setValuta(Valuta valuta) {
this.valuta = valuta;
}
public Double getPrice() {
return price;
}
public AdvertiseOrder price(Double price) {
this.price = price;
return this;
}
public void setPrice(Double price) {
this.price = price;
}
public OrderStatus getStatus() {
return status;
}
public AdvertiseOrder status(OrderStatus status) {
this.status = status;
return this;
}
public void setStatus(OrderStatus status) {
this.status = status;
}
public DurationUnit getDurationUnit() {
return durationUnit;
}
public AdvertiseOrder durationUnit(DurationUnit durationUnit) {
this.durationUnit = durationUnit;
return this;
}
public void setDurationUnit(DurationUnit durationUnit) {
this.durationUnit = durationUnit;
}
public Integer getDurationValue() {
return durationValue;
}
public AdvertiseOrder durationValue(Integer durationValue) {
this.durationValue = durationValue;
return this;
}
public void setDurationValue(Integer durationValue) {
this.durationValue = durationValue;
}
public DurationUnit getStartTimeDeviationThreshold() {
return startTimeDeviationThreshold;
}
public AdvertiseOrder startTimeDeviationThreshold(DurationUnit startTimeDeviationThreshold) {
this.startTimeDeviationThreshold = startTimeDeviationThreshold;
return this;
}
public void setStartTimeDeviationThreshold(DurationUnit startTimeDeviationThreshold) {
this.startTimeDeviationThreshold = startTimeDeviationThreshold;
}
public Integer getStartTimeDeviationThesholdValue() {
return startTimeDeviationThesholdValue;
}
public void setStartTimeDeviationThesholdValue(Integer startTimeDeviationThesholdValue) {
this.startTimeDeviationThesholdValue = startTimeDeviationThesholdValue;
}
public AdvertiseOrder startTimeDeviationThesholdValue(Integer startTimeDeviationThesholdValue) {
this.startTimeDeviationThesholdValue = startTimeDeviationThesholdValue;
return this;
}
public ZonedDateTime getCreationTime() {
return creationTime;
}
public AdvertiseOrder creationTime(ZonedDateTime creationTime) {
this.creationTime = creationTime;
return this;
}
public void setCreationTime(ZonedDateTime creationTime) {
this.creationTime = creationTime;
}
public ZonedDateTime getStartTime() {
return startTime;
}
public AdvertiseOrder startTime(ZonedDateTime startTime) {
this.startTime = startTime;
return this;
}
public void setStartTime(ZonedDateTime startTime) {
this.startTime = startTime;
}
public ZonedDateTime getEndTime() {
return endTime;
}
public void setEndTime(ZonedDateTime endTime) {
this.endTime = endTime;
}
public User getCustomer() {
return customer;
}
public AdvertiseOrder customer(User user) {
this.customer = user;
return this;
}
public void setCustomer(User user) {
this.customer = user;
}
public SocialNetworkAccount getSocialNetworkAccount() {
return socialNetworkAccount;
}
public AdvertiseOrder socialNetworkAccount(SocialNetworkAccount socialNetworkAccount) {
this.socialNetworkAccount = socialNetworkAccount;
return this;
}
public void setSocialNetworkAccount(SocialNetworkAccount socialNetworkAccount) {
this.socialNetworkAccount = socialNetworkAccount;
}
public PromotionalCampaign getPromotionalCampaign() {
return promotionalCampaign;
}
public void setPromotionalCampaign(PromotionalCampaign promotionalCampaign) {
this.promotionalCampaign = promotionalCampaign;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdvertiseOrder advertiseOrder = (AdvertiseOrder) o;
if (advertiseOrder.id == null || id == null) {
return false;
}
return Objects.equals(id, advertiseOrder.id);
}
@Override
public int hashCode() {
return Objects.hashCode(id);
}
@Override
public String toString() {
return "AdvertiseOrder{" +
"id=" + id +
", description='" + description + "'" +
", text='" + text + "'" +
", pictureUrl='" + pictureUrl + "'" +
", valuta='" + valuta + "'" +
", price='" + price + "'" +
", status='" + status + "'" +
", durationUnit='" + durationUnit + "'" +
", durationValue='" + durationValue + "'" +
", startTimeDeviationThreshold='" + startTimeDeviationThreshold + "'" +
", startTimeDeviationThesholdValue='" + startTimeDeviationThesholdValue + "'" +
", creationTime='" + creationTime + "'" +
", startTime='" + startTime + "'" +
'}';
}
}
| UTF-8 | Java | 8,768 | java | AdvertiseOrder.java | Java | []
| null | []
| package com.admarket.domain;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;
import com.admarket.domain.enumeration.Valuta;
import com.admarket.domain.enumeration.OrderStatus;
import com.admarket.domain.enumeration.DurationUnit;
import com.admarket.utils.ZonedDateTimeConverter;
/**
* A AdvertiseOrder.
*/
@Entity
@Table(name = "advertise_order")
public class AdvertiseOrder implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@Column(name = "description")
private String description;
@Column(name = "text")
private String text;
@Column(name = "picture_url")
private String pictureUrl;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "valuta", nullable = false)
private Valuta valuta;
@NotNull
@DecimalMin(value = "0")
@Column(name = "price", nullable = false)
private Double price;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "status", nullable = false)
private OrderStatus status;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "duration_unit", nullable = false)
private DurationUnit durationUnit;
@NotNull
@DecimalMin(value = "0")
@Column(name = "duration_value", nullable = false)
private Integer durationValue;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "start_time_deviation_threshold", nullable = false)
private DurationUnit startTimeDeviationThreshold;
@NotNull
@DecimalMin(value = "0")
@Column(name = "start_time_deviation_theshold_value", nullable = false)
private Integer startTimeDeviationThesholdValue;
@NotNull
@Column(name = "creation_time", nullable = false)
private ZonedDateTime creationTime;
@Column(name = "start_time")
@Convert(converter = ZonedDateTimeConverter.class)
private ZonedDateTime startTime;
@Column(name = "end_time")
@Convert(converter = ZonedDateTimeConverter.class)
private ZonedDateTime endTime;
@ManyToOne
private User customer;
@ManyToOne
private SocialNetworkAccount socialNetworkAccount;
@ManyToOne
private PromotionalCampaign promotionalCampaign;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDescription() {
return description;
}
public AdvertiseOrder description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public String getText() {
return text;
}
public AdvertiseOrder text(String text) {
this.text = text;
return this;
}
public void setText(String text) {
this.text = text;
}
public String getPictureUrl() {
return pictureUrl;
}
public AdvertiseOrder pictureUrl(String pictureUrl) {
this.pictureUrl = pictureUrl;
return this;
}
public void setPictureUrl(String pictureUrl) {
this.pictureUrl = pictureUrl;
}
public Valuta getValuta() {
return valuta;
}
public AdvertiseOrder valuta(Valuta valuta) {
this.valuta = valuta;
return this;
}
public void setValuta(Valuta valuta) {
this.valuta = valuta;
}
public Double getPrice() {
return price;
}
public AdvertiseOrder price(Double price) {
this.price = price;
return this;
}
public void setPrice(Double price) {
this.price = price;
}
public OrderStatus getStatus() {
return status;
}
public AdvertiseOrder status(OrderStatus status) {
this.status = status;
return this;
}
public void setStatus(OrderStatus status) {
this.status = status;
}
public DurationUnit getDurationUnit() {
return durationUnit;
}
public AdvertiseOrder durationUnit(DurationUnit durationUnit) {
this.durationUnit = durationUnit;
return this;
}
public void setDurationUnit(DurationUnit durationUnit) {
this.durationUnit = durationUnit;
}
public Integer getDurationValue() {
return durationValue;
}
public AdvertiseOrder durationValue(Integer durationValue) {
this.durationValue = durationValue;
return this;
}
public void setDurationValue(Integer durationValue) {
this.durationValue = durationValue;
}
public DurationUnit getStartTimeDeviationThreshold() {
return startTimeDeviationThreshold;
}
public AdvertiseOrder startTimeDeviationThreshold(DurationUnit startTimeDeviationThreshold) {
this.startTimeDeviationThreshold = startTimeDeviationThreshold;
return this;
}
public void setStartTimeDeviationThreshold(DurationUnit startTimeDeviationThreshold) {
this.startTimeDeviationThreshold = startTimeDeviationThreshold;
}
public Integer getStartTimeDeviationThesholdValue() {
return startTimeDeviationThesholdValue;
}
public void setStartTimeDeviationThesholdValue(Integer startTimeDeviationThesholdValue) {
this.startTimeDeviationThesholdValue = startTimeDeviationThesholdValue;
}
public AdvertiseOrder startTimeDeviationThesholdValue(Integer startTimeDeviationThesholdValue) {
this.startTimeDeviationThesholdValue = startTimeDeviationThesholdValue;
return this;
}
public ZonedDateTime getCreationTime() {
return creationTime;
}
public AdvertiseOrder creationTime(ZonedDateTime creationTime) {
this.creationTime = creationTime;
return this;
}
public void setCreationTime(ZonedDateTime creationTime) {
this.creationTime = creationTime;
}
public ZonedDateTime getStartTime() {
return startTime;
}
public AdvertiseOrder startTime(ZonedDateTime startTime) {
this.startTime = startTime;
return this;
}
public void setStartTime(ZonedDateTime startTime) {
this.startTime = startTime;
}
public ZonedDateTime getEndTime() {
return endTime;
}
public void setEndTime(ZonedDateTime endTime) {
this.endTime = endTime;
}
public User getCustomer() {
return customer;
}
public AdvertiseOrder customer(User user) {
this.customer = user;
return this;
}
public void setCustomer(User user) {
this.customer = user;
}
public SocialNetworkAccount getSocialNetworkAccount() {
return socialNetworkAccount;
}
public AdvertiseOrder socialNetworkAccount(SocialNetworkAccount socialNetworkAccount) {
this.socialNetworkAccount = socialNetworkAccount;
return this;
}
public void setSocialNetworkAccount(SocialNetworkAccount socialNetworkAccount) {
this.socialNetworkAccount = socialNetworkAccount;
}
public PromotionalCampaign getPromotionalCampaign() {
return promotionalCampaign;
}
public void setPromotionalCampaign(PromotionalCampaign promotionalCampaign) {
this.promotionalCampaign = promotionalCampaign;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdvertiseOrder advertiseOrder = (AdvertiseOrder) o;
if (advertiseOrder.id == null || id == null) {
return false;
}
return Objects.equals(id, advertiseOrder.id);
}
@Override
public int hashCode() {
return Objects.hashCode(id);
}
@Override
public String toString() {
return "AdvertiseOrder{" +
"id=" + id +
", description='" + description + "'" +
", text='" + text + "'" +
", pictureUrl='" + pictureUrl + "'" +
", valuta='" + valuta + "'" +
", price='" + price + "'" +
", status='" + status + "'" +
", durationUnit='" + durationUnit + "'" +
", durationValue='" + durationValue + "'" +
", startTimeDeviationThreshold='" + startTimeDeviationThreshold + "'" +
", startTimeDeviationThesholdValue='" + startTimeDeviationThesholdValue + "'" +
", creationTime='" + creationTime + "'" +
", startTime='" + startTime + "'" +
'}';
}
}
| 8,768 | 0.652372 | 0.651916 | 340 | 24.788235 | 23.362913 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.361765 | false | false | 9 |
54fde17d4cc98b8270fc3bb44e0fd3b3bc3f9e91 | 26,293,789,807,009 | 6478c60c8adecacaad6d5ac0dbe6981b4b17250d | /clone/src/com/child/Boy.java | 7504d09cab15ec0cd8ae11fd6349e9fe9932150b | []
| no_license | Dale-GoldenStar/JAVA_Test | https://github.com/Dale-GoldenStar/JAVA_Test | 8e18b973064e969f1689573b796b45514a1a1a2d | 9ea1393407fff65d834ee870f693e6a041e053bd | refs/heads/master | 2020-02-27T05:55:58.908000 | 2018-08-12T14:12:11 | 2018-08-12T14:12:11 | 84,064,798 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.child;
import com.parent.Person;
/**
* Created by jacee on 16-10-18.
*/
public class Boy extends Person implements Cloneable {
public Boy() {
mDressColor = 2;
}
// public void compareGender(Girl g) {
// System.out.println("Me: " + mDressColor);
// System.out.println("Me: " + g.mDressColor);
// mAge = 3;
// dress();
// }
protected void dressBoy() {
}
@Override
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
| UTF-8 | Java | 548 | java | Boy.java | Java | [
{
"context": "ild;\n\nimport com.parent.Person;\n\n/**\n * Created by jacee on 16-10-18.\n */\npublic class Boy extends Person ",
"end": 70,
"score": 0.9987489581108093,
"start": 65,
"tag": "USERNAME",
"value": "jacee"
}
]
| null | []
| package com.child;
import com.parent.Person;
/**
* Created by jacee on 16-10-18.
*/
public class Boy extends Person implements Cloneable {
public Boy() {
mDressColor = 2;
}
// public void compareGender(Girl g) {
// System.out.println("Me: " + mDressColor);
// System.out.println("Me: " + g.mDressColor);
// mAge = 3;
// dress();
// }
protected void dressBoy() {
}
@Override
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
| 548 | 0.582117 | 0.567518 | 29 | 17.896551 | 19.016045 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.275862 | false | false | 9 |
97d30dd48fdb652534707cd537d1ff85d96924e1 | 32,710,470,935,410 | 50c498d19518096c8f8a64ab7fd10a996693b05e | /app/src/main/java/com/example/ru_you/ModelRecycler.java | d7e12b2624a0affb98cacf3b2f7527f3df8fac2a | []
| no_license | Nikita-Freedom/Ru-you | https://github.com/Nikita-Freedom/Ru-you | fe1176250dc6c896d198483912bbe559b2df9b07 | 77a6371e82e8de444530eade30bdd06ddbdd987c | refs/heads/master | 2020-12-11T10:09:02.060000 | 2020-01-14T10:42:41 | 2020-01-14T10:42:41 | 233,818,367 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.ru_you;
public class ModelRecycler {
private String number, name, surname, patronymic, imgUrl;
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getPatronymic() {
return patronymic;
}
public void setPatronymic(String patronymic) {
this.patronymic = patronymic;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
} | UTF-8 | Java | 849 | java | ModelRecycler.java | Java | []
| null | []
| package com.example.ru_you;
public class ModelRecycler {
private String number, name, surname, patronymic, imgUrl;
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getPatronymic() {
return patronymic;
}
public void setPatronymic(String patronymic) {
this.patronymic = patronymic;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
} | 849 | 0.600707 | 0.600707 | 45 | 17.888889 | 16.809021 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.355556 | false | false | 9 |
a4f140c64ca0e39eacf50f972bd87f24cb8d8f51 | 2,482,491,109,479 | e09b9173e9a89f9812d6d536d73a20936b1fe1fa | /borrowland_server/src/main/java/com/lackhite/borrowland/server/StaticDateFormat.java | 889734d50f0d0243b10bf23e4dc35ee2265b3df3 | []
| no_license | kannabi/borrowland | https://github.com/kannabi/borrowland | 86bd5d71a6e17c877f3ff9f244e9547b0d787f12 | de376cdd8372f5576f9c279df4061bc2b471f499 | refs/heads/master | 2021-01-22T09:57:51.655000 | 2017-05-18T06:04:15 | 2017-05-18T06:04:15 | 81,981,604 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lackhite.borrowland.server;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
public class StaticDateFormat {
public static DateFormat dateFormat = new SimpleDateFormat("dd:MM:yyyy");
public static DateFormat timeFormat = new SimpleDateFormat("HH:mm");
}
| UTF-8 | Java | 291 | java | StaticDateFormat.java | Java | []
| null | []
| package com.lackhite.borrowland.server;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
public class StaticDateFormat {
public static DateFormat dateFormat = new SimpleDateFormat("dd:MM:yyyy");
public static DateFormat timeFormat = new SimpleDateFormat("HH:mm");
}
| 291 | 0.786942 | 0.786942 | 9 | 31.333334 | 27.28451 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.555556 | false | false | 9 |
c512a77f444b23e70a996f00c7a6d43e2ae7cda8 | 3,015,067,085,019 | 1a5c8c3837984e3ed540497f5ab3287364142a2d | /SmartDealer/src/com/adibrata/smartdealer/model/CoyCust.java | aeb96c1c141a3b9c4603b3f18c798c116a4a8c72 | []
| no_license | adibrata/smartdealer | https://github.com/adibrata/smartdealer | af2043d7f4dd71ec743a3eb30a154a8ec71698c1 | ba7d0c94cb9ce5661fc292f371628161442e7557 | refs/heads/master | 2021-01-10T21:14:58.476000 | 2015-07-15T10:22:15 | 2015-07-15T10:22:15 | 38,410,616 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.adibrata.smartdealer.model;
// Generated Jul 15, 2015 5:19:07 PM by Hibernate Tools 4.3.1
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* CoyCust generated by hbm2java
*/
@Entity
@Table(name = "CoyCust", schema = "dbo", catalog = "SmartDealer")
public class CoyCust implements java.io.Serializable {
private long id;
private Customer customer;
private String npwp;
private String npwpchecking;
private String companyType;
private Short numberOfEmployees;
private Short yearOfEstablished;
private String industryTypeId;
private String pengelolaGedungAreaPhone;
private String pengelolaGedungPhone;
private BigDecimal currentRatio;
private BigDecimal roi;
private BigDecimal der;
private BigDecimal modalDasar;
private BigDecimal modalDisetor;
private BigDecimal netProfitMargin;
private String bankAccountType;
private BigDecimal nilaiPinjamanSedangBerjalan;
private BigDecimal averageDebitTransaction;
private BigDecimal averageCreditTransaction;
private BigDecimal averageBalance;
private BigDecimal deposito;
private Serializable additionalCollateralType;
private BigDecimal additionalCollateralAmount;
private String companyStatus;
private Short companyStatusSinceYear;
private Date rentFinishDate;
private String bankId;
private String bankBranch;
private String accountNo;
private Serializable accountName;
private String reference;
private boolean isApplyCarLoanBefore;
private Serializable applyCarLoanCompanyName;
private char activeCustomer;
private Serializable notes;
private Boolean isCorporateCreditLine;
private BigDecimal plafondAmount;
private Serializable customerGroup;
private String noDocumentOfEstablished;
private Date dateDocumentOfEstablished;
private String notaryPlace;
private String notaryName;
private String lastNoDocumentOfEstablished;
private Date lastDateDocumentOfEstablished;
private String lastNotaryPlace;
private String lastNotaryName;
public CoyCust() {
}
public CoyCust(long id, String npwp, String npwpchecking,
String companyType, String industryTypeId, BigDecimal modalDasar,
BigDecimal modalDisetor, BigDecimal netProfitMargin,
BigDecimal nilaiPinjamanSedangBerjalan,
boolean isApplyCarLoanBefore, char activeCustomer,
Serializable customerGroup) {
this.id = id;
this.npwp = npwp;
this.npwpchecking = npwpchecking;
this.companyType = companyType;
this.industryTypeId = industryTypeId;
this.modalDasar = modalDasar;
this.modalDisetor = modalDisetor;
this.netProfitMargin = netProfitMargin;
this.nilaiPinjamanSedangBerjalan = nilaiPinjamanSedangBerjalan;
this.isApplyCarLoanBefore = isApplyCarLoanBefore;
this.activeCustomer = activeCustomer;
this.customerGroup = customerGroup;
}
public CoyCust(long id, Customer customer, String npwp,
String npwpchecking, String companyType, Short numberOfEmployees,
Short yearOfEstablished, String industryTypeId,
String pengelolaGedungAreaPhone, String pengelolaGedungPhone,
BigDecimal currentRatio, BigDecimal roi, BigDecimal der,
BigDecimal modalDasar, BigDecimal modalDisetor,
BigDecimal netProfitMargin, String bankAccountType,
BigDecimal nilaiPinjamanSedangBerjalan,
BigDecimal averageDebitTransaction,
BigDecimal averageCreditTransaction, BigDecimal averageBalance,
BigDecimal deposito, Serializable additionalCollateralType,
BigDecimal additionalCollateralAmount, String companyStatus,
Short companyStatusSinceYear, Date rentFinishDate, String bankId,
String bankBranch, String accountNo, Serializable accountName,
String reference, boolean isApplyCarLoanBefore,
Serializable applyCarLoanCompanyName, char activeCustomer,
Serializable notes, Boolean isCorporateCreditLine,
BigDecimal plafondAmount, Serializable customerGroup,
String noDocumentOfEstablished, Date dateDocumentOfEstablished,
String notaryPlace, String notaryName,
String lastNoDocumentOfEstablished,
Date lastDateDocumentOfEstablished, String lastNotaryPlace,
String lastNotaryName) {
this.id = id;
this.customer = customer;
this.npwp = npwp;
this.npwpchecking = npwpchecking;
this.companyType = companyType;
this.numberOfEmployees = numberOfEmployees;
this.yearOfEstablished = yearOfEstablished;
this.industryTypeId = industryTypeId;
this.pengelolaGedungAreaPhone = pengelolaGedungAreaPhone;
this.pengelolaGedungPhone = pengelolaGedungPhone;
this.currentRatio = currentRatio;
this.roi = roi;
this.der = der;
this.modalDasar = modalDasar;
this.modalDisetor = modalDisetor;
this.netProfitMargin = netProfitMargin;
this.bankAccountType = bankAccountType;
this.nilaiPinjamanSedangBerjalan = nilaiPinjamanSedangBerjalan;
this.averageDebitTransaction = averageDebitTransaction;
this.averageCreditTransaction = averageCreditTransaction;
this.averageBalance = averageBalance;
this.deposito = deposito;
this.additionalCollateralType = additionalCollateralType;
this.additionalCollateralAmount = additionalCollateralAmount;
this.companyStatus = companyStatus;
this.companyStatusSinceYear = companyStatusSinceYear;
this.rentFinishDate = rentFinishDate;
this.bankId = bankId;
this.bankBranch = bankBranch;
this.accountNo = accountNo;
this.accountName = accountName;
this.reference = reference;
this.isApplyCarLoanBefore = isApplyCarLoanBefore;
this.applyCarLoanCompanyName = applyCarLoanCompanyName;
this.activeCustomer = activeCustomer;
this.notes = notes;
this.isCorporateCreditLine = isCorporateCreditLine;
this.plafondAmount = plafondAmount;
this.customerGroup = customerGroup;
this.noDocumentOfEstablished = noDocumentOfEstablished;
this.dateDocumentOfEstablished = dateDocumentOfEstablished;
this.notaryPlace = notaryPlace;
this.notaryName = notaryName;
this.lastNoDocumentOfEstablished = lastNoDocumentOfEstablished;
this.lastDateDocumentOfEstablished = lastDateDocumentOfEstablished;
this.lastNotaryPlace = lastNotaryPlace;
this.lastNotaryName = lastNotaryName;
}
@Id @GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "Id", unique = true, nullable = false)
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CustomerId")
public Customer getCustomer() {
return this.customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
@Column(name = "NPWP", nullable = false, length = 25)
public String getNpwp() {
return this.npwp;
}
public void setNpwp(String npwp) {
this.npwp = npwp;
}
@Column(name = "NPWPChecking", nullable = false, length = 25)
public String getNpwpchecking() {
return this.npwpchecking;
}
public void setNpwpchecking(String npwpchecking) {
this.npwpchecking = npwpchecking;
}
@Column(name = "CompanyType", nullable = false, length = 10)
public String getCompanyType() {
return this.companyType;
}
public void setCompanyType(String companyType) {
this.companyType = companyType;
}
@Column(name = "NumberOfEmployees")
public Short getNumberOfEmployees() {
return this.numberOfEmployees;
}
public void setNumberOfEmployees(Short numberOfEmployees) {
this.numberOfEmployees = numberOfEmployees;
}
@Column(name = "YearOfEstablished")
public Short getYearOfEstablished() {
return this.yearOfEstablished;
}
public void setYearOfEstablished(Short yearOfEstablished) {
this.yearOfEstablished = yearOfEstablished;
}
@Column(name = "IndustryTypeID", nullable = false, length = 10)
public String getIndustryTypeId() {
return this.industryTypeId;
}
public void setIndustryTypeId(String industryTypeId) {
this.industryTypeId = industryTypeId;
}
@Column(name = "PengelolaGedungAreaPhone", length = 4)
public String getPengelolaGedungAreaPhone() {
return this.pengelolaGedungAreaPhone;
}
public void setPengelolaGedungAreaPhone(String pengelolaGedungAreaPhone) {
this.pengelolaGedungAreaPhone = pengelolaGedungAreaPhone;
}
@Column(name = "PengelolaGedungPhone", length = 10)
public String getPengelolaGedungPhone() {
return this.pengelolaGedungPhone;
}
public void setPengelolaGedungPhone(String pengelolaGedungPhone) {
this.pengelolaGedungPhone = pengelolaGedungPhone;
}
@Column(name = "CurrentRatio", precision = 9, scale = 6)
public BigDecimal getCurrentRatio() {
return this.currentRatio;
}
public void setCurrentRatio(BigDecimal currentRatio) {
this.currentRatio = currentRatio;
}
@Column(name = "ROI", precision = 9, scale = 6)
public BigDecimal getRoi() {
return this.roi;
}
public void setRoi(BigDecimal roi) {
this.roi = roi;
}
@Column(name = "DER", precision = 9, scale = 6)
public BigDecimal getDer() {
return this.der;
}
public void setDer(BigDecimal der) {
this.der = der;
}
@Column(name = "ModalDasar", nullable = false, precision = 17)
public BigDecimal getModalDasar() {
return this.modalDasar;
}
public void setModalDasar(BigDecimal modalDasar) {
this.modalDasar = modalDasar;
}
@Column(name = "ModalDisetor", nullable = false, precision = 17)
public BigDecimal getModalDisetor() {
return this.modalDisetor;
}
public void setModalDisetor(BigDecimal modalDisetor) {
this.modalDisetor = modalDisetor;
}
@Column(name = "NetProfitMargin", nullable = false, precision = 17)
public BigDecimal getNetProfitMargin() {
return this.netProfitMargin;
}
public void setNetProfitMargin(BigDecimal netProfitMargin) {
this.netProfitMargin = netProfitMargin;
}
@Column(name = "BankAccountType", length = 10)
public String getBankAccountType() {
return this.bankAccountType;
}
public void setBankAccountType(String bankAccountType) {
this.bankAccountType = bankAccountType;
}
@Column(name = "NilaiPinjamanSedangBerjalan", nullable = false, precision = 17)
public BigDecimal getNilaiPinjamanSedangBerjalan() {
return this.nilaiPinjamanSedangBerjalan;
}
public void setNilaiPinjamanSedangBerjalan(
BigDecimal nilaiPinjamanSedangBerjalan) {
this.nilaiPinjamanSedangBerjalan = nilaiPinjamanSedangBerjalan;
}
@Column(name = "AverageDebitTransaction", precision = 17)
public BigDecimal getAverageDebitTransaction() {
return this.averageDebitTransaction;
}
public void setAverageDebitTransaction(BigDecimal averageDebitTransaction) {
this.averageDebitTransaction = averageDebitTransaction;
}
@Column(name = "AverageCreditTransaction", precision = 17)
public BigDecimal getAverageCreditTransaction() {
return this.averageCreditTransaction;
}
public void setAverageCreditTransaction(BigDecimal averageCreditTransaction) {
this.averageCreditTransaction = averageCreditTransaction;
}
@Column(name = "AverageBalance", precision = 17)
public BigDecimal getAverageBalance() {
return this.averageBalance;
}
public void setAverageBalance(BigDecimal averageBalance) {
this.averageBalance = averageBalance;
}
@Column(name = "Deposito", precision = 17)
public BigDecimal getDeposito() {
return this.deposito;
}
public void setDeposito(BigDecimal deposito) {
this.deposito = deposito;
}
@Column(name = "AdditionalCollateralType")
public Serializable getAdditionalCollateralType() {
return this.additionalCollateralType;
}
public void setAdditionalCollateralType(
Serializable additionalCollateralType) {
this.additionalCollateralType = additionalCollateralType;
}
@Column(name = "AdditionalCollateralAmount", precision = 17)
public BigDecimal getAdditionalCollateralAmount() {
return this.additionalCollateralAmount;
}
public void setAdditionalCollateralAmount(
BigDecimal additionalCollateralAmount) {
this.additionalCollateralAmount = additionalCollateralAmount;
}
@Column(name = "CompanyStatus", length = 10)
public String getCompanyStatus() {
return this.companyStatus;
}
public void setCompanyStatus(String companyStatus) {
this.companyStatus = companyStatus;
}
@Column(name = "CompanyStatusSinceYear")
public Short getCompanyStatusSinceYear() {
return this.companyStatusSinceYear;
}
public void setCompanyStatusSinceYear(Short companyStatusSinceYear) {
this.companyStatusSinceYear = companyStatusSinceYear;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "RentFinishDate", length = 23)
public Date getRentFinishDate() {
return this.rentFinishDate;
}
public void setRentFinishDate(Date rentFinishDate) {
this.rentFinishDate = rentFinishDate;
}
@Column(name = "BankID", length = 5)
public String getBankId() {
return this.bankId;
}
public void setBankId(String bankId) {
this.bankId = bankId;
}
@Column(name = "BankBranch", length = 50)
public String getBankBranch() {
return this.bankBranch;
}
public void setBankBranch(String bankBranch) {
this.bankBranch = bankBranch;
}
@Column(name = "AccountNo", length = 20)
public String getAccountNo() {
return this.accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
@Column(name = "AccountName")
public Serializable getAccountName() {
return this.accountName;
}
public void setAccountName(Serializable accountName) {
this.accountName = accountName;
}
@Column(name = "Reference", length = 10)
public String getReference() {
return this.reference;
}
public void setReference(String reference) {
this.reference = reference;
}
@Column(name = "IsApplyCarLoanBefore", nullable = false)
public boolean isIsApplyCarLoanBefore() {
return this.isApplyCarLoanBefore;
}
public void setIsApplyCarLoanBefore(boolean isApplyCarLoanBefore) {
this.isApplyCarLoanBefore = isApplyCarLoanBefore;
}
@Column(name = "ApplyCarLoanCompanyName")
public Serializable getApplyCarLoanCompanyName() {
return this.applyCarLoanCompanyName;
}
public void setApplyCarLoanCompanyName(Serializable applyCarLoanCompanyName) {
this.applyCarLoanCompanyName = applyCarLoanCompanyName;
}
@Column(name = "ActiveCustomer", nullable = false, length = 1)
public char getActiveCustomer() {
return this.activeCustomer;
}
public void setActiveCustomer(char activeCustomer) {
this.activeCustomer = activeCustomer;
}
@Column(name = "Notes")
public Serializable getNotes() {
return this.notes;
}
public void setNotes(Serializable notes) {
this.notes = notes;
}
@Column(name = "IsCorporateCreditLine")
public Boolean getIsCorporateCreditLine() {
return this.isCorporateCreditLine;
}
public void setIsCorporateCreditLine(Boolean isCorporateCreditLine) {
this.isCorporateCreditLine = isCorporateCreditLine;
}
@Column(name = "PlafondAmount", precision = 17)
public BigDecimal getPlafondAmount() {
return this.plafondAmount;
}
public void setPlafondAmount(BigDecimal plafondAmount) {
this.plafondAmount = plafondAmount;
}
@Column(name = "CustomerGroup", nullable = false)
public Serializable getCustomerGroup() {
return this.customerGroup;
}
public void setCustomerGroup(Serializable customerGroup) {
this.customerGroup = customerGroup;
}
@Column(name = "NoDocumentOfEstablished", length = 50)
public String getNoDocumentOfEstablished() {
return this.noDocumentOfEstablished;
}
public void setNoDocumentOfEstablished(String noDocumentOfEstablished) {
this.noDocumentOfEstablished = noDocumentOfEstablished;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DateDocumentOfEstablished", length = 23)
public Date getDateDocumentOfEstablished() {
return this.dateDocumentOfEstablished;
}
public void setDateDocumentOfEstablished(Date dateDocumentOfEstablished) {
this.dateDocumentOfEstablished = dateDocumentOfEstablished;
}
@Column(name = "NotaryPlace", length = 50)
public String getNotaryPlace() {
return this.notaryPlace;
}
public void setNotaryPlace(String notaryPlace) {
this.notaryPlace = notaryPlace;
}
@Column(name = "NotaryName", length = 50)
public String getNotaryName() {
return this.notaryName;
}
public void setNotaryName(String notaryName) {
this.notaryName = notaryName;
}
@Column(name = "LastNoDocumentOfEstablished", length = 50)
public String getLastNoDocumentOfEstablished() {
return this.lastNoDocumentOfEstablished;
}
public void setLastNoDocumentOfEstablished(
String lastNoDocumentOfEstablished) {
this.lastNoDocumentOfEstablished = lastNoDocumentOfEstablished;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LastDateDocumentOfEstablished", length = 23)
public Date getLastDateDocumentOfEstablished() {
return this.lastDateDocumentOfEstablished;
}
public void setLastDateDocumentOfEstablished(
Date lastDateDocumentOfEstablished) {
this.lastDateDocumentOfEstablished = lastDateDocumentOfEstablished;
}
@Column(name = "LastNotaryPlace", length = 50)
public String getLastNotaryPlace() {
return this.lastNotaryPlace;
}
public void setLastNotaryPlace(String lastNotaryPlace) {
this.lastNotaryPlace = lastNotaryPlace;
}
@Column(name = "LastNotaryName", length = 50)
public String getLastNotaryName() {
return this.lastNotaryName;
}
public void setLastNotaryName(String lastNotaryName) {
this.lastNotaryName = lastNotaryName;
}
}
| UTF-8 | Java | 18,080 | java | CoyCust.java | Java | [
{
"context": "yPlace = lastNotaryPlace;\r\n\t}\r\n\r\n\t@Column(name = \"LastNotaryName\", length = 50)\r\n\tpublic String getLastNotaryName(",
"end": 17881,
"score": 0.8157680034637451,
"start": 17867,
"tag": "NAME",
"value": "LastNotaryName"
}
]
| null | []
| package com.adibrata.smartdealer.model;
// Generated Jul 15, 2015 5:19:07 PM by Hibernate Tools 4.3.1
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* CoyCust generated by hbm2java
*/
@Entity
@Table(name = "CoyCust", schema = "dbo", catalog = "SmartDealer")
public class CoyCust implements java.io.Serializable {
private long id;
private Customer customer;
private String npwp;
private String npwpchecking;
private String companyType;
private Short numberOfEmployees;
private Short yearOfEstablished;
private String industryTypeId;
private String pengelolaGedungAreaPhone;
private String pengelolaGedungPhone;
private BigDecimal currentRatio;
private BigDecimal roi;
private BigDecimal der;
private BigDecimal modalDasar;
private BigDecimal modalDisetor;
private BigDecimal netProfitMargin;
private String bankAccountType;
private BigDecimal nilaiPinjamanSedangBerjalan;
private BigDecimal averageDebitTransaction;
private BigDecimal averageCreditTransaction;
private BigDecimal averageBalance;
private BigDecimal deposito;
private Serializable additionalCollateralType;
private BigDecimal additionalCollateralAmount;
private String companyStatus;
private Short companyStatusSinceYear;
private Date rentFinishDate;
private String bankId;
private String bankBranch;
private String accountNo;
private Serializable accountName;
private String reference;
private boolean isApplyCarLoanBefore;
private Serializable applyCarLoanCompanyName;
private char activeCustomer;
private Serializable notes;
private Boolean isCorporateCreditLine;
private BigDecimal plafondAmount;
private Serializable customerGroup;
private String noDocumentOfEstablished;
private Date dateDocumentOfEstablished;
private String notaryPlace;
private String notaryName;
private String lastNoDocumentOfEstablished;
private Date lastDateDocumentOfEstablished;
private String lastNotaryPlace;
private String lastNotaryName;
public CoyCust() {
}
public CoyCust(long id, String npwp, String npwpchecking,
String companyType, String industryTypeId, BigDecimal modalDasar,
BigDecimal modalDisetor, BigDecimal netProfitMargin,
BigDecimal nilaiPinjamanSedangBerjalan,
boolean isApplyCarLoanBefore, char activeCustomer,
Serializable customerGroup) {
this.id = id;
this.npwp = npwp;
this.npwpchecking = npwpchecking;
this.companyType = companyType;
this.industryTypeId = industryTypeId;
this.modalDasar = modalDasar;
this.modalDisetor = modalDisetor;
this.netProfitMargin = netProfitMargin;
this.nilaiPinjamanSedangBerjalan = nilaiPinjamanSedangBerjalan;
this.isApplyCarLoanBefore = isApplyCarLoanBefore;
this.activeCustomer = activeCustomer;
this.customerGroup = customerGroup;
}
public CoyCust(long id, Customer customer, String npwp,
String npwpchecking, String companyType, Short numberOfEmployees,
Short yearOfEstablished, String industryTypeId,
String pengelolaGedungAreaPhone, String pengelolaGedungPhone,
BigDecimal currentRatio, BigDecimal roi, BigDecimal der,
BigDecimal modalDasar, BigDecimal modalDisetor,
BigDecimal netProfitMargin, String bankAccountType,
BigDecimal nilaiPinjamanSedangBerjalan,
BigDecimal averageDebitTransaction,
BigDecimal averageCreditTransaction, BigDecimal averageBalance,
BigDecimal deposito, Serializable additionalCollateralType,
BigDecimal additionalCollateralAmount, String companyStatus,
Short companyStatusSinceYear, Date rentFinishDate, String bankId,
String bankBranch, String accountNo, Serializable accountName,
String reference, boolean isApplyCarLoanBefore,
Serializable applyCarLoanCompanyName, char activeCustomer,
Serializable notes, Boolean isCorporateCreditLine,
BigDecimal plafondAmount, Serializable customerGroup,
String noDocumentOfEstablished, Date dateDocumentOfEstablished,
String notaryPlace, String notaryName,
String lastNoDocumentOfEstablished,
Date lastDateDocumentOfEstablished, String lastNotaryPlace,
String lastNotaryName) {
this.id = id;
this.customer = customer;
this.npwp = npwp;
this.npwpchecking = npwpchecking;
this.companyType = companyType;
this.numberOfEmployees = numberOfEmployees;
this.yearOfEstablished = yearOfEstablished;
this.industryTypeId = industryTypeId;
this.pengelolaGedungAreaPhone = pengelolaGedungAreaPhone;
this.pengelolaGedungPhone = pengelolaGedungPhone;
this.currentRatio = currentRatio;
this.roi = roi;
this.der = der;
this.modalDasar = modalDasar;
this.modalDisetor = modalDisetor;
this.netProfitMargin = netProfitMargin;
this.bankAccountType = bankAccountType;
this.nilaiPinjamanSedangBerjalan = nilaiPinjamanSedangBerjalan;
this.averageDebitTransaction = averageDebitTransaction;
this.averageCreditTransaction = averageCreditTransaction;
this.averageBalance = averageBalance;
this.deposito = deposito;
this.additionalCollateralType = additionalCollateralType;
this.additionalCollateralAmount = additionalCollateralAmount;
this.companyStatus = companyStatus;
this.companyStatusSinceYear = companyStatusSinceYear;
this.rentFinishDate = rentFinishDate;
this.bankId = bankId;
this.bankBranch = bankBranch;
this.accountNo = accountNo;
this.accountName = accountName;
this.reference = reference;
this.isApplyCarLoanBefore = isApplyCarLoanBefore;
this.applyCarLoanCompanyName = applyCarLoanCompanyName;
this.activeCustomer = activeCustomer;
this.notes = notes;
this.isCorporateCreditLine = isCorporateCreditLine;
this.plafondAmount = plafondAmount;
this.customerGroup = customerGroup;
this.noDocumentOfEstablished = noDocumentOfEstablished;
this.dateDocumentOfEstablished = dateDocumentOfEstablished;
this.notaryPlace = notaryPlace;
this.notaryName = notaryName;
this.lastNoDocumentOfEstablished = lastNoDocumentOfEstablished;
this.lastDateDocumentOfEstablished = lastDateDocumentOfEstablished;
this.lastNotaryPlace = lastNotaryPlace;
this.lastNotaryName = lastNotaryName;
}
@Id @GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "Id", unique = true, nullable = false)
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CustomerId")
public Customer getCustomer() {
return this.customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
@Column(name = "NPWP", nullable = false, length = 25)
public String getNpwp() {
return this.npwp;
}
public void setNpwp(String npwp) {
this.npwp = npwp;
}
@Column(name = "NPWPChecking", nullable = false, length = 25)
public String getNpwpchecking() {
return this.npwpchecking;
}
public void setNpwpchecking(String npwpchecking) {
this.npwpchecking = npwpchecking;
}
@Column(name = "CompanyType", nullable = false, length = 10)
public String getCompanyType() {
return this.companyType;
}
public void setCompanyType(String companyType) {
this.companyType = companyType;
}
@Column(name = "NumberOfEmployees")
public Short getNumberOfEmployees() {
return this.numberOfEmployees;
}
public void setNumberOfEmployees(Short numberOfEmployees) {
this.numberOfEmployees = numberOfEmployees;
}
@Column(name = "YearOfEstablished")
public Short getYearOfEstablished() {
return this.yearOfEstablished;
}
public void setYearOfEstablished(Short yearOfEstablished) {
this.yearOfEstablished = yearOfEstablished;
}
@Column(name = "IndustryTypeID", nullable = false, length = 10)
public String getIndustryTypeId() {
return this.industryTypeId;
}
public void setIndustryTypeId(String industryTypeId) {
this.industryTypeId = industryTypeId;
}
@Column(name = "PengelolaGedungAreaPhone", length = 4)
public String getPengelolaGedungAreaPhone() {
return this.pengelolaGedungAreaPhone;
}
public void setPengelolaGedungAreaPhone(String pengelolaGedungAreaPhone) {
this.pengelolaGedungAreaPhone = pengelolaGedungAreaPhone;
}
@Column(name = "PengelolaGedungPhone", length = 10)
public String getPengelolaGedungPhone() {
return this.pengelolaGedungPhone;
}
public void setPengelolaGedungPhone(String pengelolaGedungPhone) {
this.pengelolaGedungPhone = pengelolaGedungPhone;
}
@Column(name = "CurrentRatio", precision = 9, scale = 6)
public BigDecimal getCurrentRatio() {
return this.currentRatio;
}
public void setCurrentRatio(BigDecimal currentRatio) {
this.currentRatio = currentRatio;
}
@Column(name = "ROI", precision = 9, scale = 6)
public BigDecimal getRoi() {
return this.roi;
}
public void setRoi(BigDecimal roi) {
this.roi = roi;
}
@Column(name = "DER", precision = 9, scale = 6)
public BigDecimal getDer() {
return this.der;
}
public void setDer(BigDecimal der) {
this.der = der;
}
@Column(name = "ModalDasar", nullable = false, precision = 17)
public BigDecimal getModalDasar() {
return this.modalDasar;
}
public void setModalDasar(BigDecimal modalDasar) {
this.modalDasar = modalDasar;
}
@Column(name = "ModalDisetor", nullable = false, precision = 17)
public BigDecimal getModalDisetor() {
return this.modalDisetor;
}
public void setModalDisetor(BigDecimal modalDisetor) {
this.modalDisetor = modalDisetor;
}
@Column(name = "NetProfitMargin", nullable = false, precision = 17)
public BigDecimal getNetProfitMargin() {
return this.netProfitMargin;
}
public void setNetProfitMargin(BigDecimal netProfitMargin) {
this.netProfitMargin = netProfitMargin;
}
@Column(name = "BankAccountType", length = 10)
public String getBankAccountType() {
return this.bankAccountType;
}
public void setBankAccountType(String bankAccountType) {
this.bankAccountType = bankAccountType;
}
@Column(name = "NilaiPinjamanSedangBerjalan", nullable = false, precision = 17)
public BigDecimal getNilaiPinjamanSedangBerjalan() {
return this.nilaiPinjamanSedangBerjalan;
}
public void setNilaiPinjamanSedangBerjalan(
BigDecimal nilaiPinjamanSedangBerjalan) {
this.nilaiPinjamanSedangBerjalan = nilaiPinjamanSedangBerjalan;
}
@Column(name = "AverageDebitTransaction", precision = 17)
public BigDecimal getAverageDebitTransaction() {
return this.averageDebitTransaction;
}
public void setAverageDebitTransaction(BigDecimal averageDebitTransaction) {
this.averageDebitTransaction = averageDebitTransaction;
}
@Column(name = "AverageCreditTransaction", precision = 17)
public BigDecimal getAverageCreditTransaction() {
return this.averageCreditTransaction;
}
public void setAverageCreditTransaction(BigDecimal averageCreditTransaction) {
this.averageCreditTransaction = averageCreditTransaction;
}
@Column(name = "AverageBalance", precision = 17)
public BigDecimal getAverageBalance() {
return this.averageBalance;
}
public void setAverageBalance(BigDecimal averageBalance) {
this.averageBalance = averageBalance;
}
@Column(name = "Deposito", precision = 17)
public BigDecimal getDeposito() {
return this.deposito;
}
public void setDeposito(BigDecimal deposito) {
this.deposito = deposito;
}
@Column(name = "AdditionalCollateralType")
public Serializable getAdditionalCollateralType() {
return this.additionalCollateralType;
}
public void setAdditionalCollateralType(
Serializable additionalCollateralType) {
this.additionalCollateralType = additionalCollateralType;
}
@Column(name = "AdditionalCollateralAmount", precision = 17)
public BigDecimal getAdditionalCollateralAmount() {
return this.additionalCollateralAmount;
}
public void setAdditionalCollateralAmount(
BigDecimal additionalCollateralAmount) {
this.additionalCollateralAmount = additionalCollateralAmount;
}
@Column(name = "CompanyStatus", length = 10)
public String getCompanyStatus() {
return this.companyStatus;
}
public void setCompanyStatus(String companyStatus) {
this.companyStatus = companyStatus;
}
@Column(name = "CompanyStatusSinceYear")
public Short getCompanyStatusSinceYear() {
return this.companyStatusSinceYear;
}
public void setCompanyStatusSinceYear(Short companyStatusSinceYear) {
this.companyStatusSinceYear = companyStatusSinceYear;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "RentFinishDate", length = 23)
public Date getRentFinishDate() {
return this.rentFinishDate;
}
public void setRentFinishDate(Date rentFinishDate) {
this.rentFinishDate = rentFinishDate;
}
@Column(name = "BankID", length = 5)
public String getBankId() {
return this.bankId;
}
public void setBankId(String bankId) {
this.bankId = bankId;
}
@Column(name = "BankBranch", length = 50)
public String getBankBranch() {
return this.bankBranch;
}
public void setBankBranch(String bankBranch) {
this.bankBranch = bankBranch;
}
@Column(name = "AccountNo", length = 20)
public String getAccountNo() {
return this.accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
@Column(name = "AccountName")
public Serializable getAccountName() {
return this.accountName;
}
public void setAccountName(Serializable accountName) {
this.accountName = accountName;
}
@Column(name = "Reference", length = 10)
public String getReference() {
return this.reference;
}
public void setReference(String reference) {
this.reference = reference;
}
@Column(name = "IsApplyCarLoanBefore", nullable = false)
public boolean isIsApplyCarLoanBefore() {
return this.isApplyCarLoanBefore;
}
public void setIsApplyCarLoanBefore(boolean isApplyCarLoanBefore) {
this.isApplyCarLoanBefore = isApplyCarLoanBefore;
}
@Column(name = "ApplyCarLoanCompanyName")
public Serializable getApplyCarLoanCompanyName() {
return this.applyCarLoanCompanyName;
}
public void setApplyCarLoanCompanyName(Serializable applyCarLoanCompanyName) {
this.applyCarLoanCompanyName = applyCarLoanCompanyName;
}
@Column(name = "ActiveCustomer", nullable = false, length = 1)
public char getActiveCustomer() {
return this.activeCustomer;
}
public void setActiveCustomer(char activeCustomer) {
this.activeCustomer = activeCustomer;
}
@Column(name = "Notes")
public Serializable getNotes() {
return this.notes;
}
public void setNotes(Serializable notes) {
this.notes = notes;
}
@Column(name = "IsCorporateCreditLine")
public Boolean getIsCorporateCreditLine() {
return this.isCorporateCreditLine;
}
public void setIsCorporateCreditLine(Boolean isCorporateCreditLine) {
this.isCorporateCreditLine = isCorporateCreditLine;
}
@Column(name = "PlafondAmount", precision = 17)
public BigDecimal getPlafondAmount() {
return this.plafondAmount;
}
public void setPlafondAmount(BigDecimal plafondAmount) {
this.plafondAmount = plafondAmount;
}
@Column(name = "CustomerGroup", nullable = false)
public Serializable getCustomerGroup() {
return this.customerGroup;
}
public void setCustomerGroup(Serializable customerGroup) {
this.customerGroup = customerGroup;
}
@Column(name = "NoDocumentOfEstablished", length = 50)
public String getNoDocumentOfEstablished() {
return this.noDocumentOfEstablished;
}
public void setNoDocumentOfEstablished(String noDocumentOfEstablished) {
this.noDocumentOfEstablished = noDocumentOfEstablished;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DateDocumentOfEstablished", length = 23)
public Date getDateDocumentOfEstablished() {
return this.dateDocumentOfEstablished;
}
public void setDateDocumentOfEstablished(Date dateDocumentOfEstablished) {
this.dateDocumentOfEstablished = dateDocumentOfEstablished;
}
@Column(name = "NotaryPlace", length = 50)
public String getNotaryPlace() {
return this.notaryPlace;
}
public void setNotaryPlace(String notaryPlace) {
this.notaryPlace = notaryPlace;
}
@Column(name = "NotaryName", length = 50)
public String getNotaryName() {
return this.notaryName;
}
public void setNotaryName(String notaryName) {
this.notaryName = notaryName;
}
@Column(name = "LastNoDocumentOfEstablished", length = 50)
public String getLastNoDocumentOfEstablished() {
return this.lastNoDocumentOfEstablished;
}
public void setLastNoDocumentOfEstablished(
String lastNoDocumentOfEstablished) {
this.lastNoDocumentOfEstablished = lastNoDocumentOfEstablished;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LastDateDocumentOfEstablished", length = 23)
public Date getLastDateDocumentOfEstablished() {
return this.lastDateDocumentOfEstablished;
}
public void setLastDateDocumentOfEstablished(
Date lastDateDocumentOfEstablished) {
this.lastDateDocumentOfEstablished = lastDateDocumentOfEstablished;
}
@Column(name = "LastNotaryPlace", length = 50)
public String getLastNotaryPlace() {
return this.lastNotaryPlace;
}
public void setLastNotaryPlace(String lastNotaryPlace) {
this.lastNotaryPlace = lastNotaryPlace;
}
@Column(name = "LastNotaryName", length = 50)
public String getLastNotaryName() {
return this.lastNotaryName;
}
public void setLastNotaryName(String lastNotaryName) {
this.lastNotaryName = lastNotaryName;
}
}
| 18,080 | 0.758905 | 0.754369 | 601 | 28.083195 | 22.454458 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.698835 | false | false | 9 |
ba2e781561346c1d5516f28cfd6d79c4cca9cfb0 | 11,338,713,712,335 | 0142cab4f35613b31f16292bdb627de1df13c7b8 | /test/credit/rule/LegalRule2.java | 6918257da820e3f8805b885d1f6c38046b7ce0eb | []
| no_license | zhipingch/ruleengine-1 | https://github.com/zhipingch/ruleengine-1 | e9a74fb3de63d11f5536fdf4e973c3f8706a3256 | 2ab2c245c2b7e28f4cdf060b714666b7806c291f | refs/heads/master | 2020-04-08T20:38:43.086000 | 2018-11-07T11:45:32 | 2018-11-07T11:45:32 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package credit.rule;
import org.easyrules.annotation.Action;
import org.easyrules.annotation.Condition;
import org.easyrules.annotation.Rule;
import org.slf4j.Logger;
import com.beetle.framework.log.AppLogger;
import credit.UserInfo;
@Rule(name = "LegalRule2", description = "")
public class LegalRule2 {
private static Logger logger = AppLogger.getLogger(LegalRule2.class);
private UserInfo user;
public LegalRule2(UserInfo user) {
super();
this.user = user;
}
@Condition
public boolean when() {// 满足条件为true
// 1为大专以下,2为大专,3为本科,4为本科以上
if ((user.getDegree() == 2 || user.getDegree() == 3) && user.getSalary() < 3000 && user.isHasCar() == false
&& user.isHasHouse() == false && user.getCreditNum() == 0) {
logger.debug("when:true");
return true;// 满足条件为true
}
logger.debug("when:false");
return false;
}
@Action(order = 1)
public void then() throws Exception {// 条件为true时,执行的动作(通过不通过)
user.setApprove(false);
logger.debug("then:rule2 action");
logger.debug("user:{}", user);
}
@Action(order = 2)
public void end() throws Exception {
logger.debug("end:action");
}
}
| UTF-8 | Java | 1,207 | java | LegalRule2.java | Java | []
| null | []
| package credit.rule;
import org.easyrules.annotation.Action;
import org.easyrules.annotation.Condition;
import org.easyrules.annotation.Rule;
import org.slf4j.Logger;
import com.beetle.framework.log.AppLogger;
import credit.UserInfo;
@Rule(name = "LegalRule2", description = "")
public class LegalRule2 {
private static Logger logger = AppLogger.getLogger(LegalRule2.class);
private UserInfo user;
public LegalRule2(UserInfo user) {
super();
this.user = user;
}
@Condition
public boolean when() {// 满足条件为true
// 1为大专以下,2为大专,3为本科,4为本科以上
if ((user.getDegree() == 2 || user.getDegree() == 3) && user.getSalary() < 3000 && user.isHasCar() == false
&& user.isHasHouse() == false && user.getCreditNum() == 0) {
logger.debug("when:true");
return true;// 满足条件为true
}
logger.debug("when:false");
return false;
}
@Action(order = 1)
public void then() throws Exception {// 条件为true时,执行的动作(通过不通过)
user.setApprove(false);
logger.debug("then:rule2 action");
logger.debug("user:{}", user);
}
@Action(order = 2)
public void end() throws Exception {
logger.debug("end:action");
}
}
| 1,207 | 0.693823 | 0.676813 | 45 | 23.822222 | 22.421507 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.533333 | false | false | 9 |
1c2a4bde8f21ead239f1c3de543ee796e83554cf | 20,143,396,656,482 | 39715143be76260ad50b8b07ea37963cdfbb5568 | /app/src/main/java/com/aliakbar/android/prod/customer/CustomerDetailActivity.java | ad7defc837214c6bd449290fb44920b64a3fe7de | []
| no_license | aliakbarhiphop/Prod | https://github.com/aliakbarhiphop/Prod | 5ee5385382290c0fff91b3adb63e45708799d20c | fd6ec2ed563392be47351e8e312ccbd46c96a940 | refs/heads/master | 2020-03-25T08:01:43.670000 | 2018-08-13T17:14:17 | 2018-08-13T17:14:17 | 143,587,207 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.aliakbar.android.prod.customer;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.aliakbar.android.prod.R;
import com.aliakbar.android.prod.data.Customer;
import com.aliakbar.android.prod.data.InsertMysql;
import com.aliakbar.android.prod.data.ProdContract;
import com.aliakbar.android.prod.network.VolleyHelper;
import com.aliakbar.android.prod.network.VolleyRequest;
import com.android.volley.NetworkError;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.ServerError;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import static com.aliakbar.android.prod.data.JsonExtract.extractCustomerJson;
public class CustomerDetailActivity extends AppCompatActivity {
Toast toast;
String staffId;
TextView idTextView, nameTextView, managerTextView, dealTextView, totalTextView, paidTextView, creditTextView, orderTextView;
String idFromIntent;
RequestQueue customerDetailRequestQueue, deleteCustomerRequestQueue;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_customer_detail);
deleteCustomerRequestQueue = Volley.newRequestQueue(CustomerDetailActivity.this);
customerDetailRequestQueue = Volley.newRequestQueue(CustomerDetailActivity.this);
Intent extractIdIntent = getIntent();
idFromIntent = extractIdIntent.getStringExtra("selectedCustomerId");
ImageView backIcon = findViewById(R.id.customer_detail_back);
backIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
idTextView = findViewById(R.id.customer_detail_id);
nameTextView = findViewById(R.id.customer_detail_name);
managerTextView = findViewById(R.id.customer_detail_manager);
dealTextView = findViewById(R.id.customer_detail_deals);
totalTextView = findViewById(R.id.customer_detail_total);
paidTextView = findViewById(R.id.customer_detail_paid);
creditTextView = findViewById(R.id.customer_detail_credit);
orderTextView = findViewById(R.id.customer_detail_order);
FrameLayout deleteFrame = findViewById(R.id.customer_detail_delete);
deleteFrame.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
deleteFunction();
}
});
FrameLayout editFrame = (FrameLayout) findViewById(R.id.customer_detail_edit);
editFrame.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent detailIntent = new Intent(CustomerDetailActivity.this, CustomerAddActivity.class);
CustomerAddActivity.editMode = true;
detailIntent.putExtra("selectedCustomerId", idFromIntent);
startActivity(detailIntent);
}
});
}
@Override
protected void onResume() {
super.onResume();
if (CustomerAddActivity.editMode) {
CustomerAddActivity.editMode = false;
}
setCustomer();
}
void setCustomer() {
String[] projection = new String[]{ProdContract.Customer.FULL_COLUMN_CUSTOMER_NAME, ProdContract.Customer.FULL_COLUMN_ID
, ProdContract.Staff.FULL_COLUMN_STAFF_NAME, ProdContract.Staff.FULL_COLUMN_ID, ProdContract.Customer.FULL_COLUMN_TOTAL_DEAL, ProdContract.Customer.FULL_COLUMN_TOTAL
, ProdContract.Customer.FULL_COLUMN_PAID, ProdContract.Customer.FULL_COLUMN_CREDIT, ProdContract.Customer.FULL_COLUMN_ORDER};
String tableName = ProdContract.Customer.TABLE_NAME + " INNER JOIN " + ProdContract.Staff.TABLE_NAME
+ " ON " + ProdContract.Customer.FULL_COLUMN_CUSTOMER_MANAGER_ID + " = " + ProdContract.Staff.FULL_COLUMN_ID;
String selection = ProdContract.Customer.FULL_COLUMN_ID + "=?";
String selectionArgs[] = new String[]{idFromIntent};
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.selectVolly(
tableName
, projection
, selection, selectionArgs, null)
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Login Response", response);
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getBoolean("success")) {
List<Customer> customerListFromServer = extractCustomerJson(jsonObject.getJSONArray("cursor"));
Customer customer = customerListFromServer.get(0);
String name = customer.getName();
nameTextView.setText(name);
String id = "" + customer.getId();
idTextView.setText(id);
String managerName = customer.getManagerName();
managerTextView.setText("Manager :" + managerName);
String deals = "" + customer.getDeals();
dealTextView.setText(deals);
String order = "" + customer.getOrders();
orderTextView.setText(order);
String total = "" + customer.getTotal();
totalTextView.setText(total);
String paid = "" + customer.getPaid();
paidTextView.setText(paid);
String credit = "" + customer.getCredit();
creditTextView.setText(credit);
//SETUP STAFF ID
JSONArray jsonArray = jsonObject.getJSONArray("cursor");
JSONObject obj = jsonArray.getJSONObject(0);
int staffIdJson = obj.getInt(ProdContract.Staff.FULL_COLUMN_ID);
staffId = "" + staffIdJson;
} else {
if (jsonObject.getString("status").equals("INVALID")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "User Not Found", Toast.LENGTH_SHORT);
toast.show();
} else if (jsonObject.getString("status").equals("EMPTY DATABASE")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Database Empty", Toast.LENGTH_SHORT);
toast.show();
}
}
} catch (JSONException e) {
e.printStackTrace();
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Response From Server", Toast.LENGTH_SHORT);
toast.show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (error instanceof ServerError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Server Error", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof TimeoutError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Connection Timed Out", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof NetworkError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Network Connection", Toast.LENGTH_SHORT);
toast.show();
}
}
});
customerDetailRequestQueue.add(volleyRequest);
}
void deleteFunction() {
DialogInterface.OnClickListener yesButtonClickListener =
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
String tableName = ProdContract.Customer.TABLE_NAME;
String selection = ProdContract.Customer._ID + "=?";
String[] selectionArgs = new String[]{idFromIntent};
deleteCustomer(tableName, selection, selectionArgs);
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(CustomerDetailActivity.this);
builder.setMessage("Are You Sure,Do You Want To Delete");
builder.setPositiveButton("Yes", yesButtonClickListener);
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (dialog != null) {
dialog.dismiss();
}
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
void deleteCustomer(String tableName, String selection, String[] selectionArgs) {
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.deleteVolly(tableName, selection, selectionArgs)
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Login Response", response);
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getBoolean("success")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Deleted Successfully.Deleted " + jsonObject.getInt("affectedRaw")
+ " Item"
, Toast.LENGTH_SHORT);
toast.show();
if (!staffId.matches("0")) {
updateDeleteStaff();
}
finish();
} else {
if (jsonObject.getString("status").equals("INVALID")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "User Not Found", Toast.LENGTH_SHORT);toast.show();
} else if (jsonObject.getString("status").equals("DELETE ERROR")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Failed To Delete", Toast.LENGTH_SHORT);toast.show();
finish();
}
}
} catch (JSONException e) {
e.printStackTrace();
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Response From Server", Toast.LENGTH_SHORT);toast.show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (error instanceof ServerError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Server Error", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof TimeoutError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Connection Timed Out", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof NetworkError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Network Connection", Toast.LENGTH_SHORT);
toast.show();
}
}
});
deleteCustomerRequestQueue.add(volleyRequest);
}
void updateDeleteStaff() {
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.selectVolly(ProdContract.Staff.TABLE_NAME
, new String[]{ProdContract.Staff.COLUMN_STAFF_CLIENT}, ProdContract.Staff._ID + " = ?", new String[]{staffId}, null)
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Login Response", response);
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getBoolean("success")) {
JSONArray customerJson = jsonObject.getJSONArray("cursor");
JSONObject obj = customerJson.getJSONObject(0);
int client = obj.getInt(ProdContract.Staff.COLUMN_STAFF_CLIENT);
if (client <= 0) {
client = 0;
} else {
client--;
}
String clientString = "" + client;
ArrayList<InsertMysql> ins = new ArrayList<>();
ins.add(new InsertMysql(ProdContract.Staff.COLUMN_STAFF_CLIENT, clientString));
updateStaffClent(ins);
} else {
if (jsonObject.getString("status").equals("INVALID")) {
} else if (jsonObject.getString("status").equals("UPDATE ERROR")) {
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
deleteCustomerRequestQueue.add(volleyRequest);
}
void updateStaffClent(List<InsertMysql> insertMysqls) {
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.updateVolly(ProdContract.Staff.TABLE_NAME
, insertMysqls, ProdContract.Staff._ID + " = ?", new String[]{staffId})
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
customerDetailRequestQueue.add(volleyRequest);
}
}
| UTF-8 | Java | 16,184 | java | CustomerDetailActivity.java | Java | []
| null | []
| package com.aliakbar.android.prod.customer;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.aliakbar.android.prod.R;
import com.aliakbar.android.prod.data.Customer;
import com.aliakbar.android.prod.data.InsertMysql;
import com.aliakbar.android.prod.data.ProdContract;
import com.aliakbar.android.prod.network.VolleyHelper;
import com.aliakbar.android.prod.network.VolleyRequest;
import com.android.volley.NetworkError;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.ServerError;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import static com.aliakbar.android.prod.data.JsonExtract.extractCustomerJson;
public class CustomerDetailActivity extends AppCompatActivity {
Toast toast;
String staffId;
TextView idTextView, nameTextView, managerTextView, dealTextView, totalTextView, paidTextView, creditTextView, orderTextView;
String idFromIntent;
RequestQueue customerDetailRequestQueue, deleteCustomerRequestQueue;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_customer_detail);
deleteCustomerRequestQueue = Volley.newRequestQueue(CustomerDetailActivity.this);
customerDetailRequestQueue = Volley.newRequestQueue(CustomerDetailActivity.this);
Intent extractIdIntent = getIntent();
idFromIntent = extractIdIntent.getStringExtra("selectedCustomerId");
ImageView backIcon = findViewById(R.id.customer_detail_back);
backIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
idTextView = findViewById(R.id.customer_detail_id);
nameTextView = findViewById(R.id.customer_detail_name);
managerTextView = findViewById(R.id.customer_detail_manager);
dealTextView = findViewById(R.id.customer_detail_deals);
totalTextView = findViewById(R.id.customer_detail_total);
paidTextView = findViewById(R.id.customer_detail_paid);
creditTextView = findViewById(R.id.customer_detail_credit);
orderTextView = findViewById(R.id.customer_detail_order);
FrameLayout deleteFrame = findViewById(R.id.customer_detail_delete);
deleteFrame.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
deleteFunction();
}
});
FrameLayout editFrame = (FrameLayout) findViewById(R.id.customer_detail_edit);
editFrame.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent detailIntent = new Intent(CustomerDetailActivity.this, CustomerAddActivity.class);
CustomerAddActivity.editMode = true;
detailIntent.putExtra("selectedCustomerId", idFromIntent);
startActivity(detailIntent);
}
});
}
@Override
protected void onResume() {
super.onResume();
if (CustomerAddActivity.editMode) {
CustomerAddActivity.editMode = false;
}
setCustomer();
}
void setCustomer() {
String[] projection = new String[]{ProdContract.Customer.FULL_COLUMN_CUSTOMER_NAME, ProdContract.Customer.FULL_COLUMN_ID
, ProdContract.Staff.FULL_COLUMN_STAFF_NAME, ProdContract.Staff.FULL_COLUMN_ID, ProdContract.Customer.FULL_COLUMN_TOTAL_DEAL, ProdContract.Customer.FULL_COLUMN_TOTAL
, ProdContract.Customer.FULL_COLUMN_PAID, ProdContract.Customer.FULL_COLUMN_CREDIT, ProdContract.Customer.FULL_COLUMN_ORDER};
String tableName = ProdContract.Customer.TABLE_NAME + " INNER JOIN " + ProdContract.Staff.TABLE_NAME
+ " ON " + ProdContract.Customer.FULL_COLUMN_CUSTOMER_MANAGER_ID + " = " + ProdContract.Staff.FULL_COLUMN_ID;
String selection = ProdContract.Customer.FULL_COLUMN_ID + "=?";
String selectionArgs[] = new String[]{idFromIntent};
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.selectVolly(
tableName
, projection
, selection, selectionArgs, null)
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Login Response", response);
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getBoolean("success")) {
List<Customer> customerListFromServer = extractCustomerJson(jsonObject.getJSONArray("cursor"));
Customer customer = customerListFromServer.get(0);
String name = customer.getName();
nameTextView.setText(name);
String id = "" + customer.getId();
idTextView.setText(id);
String managerName = customer.getManagerName();
managerTextView.setText("Manager :" + managerName);
String deals = "" + customer.getDeals();
dealTextView.setText(deals);
String order = "" + customer.getOrders();
orderTextView.setText(order);
String total = "" + customer.getTotal();
totalTextView.setText(total);
String paid = "" + customer.getPaid();
paidTextView.setText(paid);
String credit = "" + customer.getCredit();
creditTextView.setText(credit);
//SETUP STAFF ID
JSONArray jsonArray = jsonObject.getJSONArray("cursor");
JSONObject obj = jsonArray.getJSONObject(0);
int staffIdJson = obj.getInt(ProdContract.Staff.FULL_COLUMN_ID);
staffId = "" + staffIdJson;
} else {
if (jsonObject.getString("status").equals("INVALID")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "User Not Found", Toast.LENGTH_SHORT);
toast.show();
} else if (jsonObject.getString("status").equals("EMPTY DATABASE")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Database Empty", Toast.LENGTH_SHORT);
toast.show();
}
}
} catch (JSONException e) {
e.printStackTrace();
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Response From Server", Toast.LENGTH_SHORT);
toast.show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (error instanceof ServerError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Server Error", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof TimeoutError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Connection Timed Out", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof NetworkError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Network Connection", Toast.LENGTH_SHORT);
toast.show();
}
}
});
customerDetailRequestQueue.add(volleyRequest);
}
void deleteFunction() {
DialogInterface.OnClickListener yesButtonClickListener =
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
String tableName = ProdContract.Customer.TABLE_NAME;
String selection = ProdContract.Customer._ID + "=?";
String[] selectionArgs = new String[]{idFromIntent};
deleteCustomer(tableName, selection, selectionArgs);
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(CustomerDetailActivity.this);
builder.setMessage("Are You Sure,Do You Want To Delete");
builder.setPositiveButton("Yes", yesButtonClickListener);
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (dialog != null) {
dialog.dismiss();
}
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
void deleteCustomer(String tableName, String selection, String[] selectionArgs) {
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.deleteVolly(tableName, selection, selectionArgs)
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Login Response", response);
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getBoolean("success")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Deleted Successfully.Deleted " + jsonObject.getInt("affectedRaw")
+ " Item"
, Toast.LENGTH_SHORT);
toast.show();
if (!staffId.matches("0")) {
updateDeleteStaff();
}
finish();
} else {
if (jsonObject.getString("status").equals("INVALID")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "User Not Found", Toast.LENGTH_SHORT);toast.show();
} else if (jsonObject.getString("status").equals("DELETE ERROR")) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Failed To Delete", Toast.LENGTH_SHORT);toast.show();
finish();
}
}
} catch (JSONException e) {
e.printStackTrace();
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Response From Server", Toast.LENGTH_SHORT);toast.show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (error instanceof ServerError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Server Error", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof TimeoutError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Connection Timed Out", Toast.LENGTH_SHORT);
toast.show();
} else if (error instanceof NetworkError) {
if (toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomerDetailActivity.this, "Bad Network Connection", Toast.LENGTH_SHORT);
toast.show();
}
}
});
deleteCustomerRequestQueue.add(volleyRequest);
}
void updateDeleteStaff() {
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.selectVolly(ProdContract.Staff.TABLE_NAME
, new String[]{ProdContract.Staff.COLUMN_STAFF_CLIENT}, ProdContract.Staff._ID + " = ?", new String[]{staffId}, null)
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Login Response", response);
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getBoolean("success")) {
JSONArray customerJson = jsonObject.getJSONArray("cursor");
JSONObject obj = customerJson.getJSONObject(0);
int client = obj.getInt(ProdContract.Staff.COLUMN_STAFF_CLIENT);
if (client <= 0) {
client = 0;
} else {
client--;
}
String clientString = "" + client;
ArrayList<InsertMysql> ins = new ArrayList<>();
ins.add(new InsertMysql(ProdContract.Staff.COLUMN_STAFF_CLIENT, clientString));
updateStaffClent(ins);
} else {
if (jsonObject.getString("status").equals("INVALID")) {
} else if (jsonObject.getString("status").equals("UPDATE ERROR")) {
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
deleteCustomerRequestQueue.add(volleyRequest);
}
void updateStaffClent(List<InsertMysql> insertMysqls) {
final VolleyRequest volleyRequest = new VolleyRequest(VolleyHelper.updateVolly(ProdContract.Staff.TABLE_NAME
, insertMysqls, ProdContract.Staff._ID + " = ?", new String[]{staffId})
, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
customerDetailRequestQueue.add(volleyRequest);
}
}
| 16,184 | 0.542449 | 0.542017 | 380 | 41.589474 | 32.967606 | 181 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.655263 | false | false | 9 |
a8d12c6ae1caf31e39ee35cf3e26e1fb7af47dae | 14,611,478,759,728 | bc6b149dc547069d5225f47999c3cb41ff8be40c | /test-case/src/test/java/jp/skypencil/findbugs/slf4j/Issue37Test.java | b4ca6481fd6bb4a080268e64efa67ec5c1c32c5c | [
"Apache-2.0"
]
| permissive | KengoTODA/findbugs-slf4j | https://github.com/KengoTODA/findbugs-slf4j | 52c8f970c0fb892fe2a4635957b0079d7f7eee18 | b3b8f9dd203b058c67748ad870a461b14ba26a81 | refs/heads/master | 2023-08-16T06:51:00.213000 | 2022-05-11T08:04:35 | 2022-05-11T08:09:56 | 5,559,719 | 55 | 9 | Apache-2.0 | false | 2023-03-13T14:57:03 | 2012-08-26T12:12:13 | 2023-02-18T13:36:40 | 2023-03-13T14:56:58 | 681 | 67 | 11 | 18 | Java | false | false | package jp.skypencil.findbugs.slf4j;
import java.util.Collections;
import java.util.Map;
import org.junit.jupiter.api.Test;
public class Issue37Test {
@Test
public void testToFindIllegalArgumentException() {
Map<String, Integer> expectedError =
Collections.singletonMap("SBSC_USE_STRINGBUFFER_CONCATENATION", 1);
new XmlParser().expect(pkg.Issue37.class, expectedError);
}
}
| UTF-8 | Java | 399 | java | Issue37Test.java | Java | []
| null | []
| package jp.skypencil.findbugs.slf4j;
import java.util.Collections;
import java.util.Map;
import org.junit.jupiter.api.Test;
public class Issue37Test {
@Test
public void testToFindIllegalArgumentException() {
Map<String, Integer> expectedError =
Collections.singletonMap("SBSC_USE_STRINGBUFFER_CONCATENATION", 1);
new XmlParser().expect(pkg.Issue37.class, expectedError);
}
}
| 399 | 0.756892 | 0.741855 | 14 | 27.5 | 23.194057 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.642857 | false | false | 9 |
474ac87f878dca9c8d8c16b0410f9fbfa4feab43 | 14,611,478,757,992 | 18f2acea9ebe8bdd357147627e4385454cc8fe9b | /src/main/java/io/github/emanuelcerqueira/wirecardbackendchallenge/core/services/PaymentProcessorVisitorService.java | e415efccefbc49dfe9df5fcc5df4456db7946201 | []
| no_license | emvnuel/wirecard-backend-challenge | https://github.com/emvnuel/wirecard-backend-challenge | 0cfcecfc9cb926fe9535396ca095108e00106597 | 78b8224de4ba314e11fb2eecb2c1a795bfb6a2c7 | refs/heads/main | 2023-01-05T16:19:33.255000 | 2020-10-31T01:17:09 | 2020-10-31T01:17:09 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package io.github.emanuelcerqueira.wirecardbackendchallenge.core.services;
import io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.BoletoPayment;
import io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.CreditCardPayment;
import io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.PaymentVisitor;
import org.springframework.stereotype.Service;
@Service
public class PaymentProcessorVisitorService implements PaymentVisitor {
private final BoletoService boletoService;
private final CreditCardService creditCardService;
public PaymentProcessorVisitorService(BoletoService boletoService, CreditCardService creditCardService) {
this.boletoService = boletoService;
this.creditCardService = creditCardService;
}
@Override
public Object visit(BoletoPayment boletoPayment) {
boletoService.processPayment(boletoPayment);
return boletoPayment;
}
@Override
public Object visit(CreditCardPayment creditCardPayment) {
creditCardService.processPayment(creditCardPayment);
return creditCardPayment;
}
}
| UTF-8 | Java | 1,121 | java | PaymentProcessorVisitorService.java | Java | [
{
"context": "package io.github.emanuelcerqueira.wirecardbackendchallenge.core.services;\n\nimport i",
"end": 34,
"score": 0.9993497729301453,
"start": 18,
"tag": "USERNAME",
"value": "emanuelcerqueira"
},
{
"context": "backendchallenge.core.services;\n\nimport io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.BoletoPayment",
"end": 109,
"score": 0.9994487762451172,
"start": 93,
"tag": "USERNAME",
"value": "emanuelcerqueira"
},
{
"context": "llenge.core.model.BoletoPayment;\nimport io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.CreditCardPay",
"end": 194,
"score": 0.9994343519210815,
"start": 178,
"tag": "USERNAME",
"value": "emanuelcerqueira"
},
{
"context": "ge.core.model.CreditCardPayment;\nimport io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.PaymentVisito",
"end": 283,
"score": 0.9994133710861206,
"start": 267,
"tag": "USERNAME",
"value": "emanuelcerqueira"
}
]
| null | []
| package io.github.emanuelcerqueira.wirecardbackendchallenge.core.services;
import io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.BoletoPayment;
import io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.CreditCardPayment;
import io.github.emanuelcerqueira.wirecardbackendchallenge.core.model.PaymentVisitor;
import org.springframework.stereotype.Service;
@Service
public class PaymentProcessorVisitorService implements PaymentVisitor {
private final BoletoService boletoService;
private final CreditCardService creditCardService;
public PaymentProcessorVisitorService(BoletoService boletoService, CreditCardService creditCardService) {
this.boletoService = boletoService;
this.creditCardService = creditCardService;
}
@Override
public Object visit(BoletoPayment boletoPayment) {
boletoService.processPayment(boletoPayment);
return boletoPayment;
}
@Override
public Object visit(CreditCardPayment creditCardPayment) {
creditCardService.processPayment(creditCardPayment);
return creditCardPayment;
}
}
| 1,121 | 0.803747 | 0.803747 | 30 | 36.366665 | 32.566326 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.466667 | false | false | 9 |
864adabafd4f1cb91f481060c07c0d240d2f27fc | 21,517,786,160,202 | b2d5b00b206963cbdd88dd31f144a3c13ee1f60e | /catalogue/src/main/java/projectx/persistence/webentities/CurrentSession.java | 406bec777d8a87f2b24479bfb7de0e56dfba63df | []
| no_license | eawatts/ProjectX | https://github.com/eawatts/ProjectX | f592056d625a1858c94293c1ded9ea72f75d3a00 | c66a0ee0c000276b363550b18cc455d9cd722dbc | refs/heads/master | 2020-05-29T09:16:17.955000 | 2016-11-07T16:42:54 | 2016-11-07T16:42:54 | 69,440,986 | 1 | 0 | null | false | 2016-10-28T08:32:05 | 2016-09-28T08:10:36 | 2016-10-28T08:26:51 | 2016-10-28T08:32:04 | 16,726 | 1 | 0 | 0 | CSS | null | null | package projectx.persistence.webentities;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import projectx.persistence.entities.User;
import java.io.Serializable;
@SessionScoped
@Named("current_session")
public class CurrentSession implements Serializable {
private static final long serialVersionUID = 1L;
private User user;
private Basket basket;
private String urlRedirect; // Used to store a page to redirect to after an event (login for example).
@PostConstruct
private void setupCurrentSession(){
this.basket = new Basket();
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Basket getBasket() {
return basket;
}
public void setBasket(Basket basket) {
this.basket = basket;
}
public String getUserFirstName() {
return this.user.getFirstname();
}
public boolean isLoggedIn() {
return (user == null) ? false : true;
}
public void logout() {
this.user = null;
}
public String getUrlRedirect() {
return urlRedirect;
}
public void setUrlRedirect(String urlRedirect) {
this.urlRedirect = urlRedirect;
}
}
| UTF-8 | Java | 1,184 | java | CurrentSession.java | Java | []
| null | []
| package projectx.persistence.webentities;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import projectx.persistence.entities.User;
import java.io.Serializable;
@SessionScoped
@Named("current_session")
public class CurrentSession implements Serializable {
private static final long serialVersionUID = 1L;
private User user;
private Basket basket;
private String urlRedirect; // Used to store a page to redirect to after an event (login for example).
@PostConstruct
private void setupCurrentSession(){
this.basket = new Basket();
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Basket getBasket() {
return basket;
}
public void setBasket(Basket basket) {
this.basket = basket;
}
public String getUserFirstName() {
return this.user.getFirstname();
}
public boolean isLoggedIn() {
return (user == null) ? false : true;
}
public void logout() {
this.user = null;
}
public String getUrlRedirect() {
return urlRedirect;
}
public void setUrlRedirect(String urlRedirect) {
this.urlRedirect = urlRedirect;
}
}
| 1,184 | 0.735642 | 0.734797 | 62 | 18.096775 | 19.723663 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.080645 | false | false | 9 |
f718da7f9573bff99e9fb6c19bdfca5defdb4bec | 7,198,365,202,245 | 85f6655bb086ac00db535f0a63623cbdbd893aa3 | /app/src/main/java/mycroft/ai/mycroftcore/TestInteractionActivity.java | 696da2e18ba364b4eb7819ab2abb7e78e4a28c16 | []
| no_license | paulscott56/Android-Mycroft-Core-AssistAPIExperiment | https://github.com/paulscott56/Android-Mycroft-Core-AssistAPIExperiment | 35b2b494e3128afa479d338a5f96604b70d04545 | ea6fcd41f4feebcc9b7c42d138540b347c5b21a4 | refs/heads/master | 2021-01-20T18:44:27.223000 | 2016-06-23T14:48:24 | 2016-06-23T14:48:24 | 61,813,103 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package mycroft.ai.mycroftcore;
/**
* Created by paul on 2016/06/22.
*/
import android.app.Activity;
import android.app.VoiceInteractor;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
public class TestInteractionActivity extends Activity implements View.OnClickListener {
static final String TAG = "TestInteractionActivity";
VoiceInteractor mInteractor;
Button mAbortButton;
Button mCompleteButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!isVoiceInteraction()) {
Log.w(TAG, "Not running as a voice interaction!");
finish();
return;
}
setContentView(R.layout.test_interaction);
mAbortButton = (Button) findViewById(R.id.abort);
mAbortButton.setOnClickListener(this);
mCompleteButton = (Button) findViewById(R.id.complete);
mCompleteButton.setOnClickListener(this);
// Framework should take care of these.
getWindow().setGravity(Gravity.TOP);
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
mInteractor = getVoiceInteractor();
Bundle status = new Bundle();
VoiceInteractor.Prompt prompt = new VoiceInteractor.Prompt("this is a confirmation");
VoiceInteractor.ConfirmationRequest req = new VoiceInteractor.ConfirmationRequest(prompt, null) {
@Override
public void onCancel() {
Log.i(TAG, "Canceled!");
getActivity().finish();
}
@Override
public void onConfirmationResult(boolean confirmed, Bundle result) {
Log.i(TAG, "Confirmation result: confirmed=" + confirmed + " result=" + result);
getActivity().finish();
}
};
mInteractor.submitRequest(req);
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onClick(View v) {
if (v == mAbortButton) {
VoiceInteractor.Prompt prompt2 = new VoiceInteractor.Prompt("Dammit, we suck :(");
VoiceInteractor.AbortVoiceRequest req = new VoiceInteractor.AbortVoiceRequest(
prompt2, null) {
@Override
public void onCancel() {
Log.i(TAG, "Canceled!");
}
@Override
public void onAbortResult(Bundle result) {
Log.i(TAG, "Abort result: result=" + result);
getActivity().finish();
}
};
mInteractor.submitRequest(req);
} else if (v == mCompleteButton) {
VoiceInteractor.Prompt prompt3 = new VoiceInteractor.Prompt("Woohoo, completed!");
VoiceInteractor.CompleteVoiceRequest req = new VoiceInteractor.CompleteVoiceRequest(
prompt3, null) {
@Override
public void onCancel() {
Log.i(TAG, "Canceled!");
}
@Override
public void onCompleteResult(Bundle result) {
Log.i(TAG, "Complete result: result=" + result);
getActivity().finish();
}
};
mInteractor.submitRequest(req);
}
}
@Override
public void onDestroy() {
super.onDestroy();
}
} | UTF-8 | Java | 3,598 | java | TestInteractionActivity.java | Java | [
{
"context": "package mycroft.ai.mycroftcore;\n\n/**\n * Created by paul on 2016/06/22.\n */\n\nimport android.app.Activity;\n",
"end": 55,
"score": 0.9946978092193604,
"start": 51,
"tag": "USERNAME",
"value": "paul"
}
]
| null | []
| package mycroft.ai.mycroftcore;
/**
* Created by paul on 2016/06/22.
*/
import android.app.Activity;
import android.app.VoiceInteractor;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
public class TestInteractionActivity extends Activity implements View.OnClickListener {
static final String TAG = "TestInteractionActivity";
VoiceInteractor mInteractor;
Button mAbortButton;
Button mCompleteButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!isVoiceInteraction()) {
Log.w(TAG, "Not running as a voice interaction!");
finish();
return;
}
setContentView(R.layout.test_interaction);
mAbortButton = (Button) findViewById(R.id.abort);
mAbortButton.setOnClickListener(this);
mCompleteButton = (Button) findViewById(R.id.complete);
mCompleteButton.setOnClickListener(this);
// Framework should take care of these.
getWindow().setGravity(Gravity.TOP);
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
mInteractor = getVoiceInteractor();
Bundle status = new Bundle();
VoiceInteractor.Prompt prompt = new VoiceInteractor.Prompt("this is a confirmation");
VoiceInteractor.ConfirmationRequest req = new VoiceInteractor.ConfirmationRequest(prompt, null) {
@Override
public void onCancel() {
Log.i(TAG, "Canceled!");
getActivity().finish();
}
@Override
public void onConfirmationResult(boolean confirmed, Bundle result) {
Log.i(TAG, "Confirmation result: confirmed=" + confirmed + " result=" + result);
getActivity().finish();
}
};
mInteractor.submitRequest(req);
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onClick(View v) {
if (v == mAbortButton) {
VoiceInteractor.Prompt prompt2 = new VoiceInteractor.Prompt("Dammit, we suck :(");
VoiceInteractor.AbortVoiceRequest req = new VoiceInteractor.AbortVoiceRequest(
prompt2, null) {
@Override
public void onCancel() {
Log.i(TAG, "Canceled!");
}
@Override
public void onAbortResult(Bundle result) {
Log.i(TAG, "Abort result: result=" + result);
getActivity().finish();
}
};
mInteractor.submitRequest(req);
} else if (v == mCompleteButton) {
VoiceInteractor.Prompt prompt3 = new VoiceInteractor.Prompt("Woohoo, completed!");
VoiceInteractor.CompleteVoiceRequest req = new VoiceInteractor.CompleteVoiceRequest(
prompt3, null) {
@Override
public void onCancel() {
Log.i(TAG, "Canceled!");
}
@Override
public void onCompleteResult(Bundle result) {
Log.i(TAG, "Complete result: result=" + result);
getActivity().finish();
}
};
mInteractor.submitRequest(req);
}
}
@Override
public void onDestroy() {
super.onDestroy();
}
} | 3,598 | 0.584213 | 0.580878 | 105 | 33.276192 | 25.522911 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.580952 | false | false | 9 |
f08f3823b22cd69b18e2bfa8a3e7c6df6dc53d93 | 29,575,144,809,291 | 27ef2a2ea8cc19c1aeba93f86d5fb4417631d576 | /src/Square.java | 1cb4229c92c55cc3461e09f1df6d4939acf5e120 | []
| no_license | clarissam5/8-20-18 | https://github.com/clarissam5/8-20-18 | ec0c2318c1c9deca14d9d776d3a34ee475b97e70 | e7c8975a267edc3b000cc498fff2387ed37999ec | refs/heads/master | 2020-03-26T22:53:57.002000 | 2018-08-22T18:50:43 | 2018-08-22T18:50:43 | 145,494,963 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class Square extends Shape {
public int side;
Square (String name, int side){
super(name);
}
@Override //Annotation
public void calculateArea() {
//Accessing Math's PI value
double area = (Math.pow(side, 2));
System.out.println("Area of a square is " + area);
}
public void calculatePerimeter(){
double perimeter = 4 * side;
System.out.println("Perimeter of the square is: " + perimeter);
}
@Override
public void draw() {
System.out.println("Draw Square");
}
}
| UTF-8 | Java | 527 | java | Square.java | Java | []
| null | []
|
public class Square extends Shape {
public int side;
Square (String name, int side){
super(name);
}
@Override //Annotation
public void calculateArea() {
//Accessing Math's PI value
double area = (Math.pow(side, 2));
System.out.println("Area of a square is " + area);
}
public void calculatePerimeter(){
double perimeter = 4 * side;
System.out.println("Perimeter of the square is: " + perimeter);
}
@Override
public void draw() {
System.out.println("Draw Square");
}
}
| 527 | 0.637571 | 0.633776 | 27 | 18.481482 | 18.048023 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.074074 | false | false | 9 |
6a602f3a6aff4342aed691937a266d2fe29cc600 | 7,395,933,695,264 | b844a7f55ce0c294edfe46098ef8a34babf95073 | /self-Study-Space/src/main/java/com/suyb/selfStudy/pattern/generic/nesting/StudentApp.java | 21e1a694a9406f238470ac27aa41419dd688906b | []
| no_license | robin-su/pattern | https://github.com/robin-su/pattern | 4618308f3479d556c8dfacea76dcab64f9f9c960 | b5c6e3c573b9aa88998fc5012ad7f304fdd4122c | refs/heads/master | 2021-07-21T05:12:05.330000 | 2017-10-31T13:44:40 | 2017-10-31T13:44:40 | 108,563,126 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.suyb.selfStudy.pattern.generic.nesting;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
/**
* 泛型嵌套 --> 由外到内的拆分
*/
public class StudentApp {
public static void main(String[] args) {
Student<String> stu = new Student<String>();
stu.setScore("优秀");
System.out.println(stu.getScore()); //优秀
//泛型的嵌套
Bjsxt<Student<String>> bjsxt = new Bjsxt<Student<String>>();
bjsxt.setStu(stu);
stu = bjsxt.getStu();
String score = stu.getScore();
System.out.println(score);
//HashMap --> 使用泛型的嵌套
Map<String, String> map = new HashMap<String,String>();
map.put("a","java");
map.put("b", "马士兵Javase");
Set<Entry<String, String>> entrySet = map.entrySet();
for (Entry<String, String> entry : entrySet) {
System.out.println(entry.getKey() + "->" + entry.getValue());
}
}
}
| UTF-8 | Java | 976 | java | StudentApp.java | Java | [
{
"context": "ring>();\r\n\t\tmap.put(\"a\",\"java\");\r\n\t\tmap.put(\"b\", \"马士兵Javase\");\r\n\t\t\r\n\t\tSet<Entry<String, String>> entrySet = m",
"end": 716,
"score": 0.9611668586730957,
"start": 707,
"tag": "NAME",
"value": "马士兵Javase"
}
]
| null | []
| package com.suyb.selfStudy.pattern.generic.nesting;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
/**
* 泛型嵌套 --> 由外到内的拆分
*/
public class StudentApp {
public static void main(String[] args) {
Student<String> stu = new Student<String>();
stu.setScore("优秀");
System.out.println(stu.getScore()); //优秀
//泛型的嵌套
Bjsxt<Student<String>> bjsxt = new Bjsxt<Student<String>>();
bjsxt.setStu(stu);
stu = bjsxt.getStu();
String score = stu.getScore();
System.out.println(score);
//HashMap --> 使用泛型的嵌套
Map<String, String> map = new HashMap<String,String>();
map.put("a","java");
map.put("b", "马士兵Javase");
Set<Entry<String, String>> entrySet = map.entrySet();
for (Entry<String, String> entry : entrySet) {
System.out.println(entry.getKey() + "->" + entry.getValue());
}
}
}
| 976 | 0.622271 | 0.622271 | 39 | 21.487179 | 19.762527 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.846154 | false | false | 9 |
1513fbc031245fa11d53a427210b3283c9d02a24 | 30,262,339,577,342 | 2d2e1c6126870b0833c6f80fec950af7897065e5 | /scriptom-office-2k7/src/main/java/org/codehaus/groovy/scriptom/tlb/office2007/visio/VisUICtrlIDs.java | 322c0a475cbe05355b30dd1d73ca7421e0fc4f13 | []
| no_license | groovy/Scriptom | https://github.com/groovy/Scriptom | d650b0464f58d3b58bb13469e710dbb80e2517d5 | 790eef97cdacc5da293d18600854b547f47e4169 | refs/heads/master | 2023-09-01T16:13:00.152000 | 2022-02-14T12:30:17 | 2022-02-14T12:30:17 | 39,463,850 | 20 | 7 | null | false | 2015-07-23T12:48:26 | 2015-07-21T18:52:11 | 2015-07-22T05:53:44 | 2015-07-23T12:48:26 | 0 | 1 | 2 | 0 | Java | null | null | /*
* Copyright 2009 (C) The Codehaus. All Rights Reserved.
*
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided that the
* following conditions are met:
* 1. Redistributions of source code must retain copyright statements and
* notices. Redistributions must also contain a copy of this document.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name "groovy" must not be used to endorse or promote products
* derived from this Software without prior written permission of The Codehaus.
* For written permission, please contact info@codehaus.org.
* 4. Products derived from this Software may not be called "groovy" nor may
* "groovy" appear in their names without prior written permission of The
* Codehaus. "groovy" is a registered trademark of The Codehaus.
* 5. Due credit should be given to The Codehaus - http://groovy.codehaus.org/
*
* THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
package org.codehaus.groovy.scriptom.tlb.office2007.visio;
import java.util.Map;
import java.util.TreeMap;
import java.util.Collections;
/**
* Toolbar Bar constants for CntrlID property. Obsolete as of Visio 2003.
* @author Jason Smith
*/
public final class VisUICtrlIDs
{
private VisUICtrlIDs()
{
}
/**
* Obsolete as of Visio 2003.<p>
* Value is 8383 (0x20BF)
*/
public static final Integer visCtrlIDNEW = Integer.valueOf(8383);
/**
* Obsolete as of Visio 2003.<p>
* Value is 1 (0x1)
*/
public static final Integer visCtrlIDOPEN = Integer.valueOf(1);
/**
* Obsolete as of Visio 2003.<p>
* Value is 2 (0x2)
*/
public static final Integer visCtrlIDOPENSTEN = Integer.valueOf(2);
/**
* Obsolete as of Visio 2003.<p>
* Value is 3 (0x3)
*/
public static final Integer visCtrlIDSAVE = Integer.valueOf(3);
/**
* Obsolete as of Visio 2003.<p>
* Value is 4 (0x4)
*/
public static final Integer visCtrlIDPRINT = Integer.valueOf(4);
/**
* Obsolete as of Visio 2003.<p>
* Value is 5 (0x5)
*/
public static final Integer visCtrlIDPREVIEW = Integer.valueOf(5);
/**
* Obsolete as of Visio 2003.<p>
* Value is 6 (0x6)
*/
public static final Integer visCtrlIDCUT = Integer.valueOf(6);
/**
* Obsolete as of Visio 2003.<p>
* Value is 7 (0x7)
*/
public static final Integer visCtrlIDCOPY = Integer.valueOf(7);
/**
* Obsolete as of Visio 2003.<p>
* Value is 8 (0x8)
*/
public static final Integer visCtrlIDPASTE = Integer.valueOf(8);
/**
* Obsolete as of Visio 2003.<p>
* Value is 9 (0x9)
*/
public static final Integer visCtrlIDCLEAR = Integer.valueOf(9);
/**
* Obsolete as of Visio 2003.<p>
* Value is 10 (0xA)
*/
public static final Integer visCtrlIDUNDO = Integer.valueOf(10);
/**
* Obsolete as of Visio 2003.<p>
* Value is 11 (0xB)
*/
public static final Integer visCtrlIDREDO = Integer.valueOf(11);
/**
* Obsolete as of Visio 2003.<p>
* Value is 12 (0xC)
*/
public static final Integer visCtrlIDREPEAT = Integer.valueOf(12);
/**
* Obsolete as of Visio 2003.<p>
* Value is 13 (0xD)
*/
public static final Integer visCtrlIDPREVIOUSPAGE = Integer.valueOf(13);
/**
* Obsolete as of Visio 2003.<p>
* Value is 14 (0xE)
*/
public static final Integer visCtrlIDNEXTPAGE = Integer.valueOf(14);
/**
* Obsolete as of Visio 2003.<p>
* Value is 15 (0xF)
*/
public static final Integer visCtrlIDZOOMOUT = Integer.valueOf(15);
/**
* Obsolete as of Visio 2003.<p>
* Value is 16 (0x10)
*/
public static final Integer visCtrlIDZOOMIN = Integer.valueOf(16);
/**
* Obsolete as of Visio 2003.<p>
* Value is 17 (0x11)
*/
public static final Integer visCtrlIDZOOM100 = Integer.valueOf(17);
/**
* Obsolete as of Visio 2003.<p>
* Value is 18 (0x12)
*/
public static final Integer visCtrlIDFLIPHORZ = Integer.valueOf(18);
/**
* Obsolete as of Visio 2003.<p>
* Value is 19 (0x13)
*/
public static final Integer visCtrlIDFLIPVERT = Integer.valueOf(19);
/**
* Obsolete as of Visio 2003.<p>
* Value is 20 (0x14)
*/
public static final Integer visCtrlIDPOINTERTOOL = Integer.valueOf(20);
/**
* Obsolete as of Visio 2003.<p>
* Value is 21 (0x15)
*/
public static final Integer visCtrlIDPENCILTOOL = Integer.valueOf(21);
/**
* Obsolete as of Visio 2003.<p>
* Value is 22 (0x16)
*/
public static final Integer visCtrlIDLINETOOL = Integer.valueOf(22);
/**
* Obsolete as of Visio 2003.<p>
* Value is 23 (0x17)
*/
public static final Integer visCtrlIDQTRARCTOOL = Integer.valueOf(23);
/**
* Obsolete as of Visio 2003.<p>
* Value is 24 (0x18)
*/
public static final Integer visCtrlIDRECTTOOL = Integer.valueOf(24);
/**
* Obsolete as of Visio 2003.<p>
* Value is 25 (0x19)
*/
public static final Integer visCtrlIDOVALTOOL = Integer.valueOf(25);
/**
* Obsolete as of Visio 2003.<p>
* Value is 26 (0x1A)
*/
public static final Integer visCtrlIDSTAMPTOOL = Integer.valueOf(26);
/**
* Obsolete as of Visio 2003.<p>
* Value is 27 (0x1B)
*/
public static final Integer visCtrlIDTEXTTOOL = Integer.valueOf(27);
/**
* Obsolete as of Visio 2003.<p>
* Value is 28 (0x1C)
*/
public static final Integer visCtrlIDROTATETOOL = Integer.valueOf(28);
/**
* Obsolete as of Visio 2003.<p>
* Value is 29 (0x1D)
*/
public static final Integer visCtrlIDCROPTOOL = Integer.valueOf(29);
/**
* Obsolete as of Visio 2003.<p>
* Value is 30 (0x1E)
*/
public static final Integer visCtrlIDCONNECTIONPTTOOL = Integer.valueOf(30);
/**
* Obsolete as of Visio 2003.<p>
* Value is 31 (0x1F)
*/
public static final Integer visCtrlIDSNAP = Integer.valueOf(31);
/**
* Obsolete as of Visio 2003.<p>
* Value is 32 (0x20)
*/
public static final Integer visCtrlIDGLUE = Integer.valueOf(32);
/**
* Obsolete as of Visio 2003.<p>
* Value is 33 (0x21)
*/
public static final Integer visCtrlIDRULER = Integer.valueOf(33);
/**
* Obsolete as of Visio 2003.<p>
* Value is 34 (0x22)
*/
public static final Integer visCtrlIDGRID = Integer.valueOf(34);
/**
* Obsolete as of Visio 2003.<p>
* Value is 35 (0x23)
*/
public static final Integer visCtrlIDGUIDE = Integer.valueOf(35);
/**
* Obsolete as of Visio 2003.<p>
* Value is 36 (0x24)
*/
public static final Integer visCtrlIDCONNECT = Integer.valueOf(36);
/**
* Obsolete as of Visio 2003.<p>
* Value is 37 (0x25)
*/
public static final Integer visCtrlIDROTATECLOCKWISE = Integer.valueOf(37);
/**
* Obsolete as of Visio 2003.<p>
* Value is 38 (0x26)
*/
public static final Integer visCtrlIDROTATECOUNTER = Integer.valueOf(38);
/**
* Obsolete as of Visio 2003.<p>
* Value is 39 (0x27)
*/
public static final Integer visCtrlIDNEWWINDOW = Integer.valueOf(39);
/**
* Obsolete as of Visio 2003.<p>
* Value is 40 (0x28)
*/
public static final Integer visCtrlIDCORNERSTYLE = Integer.valueOf(40);
/**
* Obsolete as of Visio 2003.<p>
* Value is 41 (0x29)
*/
public static final Integer visCtrlIDLINEEND = Integer.valueOf(41);
/**
* Obsolete as of Visio 2003.<p>
* Value is 42 (0x2A)
*/
public static final Integer visCtrlIDSHADOWSTYLE = Integer.valueOf(42);
/**
* Obsolete as of Visio 2003.<p>
* Value is 43 (0x2B)
*/
public static final Integer visCtrlIDFILLCOLOR = Integer.valueOf(43);
/**
* Obsolete as of Visio 2003.<p>
* Value is 44 (0x2C)
*/
public static final Integer visCtrlIDLINECOLOR = Integer.valueOf(44);
/**
* Obsolete as of Visio 2003.<p>
* Value is 45 (0x2D)
*/
public static final Integer visCtrlIDLINEWEIGHT = Integer.valueOf(45);
/**
* Obsolete as of Visio 2003.<p>
* Value is 46 (0x2E)
*/
public static final Integer visCtrlIDLINEPATTERN = Integer.valueOf(46);
/**
* Obsolete as of Visio 2003.<p>
* Value is 47 (0x2F)
*/
public static final Integer visCtrlIDFILLPATTERN = Integer.valueOf(47);
/**
* Obsolete as of Visio 2003.<p>
* Value is 48 (0x30)
*/
public static final Integer visCtrlIDPOINTSIZEDOWN = Integer.valueOf(48);
/**
* Obsolete as of Visio 2003.<p>
* Value is 49 (0x31)
*/
public static final Integer visCtrlIDPOINTSIZEUP = Integer.valueOf(49);
/**
* Obsolete as of Visio 2003.<p>
* Value is 50 (0x32)
*/
public static final Integer visCtrlIDBOLD = Integer.valueOf(50);
/**
* Obsolete as of Visio 2003.<p>
* Value is 51 (0x33)
*/
public static final Integer visCtrlIDITALIC = Integer.valueOf(51);
/**
* Obsolete as of Visio 2003.<p>
* Value is 52 (0x34)
*/
public static final Integer visCtrlIDULINE = Integer.valueOf(52);
/**
* Obsolete as of Visio 2003.<p>
* Value is 53 (0x35)
*/
public static final Integer visCtrlIDSUPERSCRIPT = Integer.valueOf(53);
/**
* Obsolete as of Visio 2003.<p>
* Value is 54 (0x36)
*/
public static final Integer visCtrlIDSUBSCRIPT = Integer.valueOf(54);
/**
* Obsolete as of Visio 2003.<p>
* Value is 55 (0x37)
*/
public static final Integer visCtrlIDTEXTCOLOR = Integer.valueOf(55);
/**
* Obsolete as of Visio 2003.<p>
* Value is 56 (0x38)
*/
public static final Integer visCtrlIDTEXTLEFT = Integer.valueOf(56);
/**
* Obsolete as of Visio 2003.<p>
* Value is 57 (0x39)
*/
public static final Integer visCtrlIDTEXTCENTER = Integer.valueOf(57);
/**
* Obsolete as of Visio 2003.<p>
* Value is 58 (0x3A)
*/
public static final Integer visCtrlIDTEXTRIGHT = Integer.valueOf(58);
/**
* Obsolete as of Visio 2003.<p>
* Value is 59 (0x3B)
*/
public static final Integer visCtrlIDTEXTJUSTIFY = Integer.valueOf(59);
/**
* Obsolete as of Visio 2003.<p>
* Value is 60 (0x3C)
*/
public static final Integer visCtrlIDTEXTTOP = Integer.valueOf(60);
/**
* Obsolete as of Visio 2003.<p>
* Value is 61 (0x3D)
*/
public static final Integer visCtrlIDTEXTMIDDLE = Integer.valueOf(61);
/**
* Obsolete as of Visio 2003.<p>
* Value is 62 (0x3E)
*/
public static final Integer visCtrlIDTEXTBOTTOM = Integer.valueOf(62);
/**
* Obsolete as of Visio 2003.<p>
* Value is 63 (0x3F)
*/
public static final Integer visCtrlIDALIGN = Integer.valueOf(63);
/**
* Obsolete as of Visio 2003.<p>
* Value is 64 (0x40)
*/
public static final Integer visCtrlIDALIGNLEFT = Integer.valueOf(64);
/**
* Obsolete as of Visio 2003.<p>
* Value is 65 (0x41)
*/
public static final Integer visCtrlIDALIGNCENTER = Integer.valueOf(65);
/**
* Obsolete as of Visio 2003.<p>
* Value is 66 (0x42)
*/
public static final Integer visCtrlIDALIGNRIGHT = Integer.valueOf(66);
/**
* Obsolete as of Visio 2003.<p>
* Value is 67 (0x43)
*/
public static final Integer visCtrlIDALIGNTOP = Integer.valueOf(67);
/**
* Obsolete as of Visio 2003.<p>
* Value is 68 (0x44)
*/
public static final Integer visCtrlIDALIGNMIDDLE = Integer.valueOf(68);
/**
* Obsolete as of Visio 2003.<p>
* Value is 69 (0x45)
*/
public static final Integer visCtrlIDALIGNBOTTOM = Integer.valueOf(69);
/**
* Obsolete as of Visio 2003.<p>
* Value is 70 (0x46)
*/
public static final Integer visCtrlIDDISTRIBUTE = Integer.valueOf(70);
/**
* Obsolete as of Visio 2003.<p>
* Value is 71 (0x47)
*/
public static final Integer visCtrlIDDHORZ_EQSPACE = Integer.valueOf(71);
/**
* Obsolete as of Visio 2003.<p>
* Value is 72 (0x48)
*/
public static final Integer visCtrlIDDHORZ_CENTER = Integer.valueOf(72);
/**
* Obsolete as of Visio 2003.<p>
* Value is 73 (0x49)
*/
public static final Integer visCtrlIDDVERT_EQSPACE = Integer.valueOf(73);
/**
* Obsolete as of Visio 2003.<p>
* Value is 74 (0x4A)
*/
public static final Integer visCtrlIDDVERT_MIDDLE = Integer.valueOf(74);
/**
* Obsolete as of Visio 2003.<p>
* Value is 75 (0x4B)
*/
public static final Integer visCtrlIDCONNECTSHAPES = Integer.valueOf(75);
/**
* Obsolete as of Visio 2003.<p>
* Value is 76 (0x4C)
*/
public static final Integer visCtrlIDFIRSTPAGE = Integer.valueOf(76);
/**
* Obsolete as of Visio 2003.<p>
* Value is 77 (0x4D)
*/
public static final Integer visCtrlIDLASTPAGE = Integer.valueOf(77);
/**
* Obsolete as of Visio 2003.<p>
* Value is 78 (0x4E)
*/
public static final Integer visCtrlIDPAGEBREAKS = Integer.valueOf(78);
/**
* Obsolete as of Visio 2003.<p>
* Value is 80 (0x50)
*/
public static final Integer visCtrlIDICONNAME = Integer.valueOf(80);
/**
* Obsolete as of Visio 2003.<p>
* Value is 81 (0x51)
*/
public static final Integer visCtrlIDICONONLY = Integer.valueOf(81);
/**
* Obsolete as of Visio 2003.<p>
* Value is 82 (0x52)
*/
public static final Integer visCtrlIDNAMEONLY = Integer.valueOf(82);
/**
* Obsolete as of Visio 2003.<p>
* Value is 83 (0x53)
*/
public static final Integer visCtrlIDARRANGEICONS = Integer.valueOf(83);
/**
* Obsolete as of Visio 2003.<p>
* Value is 84 (0x54)
*/
public static final Integer visCtrlIDCANCELFORMULA = Integer.valueOf(84);
/**
* Obsolete as of Visio 2003.<p>
* Value is 85 (0x55)
*/
public static final Integer visCtrlIDACCEPTFORMULA = Integer.valueOf(85);
/**
* Obsolete as of Visio 2003.<p>
* Value is 86 (0x56)
*/
public static final Integer visCtrlIDICONPENCIL = Integer.valueOf(86);
/**
* Obsolete as of Visio 2003.<p>
* Value is 87 (0x57)
*/
public static final Integer visCtrlIDICONBUCKET = Integer.valueOf(87);
/**
* Obsolete as of Visio 2003.<p>
* Value is 88 (0x58)
*/
public static final Integer visCtrlIDICONLASSO = Integer.valueOf(88);
/**
* Obsolete as of Visio 2003.<p>
* Value is 89 (0x59)
*/
public static final Integer visCtrlIDICONSELNET = Integer.valueOf(89);
/**
* Obsolete as of Visio 2003.<p>
* Value is 90 (0x5A)
*/
public static final Integer visCtrlIDBRINGFRONT = Integer.valueOf(90);
/**
* Obsolete as of Visio 2003.<p>
* Value is 91 (0x5B)
*/
public static final Integer visCtrlIDSENDBACK = Integer.valueOf(91);
/**
* Obsolete as of Visio 2003.<p>
* Value is 92 (0x5C)
*/
public static final Integer visCtrlIDGROUP = Integer.valueOf(92);
/**
* Obsolete as of Visio 2003.<p>
* Value is 93 (0x5D)
*/
public static final Integer visCtrlIDUNGROUP = Integer.valueOf(93);
/**
* Obsolete as of Visio 2003.<p>
* Value is 94 (0x5E)
*/
public static final Integer visCtrlIDCASCADE = Integer.valueOf(94);
/**
* Obsolete as of Visio 2003.<p>
* Value is 95 (0x5F)
*/
public static final Integer visCtrlIDTILE = Integer.valueOf(95);
/**
* Obsolete as of Visio 2003.<p>
* Value is 96 (0x60)
*/
public static final Integer visCtrlIDCONNECTORTOOL = Integer.valueOf(96);
/**
* Obsolete as of Visio 2003.<p>
* Value is 97 (0x61)
*/
public static final Integer visCtrlIDTEXTBLOCKTOOL = Integer.valueOf(97);
/**
* Obsolete as of Visio 2003.<p>
* Value is 98 (0x62)
*/
public static final Integer visCtrlIDWHOLEPAGE = Integer.valueOf(98);
/**
* Obsolete as of Visio 2003.<p>
* Value is 99 (0x63)
*/
public static final Integer visCtrlIDSINGLETILE = Integer.valueOf(99);
/**
* Obsolete as of Visio 2003.<p>
* Value is 190 (0xBE)
*/
public static final Integer visCtrlIDFORMULA = Integer.valueOf(190);
/**
* Obsolete as of Visio 2003.<p>
* Value is 191 (0xBF)
*/
public static final Integer visCtrlIDSPACER = Integer.valueOf(191);
/**
* Obsolete as of Visio 2003.<p>
* Value is 200 (0xC8)
*/
public static final Integer visCtrlIDALLSTYLESCOMBO = Integer.valueOf(200);
/**
* Obsolete as of Visio 2003.<p>
* Value is 201 (0xC9)
*/
public static final Integer visCtrlIDTEXTSTYLECOMBO = Integer.valueOf(201);
/**
* Obsolete as of Visio 2003.<p>
* Value is 202 (0xCA)
*/
public static final Integer visCtrlIDLINESTYLECOMBO = Integer.valueOf(202);
/**
* Obsolete as of Visio 2003.<p>
* Value is 203 (0xCB)
*/
public static final Integer visCtrlIDFILLSTYLECOMBO = Integer.valueOf(203);
/**
* Obsolete as of Visio 2003.<p>
* Value is 204 (0xCC)
*/
public static final Integer visCtrlIDZOOMCOMBO = Integer.valueOf(204);
/**
* Obsolete as of Visio 2003.<p>
* Value is 205 (0xCD)
*/
public static final Integer visCtrlIDFONTCOMBO = Integer.valueOf(205);
/**
* Obsolete as of Visio 2003.<p>
* Value is 206 (0xCE)
*/
public static final Integer visCtrlIDPOINTSIZECOMBO = Integer.valueOf(206);
/**
* Obsolete as of Visio 2003.<p>
* Value is 220 (0xDC)
*/
public static final Integer visCtrlIDALLSTYLESLIST = Integer.valueOf(220);
/**
* Obsolete as of Visio 2003.<p>
* Value is 221 (0xDD)
*/
public static final Integer visCtrlIDTEXTSTYLELIST = Integer.valueOf(221);
/**
* Obsolete as of Visio 2003.<p>
* Value is 222 (0xDE)
*/
public static final Integer visCtrlIDLINESTYLELIST = Integer.valueOf(222);
/**
* Obsolete as of Visio 2003.<p>
* Value is 223 (0xDF)
*/
public static final Integer visCtrlIDFILLSTYLELIST = Integer.valueOf(223);
/**
* Obsolete as of Visio 2003.<p>
* Value is 224 (0xE0)
*/
public static final Integer visCtrlIDZOOMLIST = Integer.valueOf(224);
/**
* Obsolete as of Visio 2003.<p>
* Value is 225 (0xE1)
*/
public static final Integer visCtrlIDFONTLIST = Integer.valueOf(225);
/**
* Obsolete as of Visio 2003.<p>
* Value is 226 (0xE2)
*/
public static final Integer visCtrlIDPOINTSIZELIST = Integer.valueOf(226);
/**
* Obsolete as of Visio 2003.<p>
* Value is 227 (0xE3)
*/
public static final Integer visCtrlIDGOTOPAGELIST = Integer.valueOf(227);
/**
* Obsolete as of Visio 2003.<p>
* Value is 240 (0xF0)
*/
public static final Integer visCtrlIDCLOSE = Integer.valueOf(240);
/**
* Obsolete as of Visio 2003.<p>
* Value is 300 (0x12C)
*/
public static final Integer visCtrlIDLEFTCOLORBOX = Integer.valueOf(300);
/**
* Obsolete as of Visio 2003.<p>
* Value is 301 (0x12D)
*/
public static final Integer visCtrlIDRIGHTCOLORBOX = Integer.valueOf(301);
/**
* Obsolete as of Visio 2003.<p>
* Value is 302 (0x12E)
*/
public static final Integer visCtrlIDCOLOR1 = Integer.valueOf(302);
/**
* Obsolete as of Visio 2003.<p>
* Value is 303 (0x12F)
*/
public static final Integer visCtrlIDCOLOR2 = Integer.valueOf(303);
/**
* Obsolete as of Visio 2003.<p>
* Value is 304 (0x130)
*/
public static final Integer visCtrlIDCOLOR3 = Integer.valueOf(304);
/**
* Obsolete as of Visio 2003.<p>
* Value is 305 (0x131)
*/
public static final Integer visCtrlIDCOLOR4 = Integer.valueOf(305);
/**
* Obsolete as of Visio 2003.<p>
* Value is 306 (0x132)
*/
public static final Integer visCtrlIDCOLOR5 = Integer.valueOf(306);
/**
* Obsolete as of Visio 2003.<p>
* Value is 307 (0x133)
*/
public static final Integer visCtrlIDCOLOR6 = Integer.valueOf(307);
/**
* Obsolete as of Visio 2003.<p>
* Value is 308 (0x134)
*/
public static final Integer visCtrlIDCOLOR7 = Integer.valueOf(308);
/**
* Obsolete as of Visio 2003.<p>
* Value is 309 (0x135)
*/
public static final Integer visCtrlIDCOLOR8 = Integer.valueOf(309);
/**
* Obsolete as of Visio 2003.<p>
* Value is 310 (0x136)
*/
public static final Integer visCtrlIDCOLOR9 = Integer.valueOf(310);
/**
* Obsolete as of Visio 2003.<p>
* Value is 311 (0x137)
*/
public static final Integer visCtrlIDCOLOR10 = Integer.valueOf(311);
/**
* Obsolete as of Visio 2003.<p>
* Value is 312 (0x138)
*/
public static final Integer visCtrlIDCOLOR11 = Integer.valueOf(312);
/**
* Obsolete as of Visio 2003.<p>
* Value is 313 (0x139)
*/
public static final Integer visCtrlIDCOLOR12 = Integer.valueOf(313);
/**
* Obsolete as of Visio 2003.<p>
* Value is 314 (0x13A)
*/
public static final Integer visCtrlIDCOLOR13 = Integer.valueOf(314);
/**
* Obsolete as of Visio 2003.<p>
* Value is 315 (0x13B)
*/
public static final Integer visCtrlIDCOLOR14 = Integer.valueOf(315);
/**
* Obsolete as of Visio 2003.<p>
* Value is 316 (0x13C)
*/
public static final Integer visCtrlIDCOLOR15 = Integer.valueOf(316);
/**
* Obsolete as of Visio 2003.<p>
* Value is 317 (0x13D)
*/
public static final Integer visCtrlIDCOLOR16 = Integer.valueOf(317);
/**
* Obsolete as of Visio 2003.<p>
* Value is 318 (0x13E)
*/
public static final Integer visCtrlIDTRANSPARENT = Integer.valueOf(318);
/**
* Obsolete as of Visio 2003.<p>
* Value is 400 (0x190)
*/
public static final Integer visCtrlIDALLSTYLESLABEL = Integer.valueOf(400);
/**
* Obsolete as of Visio 2003.<p>
* Value is 401 (0x191)
*/
public static final Integer visCtrlIDTEXTSTYLELABEL = Integer.valueOf(401);
/**
* Obsolete as of Visio 2003.<p>
* Value is 402 (0x192)
*/
public static final Integer visCtrlIDLINESTYLELABEL = Integer.valueOf(402);
/**
* Obsolete as of Visio 2003.<p>
* Value is 403 (0x193)
*/
public static final Integer visCtrlIDFILLSTYLELABEL = Integer.valueOf(403);
/**
* Obsolete as of Visio 2003.<p>
* Value is 404 (0x194)
*/
public static final Integer visCtrlIDZOOMLABEL = Integer.valueOf(404);
/**
* Obsolete as of Visio 2003.<p>
* Value is 405 (0x195)
*/
public static final Integer visCtrlIDFONTLABEL = Integer.valueOf(405);
/**
* Obsolete as of Visio 2003.<p>
* Value is 406 (0x196)
*/
public static final Integer visCtrlIDPOINTSIZELABEL = Integer.valueOf(406);
/**
* Obsolete as of Visio 2003.<p>
* Value is 407 (0x197)
*/
public static final Integer visCtrlIDLEFTCOLORLABEL = Integer.valueOf(407);
/**
* Obsolete as of Visio 2003.<p>
* Value is 408 (0x198)
*/
public static final Integer visCtrlIDRIGHTCOLORLABEL = Integer.valueOf(408);
/**
* Obsolete as of Visio 2002.<p>
* Value is 409 (0x199)
*/
public static final Integer visCtrlIDSTATUSLABEL = Integer.valueOf(409);
/**
* Obsolete as of Visio 2003.<p>
* Value is 410 (0x19A)
*/
public static final Integer visCtrlIDPREVIEWLABEL = Integer.valueOf(410);
/**
* Obsolete as of Visio 2002.<p>
* Value is 500 (0x1F4)
*/
public static final Integer visCtrlIDSTATUSREADOUT = Integer.valueOf(500);
/**
* Obsolete as of Visio 2002.<p>
* Value is 501 (0x1F5)
*/
public static final Integer visCtrlIDSTATUSMSG_1 = Integer.valueOf(501);
/**
* Obsolete as of Visio 2002.<p>
* Value is 502 (0x1F6)
*/
public static final Integer visCtrlIDSTATUSMSG_2 = Integer.valueOf(502);
/**
* Obsolete as of Visio 2002.<p>
* Value is 503 (0x1F7)
*/
public static final Integer visCtrlIDSTATUSMSG_3 = Integer.valueOf(503);
/**
* Obsolete as of Visio 2002.<p>
* Value is 504 (0x1F8)
*/
public static final Integer visCtrlIDSTATUSMSG_4 = Integer.valueOf(504);
/**
* Obsolete as of Visio 2002.<p>
* Value is 505 (0x1F9)
*/
public static final Integer visCtrlIDSTATUSMSG_5 = Integer.valueOf(505);
/**
* Obsolete as of Visio 2002.<p>
* Value is 506 (0x1FA)
*/
public static final Integer visCtrlIDSTATUSMSG_6 = Integer.valueOf(506);
/**
* Obsolete as of Visio 2002.<p>
* Value is 507 (0x1FB)
*/
public static final Integer visCtrlIDSTATUSMSG_7 = Integer.valueOf(507);
/**
* Obsolete as of Visio 2002.<p>
* Value is 508 (0x1FC)
*/
public static final Integer visCtrlIDSTATUSMSG_8 = Integer.valueOf(508);
/**
* Obsolete as of Visio 2002.<p>
* Value is 509 (0x1FD)
*/
public static final Integer visCtrlIDSTATUSMSG_9 = Integer.valueOf(509);
/**
* Obsolete as of Visio 2003.<p>
* Value is 79 (0x4F)
*/
public static final Integer visCtrlIDSPLINETOOL = Integer.valueOf(79);
/**
* Obsolete as of Visio 2003.<p>
* Value is 100 (0x64)
*/
public static final Integer visCtrlIDSPELLING = Integer.valueOf(100);
/**
* Obsolete as of Visio 2003.<p>
* Value is 101 (0x65)
*/
public static final Integer visCtrlIDFORMATPAINTER = Integer.valueOf(101);
/**
* Obsolete as of Visio 2003.<p>
* Value is 102 (0x66)
*/
public static final Integer visCtrlIDHELPMODE = Integer.valueOf(102);
/**
* Obsolete as of Visio 2003.<p>
* Value is 103 (0x67)
*/
public static final Integer visCtrlIDLAYERPROPERTIES = Integer.valueOf(103);
/**
* Obsolete as of Visio 2003.<p>
* Value is 104 (0x68)
*/
public static final Integer visCtrlIDLAYOUTSHAPES = Integer.valueOf(104);
/**
* Obsolete as of Visio 2003.<p>
* Value is 105 (0x69)
*/
public static final Integer visCtrlIDINSERTHYPERLINK = Integer.valueOf(105);
/**
* Obsolete as of Visio 2003.<p>
* Value is 106 (0x6A)
*/
public static final Integer visCtrlIDSEARCHTHEWEB = Integer.valueOf(106);
/**
* Obsolete as of Visio 2003.<p>
* Value is 107 (0x6B)
*/
public static final Integer visCtrlIDGOBACK = Integer.valueOf(107);
/**
* Obsolete as of Visio 2003.<p>
* Value is 108 (0x6C)
*/
public static final Integer visCtrlIDGOFORWARD = Integer.valueOf(108);
/**
* Obsolete as of Visio 2003.<p>
* Value is 109 (0x6D)
*/
public static final Integer visCtrlIDWEBTOOLBAR = Integer.valueOf(109);
/**
* Obsolete as of Visio 2003.<p>
* Value is 110 (0x6E)
*/
public static final Integer visCtrlIDSHAPEEXPL = Integer.valueOf(110);
/**
* Obsolete as of Visio 2003.<p>
* Value is 111 (0x6F)
*/
public static final Integer visCtrlIDCUSTPROP = Integer.valueOf(111);
/**
* Obsolete as of Visio 2003.<p>
* Value is 112 (0x70)
*/
public static final Integer visCtrlIDROTATETEXT = Integer.valueOf(112);
/**
* Obsolete as of Visio 2003.<p>
* Value is 113 (0x71)
*/
public static final Integer visCtrlIDBULLETS = Integer.valueOf(113);
/**
* Obsolete as of Visio 2003.<p>
* Value is 114 (0x72)
*/
public static final Integer visCtrlIDDECRINDENT = Integer.valueOf(114);
/**
* Obsolete as of Visio 2003.<p>
* Value is 115 (0x73)
*/
public static final Integer visCtrlIDINCRINDENT = Integer.valueOf(115);
/**
* Obsolete as of Visio 2003.<p>
* Value is 116 (0x74)
*/
public static final Integer visCtrlIDDECRPARA = Integer.valueOf(116);
/**
* Obsolete as of Visio 2003.<p>
* Value is 117 (0x75)
*/
public static final Integer visCtrlIDINCRPARA = Integer.valueOf(117);
/**
* Obsolete as of Visio 2003.<p>
* Value is 118 (0x76)
*/
public static final Integer visCtrlIDINSERTCONTROL = Integer.valueOf(118);
/**
* Obsolete as of Visio 2003.<p>
* Value is 119 (0x77)
*/
public static final Integer visCtrlIDDESIGNMODE = Integer.valueOf(119);
/**
* Obsolete as of Visio 2003.<p>
* Value is 120 (0x78)
*/
public static final Integer visCtrlIDSHAPESHEET = Integer.valueOf(120);
/**
* Obsolete as of Visio 2003.<p>
* Value is 247 (0xF7)
*/
public static final Integer visCtrlIDSHAPELAYER = Integer.valueOf(247);
/**
* Obsolete as of Visio 2003.<p>
* Value is 207 (0xCF)
*/
public static final Integer visCtrlIDGOTOPAGE = Integer.valueOf(207);
/**
* Obsolete as of Visio 2003.<p>
* Value is 241 (0xF1)
*/
public static final Integer visCtrlIDLINECOLORS = Integer.valueOf(241);
/**
* Obsolete as of Visio 2003.<p>
* Value is 242 (0xF2)
*/
public static final Integer visCtrlIDLINEWEIGHTS = Integer.valueOf(242);
/**
* Obsolete as of Visio 2003.<p>
* Value is 243 (0xF3)
*/
public static final Integer visCtrlIDLINEPATTERNS = Integer.valueOf(243);
/**
* Obsolete as of Visio 2003.<p>
* Value is 244 (0xF4)
*/
public static final Integer visCtrlIDFILLCOLORS = Integer.valueOf(244);
/**
* Obsolete as of Visio 2003.<p>
* Value is 245 (0xF5)
*/
public static final Integer visCtrlIDFILLPATTERNS = Integer.valueOf(245);
/**
* Obsolete as of Visio 2003.<p>
* Value is 246 (0xF6)
*/
public static final Integer visCtrlIDTEXTCOLORS = Integer.valueOf(246);
/**
* Obsolete as of Visio 2003.<p>
* Value is 121 (0x79)
*/
public static final Integer visCtrlIDMACROS = Integer.valueOf(121);
/**
* Obsolete as of Visio 2003.<p>
* Value is 122 (0x7A)
*/
public static final Integer visCtrlIDVBEDITOR = Integer.valueOf(122);
/**
* Obsolete as of Visio 2003.<p>
* Value is 208 (0xD0)
*/
public static final Integer visCtrlIDSHAPELAYERCOMBO = Integer.valueOf(208);
/**
* Obsolete as of Visio 2003.<p>
* Value is 228 (0xE4)
*/
public static final Integer visCtrlIDSHAPELAYERLIST = Integer.valueOf(228);
/**
* Obsolete as of Visio 2003.<p>
* Value is 260 (0x104)
*/
public static final Integer visCtrlIDALIGNSHAPES = Integer.valueOf(260);
/**
* Obsolete as of Visio 2003.<p>
* Value is 261 (0x105)
*/
public static final Integer visCtrlIDDISTRIBUTESHAPES = Integer.valueOf(261);
/**
* Obsolete as of Visio 2003.<p>
* Value is 510 (0x1FE)
*/
public static final Integer visCtrlIDMSG_PAGES = Integer.valueOf(510);
/**
* A {@code Map} of the symbolic names to constant values.
*/
public static final Map<String,Object> values;
static
{
TreeMap<String,Object> v = new TreeMap<String,Object>();
v.put("visCtrlIDNEW", visCtrlIDNEW);
v.put("visCtrlIDOPEN", visCtrlIDOPEN);
v.put("visCtrlIDOPENSTEN", visCtrlIDOPENSTEN);
v.put("visCtrlIDSAVE", visCtrlIDSAVE);
v.put("visCtrlIDPRINT", visCtrlIDPRINT);
v.put("visCtrlIDPREVIEW", visCtrlIDPREVIEW);
v.put("visCtrlIDCUT", visCtrlIDCUT);
v.put("visCtrlIDCOPY", visCtrlIDCOPY);
v.put("visCtrlIDPASTE", visCtrlIDPASTE);
v.put("visCtrlIDCLEAR", visCtrlIDCLEAR);
v.put("visCtrlIDUNDO", visCtrlIDUNDO);
v.put("visCtrlIDREDO", visCtrlIDREDO);
v.put("visCtrlIDREPEAT", visCtrlIDREPEAT);
v.put("visCtrlIDPREVIOUSPAGE", visCtrlIDPREVIOUSPAGE);
v.put("visCtrlIDNEXTPAGE", visCtrlIDNEXTPAGE);
v.put("visCtrlIDZOOMOUT", visCtrlIDZOOMOUT);
v.put("visCtrlIDZOOMIN", visCtrlIDZOOMIN);
v.put("visCtrlIDZOOM100", visCtrlIDZOOM100);
v.put("visCtrlIDFLIPHORZ", visCtrlIDFLIPHORZ);
v.put("visCtrlIDFLIPVERT", visCtrlIDFLIPVERT);
v.put("visCtrlIDPOINTERTOOL", visCtrlIDPOINTERTOOL);
v.put("visCtrlIDPENCILTOOL", visCtrlIDPENCILTOOL);
v.put("visCtrlIDLINETOOL", visCtrlIDLINETOOL);
v.put("visCtrlIDQTRARCTOOL", visCtrlIDQTRARCTOOL);
v.put("visCtrlIDRECTTOOL", visCtrlIDRECTTOOL);
v.put("visCtrlIDOVALTOOL", visCtrlIDOVALTOOL);
v.put("visCtrlIDSTAMPTOOL", visCtrlIDSTAMPTOOL);
v.put("visCtrlIDTEXTTOOL", visCtrlIDTEXTTOOL);
v.put("visCtrlIDROTATETOOL", visCtrlIDROTATETOOL);
v.put("visCtrlIDCROPTOOL", visCtrlIDCROPTOOL);
v.put("visCtrlIDCONNECTIONPTTOOL", visCtrlIDCONNECTIONPTTOOL);
v.put("visCtrlIDSNAP", visCtrlIDSNAP);
v.put("visCtrlIDGLUE", visCtrlIDGLUE);
v.put("visCtrlIDRULER", visCtrlIDRULER);
v.put("visCtrlIDGRID", visCtrlIDGRID);
v.put("visCtrlIDGUIDE", visCtrlIDGUIDE);
v.put("visCtrlIDCONNECT", visCtrlIDCONNECT);
v.put("visCtrlIDROTATECLOCKWISE", visCtrlIDROTATECLOCKWISE);
v.put("visCtrlIDROTATECOUNTER", visCtrlIDROTATECOUNTER);
v.put("visCtrlIDNEWWINDOW", visCtrlIDNEWWINDOW);
v.put("visCtrlIDCORNERSTYLE", visCtrlIDCORNERSTYLE);
v.put("visCtrlIDLINEEND", visCtrlIDLINEEND);
v.put("visCtrlIDSHADOWSTYLE", visCtrlIDSHADOWSTYLE);
v.put("visCtrlIDFILLCOLOR", visCtrlIDFILLCOLOR);
v.put("visCtrlIDLINECOLOR", visCtrlIDLINECOLOR);
v.put("visCtrlIDLINEWEIGHT", visCtrlIDLINEWEIGHT);
v.put("visCtrlIDLINEPATTERN", visCtrlIDLINEPATTERN);
v.put("visCtrlIDFILLPATTERN", visCtrlIDFILLPATTERN);
v.put("visCtrlIDPOINTSIZEDOWN", visCtrlIDPOINTSIZEDOWN);
v.put("visCtrlIDPOINTSIZEUP", visCtrlIDPOINTSIZEUP);
v.put("visCtrlIDBOLD", visCtrlIDBOLD);
v.put("visCtrlIDITALIC", visCtrlIDITALIC);
v.put("visCtrlIDULINE", visCtrlIDULINE);
v.put("visCtrlIDSUPERSCRIPT", visCtrlIDSUPERSCRIPT);
v.put("visCtrlIDSUBSCRIPT", visCtrlIDSUBSCRIPT);
v.put("visCtrlIDTEXTCOLOR", visCtrlIDTEXTCOLOR);
v.put("visCtrlIDTEXTLEFT", visCtrlIDTEXTLEFT);
v.put("visCtrlIDTEXTCENTER", visCtrlIDTEXTCENTER);
v.put("visCtrlIDTEXTRIGHT", visCtrlIDTEXTRIGHT);
v.put("visCtrlIDTEXTJUSTIFY", visCtrlIDTEXTJUSTIFY);
v.put("visCtrlIDTEXTTOP", visCtrlIDTEXTTOP);
v.put("visCtrlIDTEXTMIDDLE", visCtrlIDTEXTMIDDLE);
v.put("visCtrlIDTEXTBOTTOM", visCtrlIDTEXTBOTTOM);
v.put("visCtrlIDALIGN", visCtrlIDALIGN);
v.put("visCtrlIDALIGNLEFT", visCtrlIDALIGNLEFT);
v.put("visCtrlIDALIGNCENTER", visCtrlIDALIGNCENTER);
v.put("visCtrlIDALIGNRIGHT", visCtrlIDALIGNRIGHT);
v.put("visCtrlIDALIGNTOP", visCtrlIDALIGNTOP);
v.put("visCtrlIDALIGNMIDDLE", visCtrlIDALIGNMIDDLE);
v.put("visCtrlIDALIGNBOTTOM", visCtrlIDALIGNBOTTOM);
v.put("visCtrlIDDISTRIBUTE", visCtrlIDDISTRIBUTE);
v.put("visCtrlIDDHORZ_EQSPACE", visCtrlIDDHORZ_EQSPACE);
v.put("visCtrlIDDHORZ_CENTER", visCtrlIDDHORZ_CENTER);
v.put("visCtrlIDDVERT_EQSPACE", visCtrlIDDVERT_EQSPACE);
v.put("visCtrlIDDVERT_MIDDLE", visCtrlIDDVERT_MIDDLE);
v.put("visCtrlIDCONNECTSHAPES", visCtrlIDCONNECTSHAPES);
v.put("visCtrlIDFIRSTPAGE", visCtrlIDFIRSTPAGE);
v.put("visCtrlIDLASTPAGE", visCtrlIDLASTPAGE);
v.put("visCtrlIDPAGEBREAKS", visCtrlIDPAGEBREAKS);
v.put("visCtrlIDICONNAME", visCtrlIDICONNAME);
v.put("visCtrlIDICONONLY", visCtrlIDICONONLY);
v.put("visCtrlIDNAMEONLY", visCtrlIDNAMEONLY);
v.put("visCtrlIDARRANGEICONS", visCtrlIDARRANGEICONS);
v.put("visCtrlIDCANCELFORMULA", visCtrlIDCANCELFORMULA);
v.put("visCtrlIDACCEPTFORMULA", visCtrlIDACCEPTFORMULA);
v.put("visCtrlIDICONPENCIL", visCtrlIDICONPENCIL);
v.put("visCtrlIDICONBUCKET", visCtrlIDICONBUCKET);
v.put("visCtrlIDICONLASSO", visCtrlIDICONLASSO);
v.put("visCtrlIDICONSELNET", visCtrlIDICONSELNET);
v.put("visCtrlIDBRINGFRONT", visCtrlIDBRINGFRONT);
v.put("visCtrlIDSENDBACK", visCtrlIDSENDBACK);
v.put("visCtrlIDGROUP", visCtrlIDGROUP);
v.put("visCtrlIDUNGROUP", visCtrlIDUNGROUP);
v.put("visCtrlIDCASCADE", visCtrlIDCASCADE);
v.put("visCtrlIDTILE", visCtrlIDTILE);
v.put("visCtrlIDCONNECTORTOOL", visCtrlIDCONNECTORTOOL);
v.put("visCtrlIDTEXTBLOCKTOOL", visCtrlIDTEXTBLOCKTOOL);
v.put("visCtrlIDWHOLEPAGE", visCtrlIDWHOLEPAGE);
v.put("visCtrlIDSINGLETILE", visCtrlIDSINGLETILE);
v.put("visCtrlIDFORMULA", visCtrlIDFORMULA);
v.put("visCtrlIDSPACER", visCtrlIDSPACER);
v.put("visCtrlIDALLSTYLESCOMBO", visCtrlIDALLSTYLESCOMBO);
v.put("visCtrlIDTEXTSTYLECOMBO", visCtrlIDTEXTSTYLECOMBO);
v.put("visCtrlIDLINESTYLECOMBO", visCtrlIDLINESTYLECOMBO);
v.put("visCtrlIDFILLSTYLECOMBO", visCtrlIDFILLSTYLECOMBO);
v.put("visCtrlIDZOOMCOMBO", visCtrlIDZOOMCOMBO);
v.put("visCtrlIDFONTCOMBO", visCtrlIDFONTCOMBO);
v.put("visCtrlIDPOINTSIZECOMBO", visCtrlIDPOINTSIZECOMBO);
v.put("visCtrlIDALLSTYLESLIST", visCtrlIDALLSTYLESLIST);
v.put("visCtrlIDTEXTSTYLELIST", visCtrlIDTEXTSTYLELIST);
v.put("visCtrlIDLINESTYLELIST", visCtrlIDLINESTYLELIST);
v.put("visCtrlIDFILLSTYLELIST", visCtrlIDFILLSTYLELIST);
v.put("visCtrlIDZOOMLIST", visCtrlIDZOOMLIST);
v.put("visCtrlIDFONTLIST", visCtrlIDFONTLIST);
v.put("visCtrlIDPOINTSIZELIST", visCtrlIDPOINTSIZELIST);
v.put("visCtrlIDGOTOPAGELIST", visCtrlIDGOTOPAGELIST);
v.put("visCtrlIDCLOSE", visCtrlIDCLOSE);
v.put("visCtrlIDLEFTCOLORBOX", visCtrlIDLEFTCOLORBOX);
v.put("visCtrlIDRIGHTCOLORBOX", visCtrlIDRIGHTCOLORBOX);
v.put("visCtrlIDCOLOR1", visCtrlIDCOLOR1);
v.put("visCtrlIDCOLOR2", visCtrlIDCOLOR2);
v.put("visCtrlIDCOLOR3", visCtrlIDCOLOR3);
v.put("visCtrlIDCOLOR4", visCtrlIDCOLOR4);
v.put("visCtrlIDCOLOR5", visCtrlIDCOLOR5);
v.put("visCtrlIDCOLOR6", visCtrlIDCOLOR6);
v.put("visCtrlIDCOLOR7", visCtrlIDCOLOR7);
v.put("visCtrlIDCOLOR8", visCtrlIDCOLOR8);
v.put("visCtrlIDCOLOR9", visCtrlIDCOLOR9);
v.put("visCtrlIDCOLOR10", visCtrlIDCOLOR10);
v.put("visCtrlIDCOLOR11", visCtrlIDCOLOR11);
v.put("visCtrlIDCOLOR12", visCtrlIDCOLOR12);
v.put("visCtrlIDCOLOR13", visCtrlIDCOLOR13);
v.put("visCtrlIDCOLOR14", visCtrlIDCOLOR14);
v.put("visCtrlIDCOLOR15", visCtrlIDCOLOR15);
v.put("visCtrlIDCOLOR16", visCtrlIDCOLOR16);
v.put("visCtrlIDTRANSPARENT", visCtrlIDTRANSPARENT);
v.put("visCtrlIDALLSTYLESLABEL", visCtrlIDALLSTYLESLABEL);
v.put("visCtrlIDTEXTSTYLELABEL", visCtrlIDTEXTSTYLELABEL);
v.put("visCtrlIDLINESTYLELABEL", visCtrlIDLINESTYLELABEL);
v.put("visCtrlIDFILLSTYLELABEL", visCtrlIDFILLSTYLELABEL);
v.put("visCtrlIDZOOMLABEL", visCtrlIDZOOMLABEL);
v.put("visCtrlIDFONTLABEL", visCtrlIDFONTLABEL);
v.put("visCtrlIDPOINTSIZELABEL", visCtrlIDPOINTSIZELABEL);
v.put("visCtrlIDLEFTCOLORLABEL", visCtrlIDLEFTCOLORLABEL);
v.put("visCtrlIDRIGHTCOLORLABEL", visCtrlIDRIGHTCOLORLABEL);
v.put("visCtrlIDSTATUSLABEL", visCtrlIDSTATUSLABEL);
v.put("visCtrlIDPREVIEWLABEL", visCtrlIDPREVIEWLABEL);
v.put("visCtrlIDSTATUSREADOUT", visCtrlIDSTATUSREADOUT);
v.put("visCtrlIDSTATUSMSG_1", visCtrlIDSTATUSMSG_1);
v.put("visCtrlIDSTATUSMSG_2", visCtrlIDSTATUSMSG_2);
v.put("visCtrlIDSTATUSMSG_3", visCtrlIDSTATUSMSG_3);
v.put("visCtrlIDSTATUSMSG_4", visCtrlIDSTATUSMSG_4);
v.put("visCtrlIDSTATUSMSG_5", visCtrlIDSTATUSMSG_5);
v.put("visCtrlIDSTATUSMSG_6", visCtrlIDSTATUSMSG_6);
v.put("visCtrlIDSTATUSMSG_7", visCtrlIDSTATUSMSG_7);
v.put("visCtrlIDSTATUSMSG_8", visCtrlIDSTATUSMSG_8);
v.put("visCtrlIDSTATUSMSG_9", visCtrlIDSTATUSMSG_9);
v.put("visCtrlIDSPLINETOOL", visCtrlIDSPLINETOOL);
v.put("visCtrlIDSPELLING", visCtrlIDSPELLING);
v.put("visCtrlIDFORMATPAINTER", visCtrlIDFORMATPAINTER);
v.put("visCtrlIDHELPMODE", visCtrlIDHELPMODE);
v.put("visCtrlIDLAYERPROPERTIES", visCtrlIDLAYERPROPERTIES);
v.put("visCtrlIDLAYOUTSHAPES", visCtrlIDLAYOUTSHAPES);
v.put("visCtrlIDINSERTHYPERLINK", visCtrlIDINSERTHYPERLINK);
v.put("visCtrlIDSEARCHTHEWEB", visCtrlIDSEARCHTHEWEB);
v.put("visCtrlIDGOBACK", visCtrlIDGOBACK);
v.put("visCtrlIDGOFORWARD", visCtrlIDGOFORWARD);
v.put("visCtrlIDWEBTOOLBAR", visCtrlIDWEBTOOLBAR);
v.put("visCtrlIDSHAPEEXPL", visCtrlIDSHAPEEXPL);
v.put("visCtrlIDCUSTPROP", visCtrlIDCUSTPROP);
v.put("visCtrlIDROTATETEXT", visCtrlIDROTATETEXT);
v.put("visCtrlIDBULLETS", visCtrlIDBULLETS);
v.put("visCtrlIDDECRINDENT", visCtrlIDDECRINDENT);
v.put("visCtrlIDINCRINDENT", visCtrlIDINCRINDENT);
v.put("visCtrlIDDECRPARA", visCtrlIDDECRPARA);
v.put("visCtrlIDINCRPARA", visCtrlIDINCRPARA);
v.put("visCtrlIDINSERTCONTROL", visCtrlIDINSERTCONTROL);
v.put("visCtrlIDDESIGNMODE", visCtrlIDDESIGNMODE);
v.put("visCtrlIDSHAPESHEET", visCtrlIDSHAPESHEET);
v.put("visCtrlIDSHAPELAYER", visCtrlIDSHAPELAYER);
v.put("visCtrlIDGOTOPAGE", visCtrlIDGOTOPAGE);
v.put("visCtrlIDLINECOLORS", visCtrlIDLINECOLORS);
v.put("visCtrlIDLINEWEIGHTS", visCtrlIDLINEWEIGHTS);
v.put("visCtrlIDLINEPATTERNS", visCtrlIDLINEPATTERNS);
v.put("visCtrlIDFILLCOLORS", visCtrlIDFILLCOLORS);
v.put("visCtrlIDFILLPATTERNS", visCtrlIDFILLPATTERNS);
v.put("visCtrlIDTEXTCOLORS", visCtrlIDTEXTCOLORS);
v.put("visCtrlIDMACROS", visCtrlIDMACROS);
v.put("visCtrlIDVBEDITOR", visCtrlIDVBEDITOR);
v.put("visCtrlIDSHAPELAYERCOMBO", visCtrlIDSHAPELAYERCOMBO);
v.put("visCtrlIDSHAPELAYERLIST", visCtrlIDSHAPELAYERLIST);
v.put("visCtrlIDALIGNSHAPES", visCtrlIDALIGNSHAPES);
v.put("visCtrlIDDISTRIBUTESHAPES", visCtrlIDDISTRIBUTESHAPES);
v.put("visCtrlIDMSG_PAGES", visCtrlIDMSG_PAGES);
values = Collections.synchronizedMap(Collections.unmodifiableMap(v));
}
}
| UTF-8 | Java | 42,545 | java | VisUICtrlIDs.java | Java | [
{
"context": "odehaus.\n * For written permission, please contact info@codehaus.org.\n * 4. Products derived from this Software may n",
"end": 821,
"score": 0.9999284744262695,
"start": 804,
"tag": "EMAIL",
"value": "info@codehaus.org"
},
{
"context": "D property. Obsolete as of Visio 2003.\r\n * @author Jason Smith\r\n */\r\npublic final class VisUICtrlIDs\r\n{\r\n priva",
"end": 2155,
"score": 0.9986569285392761,
"start": 2144,
"tag": "NAME",
"value": "Jason Smith"
}
]
| null | []
| /*
* Copyright 2009 (C) The Codehaus. All Rights Reserved.
*
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided that the
* following conditions are met:
* 1. Redistributions of source code must retain copyright statements and
* notices. Redistributions must also contain a copy of this document.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name "groovy" must not be used to endorse or promote products
* derived from this Software without prior written permission of The Codehaus.
* For written permission, please contact <EMAIL>.
* 4. Products derived from this Software may not be called "groovy" nor may
* "groovy" appear in their names without prior written permission of The
* Codehaus. "groovy" is a registered trademark of The Codehaus.
* 5. Due credit should be given to The Codehaus - http://groovy.codehaus.org/
*
* THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
package org.codehaus.groovy.scriptom.tlb.office2007.visio;
import java.util.Map;
import java.util.TreeMap;
import java.util.Collections;
/**
* Toolbar Bar constants for CntrlID property. Obsolete as of Visio 2003.
* @author <NAME>
*/
public final class VisUICtrlIDs
{
private VisUICtrlIDs()
{
}
/**
* Obsolete as of Visio 2003.<p>
* Value is 8383 (0x20BF)
*/
public static final Integer visCtrlIDNEW = Integer.valueOf(8383);
/**
* Obsolete as of Visio 2003.<p>
* Value is 1 (0x1)
*/
public static final Integer visCtrlIDOPEN = Integer.valueOf(1);
/**
* Obsolete as of Visio 2003.<p>
* Value is 2 (0x2)
*/
public static final Integer visCtrlIDOPENSTEN = Integer.valueOf(2);
/**
* Obsolete as of Visio 2003.<p>
* Value is 3 (0x3)
*/
public static final Integer visCtrlIDSAVE = Integer.valueOf(3);
/**
* Obsolete as of Visio 2003.<p>
* Value is 4 (0x4)
*/
public static final Integer visCtrlIDPRINT = Integer.valueOf(4);
/**
* Obsolete as of Visio 2003.<p>
* Value is 5 (0x5)
*/
public static final Integer visCtrlIDPREVIEW = Integer.valueOf(5);
/**
* Obsolete as of Visio 2003.<p>
* Value is 6 (0x6)
*/
public static final Integer visCtrlIDCUT = Integer.valueOf(6);
/**
* Obsolete as of Visio 2003.<p>
* Value is 7 (0x7)
*/
public static final Integer visCtrlIDCOPY = Integer.valueOf(7);
/**
* Obsolete as of Visio 2003.<p>
* Value is 8 (0x8)
*/
public static final Integer visCtrlIDPASTE = Integer.valueOf(8);
/**
* Obsolete as of Visio 2003.<p>
* Value is 9 (0x9)
*/
public static final Integer visCtrlIDCLEAR = Integer.valueOf(9);
/**
* Obsolete as of Visio 2003.<p>
* Value is 10 (0xA)
*/
public static final Integer visCtrlIDUNDO = Integer.valueOf(10);
/**
* Obsolete as of Visio 2003.<p>
* Value is 11 (0xB)
*/
public static final Integer visCtrlIDREDO = Integer.valueOf(11);
/**
* Obsolete as of Visio 2003.<p>
* Value is 12 (0xC)
*/
public static final Integer visCtrlIDREPEAT = Integer.valueOf(12);
/**
* Obsolete as of Visio 2003.<p>
* Value is 13 (0xD)
*/
public static final Integer visCtrlIDPREVIOUSPAGE = Integer.valueOf(13);
/**
* Obsolete as of Visio 2003.<p>
* Value is 14 (0xE)
*/
public static final Integer visCtrlIDNEXTPAGE = Integer.valueOf(14);
/**
* Obsolete as of Visio 2003.<p>
* Value is 15 (0xF)
*/
public static final Integer visCtrlIDZOOMOUT = Integer.valueOf(15);
/**
* Obsolete as of Visio 2003.<p>
* Value is 16 (0x10)
*/
public static final Integer visCtrlIDZOOMIN = Integer.valueOf(16);
/**
* Obsolete as of Visio 2003.<p>
* Value is 17 (0x11)
*/
public static final Integer visCtrlIDZOOM100 = Integer.valueOf(17);
/**
* Obsolete as of Visio 2003.<p>
* Value is 18 (0x12)
*/
public static final Integer visCtrlIDFLIPHORZ = Integer.valueOf(18);
/**
* Obsolete as of Visio 2003.<p>
* Value is 19 (0x13)
*/
public static final Integer visCtrlIDFLIPVERT = Integer.valueOf(19);
/**
* Obsolete as of Visio 2003.<p>
* Value is 20 (0x14)
*/
public static final Integer visCtrlIDPOINTERTOOL = Integer.valueOf(20);
/**
* Obsolete as of Visio 2003.<p>
* Value is 21 (0x15)
*/
public static final Integer visCtrlIDPENCILTOOL = Integer.valueOf(21);
/**
* Obsolete as of Visio 2003.<p>
* Value is 22 (0x16)
*/
public static final Integer visCtrlIDLINETOOL = Integer.valueOf(22);
/**
* Obsolete as of Visio 2003.<p>
* Value is 23 (0x17)
*/
public static final Integer visCtrlIDQTRARCTOOL = Integer.valueOf(23);
/**
* Obsolete as of Visio 2003.<p>
* Value is 24 (0x18)
*/
public static final Integer visCtrlIDRECTTOOL = Integer.valueOf(24);
/**
* Obsolete as of Visio 2003.<p>
* Value is 25 (0x19)
*/
public static final Integer visCtrlIDOVALTOOL = Integer.valueOf(25);
/**
* Obsolete as of Visio 2003.<p>
* Value is 26 (0x1A)
*/
public static final Integer visCtrlIDSTAMPTOOL = Integer.valueOf(26);
/**
* Obsolete as of Visio 2003.<p>
* Value is 27 (0x1B)
*/
public static final Integer visCtrlIDTEXTTOOL = Integer.valueOf(27);
/**
* Obsolete as of Visio 2003.<p>
* Value is 28 (0x1C)
*/
public static final Integer visCtrlIDROTATETOOL = Integer.valueOf(28);
/**
* Obsolete as of Visio 2003.<p>
* Value is 29 (0x1D)
*/
public static final Integer visCtrlIDCROPTOOL = Integer.valueOf(29);
/**
* Obsolete as of Visio 2003.<p>
* Value is 30 (0x1E)
*/
public static final Integer visCtrlIDCONNECTIONPTTOOL = Integer.valueOf(30);
/**
* Obsolete as of Visio 2003.<p>
* Value is 31 (0x1F)
*/
public static final Integer visCtrlIDSNAP = Integer.valueOf(31);
/**
* Obsolete as of Visio 2003.<p>
* Value is 32 (0x20)
*/
public static final Integer visCtrlIDGLUE = Integer.valueOf(32);
/**
* Obsolete as of Visio 2003.<p>
* Value is 33 (0x21)
*/
public static final Integer visCtrlIDRULER = Integer.valueOf(33);
/**
* Obsolete as of Visio 2003.<p>
* Value is 34 (0x22)
*/
public static final Integer visCtrlIDGRID = Integer.valueOf(34);
/**
* Obsolete as of Visio 2003.<p>
* Value is 35 (0x23)
*/
public static final Integer visCtrlIDGUIDE = Integer.valueOf(35);
/**
* Obsolete as of Visio 2003.<p>
* Value is 36 (0x24)
*/
public static final Integer visCtrlIDCONNECT = Integer.valueOf(36);
/**
* Obsolete as of Visio 2003.<p>
* Value is 37 (0x25)
*/
public static final Integer visCtrlIDROTATECLOCKWISE = Integer.valueOf(37);
/**
* Obsolete as of Visio 2003.<p>
* Value is 38 (0x26)
*/
public static final Integer visCtrlIDROTATECOUNTER = Integer.valueOf(38);
/**
* Obsolete as of Visio 2003.<p>
* Value is 39 (0x27)
*/
public static final Integer visCtrlIDNEWWINDOW = Integer.valueOf(39);
/**
* Obsolete as of Visio 2003.<p>
* Value is 40 (0x28)
*/
public static final Integer visCtrlIDCORNERSTYLE = Integer.valueOf(40);
/**
* Obsolete as of Visio 2003.<p>
* Value is 41 (0x29)
*/
public static final Integer visCtrlIDLINEEND = Integer.valueOf(41);
/**
* Obsolete as of Visio 2003.<p>
* Value is 42 (0x2A)
*/
public static final Integer visCtrlIDSHADOWSTYLE = Integer.valueOf(42);
/**
* Obsolete as of Visio 2003.<p>
* Value is 43 (0x2B)
*/
public static final Integer visCtrlIDFILLCOLOR = Integer.valueOf(43);
/**
* Obsolete as of Visio 2003.<p>
* Value is 44 (0x2C)
*/
public static final Integer visCtrlIDLINECOLOR = Integer.valueOf(44);
/**
* Obsolete as of Visio 2003.<p>
* Value is 45 (0x2D)
*/
public static final Integer visCtrlIDLINEWEIGHT = Integer.valueOf(45);
/**
* Obsolete as of Visio 2003.<p>
* Value is 46 (0x2E)
*/
public static final Integer visCtrlIDLINEPATTERN = Integer.valueOf(46);
/**
* Obsolete as of Visio 2003.<p>
* Value is 47 (0x2F)
*/
public static final Integer visCtrlIDFILLPATTERN = Integer.valueOf(47);
/**
* Obsolete as of Visio 2003.<p>
* Value is 48 (0x30)
*/
public static final Integer visCtrlIDPOINTSIZEDOWN = Integer.valueOf(48);
/**
* Obsolete as of Visio 2003.<p>
* Value is 49 (0x31)
*/
public static final Integer visCtrlIDPOINTSIZEUP = Integer.valueOf(49);
/**
* Obsolete as of Visio 2003.<p>
* Value is 50 (0x32)
*/
public static final Integer visCtrlIDBOLD = Integer.valueOf(50);
/**
* Obsolete as of Visio 2003.<p>
* Value is 51 (0x33)
*/
public static final Integer visCtrlIDITALIC = Integer.valueOf(51);
/**
* Obsolete as of Visio 2003.<p>
* Value is 52 (0x34)
*/
public static final Integer visCtrlIDULINE = Integer.valueOf(52);
/**
* Obsolete as of Visio 2003.<p>
* Value is 53 (0x35)
*/
public static final Integer visCtrlIDSUPERSCRIPT = Integer.valueOf(53);
/**
* Obsolete as of Visio 2003.<p>
* Value is 54 (0x36)
*/
public static final Integer visCtrlIDSUBSCRIPT = Integer.valueOf(54);
/**
* Obsolete as of Visio 2003.<p>
* Value is 55 (0x37)
*/
public static final Integer visCtrlIDTEXTCOLOR = Integer.valueOf(55);
/**
* Obsolete as of Visio 2003.<p>
* Value is 56 (0x38)
*/
public static final Integer visCtrlIDTEXTLEFT = Integer.valueOf(56);
/**
* Obsolete as of Visio 2003.<p>
* Value is 57 (0x39)
*/
public static final Integer visCtrlIDTEXTCENTER = Integer.valueOf(57);
/**
* Obsolete as of Visio 2003.<p>
* Value is 58 (0x3A)
*/
public static final Integer visCtrlIDTEXTRIGHT = Integer.valueOf(58);
/**
* Obsolete as of Visio 2003.<p>
* Value is 59 (0x3B)
*/
public static final Integer visCtrlIDTEXTJUSTIFY = Integer.valueOf(59);
/**
* Obsolete as of Visio 2003.<p>
* Value is 60 (0x3C)
*/
public static final Integer visCtrlIDTEXTTOP = Integer.valueOf(60);
/**
* Obsolete as of Visio 2003.<p>
* Value is 61 (0x3D)
*/
public static final Integer visCtrlIDTEXTMIDDLE = Integer.valueOf(61);
/**
* Obsolete as of Visio 2003.<p>
* Value is 62 (0x3E)
*/
public static final Integer visCtrlIDTEXTBOTTOM = Integer.valueOf(62);
/**
* Obsolete as of Visio 2003.<p>
* Value is 63 (0x3F)
*/
public static final Integer visCtrlIDALIGN = Integer.valueOf(63);
/**
* Obsolete as of Visio 2003.<p>
* Value is 64 (0x40)
*/
public static final Integer visCtrlIDALIGNLEFT = Integer.valueOf(64);
/**
* Obsolete as of Visio 2003.<p>
* Value is 65 (0x41)
*/
public static final Integer visCtrlIDALIGNCENTER = Integer.valueOf(65);
/**
* Obsolete as of Visio 2003.<p>
* Value is 66 (0x42)
*/
public static final Integer visCtrlIDALIGNRIGHT = Integer.valueOf(66);
/**
* Obsolete as of Visio 2003.<p>
* Value is 67 (0x43)
*/
public static final Integer visCtrlIDALIGNTOP = Integer.valueOf(67);
/**
* Obsolete as of Visio 2003.<p>
* Value is 68 (0x44)
*/
public static final Integer visCtrlIDALIGNMIDDLE = Integer.valueOf(68);
/**
* Obsolete as of Visio 2003.<p>
* Value is 69 (0x45)
*/
public static final Integer visCtrlIDALIGNBOTTOM = Integer.valueOf(69);
/**
* Obsolete as of Visio 2003.<p>
* Value is 70 (0x46)
*/
public static final Integer visCtrlIDDISTRIBUTE = Integer.valueOf(70);
/**
* Obsolete as of Visio 2003.<p>
* Value is 71 (0x47)
*/
public static final Integer visCtrlIDDHORZ_EQSPACE = Integer.valueOf(71);
/**
* Obsolete as of Visio 2003.<p>
* Value is 72 (0x48)
*/
public static final Integer visCtrlIDDHORZ_CENTER = Integer.valueOf(72);
/**
* Obsolete as of Visio 2003.<p>
* Value is 73 (0x49)
*/
public static final Integer visCtrlIDDVERT_EQSPACE = Integer.valueOf(73);
/**
* Obsolete as of Visio 2003.<p>
* Value is 74 (0x4A)
*/
public static final Integer visCtrlIDDVERT_MIDDLE = Integer.valueOf(74);
/**
* Obsolete as of Visio 2003.<p>
* Value is 75 (0x4B)
*/
public static final Integer visCtrlIDCONNECTSHAPES = Integer.valueOf(75);
/**
* Obsolete as of Visio 2003.<p>
* Value is 76 (0x4C)
*/
public static final Integer visCtrlIDFIRSTPAGE = Integer.valueOf(76);
/**
* Obsolete as of Visio 2003.<p>
* Value is 77 (0x4D)
*/
public static final Integer visCtrlIDLASTPAGE = Integer.valueOf(77);
/**
* Obsolete as of Visio 2003.<p>
* Value is 78 (0x4E)
*/
public static final Integer visCtrlIDPAGEBREAKS = Integer.valueOf(78);
/**
* Obsolete as of Visio 2003.<p>
* Value is 80 (0x50)
*/
public static final Integer visCtrlIDICONNAME = Integer.valueOf(80);
/**
* Obsolete as of Visio 2003.<p>
* Value is 81 (0x51)
*/
public static final Integer visCtrlIDICONONLY = Integer.valueOf(81);
/**
* Obsolete as of Visio 2003.<p>
* Value is 82 (0x52)
*/
public static final Integer visCtrlIDNAMEONLY = Integer.valueOf(82);
/**
* Obsolete as of Visio 2003.<p>
* Value is 83 (0x53)
*/
public static final Integer visCtrlIDARRANGEICONS = Integer.valueOf(83);
/**
* Obsolete as of Visio 2003.<p>
* Value is 84 (0x54)
*/
public static final Integer visCtrlIDCANCELFORMULA = Integer.valueOf(84);
/**
* Obsolete as of Visio 2003.<p>
* Value is 85 (0x55)
*/
public static final Integer visCtrlIDACCEPTFORMULA = Integer.valueOf(85);
/**
* Obsolete as of Visio 2003.<p>
* Value is 86 (0x56)
*/
public static final Integer visCtrlIDICONPENCIL = Integer.valueOf(86);
/**
* Obsolete as of Visio 2003.<p>
* Value is 87 (0x57)
*/
public static final Integer visCtrlIDICONBUCKET = Integer.valueOf(87);
/**
* Obsolete as of Visio 2003.<p>
* Value is 88 (0x58)
*/
public static final Integer visCtrlIDICONLASSO = Integer.valueOf(88);
/**
* Obsolete as of Visio 2003.<p>
* Value is 89 (0x59)
*/
public static final Integer visCtrlIDICONSELNET = Integer.valueOf(89);
/**
* Obsolete as of Visio 2003.<p>
* Value is 90 (0x5A)
*/
public static final Integer visCtrlIDBRINGFRONT = Integer.valueOf(90);
/**
* Obsolete as of Visio 2003.<p>
* Value is 91 (0x5B)
*/
public static final Integer visCtrlIDSENDBACK = Integer.valueOf(91);
/**
* Obsolete as of Visio 2003.<p>
* Value is 92 (0x5C)
*/
public static final Integer visCtrlIDGROUP = Integer.valueOf(92);
/**
* Obsolete as of Visio 2003.<p>
* Value is 93 (0x5D)
*/
public static final Integer visCtrlIDUNGROUP = Integer.valueOf(93);
/**
* Obsolete as of Visio 2003.<p>
* Value is 94 (0x5E)
*/
public static final Integer visCtrlIDCASCADE = Integer.valueOf(94);
/**
* Obsolete as of Visio 2003.<p>
* Value is 95 (0x5F)
*/
public static final Integer visCtrlIDTILE = Integer.valueOf(95);
/**
* Obsolete as of Visio 2003.<p>
* Value is 96 (0x60)
*/
public static final Integer visCtrlIDCONNECTORTOOL = Integer.valueOf(96);
/**
* Obsolete as of Visio 2003.<p>
* Value is 97 (0x61)
*/
public static final Integer visCtrlIDTEXTBLOCKTOOL = Integer.valueOf(97);
/**
* Obsolete as of Visio 2003.<p>
* Value is 98 (0x62)
*/
public static final Integer visCtrlIDWHOLEPAGE = Integer.valueOf(98);
/**
* Obsolete as of Visio 2003.<p>
* Value is 99 (0x63)
*/
public static final Integer visCtrlIDSINGLETILE = Integer.valueOf(99);
/**
* Obsolete as of Visio 2003.<p>
* Value is 190 (0xBE)
*/
public static final Integer visCtrlIDFORMULA = Integer.valueOf(190);
/**
* Obsolete as of Visio 2003.<p>
* Value is 191 (0xBF)
*/
public static final Integer visCtrlIDSPACER = Integer.valueOf(191);
/**
* Obsolete as of Visio 2003.<p>
* Value is 200 (0xC8)
*/
public static final Integer visCtrlIDALLSTYLESCOMBO = Integer.valueOf(200);
/**
* Obsolete as of Visio 2003.<p>
* Value is 201 (0xC9)
*/
public static final Integer visCtrlIDTEXTSTYLECOMBO = Integer.valueOf(201);
/**
* Obsolete as of Visio 2003.<p>
* Value is 202 (0xCA)
*/
public static final Integer visCtrlIDLINESTYLECOMBO = Integer.valueOf(202);
/**
* Obsolete as of Visio 2003.<p>
* Value is 203 (0xCB)
*/
public static final Integer visCtrlIDFILLSTYLECOMBO = Integer.valueOf(203);
/**
* Obsolete as of Visio 2003.<p>
* Value is 204 (0xCC)
*/
public static final Integer visCtrlIDZOOMCOMBO = Integer.valueOf(204);
/**
* Obsolete as of Visio 2003.<p>
* Value is 205 (0xCD)
*/
public static final Integer visCtrlIDFONTCOMBO = Integer.valueOf(205);
/**
* Obsolete as of Visio 2003.<p>
* Value is 206 (0xCE)
*/
public static final Integer visCtrlIDPOINTSIZECOMBO = Integer.valueOf(206);
/**
* Obsolete as of Visio 2003.<p>
* Value is 220 (0xDC)
*/
public static final Integer visCtrlIDALLSTYLESLIST = Integer.valueOf(220);
/**
* Obsolete as of Visio 2003.<p>
* Value is 221 (0xDD)
*/
public static final Integer visCtrlIDTEXTSTYLELIST = Integer.valueOf(221);
/**
* Obsolete as of Visio 2003.<p>
* Value is 222 (0xDE)
*/
public static final Integer visCtrlIDLINESTYLELIST = Integer.valueOf(222);
/**
* Obsolete as of Visio 2003.<p>
* Value is 223 (0xDF)
*/
public static final Integer visCtrlIDFILLSTYLELIST = Integer.valueOf(223);
/**
* Obsolete as of Visio 2003.<p>
* Value is 224 (0xE0)
*/
public static final Integer visCtrlIDZOOMLIST = Integer.valueOf(224);
/**
* Obsolete as of Visio 2003.<p>
* Value is 225 (0xE1)
*/
public static final Integer visCtrlIDFONTLIST = Integer.valueOf(225);
/**
* Obsolete as of Visio 2003.<p>
* Value is 226 (0xE2)
*/
public static final Integer visCtrlIDPOINTSIZELIST = Integer.valueOf(226);
/**
* Obsolete as of Visio 2003.<p>
* Value is 227 (0xE3)
*/
public static final Integer visCtrlIDGOTOPAGELIST = Integer.valueOf(227);
/**
* Obsolete as of Visio 2003.<p>
* Value is 240 (0xF0)
*/
public static final Integer visCtrlIDCLOSE = Integer.valueOf(240);
/**
* Obsolete as of Visio 2003.<p>
* Value is 300 (0x12C)
*/
public static final Integer visCtrlIDLEFTCOLORBOX = Integer.valueOf(300);
/**
* Obsolete as of Visio 2003.<p>
* Value is 301 (0x12D)
*/
public static final Integer visCtrlIDRIGHTCOLORBOX = Integer.valueOf(301);
/**
* Obsolete as of Visio 2003.<p>
* Value is 302 (0x12E)
*/
public static final Integer visCtrlIDCOLOR1 = Integer.valueOf(302);
/**
* Obsolete as of Visio 2003.<p>
* Value is 303 (0x12F)
*/
public static final Integer visCtrlIDCOLOR2 = Integer.valueOf(303);
/**
* Obsolete as of Visio 2003.<p>
* Value is 304 (0x130)
*/
public static final Integer visCtrlIDCOLOR3 = Integer.valueOf(304);
/**
* Obsolete as of Visio 2003.<p>
* Value is 305 (0x131)
*/
public static final Integer visCtrlIDCOLOR4 = Integer.valueOf(305);
/**
* Obsolete as of Visio 2003.<p>
* Value is 306 (0x132)
*/
public static final Integer visCtrlIDCOLOR5 = Integer.valueOf(306);
/**
* Obsolete as of Visio 2003.<p>
* Value is 307 (0x133)
*/
public static final Integer visCtrlIDCOLOR6 = Integer.valueOf(307);
/**
* Obsolete as of Visio 2003.<p>
* Value is 308 (0x134)
*/
public static final Integer visCtrlIDCOLOR7 = Integer.valueOf(308);
/**
* Obsolete as of Visio 2003.<p>
* Value is 309 (0x135)
*/
public static final Integer visCtrlIDCOLOR8 = Integer.valueOf(309);
/**
* Obsolete as of Visio 2003.<p>
* Value is 310 (0x136)
*/
public static final Integer visCtrlIDCOLOR9 = Integer.valueOf(310);
/**
* Obsolete as of Visio 2003.<p>
* Value is 311 (0x137)
*/
public static final Integer visCtrlIDCOLOR10 = Integer.valueOf(311);
/**
* Obsolete as of Visio 2003.<p>
* Value is 312 (0x138)
*/
public static final Integer visCtrlIDCOLOR11 = Integer.valueOf(312);
/**
* Obsolete as of Visio 2003.<p>
* Value is 313 (0x139)
*/
public static final Integer visCtrlIDCOLOR12 = Integer.valueOf(313);
/**
* Obsolete as of Visio 2003.<p>
* Value is 314 (0x13A)
*/
public static final Integer visCtrlIDCOLOR13 = Integer.valueOf(314);
/**
* Obsolete as of Visio 2003.<p>
* Value is 315 (0x13B)
*/
public static final Integer visCtrlIDCOLOR14 = Integer.valueOf(315);
/**
* Obsolete as of Visio 2003.<p>
* Value is 316 (0x13C)
*/
public static final Integer visCtrlIDCOLOR15 = Integer.valueOf(316);
/**
* Obsolete as of Visio 2003.<p>
* Value is 317 (0x13D)
*/
public static final Integer visCtrlIDCOLOR16 = Integer.valueOf(317);
/**
* Obsolete as of Visio 2003.<p>
* Value is 318 (0x13E)
*/
public static final Integer visCtrlIDTRANSPARENT = Integer.valueOf(318);
/**
* Obsolete as of Visio 2003.<p>
* Value is 400 (0x190)
*/
public static final Integer visCtrlIDALLSTYLESLABEL = Integer.valueOf(400);
/**
* Obsolete as of Visio 2003.<p>
* Value is 401 (0x191)
*/
public static final Integer visCtrlIDTEXTSTYLELABEL = Integer.valueOf(401);
/**
* Obsolete as of Visio 2003.<p>
* Value is 402 (0x192)
*/
public static final Integer visCtrlIDLINESTYLELABEL = Integer.valueOf(402);
/**
* Obsolete as of Visio 2003.<p>
* Value is 403 (0x193)
*/
public static final Integer visCtrlIDFILLSTYLELABEL = Integer.valueOf(403);
/**
* Obsolete as of Visio 2003.<p>
* Value is 404 (0x194)
*/
public static final Integer visCtrlIDZOOMLABEL = Integer.valueOf(404);
/**
* Obsolete as of Visio 2003.<p>
* Value is 405 (0x195)
*/
public static final Integer visCtrlIDFONTLABEL = Integer.valueOf(405);
/**
* Obsolete as of Visio 2003.<p>
* Value is 406 (0x196)
*/
public static final Integer visCtrlIDPOINTSIZELABEL = Integer.valueOf(406);
/**
* Obsolete as of Visio 2003.<p>
* Value is 407 (0x197)
*/
public static final Integer visCtrlIDLEFTCOLORLABEL = Integer.valueOf(407);
/**
* Obsolete as of Visio 2003.<p>
* Value is 408 (0x198)
*/
public static final Integer visCtrlIDRIGHTCOLORLABEL = Integer.valueOf(408);
/**
* Obsolete as of Visio 2002.<p>
* Value is 409 (0x199)
*/
public static final Integer visCtrlIDSTATUSLABEL = Integer.valueOf(409);
/**
* Obsolete as of Visio 2003.<p>
* Value is 410 (0x19A)
*/
public static final Integer visCtrlIDPREVIEWLABEL = Integer.valueOf(410);
/**
* Obsolete as of Visio 2002.<p>
* Value is 500 (0x1F4)
*/
public static final Integer visCtrlIDSTATUSREADOUT = Integer.valueOf(500);
/**
* Obsolete as of Visio 2002.<p>
* Value is 501 (0x1F5)
*/
public static final Integer visCtrlIDSTATUSMSG_1 = Integer.valueOf(501);
/**
* Obsolete as of Visio 2002.<p>
* Value is 502 (0x1F6)
*/
public static final Integer visCtrlIDSTATUSMSG_2 = Integer.valueOf(502);
/**
* Obsolete as of Visio 2002.<p>
* Value is 503 (0x1F7)
*/
public static final Integer visCtrlIDSTATUSMSG_3 = Integer.valueOf(503);
/**
* Obsolete as of Visio 2002.<p>
* Value is 504 (0x1F8)
*/
public static final Integer visCtrlIDSTATUSMSG_4 = Integer.valueOf(504);
/**
* Obsolete as of Visio 2002.<p>
* Value is 505 (0x1F9)
*/
public static final Integer visCtrlIDSTATUSMSG_5 = Integer.valueOf(505);
/**
* Obsolete as of Visio 2002.<p>
* Value is 506 (0x1FA)
*/
public static final Integer visCtrlIDSTATUSMSG_6 = Integer.valueOf(506);
/**
* Obsolete as of Visio 2002.<p>
* Value is 507 (0x1FB)
*/
public static final Integer visCtrlIDSTATUSMSG_7 = Integer.valueOf(507);
/**
* Obsolete as of Visio 2002.<p>
* Value is 508 (0x1FC)
*/
public static final Integer visCtrlIDSTATUSMSG_8 = Integer.valueOf(508);
/**
* Obsolete as of Visio 2002.<p>
* Value is 509 (0x1FD)
*/
public static final Integer visCtrlIDSTATUSMSG_9 = Integer.valueOf(509);
/**
* Obsolete as of Visio 2003.<p>
* Value is 79 (0x4F)
*/
public static final Integer visCtrlIDSPLINETOOL = Integer.valueOf(79);
/**
* Obsolete as of Visio 2003.<p>
* Value is 100 (0x64)
*/
public static final Integer visCtrlIDSPELLING = Integer.valueOf(100);
/**
* Obsolete as of Visio 2003.<p>
* Value is 101 (0x65)
*/
public static final Integer visCtrlIDFORMATPAINTER = Integer.valueOf(101);
/**
* Obsolete as of Visio 2003.<p>
* Value is 102 (0x66)
*/
public static final Integer visCtrlIDHELPMODE = Integer.valueOf(102);
/**
* Obsolete as of Visio 2003.<p>
* Value is 103 (0x67)
*/
public static final Integer visCtrlIDLAYERPROPERTIES = Integer.valueOf(103);
/**
* Obsolete as of Visio 2003.<p>
* Value is 104 (0x68)
*/
public static final Integer visCtrlIDLAYOUTSHAPES = Integer.valueOf(104);
/**
* Obsolete as of Visio 2003.<p>
* Value is 105 (0x69)
*/
public static final Integer visCtrlIDINSERTHYPERLINK = Integer.valueOf(105);
/**
* Obsolete as of Visio 2003.<p>
* Value is 106 (0x6A)
*/
public static final Integer visCtrlIDSEARCHTHEWEB = Integer.valueOf(106);
/**
* Obsolete as of Visio 2003.<p>
* Value is 107 (0x6B)
*/
public static final Integer visCtrlIDGOBACK = Integer.valueOf(107);
/**
* Obsolete as of Visio 2003.<p>
* Value is 108 (0x6C)
*/
public static final Integer visCtrlIDGOFORWARD = Integer.valueOf(108);
/**
* Obsolete as of Visio 2003.<p>
* Value is 109 (0x6D)
*/
public static final Integer visCtrlIDWEBTOOLBAR = Integer.valueOf(109);
/**
* Obsolete as of Visio 2003.<p>
* Value is 110 (0x6E)
*/
public static final Integer visCtrlIDSHAPEEXPL = Integer.valueOf(110);
/**
* Obsolete as of Visio 2003.<p>
* Value is 111 (0x6F)
*/
public static final Integer visCtrlIDCUSTPROP = Integer.valueOf(111);
/**
* Obsolete as of Visio 2003.<p>
* Value is 112 (0x70)
*/
public static final Integer visCtrlIDROTATETEXT = Integer.valueOf(112);
/**
* Obsolete as of Visio 2003.<p>
* Value is 113 (0x71)
*/
public static final Integer visCtrlIDBULLETS = Integer.valueOf(113);
/**
* Obsolete as of Visio 2003.<p>
* Value is 114 (0x72)
*/
public static final Integer visCtrlIDDECRINDENT = Integer.valueOf(114);
/**
* Obsolete as of Visio 2003.<p>
* Value is 115 (0x73)
*/
public static final Integer visCtrlIDINCRINDENT = Integer.valueOf(115);
/**
* Obsolete as of Visio 2003.<p>
* Value is 116 (0x74)
*/
public static final Integer visCtrlIDDECRPARA = Integer.valueOf(116);
/**
* Obsolete as of Visio 2003.<p>
* Value is 117 (0x75)
*/
public static final Integer visCtrlIDINCRPARA = Integer.valueOf(117);
/**
* Obsolete as of Visio 2003.<p>
* Value is 118 (0x76)
*/
public static final Integer visCtrlIDINSERTCONTROL = Integer.valueOf(118);
/**
* Obsolete as of Visio 2003.<p>
* Value is 119 (0x77)
*/
public static final Integer visCtrlIDDESIGNMODE = Integer.valueOf(119);
/**
* Obsolete as of Visio 2003.<p>
* Value is 120 (0x78)
*/
public static final Integer visCtrlIDSHAPESHEET = Integer.valueOf(120);
/**
* Obsolete as of Visio 2003.<p>
* Value is 247 (0xF7)
*/
public static final Integer visCtrlIDSHAPELAYER = Integer.valueOf(247);
/**
* Obsolete as of Visio 2003.<p>
* Value is 207 (0xCF)
*/
public static final Integer visCtrlIDGOTOPAGE = Integer.valueOf(207);
/**
* Obsolete as of Visio 2003.<p>
* Value is 241 (0xF1)
*/
public static final Integer visCtrlIDLINECOLORS = Integer.valueOf(241);
/**
* Obsolete as of Visio 2003.<p>
* Value is 242 (0xF2)
*/
public static final Integer visCtrlIDLINEWEIGHTS = Integer.valueOf(242);
/**
* Obsolete as of Visio 2003.<p>
* Value is 243 (0xF3)
*/
public static final Integer visCtrlIDLINEPATTERNS = Integer.valueOf(243);
/**
* Obsolete as of Visio 2003.<p>
* Value is 244 (0xF4)
*/
public static final Integer visCtrlIDFILLCOLORS = Integer.valueOf(244);
/**
* Obsolete as of Visio 2003.<p>
* Value is 245 (0xF5)
*/
public static final Integer visCtrlIDFILLPATTERNS = Integer.valueOf(245);
/**
* Obsolete as of Visio 2003.<p>
* Value is 246 (0xF6)
*/
public static final Integer visCtrlIDTEXTCOLORS = Integer.valueOf(246);
/**
* Obsolete as of Visio 2003.<p>
* Value is 121 (0x79)
*/
public static final Integer visCtrlIDMACROS = Integer.valueOf(121);
/**
* Obsolete as of Visio 2003.<p>
* Value is 122 (0x7A)
*/
public static final Integer visCtrlIDVBEDITOR = Integer.valueOf(122);
/**
* Obsolete as of Visio 2003.<p>
* Value is 208 (0xD0)
*/
public static final Integer visCtrlIDSHAPELAYERCOMBO = Integer.valueOf(208);
/**
* Obsolete as of Visio 2003.<p>
* Value is 228 (0xE4)
*/
public static final Integer visCtrlIDSHAPELAYERLIST = Integer.valueOf(228);
/**
* Obsolete as of Visio 2003.<p>
* Value is 260 (0x104)
*/
public static final Integer visCtrlIDALIGNSHAPES = Integer.valueOf(260);
/**
* Obsolete as of Visio 2003.<p>
* Value is 261 (0x105)
*/
public static final Integer visCtrlIDDISTRIBUTESHAPES = Integer.valueOf(261);
/**
* Obsolete as of Visio 2003.<p>
* Value is 510 (0x1FE)
*/
public static final Integer visCtrlIDMSG_PAGES = Integer.valueOf(510);
/**
* A {@code Map} of the symbolic names to constant values.
*/
public static final Map<String,Object> values;
static
{
TreeMap<String,Object> v = new TreeMap<String,Object>();
v.put("visCtrlIDNEW", visCtrlIDNEW);
v.put("visCtrlIDOPEN", visCtrlIDOPEN);
v.put("visCtrlIDOPENSTEN", visCtrlIDOPENSTEN);
v.put("visCtrlIDSAVE", visCtrlIDSAVE);
v.put("visCtrlIDPRINT", visCtrlIDPRINT);
v.put("visCtrlIDPREVIEW", visCtrlIDPREVIEW);
v.put("visCtrlIDCUT", visCtrlIDCUT);
v.put("visCtrlIDCOPY", visCtrlIDCOPY);
v.put("visCtrlIDPASTE", visCtrlIDPASTE);
v.put("visCtrlIDCLEAR", visCtrlIDCLEAR);
v.put("visCtrlIDUNDO", visCtrlIDUNDO);
v.put("visCtrlIDREDO", visCtrlIDREDO);
v.put("visCtrlIDREPEAT", visCtrlIDREPEAT);
v.put("visCtrlIDPREVIOUSPAGE", visCtrlIDPREVIOUSPAGE);
v.put("visCtrlIDNEXTPAGE", visCtrlIDNEXTPAGE);
v.put("visCtrlIDZOOMOUT", visCtrlIDZOOMOUT);
v.put("visCtrlIDZOOMIN", visCtrlIDZOOMIN);
v.put("visCtrlIDZOOM100", visCtrlIDZOOM100);
v.put("visCtrlIDFLIPHORZ", visCtrlIDFLIPHORZ);
v.put("visCtrlIDFLIPVERT", visCtrlIDFLIPVERT);
v.put("visCtrlIDPOINTERTOOL", visCtrlIDPOINTERTOOL);
v.put("visCtrlIDPENCILTOOL", visCtrlIDPENCILTOOL);
v.put("visCtrlIDLINETOOL", visCtrlIDLINETOOL);
v.put("visCtrlIDQTRARCTOOL", visCtrlIDQTRARCTOOL);
v.put("visCtrlIDRECTTOOL", visCtrlIDRECTTOOL);
v.put("visCtrlIDOVALTOOL", visCtrlIDOVALTOOL);
v.put("visCtrlIDSTAMPTOOL", visCtrlIDSTAMPTOOL);
v.put("visCtrlIDTEXTTOOL", visCtrlIDTEXTTOOL);
v.put("visCtrlIDROTATETOOL", visCtrlIDROTATETOOL);
v.put("visCtrlIDCROPTOOL", visCtrlIDCROPTOOL);
v.put("visCtrlIDCONNECTIONPTTOOL", visCtrlIDCONNECTIONPTTOOL);
v.put("visCtrlIDSNAP", visCtrlIDSNAP);
v.put("visCtrlIDGLUE", visCtrlIDGLUE);
v.put("visCtrlIDRULER", visCtrlIDRULER);
v.put("visCtrlIDGRID", visCtrlIDGRID);
v.put("visCtrlIDGUIDE", visCtrlIDGUIDE);
v.put("visCtrlIDCONNECT", visCtrlIDCONNECT);
v.put("visCtrlIDROTATECLOCKWISE", visCtrlIDROTATECLOCKWISE);
v.put("visCtrlIDROTATECOUNTER", visCtrlIDROTATECOUNTER);
v.put("visCtrlIDNEWWINDOW", visCtrlIDNEWWINDOW);
v.put("visCtrlIDCORNERSTYLE", visCtrlIDCORNERSTYLE);
v.put("visCtrlIDLINEEND", visCtrlIDLINEEND);
v.put("visCtrlIDSHADOWSTYLE", visCtrlIDSHADOWSTYLE);
v.put("visCtrlIDFILLCOLOR", visCtrlIDFILLCOLOR);
v.put("visCtrlIDLINECOLOR", visCtrlIDLINECOLOR);
v.put("visCtrlIDLINEWEIGHT", visCtrlIDLINEWEIGHT);
v.put("visCtrlIDLINEPATTERN", visCtrlIDLINEPATTERN);
v.put("visCtrlIDFILLPATTERN", visCtrlIDFILLPATTERN);
v.put("visCtrlIDPOINTSIZEDOWN", visCtrlIDPOINTSIZEDOWN);
v.put("visCtrlIDPOINTSIZEUP", visCtrlIDPOINTSIZEUP);
v.put("visCtrlIDBOLD", visCtrlIDBOLD);
v.put("visCtrlIDITALIC", visCtrlIDITALIC);
v.put("visCtrlIDULINE", visCtrlIDULINE);
v.put("visCtrlIDSUPERSCRIPT", visCtrlIDSUPERSCRIPT);
v.put("visCtrlIDSUBSCRIPT", visCtrlIDSUBSCRIPT);
v.put("visCtrlIDTEXTCOLOR", visCtrlIDTEXTCOLOR);
v.put("visCtrlIDTEXTLEFT", visCtrlIDTEXTLEFT);
v.put("visCtrlIDTEXTCENTER", visCtrlIDTEXTCENTER);
v.put("visCtrlIDTEXTRIGHT", visCtrlIDTEXTRIGHT);
v.put("visCtrlIDTEXTJUSTIFY", visCtrlIDTEXTJUSTIFY);
v.put("visCtrlIDTEXTTOP", visCtrlIDTEXTTOP);
v.put("visCtrlIDTEXTMIDDLE", visCtrlIDTEXTMIDDLE);
v.put("visCtrlIDTEXTBOTTOM", visCtrlIDTEXTBOTTOM);
v.put("visCtrlIDALIGN", visCtrlIDALIGN);
v.put("visCtrlIDALIGNLEFT", visCtrlIDALIGNLEFT);
v.put("visCtrlIDALIGNCENTER", visCtrlIDALIGNCENTER);
v.put("visCtrlIDALIGNRIGHT", visCtrlIDALIGNRIGHT);
v.put("visCtrlIDALIGNTOP", visCtrlIDALIGNTOP);
v.put("visCtrlIDALIGNMIDDLE", visCtrlIDALIGNMIDDLE);
v.put("visCtrlIDALIGNBOTTOM", visCtrlIDALIGNBOTTOM);
v.put("visCtrlIDDISTRIBUTE", visCtrlIDDISTRIBUTE);
v.put("visCtrlIDDHORZ_EQSPACE", visCtrlIDDHORZ_EQSPACE);
v.put("visCtrlIDDHORZ_CENTER", visCtrlIDDHORZ_CENTER);
v.put("visCtrlIDDVERT_EQSPACE", visCtrlIDDVERT_EQSPACE);
v.put("visCtrlIDDVERT_MIDDLE", visCtrlIDDVERT_MIDDLE);
v.put("visCtrlIDCONNECTSHAPES", visCtrlIDCONNECTSHAPES);
v.put("visCtrlIDFIRSTPAGE", visCtrlIDFIRSTPAGE);
v.put("visCtrlIDLASTPAGE", visCtrlIDLASTPAGE);
v.put("visCtrlIDPAGEBREAKS", visCtrlIDPAGEBREAKS);
v.put("visCtrlIDICONNAME", visCtrlIDICONNAME);
v.put("visCtrlIDICONONLY", visCtrlIDICONONLY);
v.put("visCtrlIDNAMEONLY", visCtrlIDNAMEONLY);
v.put("visCtrlIDARRANGEICONS", visCtrlIDARRANGEICONS);
v.put("visCtrlIDCANCELFORMULA", visCtrlIDCANCELFORMULA);
v.put("visCtrlIDACCEPTFORMULA", visCtrlIDACCEPTFORMULA);
v.put("visCtrlIDICONPENCIL", visCtrlIDICONPENCIL);
v.put("visCtrlIDICONBUCKET", visCtrlIDICONBUCKET);
v.put("visCtrlIDICONLASSO", visCtrlIDICONLASSO);
v.put("visCtrlIDICONSELNET", visCtrlIDICONSELNET);
v.put("visCtrlIDBRINGFRONT", visCtrlIDBRINGFRONT);
v.put("visCtrlIDSENDBACK", visCtrlIDSENDBACK);
v.put("visCtrlIDGROUP", visCtrlIDGROUP);
v.put("visCtrlIDUNGROUP", visCtrlIDUNGROUP);
v.put("visCtrlIDCASCADE", visCtrlIDCASCADE);
v.put("visCtrlIDTILE", visCtrlIDTILE);
v.put("visCtrlIDCONNECTORTOOL", visCtrlIDCONNECTORTOOL);
v.put("visCtrlIDTEXTBLOCKTOOL", visCtrlIDTEXTBLOCKTOOL);
v.put("visCtrlIDWHOLEPAGE", visCtrlIDWHOLEPAGE);
v.put("visCtrlIDSINGLETILE", visCtrlIDSINGLETILE);
v.put("visCtrlIDFORMULA", visCtrlIDFORMULA);
v.put("visCtrlIDSPACER", visCtrlIDSPACER);
v.put("visCtrlIDALLSTYLESCOMBO", visCtrlIDALLSTYLESCOMBO);
v.put("visCtrlIDTEXTSTYLECOMBO", visCtrlIDTEXTSTYLECOMBO);
v.put("visCtrlIDLINESTYLECOMBO", visCtrlIDLINESTYLECOMBO);
v.put("visCtrlIDFILLSTYLECOMBO", visCtrlIDFILLSTYLECOMBO);
v.put("visCtrlIDZOOMCOMBO", visCtrlIDZOOMCOMBO);
v.put("visCtrlIDFONTCOMBO", visCtrlIDFONTCOMBO);
v.put("visCtrlIDPOINTSIZECOMBO", visCtrlIDPOINTSIZECOMBO);
v.put("visCtrlIDALLSTYLESLIST", visCtrlIDALLSTYLESLIST);
v.put("visCtrlIDTEXTSTYLELIST", visCtrlIDTEXTSTYLELIST);
v.put("visCtrlIDLINESTYLELIST", visCtrlIDLINESTYLELIST);
v.put("visCtrlIDFILLSTYLELIST", visCtrlIDFILLSTYLELIST);
v.put("visCtrlIDZOOMLIST", visCtrlIDZOOMLIST);
v.put("visCtrlIDFONTLIST", visCtrlIDFONTLIST);
v.put("visCtrlIDPOINTSIZELIST", visCtrlIDPOINTSIZELIST);
v.put("visCtrlIDGOTOPAGELIST", visCtrlIDGOTOPAGELIST);
v.put("visCtrlIDCLOSE", visCtrlIDCLOSE);
v.put("visCtrlIDLEFTCOLORBOX", visCtrlIDLEFTCOLORBOX);
v.put("visCtrlIDRIGHTCOLORBOX", visCtrlIDRIGHTCOLORBOX);
v.put("visCtrlIDCOLOR1", visCtrlIDCOLOR1);
v.put("visCtrlIDCOLOR2", visCtrlIDCOLOR2);
v.put("visCtrlIDCOLOR3", visCtrlIDCOLOR3);
v.put("visCtrlIDCOLOR4", visCtrlIDCOLOR4);
v.put("visCtrlIDCOLOR5", visCtrlIDCOLOR5);
v.put("visCtrlIDCOLOR6", visCtrlIDCOLOR6);
v.put("visCtrlIDCOLOR7", visCtrlIDCOLOR7);
v.put("visCtrlIDCOLOR8", visCtrlIDCOLOR8);
v.put("visCtrlIDCOLOR9", visCtrlIDCOLOR9);
v.put("visCtrlIDCOLOR10", visCtrlIDCOLOR10);
v.put("visCtrlIDCOLOR11", visCtrlIDCOLOR11);
v.put("visCtrlIDCOLOR12", visCtrlIDCOLOR12);
v.put("visCtrlIDCOLOR13", visCtrlIDCOLOR13);
v.put("visCtrlIDCOLOR14", visCtrlIDCOLOR14);
v.put("visCtrlIDCOLOR15", visCtrlIDCOLOR15);
v.put("visCtrlIDCOLOR16", visCtrlIDCOLOR16);
v.put("visCtrlIDTRANSPARENT", visCtrlIDTRANSPARENT);
v.put("visCtrlIDALLSTYLESLABEL", visCtrlIDALLSTYLESLABEL);
v.put("visCtrlIDTEXTSTYLELABEL", visCtrlIDTEXTSTYLELABEL);
v.put("visCtrlIDLINESTYLELABEL", visCtrlIDLINESTYLELABEL);
v.put("visCtrlIDFILLSTYLELABEL", visCtrlIDFILLSTYLELABEL);
v.put("visCtrlIDZOOMLABEL", visCtrlIDZOOMLABEL);
v.put("visCtrlIDFONTLABEL", visCtrlIDFONTLABEL);
v.put("visCtrlIDPOINTSIZELABEL", visCtrlIDPOINTSIZELABEL);
v.put("visCtrlIDLEFTCOLORLABEL", visCtrlIDLEFTCOLORLABEL);
v.put("visCtrlIDRIGHTCOLORLABEL", visCtrlIDRIGHTCOLORLABEL);
v.put("visCtrlIDSTATUSLABEL", visCtrlIDSTATUSLABEL);
v.put("visCtrlIDPREVIEWLABEL", visCtrlIDPREVIEWLABEL);
v.put("visCtrlIDSTATUSREADOUT", visCtrlIDSTATUSREADOUT);
v.put("visCtrlIDSTATUSMSG_1", visCtrlIDSTATUSMSG_1);
v.put("visCtrlIDSTATUSMSG_2", visCtrlIDSTATUSMSG_2);
v.put("visCtrlIDSTATUSMSG_3", visCtrlIDSTATUSMSG_3);
v.put("visCtrlIDSTATUSMSG_4", visCtrlIDSTATUSMSG_4);
v.put("visCtrlIDSTATUSMSG_5", visCtrlIDSTATUSMSG_5);
v.put("visCtrlIDSTATUSMSG_6", visCtrlIDSTATUSMSG_6);
v.put("visCtrlIDSTATUSMSG_7", visCtrlIDSTATUSMSG_7);
v.put("visCtrlIDSTATUSMSG_8", visCtrlIDSTATUSMSG_8);
v.put("visCtrlIDSTATUSMSG_9", visCtrlIDSTATUSMSG_9);
v.put("visCtrlIDSPLINETOOL", visCtrlIDSPLINETOOL);
v.put("visCtrlIDSPELLING", visCtrlIDSPELLING);
v.put("visCtrlIDFORMATPAINTER", visCtrlIDFORMATPAINTER);
v.put("visCtrlIDHELPMODE", visCtrlIDHELPMODE);
v.put("visCtrlIDLAYERPROPERTIES", visCtrlIDLAYERPROPERTIES);
v.put("visCtrlIDLAYOUTSHAPES", visCtrlIDLAYOUTSHAPES);
v.put("visCtrlIDINSERTHYPERLINK", visCtrlIDINSERTHYPERLINK);
v.put("visCtrlIDSEARCHTHEWEB", visCtrlIDSEARCHTHEWEB);
v.put("visCtrlIDGOBACK", visCtrlIDGOBACK);
v.put("visCtrlIDGOFORWARD", visCtrlIDGOFORWARD);
v.put("visCtrlIDWEBTOOLBAR", visCtrlIDWEBTOOLBAR);
v.put("visCtrlIDSHAPEEXPL", visCtrlIDSHAPEEXPL);
v.put("visCtrlIDCUSTPROP", visCtrlIDCUSTPROP);
v.put("visCtrlIDROTATETEXT", visCtrlIDROTATETEXT);
v.put("visCtrlIDBULLETS", visCtrlIDBULLETS);
v.put("visCtrlIDDECRINDENT", visCtrlIDDECRINDENT);
v.put("visCtrlIDINCRINDENT", visCtrlIDINCRINDENT);
v.put("visCtrlIDDECRPARA", visCtrlIDDECRPARA);
v.put("visCtrlIDINCRPARA", visCtrlIDINCRPARA);
v.put("visCtrlIDINSERTCONTROL", visCtrlIDINSERTCONTROL);
v.put("visCtrlIDDESIGNMODE", visCtrlIDDESIGNMODE);
v.put("visCtrlIDSHAPESHEET", visCtrlIDSHAPESHEET);
v.put("visCtrlIDSHAPELAYER", visCtrlIDSHAPELAYER);
v.put("visCtrlIDGOTOPAGE", visCtrlIDGOTOPAGE);
v.put("visCtrlIDLINECOLORS", visCtrlIDLINECOLORS);
v.put("visCtrlIDLINEWEIGHTS", visCtrlIDLINEWEIGHTS);
v.put("visCtrlIDLINEPATTERNS", visCtrlIDLINEPATTERNS);
v.put("visCtrlIDFILLCOLORS", visCtrlIDFILLCOLORS);
v.put("visCtrlIDFILLPATTERNS", visCtrlIDFILLPATTERNS);
v.put("visCtrlIDTEXTCOLORS", visCtrlIDTEXTCOLORS);
v.put("visCtrlIDMACROS", visCtrlIDMACROS);
v.put("visCtrlIDVBEDITOR", visCtrlIDVBEDITOR);
v.put("visCtrlIDSHAPELAYERCOMBO", visCtrlIDSHAPELAYERCOMBO);
v.put("visCtrlIDSHAPELAYERLIST", visCtrlIDSHAPELAYERLIST);
v.put("visCtrlIDALIGNSHAPES", visCtrlIDALIGNSHAPES);
v.put("visCtrlIDDISTRIBUTESHAPES", visCtrlIDDISTRIBUTESHAPES);
v.put("visCtrlIDMSG_PAGES", visCtrlIDMSG_PAGES);
values = Collections.synchronizedMap(Collections.unmodifiableMap(v));
}
}
| 42,530 | 0.660383 | 0.605171 | 1,415 | 28.088339 | 25.791553 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.433922 | false | false | 9 |
6e707e673ecd918a311c651bd5ab558488ea4332 | 31,894,427,156,447 | cb322dee38f32caf8ee5d2e7f68f6281c5b0352c | /Core/org.emftext.language.java/src/org/emftext/language/java/extensions/classifiers/ClassExtension.java | 483c775a9ed7110c29b45f8209ff0e0a828d6e9f | []
| no_license | DevBoost/JaMoPP | https://github.com/DevBoost/JaMoPP | b83458ea74d0ead50f8879d8d9fdcae914686b13 | 8bc07e8407993e463323a5e0325540bed839502a | refs/heads/master | 2022-09-23T19:12:43.803000 | 2019-06-09T20:54:34 | 2019-06-09T20:54:34 | 5,324,796 | 13 | 13 | null | false | 2022-09-05T10:47:42 | 2012-08-07T07:25:32 | 2022-05-30T22:53:12 | 2022-09-05T10:37:59 | 12,408 | 14 | 18 | 15 | Java | false | false | /*******************************************************************************
* Copyright (c) 2006-2014
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* 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
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
package org.emftext.language.java.extensions.classifiers;
import org.eclipse.emf.common.util.EList;
import org.emftext.language.java.classifiers.ConcreteClassifier;
import org.emftext.language.java.classifiers.Interface;
import org.emftext.language.java.types.PrimitiveType;
import org.emftext.language.java.types.Type;
import org.emftext.language.java.types.TypeReference;
import org.emftext.language.java.types.TypesFactory;
import org.emftext.language.java.util.UniqueEList;
public class ClassExtension {
/**
* Recursively collects all super types (extended classes and implemented
* interfaces) of the given class.
*/
public static EList<ConcreteClassifier> getAllSuperClassifiers(
org.emftext.language.java.classifiers.Class me) {
EList<ConcreteClassifier> result = new UniqueEList<ConcreteClassifier>();
// Collects all super classes first
org.emftext.language.java.classifiers.Class superClass = me;
while (superClass != null && !superClass.eIsProxy() &&
!me.isJavaLangObject(superClass)) {
superClass = superClass.getSuperClass();
if (superClass != null) {
result.add(superClass);
}
}
// Collect all implemented interfaces
for (TypeReference typeArg : me.getImplements()) {
ConcreteClassifier superInterface = (ConcreteClassifier) typeArg.getTarget();
if (superInterface != null) {
result.add(superInterface);
if (superInterface instanceof Interface) {
result.addAll(((Interface) superInterface).getAllSuperClassifiers());
}
}
}
// Collect all implemented interfaces of super classes
superClass = me.getSuperClass();
if (superClass != null && !superClass.eIsProxy() &&
!me.isJavaLangObject(superClass)) {
result.addAll(superClass.getAllSuperClassifiers());
}
return result;
}
/**
* @return the direct super class
*/
public static org.emftext.language.java.classifiers.Class getSuperClass(
org.emftext.language.java.classifiers.Class me) {
TypeReference superClassReference = me.getExtends();
if (superClassReference == null) {
superClassReference = me.getDefaultExtends();
}
if (superClassReference == null) {
return null;
}
Type result = superClassReference.getTarget();
if (result instanceof org.emftext.language.java.classifiers.Class) {
return (org.emftext.language.java.classifiers.Class) result;
}
return null;
}
/**
* @return primitive type, if the class can be wrapped
*/
public static PrimitiveType unWrapPrimitiveType(
org.emftext.language.java.classifiers.Class me) {
if (me.getLibClass("Boolean").equals(me)) {
return TypesFactory.eINSTANCE.createBoolean();
}
if (me.getLibClass("Byte").equals(me)) {
return TypesFactory.eINSTANCE.createByte();
}
if (me.getLibClass("Character").equals(me)) {
return TypesFactory.eINSTANCE.createChar();
}
if (me.getLibClass("Float").equals(me)) {
return TypesFactory.eINSTANCE.createFloat();
}
if (me.getLibClass("Double").equals(me)) {
return TypesFactory.eINSTANCE.createDouble();
}
if (me.getLibClass("Integer").equals(me)) {
return TypesFactory.eINSTANCE.createInt();
}
if (me.getLibClass("Long").equals(me)) {
return TypesFactory.eINSTANCE.createLong();
}
if (me.getLibClass("Short").equals(me)) {
return TypesFactory.eINSTANCE.createShort();
}
if (me.getLibClass("Void").equals(me)) {
return TypesFactory.eINSTANCE.createVoid();
}
return null;
}
}
| UTF-8 | Java | 4,168 | java | ClassExtension.java | Java | []
| null | []
| /*******************************************************************************
* Copyright (c) 2006-2014
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* 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
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
package org.emftext.language.java.extensions.classifiers;
import org.eclipse.emf.common.util.EList;
import org.emftext.language.java.classifiers.ConcreteClassifier;
import org.emftext.language.java.classifiers.Interface;
import org.emftext.language.java.types.PrimitiveType;
import org.emftext.language.java.types.Type;
import org.emftext.language.java.types.TypeReference;
import org.emftext.language.java.types.TypesFactory;
import org.emftext.language.java.util.UniqueEList;
public class ClassExtension {
/**
* Recursively collects all super types (extended classes and implemented
* interfaces) of the given class.
*/
public static EList<ConcreteClassifier> getAllSuperClassifiers(
org.emftext.language.java.classifiers.Class me) {
EList<ConcreteClassifier> result = new UniqueEList<ConcreteClassifier>();
// Collects all super classes first
org.emftext.language.java.classifiers.Class superClass = me;
while (superClass != null && !superClass.eIsProxy() &&
!me.isJavaLangObject(superClass)) {
superClass = superClass.getSuperClass();
if (superClass != null) {
result.add(superClass);
}
}
// Collect all implemented interfaces
for (TypeReference typeArg : me.getImplements()) {
ConcreteClassifier superInterface = (ConcreteClassifier) typeArg.getTarget();
if (superInterface != null) {
result.add(superInterface);
if (superInterface instanceof Interface) {
result.addAll(((Interface) superInterface).getAllSuperClassifiers());
}
}
}
// Collect all implemented interfaces of super classes
superClass = me.getSuperClass();
if (superClass != null && !superClass.eIsProxy() &&
!me.isJavaLangObject(superClass)) {
result.addAll(superClass.getAllSuperClassifiers());
}
return result;
}
/**
* @return the direct super class
*/
public static org.emftext.language.java.classifiers.Class getSuperClass(
org.emftext.language.java.classifiers.Class me) {
TypeReference superClassReference = me.getExtends();
if (superClassReference == null) {
superClassReference = me.getDefaultExtends();
}
if (superClassReference == null) {
return null;
}
Type result = superClassReference.getTarget();
if (result instanceof org.emftext.language.java.classifiers.Class) {
return (org.emftext.language.java.classifiers.Class) result;
}
return null;
}
/**
* @return primitive type, if the class can be wrapped
*/
public static PrimitiveType unWrapPrimitiveType(
org.emftext.language.java.classifiers.Class me) {
if (me.getLibClass("Boolean").equals(me)) {
return TypesFactory.eINSTANCE.createBoolean();
}
if (me.getLibClass("Byte").equals(me)) {
return TypesFactory.eINSTANCE.createByte();
}
if (me.getLibClass("Character").equals(me)) {
return TypesFactory.eINSTANCE.createChar();
}
if (me.getLibClass("Float").equals(me)) {
return TypesFactory.eINSTANCE.createFloat();
}
if (me.getLibClass("Double").equals(me)) {
return TypesFactory.eINSTANCE.createDouble();
}
if (me.getLibClass("Integer").equals(me)) {
return TypesFactory.eINSTANCE.createInt();
}
if (me.getLibClass("Long").equals(me)) {
return TypesFactory.eINSTANCE.createLong();
}
if (me.getLibClass("Short").equals(me)) {
return TypesFactory.eINSTANCE.createShort();
}
if (me.getLibClass("Void").equals(me)) {
return TypesFactory.eINSTANCE.createVoid();
}
return null;
}
}
| 4,168 | 0.699856 | 0.695537 | 126 | 32.079365 | 24.751978 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.071429 | false | false | 9 |
f147c1369317f25deef11d5410de30604770d299 | 6,373,731,528,688 | 12ce874a5a036cffd11dab2f8229b4ff6da03f5e | /src/main/java/cabbage/project/lawyerSys/controller/ProjectCompanyDemandLawyerController.java | 81f2f841468205369fd0b283211f2448c7419180 | []
| no_license | pig-cabbage/lawyerSys | https://github.com/pig-cabbage/lawyerSys | e3cae8dab709035732bf913edb6ce103723bf7b1 | e99232240b5f4e7b892d8e7d39966d153233c895 | refs/heads/master | 2023-05-04T18:27:00.437000 | 2021-04-23T06:48:26 | 2021-04-23T06:48:26 | 344,865,718 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cabbage.project.lawyerSys.controller;
import cabbage.project.lawyerSys.common.utils.PageUtils;
import cabbage.project.lawyerSys.common.utils.R;
import cabbage.project.lawyerSys.entity.ProjectCompanyDemandLawyerEntity;
import cabbage.project.lawyerSys.entity.ProjectPlanEntity;
import cabbage.project.lawyerSys.service.ProjectCompanyDemandLawyerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
/**
* 企业选择律师记录表
*
* @author Weizhong
* @email 2089319261@qq.com
* @date 2021-02-07 20:32:44
*/
@RestController
@RequestMapping("/api/project/demandLawyer")
public class ProjectCompanyDemandLawyerController {
@Autowired
private ProjectCompanyDemandLawyerService projectCompanyDemandLawyerService;
/**
* 获取特定项目最近的选择律师记录
*/
@RequestMapping("/{projectId}/closestRecord")
public R getRecord(@PathVariable("projectId") Long projectId) {
ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyerEntity = projectCompanyDemandLawyerService.getByProjectIdLatest(projectId);
return R.ok().put("projectCompanyDemandLawyer", projectCompanyDemandLawyerEntity);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params) {
PageUtils page = projectCompanyDemandLawyerService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Integer id) {
ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyer = projectCompanyDemandLawyerService.getById(id);
return R.ok().put("entity", projectCompanyDemandLawyer);
}
/**
* 保存
*/
@RequestMapping("/save")
public R save(@RequestBody ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyer) {
projectCompanyDemandLawyerService.save(projectCompanyDemandLawyer);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyer) {
projectCompanyDemandLawyerService.updateById(projectCompanyDemandLawyer);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids) {
projectCompanyDemandLawyerService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
| UTF-8 | Java | 2,463 | java | ProjectCompanyDemandLawyerController.java | Java | [
{
"context": "rt java.util.Map;\n\n\n/**\n * 企业选择律师记录表\n *\n * @author Weizhong\n * @email 2089319261@qq.com\n * @date 2021-02-07 2",
"end": 564,
"score": 0.985971212387085,
"start": 556,
"tag": "NAME",
"value": "Weizhong"
},
{
"context": "/**\n * 企业选择律师记录表\n *\n * @author Weizhong\n * @email 2089319261@qq.com\n * @date 2021-02-07 20:32:44\n */\n@RestController\n",
"end": 592,
"score": 0.999756932258606,
"start": 575,
"tag": "EMAIL",
"value": "2089319261@qq.com"
}
]
| null | []
| package cabbage.project.lawyerSys.controller;
import cabbage.project.lawyerSys.common.utils.PageUtils;
import cabbage.project.lawyerSys.common.utils.R;
import cabbage.project.lawyerSys.entity.ProjectCompanyDemandLawyerEntity;
import cabbage.project.lawyerSys.entity.ProjectPlanEntity;
import cabbage.project.lawyerSys.service.ProjectCompanyDemandLawyerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
/**
* 企业选择律师记录表
*
* @author Weizhong
* @email <EMAIL>
* @date 2021-02-07 20:32:44
*/
@RestController
@RequestMapping("/api/project/demandLawyer")
public class ProjectCompanyDemandLawyerController {
@Autowired
private ProjectCompanyDemandLawyerService projectCompanyDemandLawyerService;
/**
* 获取特定项目最近的选择律师记录
*/
@RequestMapping("/{projectId}/closestRecord")
public R getRecord(@PathVariable("projectId") Long projectId) {
ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyerEntity = projectCompanyDemandLawyerService.getByProjectIdLatest(projectId);
return R.ok().put("projectCompanyDemandLawyer", projectCompanyDemandLawyerEntity);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params) {
PageUtils page = projectCompanyDemandLawyerService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Integer id) {
ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyer = projectCompanyDemandLawyerService.getById(id);
return R.ok().put("entity", projectCompanyDemandLawyer);
}
/**
* 保存
*/
@RequestMapping("/save")
public R save(@RequestBody ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyer) {
projectCompanyDemandLawyerService.save(projectCompanyDemandLawyer);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ProjectCompanyDemandLawyerEntity projectCompanyDemandLawyer) {
projectCompanyDemandLawyerService.updateById(projectCompanyDemandLawyer);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids) {
projectCompanyDemandLawyerService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
| 2,453 | 0.756159 | 0.746138 | 89 | 25.910112 | 30.851816 | 138 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.303371 | false | false | 9 |
44ff8f339ca4ad9bc8bb9ba3006a4e100e28b9c1 | 31,001,074,004,972 | cc7cc593fbdb249e340e739d5d5982c8e53a46a0 | /joooin/src/main/java/com/joooin/system/group/_22/controller/PostGroupController.java | fe6ad792a261bc23ad2204a6e9ff6486a299d01b | []
| no_license | EEIT10506/JoooIN | https://github.com/EEIT10506/JoooIN | 28b1bfc71dbc47172d00b3548a579a78f468434b | 3e8d7a60db351d5856e67000889168951cb57a3c | refs/heads/master | 2020-04-26T16:06:02.828000 | 2019-04-02T09:59:14 | 2019-04-02T09:59:14 | 173,667,576 | 2 | 1 | null | false | 2019-03-04T16:16:36 | 2019-03-04T03:31:01 | 2019-03-04T15:18:40 | 2019-03-04T16:01:02 | 31 | 0 | 0 | 0 | Java | false | null | package com.joooin.system.group._22.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.joooin.model.GroupMainBean;
import com.joooin.model.GroupPostBean;
import com.joooin.model.GroupPostReplyBean;
import com.joooin.model.MemberMainBean;
import com.joooin.system.group._22.pojo.Poster;
import com.joooin.system.group._22.pojo.Replyer;
import com.joooin.system.group._22.service.GroupService_22;
import com.joooin.system.member._27.service.MemberService;
import com.joooin.util.ImageUtils;
@Controller
public class PostGroupController {
@Autowired
GroupService_22 groupService;
@Autowired
ServletContext context;
@Autowired
MemberService memService;
// 時間格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 進入社團發文頁面
@RequestMapping(method = RequestMethod.GET, value = "/group/addpost/{groupId}")
public String mainPagePost(Model model, HttpSession session, @PathVariable Integer groupId) {
// 未登入不可發文
Integer memberId = (Integer) session.getAttribute("memberId");
if (memberId == null) {
return "not_login";
}
//成員才可以發文
boolean Permission = groupService.getPermission(groupId, memberId);
model.addAttribute("Permission", Permission);
//
GroupMainBean groupMain = groupService.getByGroupId(groupId);
model.addAttribute("groupMain", groupMain); // pass group資訊
MemberMainBean member = memService.getMemberMainBean(memberId);
model.addAttribute("member", member); // pass member資訊
// 送出空白發文表單
GroupPostBean groupPost = new GroupPostBean();
model.addAttribute("groupPostBean", groupPost);
return "group/group_post";
}
// 處理新增發文
@RequestMapping(method = RequestMethod.POST, value = "/group/addpost/{groupId}")
public String processNewGroupForm(@ModelAttribute("groupPostBean") GroupPostBean groupPostBean,
HttpSession session) {
Integer groupId = groupPostBean.getGroupId();
// 回復用照片測試
Byte[] groupImage = null;
if (!groupPostBean.getMultipartFile().isEmpty()) {
groupImage = ImageUtils.multipartFileToByteArray(groupPostBean.getMultipartFile());
groupPostBean.setGroupPostImage(groupImage);
}
String text = groupPostBean.getGroupPostText().replace("\n", "<br />");
groupPostBean.setGroupPostText(text);
// 沒有like
groupPostBean.setGroupPostLike(0);
// 預設發文時間為當下
groupPostBean.setGroupPostDate((sdf.format(new Date()).toString()));
// 預設顯示文章
groupPostBean.setIsDeleted(false);
// 文章建立
groupService.createPost(groupPostBean);
return "redirect:/group/" + groupId;
}
// 進入文章頁面
@RequestMapping(method = RequestMethod.GET, value = "/group/post/{groupPostId}")
public String postMainPage(Model model, @PathVariable Integer groupPostId, HttpSession session) {
Poster poster = groupService.getPosterByGroupPostId(groupPostId);
model.addAttribute("poster", poster);
GroupMainBean groupMain = groupService.getByGroupId(poster.getGroupId());
model.addAttribute("groupMain", groupMain);
//設定留言權限
Integer memberId = (Integer) session.getAttribute("memberId");
boolean Permission = groupService.getPermission(poster.getGroupId(), memberId);
model.addAttribute("Permission", Permission);
return "group/group_article";
}
// 產生回文
@RequestMapping(method = RequestMethod.POST,
value = "/group/recive/reply/{groupPostId}/group/{groupId}")
public String createReply(@PathVariable Integer groupPostId, @PathVariable Integer groupId,String reply, HttpSession session) {
// 未登入不可回文
Integer memberId = (Integer) session.getAttribute("memberId");
if (memberId == null) {
return "not_login";
}
// 待寫,非社團成員不可reply
// 待寫,非社團成員不可reply
GroupPostReplyBean replyBean = new GroupPostReplyBean();
replyBean.setGroupPostId(groupPostId);
replyBean.setGroupId(groupId);
replyBean.setMemberId(memberId);
replyBean.setGroupPostReplyDate((sdf.format(new Date()).toString()));
replyBean.setIsDeleted(false);
reply = reply.replace("\n", "<br />");
replyBean.setGroupPostReplyContent(reply);
groupService.createReply(replyBean);
return "redirect:/group/return/reply/"+groupPostId+"/group/"+groupId; // 先測試ajax redirect
}
//顯示所有回文
@RequestMapping(method = RequestMethod.GET,
value = "/group/return/reply/{groupPostId}/group/{groupId}")
@ResponseBody
public List<Replyer> getReplyers(@PathVariable Integer groupPostId, @PathVariable Integer groupId) {
List<Replyer> replyerByDate = groupService.getReplyerByGroupPostId(groupPostId);
return replyerByDate;
}
}
| UTF-8 | Java | 5,522 | java | PostGroupController.java | Java | []
| null | []
| package com.joooin.system.group._22.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.joooin.model.GroupMainBean;
import com.joooin.model.GroupPostBean;
import com.joooin.model.GroupPostReplyBean;
import com.joooin.model.MemberMainBean;
import com.joooin.system.group._22.pojo.Poster;
import com.joooin.system.group._22.pojo.Replyer;
import com.joooin.system.group._22.service.GroupService_22;
import com.joooin.system.member._27.service.MemberService;
import com.joooin.util.ImageUtils;
@Controller
public class PostGroupController {
@Autowired
GroupService_22 groupService;
@Autowired
ServletContext context;
@Autowired
MemberService memService;
// 時間格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 進入社團發文頁面
@RequestMapping(method = RequestMethod.GET, value = "/group/addpost/{groupId}")
public String mainPagePost(Model model, HttpSession session, @PathVariable Integer groupId) {
// 未登入不可發文
Integer memberId = (Integer) session.getAttribute("memberId");
if (memberId == null) {
return "not_login";
}
//成員才可以發文
boolean Permission = groupService.getPermission(groupId, memberId);
model.addAttribute("Permission", Permission);
//
GroupMainBean groupMain = groupService.getByGroupId(groupId);
model.addAttribute("groupMain", groupMain); // pass group資訊
MemberMainBean member = memService.getMemberMainBean(memberId);
model.addAttribute("member", member); // pass member資訊
// 送出空白發文表單
GroupPostBean groupPost = new GroupPostBean();
model.addAttribute("groupPostBean", groupPost);
return "group/group_post";
}
// 處理新增發文
@RequestMapping(method = RequestMethod.POST, value = "/group/addpost/{groupId}")
public String processNewGroupForm(@ModelAttribute("groupPostBean") GroupPostBean groupPostBean,
HttpSession session) {
Integer groupId = groupPostBean.getGroupId();
// 回復用照片測試
Byte[] groupImage = null;
if (!groupPostBean.getMultipartFile().isEmpty()) {
groupImage = ImageUtils.multipartFileToByteArray(groupPostBean.getMultipartFile());
groupPostBean.setGroupPostImage(groupImage);
}
String text = groupPostBean.getGroupPostText().replace("\n", "<br />");
groupPostBean.setGroupPostText(text);
// 沒有like
groupPostBean.setGroupPostLike(0);
// 預設發文時間為當下
groupPostBean.setGroupPostDate((sdf.format(new Date()).toString()));
// 預設顯示文章
groupPostBean.setIsDeleted(false);
// 文章建立
groupService.createPost(groupPostBean);
return "redirect:/group/" + groupId;
}
// 進入文章頁面
@RequestMapping(method = RequestMethod.GET, value = "/group/post/{groupPostId}")
public String postMainPage(Model model, @PathVariable Integer groupPostId, HttpSession session) {
Poster poster = groupService.getPosterByGroupPostId(groupPostId);
model.addAttribute("poster", poster);
GroupMainBean groupMain = groupService.getByGroupId(poster.getGroupId());
model.addAttribute("groupMain", groupMain);
//設定留言權限
Integer memberId = (Integer) session.getAttribute("memberId");
boolean Permission = groupService.getPermission(poster.getGroupId(), memberId);
model.addAttribute("Permission", Permission);
return "group/group_article";
}
// 產生回文
@RequestMapping(method = RequestMethod.POST,
value = "/group/recive/reply/{groupPostId}/group/{groupId}")
public String createReply(@PathVariable Integer groupPostId, @PathVariable Integer groupId,String reply, HttpSession session) {
// 未登入不可回文
Integer memberId = (Integer) session.getAttribute("memberId");
if (memberId == null) {
return "not_login";
}
// 待寫,非社團成員不可reply
// 待寫,非社團成員不可reply
GroupPostReplyBean replyBean = new GroupPostReplyBean();
replyBean.setGroupPostId(groupPostId);
replyBean.setGroupId(groupId);
replyBean.setMemberId(memberId);
replyBean.setGroupPostReplyDate((sdf.format(new Date()).toString()));
replyBean.setIsDeleted(false);
reply = reply.replace("\n", "<br />");
replyBean.setGroupPostReplyContent(reply);
groupService.createReply(replyBean);
return "redirect:/group/return/reply/"+groupPostId+"/group/"+groupId; // 先測試ajax redirect
}
//顯示所有回文
@RequestMapping(method = RequestMethod.GET,
value = "/group/return/reply/{groupPostId}/group/{groupId}")
@ResponseBody
public List<Replyer> getReplyers(@PathVariable Integer groupPostId, @PathVariable Integer groupId) {
List<Replyer> replyerByDate = groupService.getReplyerByGroupPostId(groupPostId);
return replyerByDate;
}
}
| 5,522 | 0.741183 | 0.738339 | 163 | 30.361963 | 28.762796 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.828221 | false | false | 9 |
6463e76562071d57b7b8b2db2f5fc6e0c26a1b41 | 29,403,346,114,097 | 5ac4d322554a1f202c7560a3182b75189c350b6f | /src/java/entities/Response.java | ebe5dce46fa7f2e025d77e426257652ab0ef0468 | []
| no_license | PaulFr/poll-expert | https://github.com/PaulFr/poll-expert | 1f48de58e18b1eead05c5d642ab49e91962a2ba5 | 6538057d421452146372b17bfe8b3534e5fa01a6 | refs/heads/master | 2021-01-10T16:02:55.900000 | 2016-01-21T17:53:57 | 2016-01-21T17:53:57 | 48,187,580 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* 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 entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Paul Frinchaboy
*/
@Entity
@Table(name = "response")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Response.findAll", query = "SELECT r FROM Response r"),
@NamedQuery(name = "Response.findById", query = "SELECT r FROM Response r WHERE r.id = :id"),
@NamedQuery(name = "Response.findByMail", query = "SELECT r FROM Response r WHERE r.mail = :mail")})
public class Response implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "id")
private Integer id;
@Lob
@Size(max = 65535)
@Column(name = "value")
private String value;
@Size(max = 255)
@Column(name = "mail")
private String mail;
@JoinColumn(name = "Choice_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Choice choiceid;
@JoinColumn(name = "Question_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Question questionid;
public Response() {
}
public Response(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public Choice getChoiceid() {
return choiceid;
}
public void setChoiceid(Choice choiceid) {
this.choiceid = choiceid;
}
public Question getQuestionid() {
return questionid;
}
public void setQuestionid(Question questionid) {
this.questionid = questionid;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Response)) {
return false;
}
Response other = (Response) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.Response[ id=" + id + " ]";
}
}
| UTF-8 | Java | 3,209 | java | Response.java | Java | [
{
"context": "bind.annotation.XmlRootElement;\n\n/**\n *\n * @author Paul Frinchaboy\n */\n@Entity\n@Table(name = \"response\")\n@XmlRootEle",
"end": 741,
"score": 0.9998829960823059,
"start": 726,
"tag": "NAME",
"value": "Paul Frinchaboy"
}
]
| null | []
| /*
* 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 entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author <NAME>
*/
@Entity
@Table(name = "response")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Response.findAll", query = "SELECT r FROM Response r"),
@NamedQuery(name = "Response.findById", query = "SELECT r FROM Response r WHERE r.id = :id"),
@NamedQuery(name = "Response.findByMail", query = "SELECT r FROM Response r WHERE r.mail = :mail")})
public class Response implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "id")
private Integer id;
@Lob
@Size(max = 65535)
@Column(name = "value")
private String value;
@Size(max = 255)
@Column(name = "mail")
private String mail;
@JoinColumn(name = "Choice_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Choice choiceid;
@JoinColumn(name = "Question_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Question questionid;
public Response() {
}
public Response(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public Choice getChoiceid() {
return choiceid;
}
public void setChoiceid(Choice choiceid) {
this.choiceid = choiceid;
}
public Question getQuestionid() {
return questionid;
}
public void setQuestionid(Question questionid) {
this.questionid = questionid;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Response)) {
return false;
}
Response other = (Response) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.Response[ id=" + id + " ]";
}
}
| 3,200 | 0.636335 | 0.632907 | 127 | 24.267717 | 22.065561 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.409449 | false | false | 9 |
d00b466dde3453b756ce4637e578e62b64e2cd98 | 29,403,346,116,120 | f7a3dea67ca6f7f9a56977161ca90126c9ef3404 | /mp/src/main/java/com/gitee/mp/entity/User.java | f61dc24fc08912078b0e1d230ec6a68a90f8952e | []
| no_license | cgb-study/frame | https://github.com/cgb-study/frame | e76756153664c4426167efe6972c359b2034769c | 53e5e04c120e0ecd04b46318ae9b8bf57e771b4e | refs/heads/master | 2023-03-19T17:57:54.466000 | 2021-03-22T00:56:37 | 2021-03-22T00:56:37 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.gitee.mp.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
/**
* @author jie
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_user")
public class User {
@TableId(type = IdType.AUTO)
private Long id;
private String name;
private Integer age;
private String email;
@TableField("manager_id")
private String mannagerId;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updataTime;
/**
* 乐观锁版本
*/
@Version
private Integer version;
/**
* TableLogic表示这是个逻辑删除字段
* TableField(select = false) 表示不查询deleted字段
*/
@TableLogic
@TableField(select = false)
private Integer deleted;
}
| UTF-8 | Java | 1,032 | java | User.java | Java | [
{
"context": ";\n\nimport java.time.LocalDateTime;\n\n/**\n * @author jie\n */\n@Data\n@Builder\n@NoArgsConstructor\n@AllArgsCon",
"end": 238,
"score": 0.9949432611465454,
"start": 235,
"tag": "USERNAME",
"value": "jie"
}
]
| null | []
| package com.gitee.mp.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
/**
* @author jie
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_user")
public class User {
@TableId(type = IdType.AUTO)
private Long id;
private String name;
private Integer age;
private String email;
@TableField("manager_id")
private String mannagerId;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updataTime;
/**
* 乐观锁版本
*/
@Version
private Integer version;
/**
* TableLogic表示这是个逻辑删除字段
* TableField(select = false) 表示不查询deleted字段
*/
@TableLogic
@TableField(select = false)
private Integer deleted;
}
| 1,032 | 0.699797 | 0.699797 | 44 | 21.40909 | 15.973441 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.409091 | false | false | 9 |
b61a036cabd38623989c1e97366faea07129db19 | 32,263,794,387,795 | e6d15cd4c054711baae7451ac30f23dbf044e6c0 | /src/main/java/cn/haichang/assignment/weforward/param/LogView.java | 9ee9842657c04297a7e8687ed12442a5b388376d | []
| no_license | linhaichang/lhc_assignment | https://github.com/linhaichang/lhc_assignment | deae0ce5de8589fa06f741f68c3c14fcd8a715c6 | 24e15dc1db7bf1f8b61351da457dd927a725ef33 | refs/heads/main | 2023-01-02T14:43:58.608000 | 2020-10-29T09:54:25 | 2020-10-29T09:54:25 | 305,633,172 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.haichang.assignment.weforward.param;
import cn.weforward.data.log.BusinessLog;
import cn.weforward.protocol.doc.annotation.DocAttribute;
import cn.weforward.protocol.doc.annotation.DocObject;
import java.util.Date;
/**
* @author HaiChang
* @date 2020/10/23
**/
@DocObject(description = "日志视图")
public class LogView {
protected BusinessLog m_Log;
public LogView(BusinessLog log) {
m_Log = log;
}
public static LogView valueOf(BusinessLog src) {
return null == src ? null : new LogView(src);
}
@DocAttribute(description = "日志时间")
public Date getTime() {
return m_Log.getTime();
}
@DocAttribute(description = "操作人")
public String getAuthor() {
return m_Log.getAuthor();
}
@DocAttribute(description = "行为")
public String getAction() {
return m_Log.getAction();
}
@DocAttribute(description = "做了什么")
public String getWhat() {
return m_Log.getWhat();
}
@DocAttribute(description = "备注")
public String getNote() {
return m_Log.getNote();
}
} | UTF-8 | Java | 1,134 | java | LogView.java | Java | [
{
"context": "DocObject;\n\nimport java.util.Date;\n\n/**\n * @author HaiChang\n * @date 2020/10/23\n **/\n@DocObject(description =",
"end": 252,
"score": 0.9997305274009705,
"start": 244,
"tag": "NAME",
"value": "HaiChang"
}
]
| null | []
| package cn.haichang.assignment.weforward.param;
import cn.weforward.data.log.BusinessLog;
import cn.weforward.protocol.doc.annotation.DocAttribute;
import cn.weforward.protocol.doc.annotation.DocObject;
import java.util.Date;
/**
* @author HaiChang
* @date 2020/10/23
**/
@DocObject(description = "日志视图")
public class LogView {
protected BusinessLog m_Log;
public LogView(BusinessLog log) {
m_Log = log;
}
public static LogView valueOf(BusinessLog src) {
return null == src ? null : new LogView(src);
}
@DocAttribute(description = "日志时间")
public Date getTime() {
return m_Log.getTime();
}
@DocAttribute(description = "操作人")
public String getAuthor() {
return m_Log.getAuthor();
}
@DocAttribute(description = "行为")
public String getAction() {
return m_Log.getAction();
}
@DocAttribute(description = "做了什么")
public String getWhat() {
return m_Log.getWhat();
}
@DocAttribute(description = "备注")
public String getNote() {
return m_Log.getNote();
}
} | 1,134 | 0.641423 | 0.634124 | 51 | 20.509804 | 17.954597 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.254902 | false | false | 9 |
656ce0ec4caf55c5c84b993b66bca08856062487 | 18,528,488,982,909 | d98711471692d7aca52ad81770ed9bb6f78377fd | /AppuntiVariEsempioDueDBandServlets-portlet/docroot/WEB-INF/service/com/appuntivari/esempio/service/persistence/SistemiUtil.java | db0305e82a8182695b912cc2a2906719d7d1f3f1 | []
| no_license | RamkumarChandran/java-liferay.appuntivari.net | https://github.com/RamkumarChandran/java-liferay.appuntivari.net | deb6db8c106339f1105e452f9a15702fc82f8506 | 7c60487d131c4d0447d30ec165042ee50b270108 | refs/heads/master | 2016-09-08T00:28:56.671000 | 2014-01-18T11:49:13 | 2014-01-18T11:49:13 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.appuntivari.esempio.service.persistence;
import com.appuntivari.esempio.model.Sistemi;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;
import java.util.List;
/**
* The persistence utility for the sistemi service. This utility wraps {@link SistemiPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
*
* <p>
* Caching information and settings can be found in <code>portal.properties</code>
* </p>
*
* @author Pasturenzi Francesco
* @see SistemiPersistence
* @see SistemiPersistenceImpl
* @generated
*/
public class SistemiUtil {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
*/
/**
* @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
*/
public static void clearCache() {
getPersistence().clearCache();
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
*/
public static void clearCache(Sistemi sistemi) {
getPersistence().clearCache(sistemi);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
*/
public long countWithDynamicQuery(DynamicQuery dynamicQuery)
throws SystemException {
return getPersistence().countWithDynamicQuery(dynamicQuery);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
*/
public static List<Sistemi> findWithDynamicQuery(DynamicQuery dynamicQuery)
throws SystemException {
return getPersistence().findWithDynamicQuery(dynamicQuery);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
*/
public static List<Sistemi> findWithDynamicQuery(
DynamicQuery dynamicQuery, int start, int end)
throws SystemException {
return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
*/
public static List<Sistemi> findWithDynamicQuery(
DynamicQuery dynamicQuery, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return getPersistence()
.findWithDynamicQuery(dynamicQuery, start, end,
orderByComparator);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
*/
public static Sistemi update(Sistemi sistemi, boolean merge)
throws SystemException {
return getPersistence().update(sistemi, merge);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
*/
public static Sistemi update(Sistemi sistemi, boolean merge,
ServiceContext serviceContext) throws SystemException {
return getPersistence().update(sistemi, merge, serviceContext);
}
/**
* Caches the sistemi in the entity cache if it is enabled.
*
* @param sistemi the sistemi
*/
public static void cacheResult(
com.appuntivari.esempio.model.Sistemi sistemi) {
getPersistence().cacheResult(sistemi);
}
/**
* Caches the sistemis in the entity cache if it is enabled.
*
* @param sistemis the sistemis
*/
public static void cacheResult(
java.util.List<com.appuntivari.esempio.model.Sistemi> sistemis) {
getPersistence().cacheResult(sistemis);
}
/**
* Creates a new sistemi with the primary key. Does not add the sistemi to the database.
*
* @param sistemaId the primary key for the new sistemi
* @return the new sistemi
*/
public static com.appuntivari.esempio.model.Sistemi create(long sistemaId) {
return getPersistence().create(sistemaId);
}
/**
* Removes the sistemi with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param sistemaId the primary key of the sistemi
* @return the sistemi that was removed
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi remove(long sistemaId)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().remove(sistemaId);
}
public static com.appuntivari.esempio.model.Sistemi updateImpl(
com.appuntivari.esempio.model.Sistemi sistemi, boolean merge)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().updateImpl(sistemi, merge);
}
/**
* Returns the sistemi with the primary key or throws a {@link com.appuntivari.esempio.NoSuchSistemiException} if it could not be found.
*
* @param sistemaId the primary key of the sistemi
* @return the sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByPrimaryKey(
long sistemaId)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByPrimaryKey(sistemaId);
}
/**
* Returns the sistemi with the primary key or returns <code>null</code> if it could not be found.
*
* @param sistemaId the primary key of the sistemi
* @return the sistemi, or <code>null</code> if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByPrimaryKey(
long sistemaId)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByPrimaryKey(sistemaId);
}
/**
* Returns all the sistemis where sistema = ?.
*
* @param sistema the sistema
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findBySistema(
java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema(sistema);
}
/**
* Returns a range of all the sistemis where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findBySistema(
java.lang.String sistema, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema(sistema, start, end);
}
/**
* Returns an ordered range of all the sistemis where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findBySistema(
java.lang.String sistema, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findBySistema(sistema, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findBySistema_First(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema_First(sistema, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchBySistema_First(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchBySistema_First(sistema, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findBySistema_Last(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema_Last(sistema, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchBySistema_Last(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchBySistema_Last(sistema, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where sistema = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findBySistema_PrevAndNext(
long sistemaId, java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findBySistema_PrevAndNext(sistemaId, sistema,
orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where sistema = ?.
*
* @param sistema the sistema
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindBySistema(
java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindBySistema(sistema);
}
/**
* Returns a range of all the sistemis that the user has permission to view where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindBySistema(
java.lang.String sistema, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindBySistema(sistema, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindBySistema(
java.lang.String sistema, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindBySistema(sistema, start, end, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where sistema = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindBySistema_PrevAndNext(
long sistemaId, java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindBySistema_PrevAndNext(sistemaId, sistema,
orderByComparator);
}
/**
* Returns all the sistemis where descrizione = ?.
*
* @param descrizione the descrizione
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByDescrizione(
java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByDescrizione(descrizione);
}
/**
* Returns a range of all the sistemis where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByDescrizione(
java.lang.String descrizione, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByDescrizione(descrizione, start, end);
}
/**
* Returns an ordered range of all the sistemis where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByDescrizione(
java.lang.String descrizione, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione(descrizione, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByDescrizione_First(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione_First(descrizione, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByDescrizione_First(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.fetchByDescrizione_First(descrizione, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByDescrizione_Last(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione_Last(descrizione, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByDescrizione_Last(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.fetchByDescrizione_Last(descrizione, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where descrizione = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findByDescrizione_PrevAndNext(
long sistemaId, java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione_PrevAndNext(sistemaId, descrizione,
orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where descrizione = ?.
*
* @param descrizione the descrizione
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByDescrizione(
java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByDescrizione(descrizione);
}
/**
* Returns a range of all the sistemis that the user has permission to view where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByDescrizione(
java.lang.String descrizione, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByDescrizione(descrizione, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByDescrizione(
java.lang.String descrizione, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByDescrizione(descrizione, start, end,
orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where descrizione = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindByDescrizione_PrevAndNext(
long sistemaId, java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByDescrizione_PrevAndNext(sistemaId, descrizione,
orderByComparator);
}
/**
* Returns all the sistemis where status = ?.
*
* @param status the status
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStatus(
java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus(status);
}
/**
* Returns a range of all the sistemis where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStatus(
java.lang.String status, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus(status, start, end);
}
/**
* Returns an ordered range of all the sistemis where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStatus(
java.lang.String status, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByStatus(status, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStatus_First(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus_First(status, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStatus_First(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStatus_First(status, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStatus_Last(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus_Last(status, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStatus_Last(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStatus_Last(status, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where status = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findByStatus_PrevAndNext(
long sistemaId, java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByStatus_PrevAndNext(sistemaId, status,
orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where status = ?.
*
* @param status the status
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStatus(
java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStatus(status);
}
/**
* Returns a range of all the sistemis that the user has permission to view where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStatus(
java.lang.String status, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStatus(status, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStatus(
java.lang.String status, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStatus(status, start, end, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where status = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindByStatus_PrevAndNext(
long sistemaId, java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStatus_PrevAndNext(sistemaId, status,
orderByComparator);
}
/**
* Returns all the sistemis where store = ?.
*
* @param store the store
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStore(
java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore(store);
}
/**
* Returns a range of all the sistemis where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStore(
java.lang.String store, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore(store, start, end);
}
/**
* Returns an ordered range of all the sistemis where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStore(
java.lang.String store, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore(store, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStore_First(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore_First(store, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStore_First(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStore_First(store, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStore_Last(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore_Last(store, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStore_Last(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStore_Last(store, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where store = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findByStore_PrevAndNext(
long sistemaId, java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByStore_PrevAndNext(sistemaId, store, orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where store = ?.
*
* @param store the store
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStore(
java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStore(store);
}
/**
* Returns a range of all the sistemis that the user has permission to view where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStore(
java.lang.String store, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStore(store, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStore(
java.lang.String store, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStore(store, start, end, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where store = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindByStore_PrevAndNext(
long sistemaId, java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStore_PrevAndNext(sistemaId, store,
orderByComparator);
}
/**
* Returns all the sistemis.
*
* @return the sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findAll()
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findAll();
}
/**
* Returns a range of all the sistemis.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findAll(
int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findAll(start, end);
}
/**
* Returns an ordered range of all the sistemis.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findAll(
int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findAll(start, end, orderByComparator);
}
/**
* Removes all the sistemis where sistema = ? from the database.
*
* @param sistema the sistema
* @throws SystemException if a system exception occurred
*/
public static void removeBySistema(java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeBySistema(sistema);
}
/**
* Removes all the sistemis where descrizione = ? from the database.
*
* @param descrizione the descrizione
* @throws SystemException if a system exception occurred
*/
public static void removeByDescrizione(java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeByDescrizione(descrizione);
}
/**
* Removes all the sistemis where status = ? from the database.
*
* @param status the status
* @throws SystemException if a system exception occurred
*/
public static void removeByStatus(java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeByStatus(status);
}
/**
* Removes all the sistemis where store = ? from the database.
*
* @param store the store
* @throws SystemException if a system exception occurred
*/
public static void removeByStore(java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeByStore(store);
}
/**
* Removes all the sistemis from the database.
*
* @throws SystemException if a system exception occurred
*/
public static void removeAll()
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeAll();
}
/**
* Returns the number of sistemis where sistema = ?.
*
* @param sistema the sistema
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countBySistema(java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countBySistema(sistema);
}
/**
* Returns the number of sistemis that the user has permission to view where sistema = ?.
*
* @param sistema the sistema
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountBySistema(java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountBySistema(sistema);
}
/**
* Returns the number of sistemis where descrizione = ?.
*
* @param descrizione the descrizione
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countByDescrizione(java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countByDescrizione(descrizione);
}
/**
* Returns the number of sistemis that the user has permission to view where descrizione = ?.
*
* @param descrizione the descrizione
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountByDescrizione(java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountByDescrizione(descrizione);
}
/**
* Returns the number of sistemis where status = ?.
*
* @param status the status
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countByStatus(java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countByStatus(status);
}
/**
* Returns the number of sistemis that the user has permission to view where status = ?.
*
* @param status the status
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountByStatus(java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountByStatus(status);
}
/**
* Returns the number of sistemis where store = ?.
*
* @param store the store
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countByStore(java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countByStore(store);
}
/**
* Returns the number of sistemis that the user has permission to view where store = ?.
*
* @param store the store
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountByStore(java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountByStore(store);
}
/**
* Returns the number of sistemis.
*
* @return the number of sistemis
* @throws SystemException if a system exception occurred
*/
public static int countAll()
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countAll();
}
public static SistemiPersistence getPersistence() {
if (_persistence == null) {
_persistence = (SistemiPersistence)PortletBeanLocatorUtil.locate(com.appuntivari.esempio.service.ClpSerializer.getServletContextName(),
SistemiPersistence.class.getName());
ReferenceRegistry.registerReference(SistemiUtil.class,
"_persistence");
}
return _persistence;
}
/**
* @deprecated
*/
public void setPersistence(SistemiPersistence persistence) {
}
private static SistemiPersistence _persistence;
} | UTF-8 | Java | 56,610 | java | SistemiUtil.java | Java | [
{
"context": "ode>portal.properties</code>\n * </p>\n *\n * @author Pasturenzi Francesco\n * @see SistemiPersistence\n * @see SistemiPersist",
"end": 1539,
"score": 0.9998599886894226,
"start": 1519,
"tag": "NAME",
"value": "Pasturenzi Francesco"
}
]
| null | []
| /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.appuntivari.esempio.service.persistence;
import com.appuntivari.esempio.model.Sistemi;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;
import java.util.List;
/**
* The persistence utility for the sistemi service. This utility wraps {@link SistemiPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
*
* <p>
* Caching information and settings can be found in <code>portal.properties</code>
* </p>
*
* @author <NAME>
* @see SistemiPersistence
* @see SistemiPersistenceImpl
* @generated
*/
public class SistemiUtil {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
*/
/**
* @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
*/
public static void clearCache() {
getPersistence().clearCache();
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
*/
public static void clearCache(Sistemi sistemi) {
getPersistence().clearCache(sistemi);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
*/
public long countWithDynamicQuery(DynamicQuery dynamicQuery)
throws SystemException {
return getPersistence().countWithDynamicQuery(dynamicQuery);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
*/
public static List<Sistemi> findWithDynamicQuery(DynamicQuery dynamicQuery)
throws SystemException {
return getPersistence().findWithDynamicQuery(dynamicQuery);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
*/
public static List<Sistemi> findWithDynamicQuery(
DynamicQuery dynamicQuery, int start, int end)
throws SystemException {
return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
*/
public static List<Sistemi> findWithDynamicQuery(
DynamicQuery dynamicQuery, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return getPersistence()
.findWithDynamicQuery(dynamicQuery, start, end,
orderByComparator);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
*/
public static Sistemi update(Sistemi sistemi, boolean merge)
throws SystemException {
return getPersistence().update(sistemi, merge);
}
/**
* @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
*/
public static Sistemi update(Sistemi sistemi, boolean merge,
ServiceContext serviceContext) throws SystemException {
return getPersistence().update(sistemi, merge, serviceContext);
}
/**
* Caches the sistemi in the entity cache if it is enabled.
*
* @param sistemi the sistemi
*/
public static void cacheResult(
com.appuntivari.esempio.model.Sistemi sistemi) {
getPersistence().cacheResult(sistemi);
}
/**
* Caches the sistemis in the entity cache if it is enabled.
*
* @param sistemis the sistemis
*/
public static void cacheResult(
java.util.List<com.appuntivari.esempio.model.Sistemi> sistemis) {
getPersistence().cacheResult(sistemis);
}
/**
* Creates a new sistemi with the primary key. Does not add the sistemi to the database.
*
* @param sistemaId the primary key for the new sistemi
* @return the new sistemi
*/
public static com.appuntivari.esempio.model.Sistemi create(long sistemaId) {
return getPersistence().create(sistemaId);
}
/**
* Removes the sistemi with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param sistemaId the primary key of the sistemi
* @return the sistemi that was removed
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi remove(long sistemaId)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().remove(sistemaId);
}
public static com.appuntivari.esempio.model.Sistemi updateImpl(
com.appuntivari.esempio.model.Sistemi sistemi, boolean merge)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().updateImpl(sistemi, merge);
}
/**
* Returns the sistemi with the primary key or throws a {@link com.appuntivari.esempio.NoSuchSistemiException} if it could not be found.
*
* @param sistemaId the primary key of the sistemi
* @return the sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByPrimaryKey(
long sistemaId)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByPrimaryKey(sistemaId);
}
/**
* Returns the sistemi with the primary key or returns <code>null</code> if it could not be found.
*
* @param sistemaId the primary key of the sistemi
* @return the sistemi, or <code>null</code> if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByPrimaryKey(
long sistemaId)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByPrimaryKey(sistemaId);
}
/**
* Returns all the sistemis where sistema = ?.
*
* @param sistema the sistema
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findBySistema(
java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema(sistema);
}
/**
* Returns a range of all the sistemis where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findBySistema(
java.lang.String sistema, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema(sistema, start, end);
}
/**
* Returns an ordered range of all the sistemis where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findBySistema(
java.lang.String sistema, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findBySistema(sistema, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findBySistema_First(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema_First(sistema, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchBySistema_First(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchBySistema_First(sistema, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findBySistema_Last(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findBySistema_Last(sistema, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where sistema = ?.
*
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchBySistema_Last(
java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchBySistema_Last(sistema, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where sistema = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findBySistema_PrevAndNext(
long sistemaId, java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findBySistema_PrevAndNext(sistemaId, sistema,
orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where sistema = ?.
*
* @param sistema the sistema
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindBySistema(
java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindBySistema(sistema);
}
/**
* Returns a range of all the sistemis that the user has permission to view where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindBySistema(
java.lang.String sistema, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindBySistema(sistema, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where sistema = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param sistema the sistema
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindBySistema(
java.lang.String sistema, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindBySistema(sistema, start, end, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where sistema = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param sistema the sistema
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindBySistema_PrevAndNext(
long sistemaId, java.lang.String sistema,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindBySistema_PrevAndNext(sistemaId, sistema,
orderByComparator);
}
/**
* Returns all the sistemis where descrizione = ?.
*
* @param descrizione the descrizione
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByDescrizione(
java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByDescrizione(descrizione);
}
/**
* Returns a range of all the sistemis where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByDescrizione(
java.lang.String descrizione, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByDescrizione(descrizione, start, end);
}
/**
* Returns an ordered range of all the sistemis where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByDescrizione(
java.lang.String descrizione, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione(descrizione, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByDescrizione_First(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione_First(descrizione, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByDescrizione_First(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.fetchByDescrizione_First(descrizione, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByDescrizione_Last(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione_Last(descrizione, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where descrizione = ?.
*
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByDescrizione_Last(
java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.fetchByDescrizione_Last(descrizione, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where descrizione = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findByDescrizione_PrevAndNext(
long sistemaId, java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByDescrizione_PrevAndNext(sistemaId, descrizione,
orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where descrizione = ?.
*
* @param descrizione the descrizione
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByDescrizione(
java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByDescrizione(descrizione);
}
/**
* Returns a range of all the sistemis that the user has permission to view where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByDescrizione(
java.lang.String descrizione, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByDescrizione(descrizione, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where descrizione = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param descrizione the descrizione
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByDescrizione(
java.lang.String descrizione, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByDescrizione(descrizione, start, end,
orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where descrizione = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param descrizione the descrizione
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindByDescrizione_PrevAndNext(
long sistemaId, java.lang.String descrizione,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByDescrizione_PrevAndNext(sistemaId, descrizione,
orderByComparator);
}
/**
* Returns all the sistemis where status = ?.
*
* @param status the status
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStatus(
java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus(status);
}
/**
* Returns a range of all the sistemis where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStatus(
java.lang.String status, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus(status, start, end);
}
/**
* Returns an ordered range of all the sistemis where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStatus(
java.lang.String status, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByStatus(status, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStatus_First(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus_First(status, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStatus_First(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStatus_First(status, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStatus_Last(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStatus_Last(status, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where status = ?.
*
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStatus_Last(
java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStatus_Last(status, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where status = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findByStatus_PrevAndNext(
long sistemaId, java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByStatus_PrevAndNext(sistemaId, status,
orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where status = ?.
*
* @param status the status
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStatus(
java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStatus(status);
}
/**
* Returns a range of all the sistemis that the user has permission to view where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStatus(
java.lang.String status, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStatus(status, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where status = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param status the status
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStatus(
java.lang.String status, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStatus(status, start, end, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where status = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param status the status
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindByStatus_PrevAndNext(
long sistemaId, java.lang.String status,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStatus_PrevAndNext(sistemaId, status,
orderByComparator);
}
/**
* Returns all the sistemis where store = ?.
*
* @param store the store
* @return the matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStore(
java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore(store);
}
/**
* Returns a range of all the sistemis where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStore(
java.lang.String store, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore(store, start, end);
}
/**
* Returns an ordered range of all the sistemis where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findByStore(
java.lang.String store, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore(store, start, end, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStore_First(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore_First(store, orderByComparator);
}
/**
* Returns the first sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStore_First(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStore_First(store, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi findByStore_Last(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findByStore_Last(store, orderByComparator);
}
/**
* Returns the last sistemi in the ordered set where store = ?.
*
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching sistemi, or <code>null</code> if a matching sistemi could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi fetchByStore_Last(
java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().fetchByStore_Last(store, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set where store = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] findByStore_PrevAndNext(
long sistemaId, java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.findByStore_PrevAndNext(sistemaId, store, orderByComparator);
}
/**
* Returns all the sistemis that the user has permission to view where store = ?.
*
* @param store the store
* @return the matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStore(
java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStore(store);
}
/**
* Returns a range of all the sistemis that the user has permission to view where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStore(
java.lang.String store, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterFindByStore(store, start, end);
}
/**
* Returns an ordered range of all the sistemis that the user has permissions to view where store = ?.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param store the store
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> filterFindByStore(
java.lang.String store, int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStore(store, start, end, orderByComparator);
}
/**
* Returns the sistemis before and after the current sistemi in the ordered set of sistemis that the user has permission to view where store = ?.
*
* @param sistemaId the primary key of the current sistemi
* @param store the store
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next sistemi
* @throws com.appuntivari.esempio.NoSuchSistemiException if a sistemi with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public static com.appuntivari.esempio.model.Sistemi[] filterFindByStore_PrevAndNext(
long sistemaId, java.lang.String store,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.appuntivari.esempio.NoSuchSistemiException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence()
.filterFindByStore_PrevAndNext(sistemaId, store,
orderByComparator);
}
/**
* Returns all the sistemis.
*
* @return the sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findAll()
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findAll();
}
/**
* Returns a range of all the sistemis.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @return the range of sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findAll(
int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findAll(start, end);
}
/**
* Returns an ordered range of all the sistemis.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param start the lower bound of the range of sistemis
* @param end the upper bound of the range of sistemis (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of sistemis
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.appuntivari.esempio.model.Sistemi> findAll(
int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findAll(start, end, orderByComparator);
}
/**
* Removes all the sistemis where sistema = ? from the database.
*
* @param sistema the sistema
* @throws SystemException if a system exception occurred
*/
public static void removeBySistema(java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeBySistema(sistema);
}
/**
* Removes all the sistemis where descrizione = ? from the database.
*
* @param descrizione the descrizione
* @throws SystemException if a system exception occurred
*/
public static void removeByDescrizione(java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeByDescrizione(descrizione);
}
/**
* Removes all the sistemis where status = ? from the database.
*
* @param status the status
* @throws SystemException if a system exception occurred
*/
public static void removeByStatus(java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeByStatus(status);
}
/**
* Removes all the sistemis where store = ? from the database.
*
* @param store the store
* @throws SystemException if a system exception occurred
*/
public static void removeByStore(java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeByStore(store);
}
/**
* Removes all the sistemis from the database.
*
* @throws SystemException if a system exception occurred
*/
public static void removeAll()
throws com.liferay.portal.kernel.exception.SystemException {
getPersistence().removeAll();
}
/**
* Returns the number of sistemis where sistema = ?.
*
* @param sistema the sistema
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countBySistema(java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countBySistema(sistema);
}
/**
* Returns the number of sistemis that the user has permission to view where sistema = ?.
*
* @param sistema the sistema
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountBySistema(java.lang.String sistema)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountBySistema(sistema);
}
/**
* Returns the number of sistemis where descrizione = ?.
*
* @param descrizione the descrizione
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countByDescrizione(java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countByDescrizione(descrizione);
}
/**
* Returns the number of sistemis that the user has permission to view where descrizione = ?.
*
* @param descrizione the descrizione
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountByDescrizione(java.lang.String descrizione)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountByDescrizione(descrizione);
}
/**
* Returns the number of sistemis where status = ?.
*
* @param status the status
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countByStatus(java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countByStatus(status);
}
/**
* Returns the number of sistemis that the user has permission to view where status = ?.
*
* @param status the status
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountByStatus(java.lang.String status)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountByStatus(status);
}
/**
* Returns the number of sistemis where store = ?.
*
* @param store the store
* @return the number of matching sistemis
* @throws SystemException if a system exception occurred
*/
public static int countByStore(java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countByStore(store);
}
/**
* Returns the number of sistemis that the user has permission to view where store = ?.
*
* @param store the store
* @return the number of matching sistemis that the user has permission to view
* @throws SystemException if a system exception occurred
*/
public static int filterCountByStore(java.lang.String store)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().filterCountByStore(store);
}
/**
* Returns the number of sistemis.
*
* @return the number of sistemis
* @throws SystemException if a system exception occurred
*/
public static int countAll()
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countAll();
}
public static SistemiPersistence getPersistence() {
if (_persistence == null) {
_persistence = (SistemiPersistence)PortletBeanLocatorUtil.locate(com.appuntivari.esempio.service.ClpSerializer.getServletContextName(),
SistemiPersistence.class.getName());
ReferenceRegistry.registerReference(SistemiUtil.class,
"_persistence");
}
return _persistence;
}
/**
* @deprecated
*/
public void setPersistence(SistemiPersistence persistence) {
}
private static SistemiPersistence _persistence;
} | 56,596 | 0.763346 | 0.760731 | 1,271 | 43.54052 | 54.56168 | 398 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.524784 | false | false | 9 |
cccff07333ce7337edbdda3b5ffd1cd94ae19f7a | 30,743,375,905,081 | 032147c1607b11c367bfb3248261ada849efec94 | /app/src/main/java/partridge/nathan/movienight/tmdb_service/OnReqCompletedHandler.java | a0dee095d69af62e2688033289a622ef489fdcab | []
| no_license | nathanpart/MovieNight | https://github.com/nathanpart/MovieNight | d0bf26c9821e517d8880220cd7a3ca49cb2e6cb9 | 4fe219ef6331913ed3908637e413fe04dbe9e48d | refs/heads/master | 2021-01-25T15:04:19.712000 | 2018-03-17T19:44:50 | 2018-03-17T19:44:50 | 123,745,490 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package partridge.nathan.movienight.tmdb_service;
import android.os.Bundle;
public interface OnReqCompletedHandler {
// Callback result codes
int BINDED = 1;
int MOVIE_LIST = 2;
int TV_LIST = 3;
int MOVIE_GENRES = 4;
int TV_GENRES = 5;
int GENRE_NET_ERROR = 6;
int NETWORK_ERROR = 7;
// Callback results bundle field keys
String ERROR_MSG = "error_msg";
String GENRE_LIST = "genre_list";
String LIST_INFO = "list_info";
String SHOW_LIST = "show_list";
void OnReqCompleted(int resultCode, Bundle results);
}
| UTF-8 | Java | 569 | java | OnReqCompletedHandler.java | Java | []
| null | []
| package partridge.nathan.movienight.tmdb_service;
import android.os.Bundle;
public interface OnReqCompletedHandler {
// Callback result codes
int BINDED = 1;
int MOVIE_LIST = 2;
int TV_LIST = 3;
int MOVIE_GENRES = 4;
int TV_GENRES = 5;
int GENRE_NET_ERROR = 6;
int NETWORK_ERROR = 7;
// Callback results bundle field keys
String ERROR_MSG = "error_msg";
String GENRE_LIST = "genre_list";
String LIST_INFO = "list_info";
String SHOW_LIST = "show_list";
void OnReqCompleted(int resultCode, Bundle results);
}
| 569 | 0.660808 | 0.648506 | 24 | 22.708334 | 16.776669 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.625 | false | false | 9 |
5c3dd395fa543765096e25e7d6e52bc74d0c604a | 3,513,283,288,275 | 712dcc1bd0ecf0087541579aef5306f2d1e4ed07 | /d27/Class1.java | 70c0b9a76252d907ae8988b914ef7e1732a9752b | []
| no_license | Renxinjiang/practice | https://github.com/Renxinjiang/practice | 7755438d5988a8101df31363d772d744e7b6a1b9 | 47c754c609f3e97111e75d3771f64e01f0eae08e | refs/heads/master | 2020-09-05T07:44:31.183000 | 2020-03-07T15:48:12 | 2020-03-07T15:48:12 | 220,030,256 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package d27;
import java.util.Arrays;
import java.util.Scanner;
/**
* @PackageName: d27
* @ClassName: Class1
* @Description:
* @author: 呆呆
* @date: 2020/3/4
*/
public class Class1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] array = new int[n];
for (int i = 0;i < n;i++){
array[i] = sc.nextInt();
}
int x = sc.nextInt();
System.out.println(select(array,x));
}
private static int select(int[] array, int x) {
for (int i = 0;i < array.length;i++){
if (x == array[i]){
return i;
}
}
return -1;
}
}
| UTF-8 | Java | 720 | java | Class1.java | Java | [
{
"context": "* @ClassName: Class1\n * @Description:\n * @author: 呆呆\n * @date: 2020/3/4\n */\npublic class Class1 {\n ",
"end": 144,
"score": 0.8393505811691284,
"start": 142,
"tag": "NAME",
"value": "呆呆"
}
]
| null | []
| package d27;
import java.util.Arrays;
import java.util.Scanner;
/**
* @PackageName: d27
* @ClassName: Class1
* @Description:
* @author: 呆呆
* @date: 2020/3/4
*/
public class Class1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] array = new int[n];
for (int i = 0;i < n;i++){
array[i] = sc.nextInt();
}
int x = sc.nextInt();
System.out.println(select(array,x));
}
private static int select(int[] array, int x) {
for (int i = 0;i < array.length;i++){
if (x == array[i]){
return i;
}
}
return -1;
}
}
| 720 | 0.497207 | 0.476257 | 34 | 20.058823 | 15.039049 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 9 |
7bfcf68114ba7cc9918812c4b64f45f43cfadea3 | 429,496,798,387 | e65416a279eb6708c23096432d3f7caabca2f805 | /src/com/lkoa/activity/CenterMsgBaseActivity.java | 9cdbda54f0dedcfc515eaef5bde25892863117df | []
| no_license | suntinghui/LKOA4Android_Desea | https://github.com/suntinghui/LKOA4Android_Desea | 20c33cb47dba5c74945eacdb35de4547f3eaff71 | 8741b8adf847268af9488f03b40d78edd97c9de8 | refs/heads/master | 2021-01-02T08:21:29.367000 | 2014-07-03T03:35:37 | 2014-07-03T03:35:37 | 17,163,995 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lkoa.activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.lkoa.R;
import com.lkoa.business.AttachmentManager;
import com.lkoa.client.ApplicationEnvironment;
import com.lkoa.client.DownloadFileRequest;
import com.lkoa.client.LKAsyncHttpResponseHandler;
import com.lkoa.util.LogUtil;
public class CenterMsgBaseActivity extends BaseActivity{
protected ImageView mIvBack;
protected TextView mTvTitle;
protected ImageView mIvRight;
protected TextView mTvBack;
protected LinearLayout mLinearRight;
protected TextView mTvRight1, mTvRight2;
protected LayoutInflater mLayoutInflater;
protected AttachmentManager mAttachmentMgr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLayoutInflater = LayoutInflater.from(this);
mAttachmentMgr = new AttachmentManager();
}
private OnClickListener mBackOnClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
};
protected void findViews() {
mIvBack = (ImageView) findViewById(R.id.iv_back);
mTvTitle = (TextView) findViewById(R.id.tv_title);
mIvRight = (ImageView) findViewById(R.id.iv_right);
mLinearRight = (LinearLayout) findViewById(R.id.linear_right);
mTvRight1 = (TextView) findViewById(R.id.tv_right_1);
mTvRight2 = (TextView) findViewById(R.id.tv_right_2);
mTvBack = (TextView)findViewById(R.id.tv_back);
}
protected void setupViews() {
mIvBack.setOnClickListener(mBackOnClickListener);
mTvBack.setOnClickListener(mBackOnClickListener);
mIvRight.setVisibility(View.GONE);
mLinearRight.setVisibility(View.GONE);
}
private LKAsyncHttpResponseHandler getAttachmentResponseHandler(final String fileName) {
return new LKAsyncHttpResponseHandler() {
@Override
public void successAction(Object obj) {
if(obj == null) return;
String fileUrl = mAttachmentMgr.getUrl((String)obj);
DownloadFileRequest.sharedInstance().downloadAndOpen(
CenterMsgBaseActivity.this, fileUrl, fileName);
}
};
}
protected void loadAttachment(String fileName, String attId) {
mAttachmentMgr.getAtt(attId, getAttachmentResponseHandler(fileName));
}
}
| UTF-8 | Java | 2,456 | java | CenterMsgBaseActivity.java | Java | []
| null | []
| package com.lkoa.activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.lkoa.R;
import com.lkoa.business.AttachmentManager;
import com.lkoa.client.ApplicationEnvironment;
import com.lkoa.client.DownloadFileRequest;
import com.lkoa.client.LKAsyncHttpResponseHandler;
import com.lkoa.util.LogUtil;
public class CenterMsgBaseActivity extends BaseActivity{
protected ImageView mIvBack;
protected TextView mTvTitle;
protected ImageView mIvRight;
protected TextView mTvBack;
protected LinearLayout mLinearRight;
protected TextView mTvRight1, mTvRight2;
protected LayoutInflater mLayoutInflater;
protected AttachmentManager mAttachmentMgr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLayoutInflater = LayoutInflater.from(this);
mAttachmentMgr = new AttachmentManager();
}
private OnClickListener mBackOnClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
};
protected void findViews() {
mIvBack = (ImageView) findViewById(R.id.iv_back);
mTvTitle = (TextView) findViewById(R.id.tv_title);
mIvRight = (ImageView) findViewById(R.id.iv_right);
mLinearRight = (LinearLayout) findViewById(R.id.linear_right);
mTvRight1 = (TextView) findViewById(R.id.tv_right_1);
mTvRight2 = (TextView) findViewById(R.id.tv_right_2);
mTvBack = (TextView)findViewById(R.id.tv_back);
}
protected void setupViews() {
mIvBack.setOnClickListener(mBackOnClickListener);
mTvBack.setOnClickListener(mBackOnClickListener);
mIvRight.setVisibility(View.GONE);
mLinearRight.setVisibility(View.GONE);
}
private LKAsyncHttpResponseHandler getAttachmentResponseHandler(final String fileName) {
return new LKAsyncHttpResponseHandler() {
@Override
public void successAction(Object obj) {
if(obj == null) return;
String fileUrl = mAttachmentMgr.getUrl((String)obj);
DownloadFileRequest.sharedInstance().downloadAndOpen(
CenterMsgBaseActivity.this, fileUrl, fileName);
}
};
}
protected void loadAttachment(String fileName, String attId) {
mAttachmentMgr.getAtt(attId, getAttachmentResponseHandler(fileName));
}
}
| 2,456 | 0.755293 | 0.75285 | 79 | 29.088608 | 22.402639 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.949367 | false | false | 9 |
e99080b01c5b3c2f7ea1da6dc6a22984bd606e6e | 17,918,603,591,381 | b44479ca3ff1f0bc630695bc2ace2105fd56c36b | /annotation/src/main/java/org/demon/dao/BookDao.java | e78f0d4da29915fe948bb1799ad29a74b36a2703 | []
| no_license | qj118/mybatis_demo | https://github.com/qj118/mybatis_demo | 02e34fcb800096cdaa2ca9e4ad5849bf5bb1d3d9 | 5af9740a5c894bd1b8a84af561bcfbd1f71a0a7a | refs/heads/master | 2022-12-14T21:24:34.815000 | 2020-09-16T06:18:21 | 2020-09-16T06:18:21 | 289,183,612 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.demon.dao;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.demon.domain.Book;
import java.util.List;
public interface BookDao {
/**
* @Results 用于封装结果
* id 给结果集一个标识
* value 由 @Result 组成的集合
* @Result 指定数据库字段与实体类属性的对应关系
* id 布尔类型,用于标识该属性是否是主键
* column 数据库字段或查询语句中的别名
* property 实体类属性名
*/
@Select("select * from t_book;")
@Results(id = "bookMap",
value = {
@Result(id = true, column = "id", property = "bookId"),
@Result(column = "name", property = "bookName"),
@Result(column = "author", property = "bookAuthor")
})
List<Book> findAll();
/**
* @ResultMap 用于指定已有的结果封装
* value 由结果封装 id 组成的数组
*/
@Select("select * from t_book where id = #{bId};")
@ResultMap(value = {"bookMap"})
Book findById(int id);
}
| UTF-8 | Java | 1,244 | java | BookDao.java | Java | []
| null | []
| package org.demon.dao;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.demon.domain.Book;
import java.util.List;
public interface BookDao {
/**
* @Results 用于封装结果
* id 给结果集一个标识
* value 由 @Result 组成的集合
* @Result 指定数据库字段与实体类属性的对应关系
* id 布尔类型,用于标识该属性是否是主键
* column 数据库字段或查询语句中的别名
* property 实体类属性名
*/
@Select("select * from t_book;")
@Results(id = "bookMap",
value = {
@Result(id = true, column = "id", property = "bookId"),
@Result(column = "name", property = "bookName"),
@Result(column = "author", property = "bookAuthor")
})
List<Book> findAll();
/**
* @ResultMap 用于指定已有的结果封装
* value 由结果封装 id 组成的数组
*/
@Select("select * from t_book where id = #{bId};")
@ResultMap(value = {"bookMap"})
Book findById(int id);
}
| 1,244 | 0.588403 | 0.588403 | 38 | 26.68421 | 18.817833 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.473684 | false | false | 9 |
3245a609b884ba304dbaac3133164c091c6521f8 | 35,347,580,847,754 | 8747a5c851eaf4f491cbd53b1057ba0f291b444f | /sfge/src/main/java/com/salesforce/graph/vertex/NullAccessCheckedVertex.java | eb42a60fe1e2d757d93db8d0c714b194c3e9ca67 | [
"MIT",
"Apache-2.0"
]
| permissive | forcedotcom/sfdx-scanner | https://github.com/forcedotcom/sfdx-scanner | bce241ab81db6bf5fc4319bb746faa8519a869c0 | 517bfd4a57169f6d89ee72f84fc170400245ffc8 | refs/heads/dev | 2023-08-16T18:43:53.956000 | 2023-08-16T15:15:47 | 2023-08-16T15:15:47 | 233,711,751 | 174 | 49 | MIT | false | 2023-09-11T20:37:00 | 2020-01-13T23:03:11 | 2023-09-05T16:44:31 | 2023-09-11T20:36:58 | 48,615 | 181 | 45 | 59 | HTML | false | false | package com.salesforce.graph.vertex;
/**
* Interface to mark vertices that can have null-access check performed on them. At some point in
* the analysis, they can have {@link com.salesforce.graph.ops.expander.NullValueAccessedException}
* thrown if the value is known to be null. These null access checks are surfaced through {@link
* com.salesforce.rules.ApexNullPointerExceptionRule}.
*/
public interface NullAccessCheckedVertex {
/**
* @return Display name to use while sharing information if vertex is affected by null-access.
*/
String getDisplayName();
/**
* @return Id to represent the vertex in a collection.
*/
Long getId();
}
| UTF-8 | Java | 679 | java | NullAccessCheckedVertex.java | Java | []
| null | []
| package com.salesforce.graph.vertex;
/**
* Interface to mark vertices that can have null-access check performed on them. At some point in
* the analysis, they can have {@link com.salesforce.graph.ops.expander.NullValueAccessedException}
* thrown if the value is known to be null. These null access checks are surfaced through {@link
* com.salesforce.rules.ApexNullPointerExceptionRule}.
*/
public interface NullAccessCheckedVertex {
/**
* @return Display name to use while sharing information if vertex is affected by null-access.
*/
String getDisplayName();
/**
* @return Id to represent the vertex in a collection.
*/
Long getId();
}
| 679 | 0.724595 | 0.724595 | 19 | 34.736843 | 36.800804 | 99 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.210526 | false | false | 9 |
8e998d53237bc5dd82ab21ffcccb4ad8831c2e21 | 16,716,012,781,282 | 9dcfb05c25e00f45e8ffef6b0bfb7e265e14b4e2 | /src/main/java/com/countmeup/domain/repository/InMemoryVoterRepository.java | f9eb768743f6f8eba4873e9b6e9a828998e6a0d0 | []
| no_license | pbartoszek/countmeup | https://github.com/pbartoszek/countmeup | 734a2e8fb8652a3cf40f723b09add874337f9de2 | c8fa0a853f0bd65ae6090e23d908ff8ae53acbb5 | refs/heads/master | 2020-12-30T14:13:48.065000 | 2017-05-13T22:29:26 | 2017-05-13T22:29:26 | 91,298,693 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.countmeup.domain.repository;
import com.countmeup.domain.Voter;
import com.countmeup.domain.VoterRepository;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
@Component
public class InMemoryVoterRepository implements VoterRepository {
private Map<String, Voter> voters = new ConcurrentHashMap<>(1000);
@Override
public Optional<Voter> byName(String name) {
Voter voter = voters.get(name);
if (voter == null) {
//put if absent used to eliminate race conditions
voters.putIfAbsent(name, new Voter(name));
return Optional.of(voters.get(name));
}
return Optional.of(voter);
}
}
| UTF-8 | Java | 771 | java | InMemoryVoterRepository.java | Java | []
| null | []
| package com.countmeup.domain.repository;
import com.countmeup.domain.Voter;
import com.countmeup.domain.VoterRepository;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
@Component
public class InMemoryVoterRepository implements VoterRepository {
private Map<String, Voter> voters = new ConcurrentHashMap<>(1000);
@Override
public Optional<Voter> byName(String name) {
Voter voter = voters.get(name);
if (voter == null) {
//put if absent used to eliminate race conditions
voters.putIfAbsent(name, new Voter(name));
return Optional.of(voters.get(name));
}
return Optional.of(voter);
}
}
| 771 | 0.706874 | 0.701686 | 26 | 28.653847 | 22.519978 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.538462 | false | false | 9 |
f7c2ce93b042976b4d755e063c2a20add5fcff1f | 29,291,676,999,920 | 97e7efa0599aa88cb07a714d882826dc109a6797 | /tst/storageContract/controller/ConsoleReaderTest.java | e728e46548c42c14417c325c0cbce1ddcaf0ed86 | []
| no_license | AndreasScharnetzki/CargoManagementSystem | https://github.com/AndreasScharnetzki/CargoManagementSystem | d28dbbd6ac155a1c098f0ad569d6d5fe01891f40 | 2738de9162bf3360ccb4b125ad14c644fdf7b065 | refs/heads/main | 2023-01-25T02:13:22.429000 | 2020-11-30T16:57:57 | 2020-11-30T16:57:57 | 317,273,583 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package storageContract.controller;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import storageContract.administration.CustomerImpl;
import storageContract.cargo.Hazard;
import storageContract.cargo.LiquidBulkCargoImpl;
import storageContract.controller.listener.*;
import storageContract.controller.observer.CapacityObserver;
import storageContract.controller.observer.HazardObserver;
import storageContract.logic.BusinessLogicImpl;
import java.io.*;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.HashSet;
import static org.junit.jupiter.api.Assertions.*;
import static storageContract.controller.CommandListAndMessages.MSG_listOfCommands;
/************************************************************************************************************************
* *
* All tests have differences only in line separators - depending on your IDE settings tests might not pass! *
* *
************************************************************************************************************************/
class ConsoleReaderTest {
private ConsoleReader cli;
private BusinessLogicImpl bl;
private ControlModel controlModel;
private LiquidBulkCargoImpl sampleCargo = new LiquidBulkCargoImpl(new CustomerImpl("Jim"), BigDecimal.ONE, Duration.ofSeconds(1), new HashSet<Hazard>(), true);
private final PrintStream standardOut = System.out;
private final InputStream standardIn = System.in;
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
private final String successfullInit =
"\u001B[0;32m✔\u001B[0m: Successfully attached new CapacityObserver\n" +
"\u001B[0;32m✔\u001B[0m: Successfully attached new HazardObserver\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n"+ System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator();
private final String backToMainMenu =
System.lineSeparator()+
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:" +
System.lineSeparator()+
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+"> ";
//src: https://www.baeldung.com/java-testing-system-out-println
@BeforeEach
public void setUp() {
System.setOut(new PrintStream(outputStreamCaptor));
bl = new BusinessLogicImpl(10);
controlModel = new ControlModel(bl);
CapacityObserver capacityObserver = new CapacityObserver(bl);
HazardObserver hazardObserver = new HazardObserver(bl);
bl.attach(capacityObserver);
bl.attach(hazardObserver);
EventListener lExit = new Listener_Exit();
EventListener lInsertNewCustomer = new Listener_InsertNewCustomer(controlModel);
EventListener lInsertNewCargo = new Listener_InsertNewCargo(controlModel);
EventListener lDeleteCargoAtPosition = new Listener_DeleteCargoAtPosition(controlModel);
EventListener lDeleteCustomerWithName = new Listener_DeleteCustomerWithName(controlModel);
EventListener lAttachObserver = new Listener_AttachObserver(controlModel);
EventListener lDetachObserver = new Listener_DetachObserver(controlModel);
EventListener lUpdateCargo = new Listener_UpdateCargo(controlModel);
EventListener lDisplayCustomer = new Listener_DisplayCustomer(controlModel);
EventListener lDisplayCargo = new Listener_DisplayCargo(controlModel);
EventListener lDisplayHazard = new Listener_DisplayHazard(controlModel);
EventListener lHandlePersistence = new Listener_HandlePersistence(controlModel);
EventListener lHandleCargoPersistence = new Listener_HandleCargoPersistence(controlModel);
cli = new ConsoleReader(
lExit,
lInsertNewCustomer,
lInsertNewCargo,
lDeleteCargoAtPosition,
lDeleteCustomerWithName,
lAttachObserver,
lDetachObserver,
lUpdateCargo,
lDisplayCustomer,
lDisplayCargo,
lDisplayHazard,
lHandlePersistence,
lHandleCargoPersistence
);
}
@AfterEach
public void tearDown() {
System.setIn(standardIn);
System.setOut(standardOut);
outputStreamCaptor.reset();
try {
Files.deleteIfExists(Paths.get("saveJOS.txt"));
Files.deleteIfExists(Paths.get("singleSerialisedCargo.txt"));
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
void getMode() {assertEquals(Mode.menu, cli.getMode());}
//MODE SWITCHES ====================================================================================================
@Test
void getMode_enter_insert_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("c\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mcreate\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"What would you like to insert \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \u001B[31m✖\u001B[0m: invalid input, returning to main menu." +
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_deletion_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("d\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mdelete\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"What would you like to delete \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \u001B[31m✖\u001B[0m: invalid input, returning to main menu." +
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_display_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("r\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please specify what you would like to display:\n" +
"> \u001B[31m✖\u001B[0m: Invalid Input, returning to Main Menu."+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_update_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("u\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mupdate\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please specify which cargo should be updated by entering the storage position:\n" +
"> \u001B[31m✖\u001B[0m: Invalid Format, please refer to natural numbers only - returning to main menu.\n" +
"\u001B[31m✖\u001B[0m: The position you typed in is out of range, returning to main menu"+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_persistence_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("p\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mpersistence\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please specify if you'd like to either <saveJOS>, <loadJOS>, <<save> <CargoPositionToBeSaved>> or <<load> <CargoPositionToBeSaved>>\n" +
"> \u001B[31m✖\u001B[0m: Unable to parse input - returning to main menu."+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_config_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("config\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mconfiguration\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please refer to the following syntax: <<add/remove> <name_of_the_observer>>\n" +
"> \u001B[31m✖\u001B[0m: Missing argument (ObserverName), returning to Main Menu."+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void start() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
String newLine = System.lineSeparator();
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream((newLine).getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> "
, outputStreamCaptor.toString());
}
//complex event chain testing
@Test
void complexEventChain() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream((
"c\n" + //change from menu to create mode
"cu\n" + //confirm choice on inserting new customer
"Jenny\n" + //entering new customers name
"c\n" + //change from menu to create mode
"ca\n" + //confirm choice on inserting new cargo
"UnitisedCargo Jenny 3345.3 360 n\n" + //passing cargo parameters
"r\n" + //change from main menu to display mode
"customer\n" + //confirm choice on displaying customers and number of associated cargo
"r\n" + //change from main menu to display mode
"cargo\n" + //confirm choice on displaying all cargo currently stored at storehouse
"r\n" + //change from main menu to display mode
"hazard e\n" + //confirm choice on displaying all hazards that are currently not contained in storehouse
"d\n" + //change to deletion mode
"cu\n" + //confirm choice on deleting a customer
"Jenny\n" + //entering customers name to be deleted
"y\n" //confirm choice on cascading deletion
).getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mcreate\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"What would you like to insert \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n"+
"> \n" +
"Please enter customer name: \n" +
">\u001B[0;32m✔\u001B[0m: new customer \u001B[0;32mJenny\u001B[0m was added to database added\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mcreate\u001B[0m\n" +
"\n" +
"What would you like to insert \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \n" +
"For adding a Cargo please follow this syntax:\n" +
"\u001B[0;32m[CargoType] [CustomerName] [Value] [DurationOfStorageInSeconds] [CommaSeparatedHazards*] [CargoIsFragile(y/n)|CargoIsPressurized(y/n)]\u001B[0m\n" +
"\n" +
"*Please note that in case multiple hazards shall be stored the listing must\u001B[31m not \u001B[0mcontain any whitespaces\n" +
"> \u001B[31m✖\u001B[0m: Not enough arguments - returning to main menu.\n" +
"\u001B[31m✖\u001B[0m: Invalid argument(s) - returning to main menu.\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m\n" +
"\n" +
"Please specify what you would like to display:\n" +
"> CustomerName | Number of associated Cargo\n" +
"\n" +
"Jenny | 0\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m\n" +
"\n" +
"Please specify what you would like to display:\n" +
"> (No Filter identified - if you intended to do so, please refer to either [liquidbulk, mixed, unitised])\n" +
"\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m\n" +
"\n" +
"Please specify what you would like to display:\n" +
"> The storehouse currently doesn't holds cargo labeled as:\n" +
"\n" +
"[explosive, flammable, toxic, radioactive]\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mdelete\u001B[0m\n" +
"\n" +
"What would you like to delete \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \n" +
"Please enter customer name: \n" +
">Please be aware that this operation will also delete all Cargo associated with that name. Do you wish to proceed? \u001B[0;32m[y]\u001B[0m/\u001B[0;32m[n]\u001B[0m ?\n" +
"\u001B[0;32m✔\u001B[0m: Customer with name \u001B[0;32mJenny\u001B[0m was successfully removed from Database."+
backToMainMenu
, outputStreamCaptor.toString());
}
} | UTF-8 | Java | 18,949 | java | ConsoleReaderTest.java | Java | [
{
"context": "Cargo = new LiquidBulkCargoImpl(new CustomerImpl(\"Jim\"), BigDecimal.ONE, Duration.ofSeconds(1), new Has",
"end": 1633,
"score": 0.9997472763061523,
"start": 1630,
"tag": "NAME",
"value": "Jim"
},
{
"context": " inserting new customer\n \"Jenny\\n\" + //entering new custo",
"end": 12183,
"score": 0.7400957345962524,
"start": 12179,
"tag": "NAME",
"value": "enny"
},
{
"context": "e on deleting a customer\n \"Jenny\\n\" + //entering c",
"end": 13526,
"score": 0.9577445983886719,
"start": 13521,
"tag": "NAME",
"value": "Jenny"
},
{
"context": " \"\\n\" +\n \"Jenny | 0\\n\" +\n \"Cur",
"end": 16352,
"score": 0.9996830821037292,
"start": 16347,
"tag": "NAME",
"value": "Jenny"
},
{
"context": "[0;32m✔\\u001B[0m: Customer with name \\u001B[0;32mJenny\\u001B[0m was successfully removed from Database.\"",
"end": 18749,
"score": 0.8534862995147705,
"start": 18745,
"tag": "NAME",
"value": "enny"
}
]
| null | []
| package storageContract.controller;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import storageContract.administration.CustomerImpl;
import storageContract.cargo.Hazard;
import storageContract.cargo.LiquidBulkCargoImpl;
import storageContract.controller.listener.*;
import storageContract.controller.observer.CapacityObserver;
import storageContract.controller.observer.HazardObserver;
import storageContract.logic.BusinessLogicImpl;
import java.io.*;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.HashSet;
import static org.junit.jupiter.api.Assertions.*;
import static storageContract.controller.CommandListAndMessages.MSG_listOfCommands;
/************************************************************************************************************************
* *
* All tests have differences only in line separators - depending on your IDE settings tests might not pass! *
* *
************************************************************************************************************************/
class ConsoleReaderTest {
private ConsoleReader cli;
private BusinessLogicImpl bl;
private ControlModel controlModel;
private LiquidBulkCargoImpl sampleCargo = new LiquidBulkCargoImpl(new CustomerImpl("Jim"), BigDecimal.ONE, Duration.ofSeconds(1), new HashSet<Hazard>(), true);
private final PrintStream standardOut = System.out;
private final InputStream standardIn = System.in;
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
private final String successfullInit =
"\u001B[0;32m✔\u001B[0m: Successfully attached new CapacityObserver\n" +
"\u001B[0;32m✔\u001B[0m: Successfully attached new HazardObserver\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n"+ System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator();
private final String backToMainMenu =
System.lineSeparator()+
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:" +
System.lineSeparator()+
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+"> ";
//src: https://www.baeldung.com/java-testing-system-out-println
@BeforeEach
public void setUp() {
System.setOut(new PrintStream(outputStreamCaptor));
bl = new BusinessLogicImpl(10);
controlModel = new ControlModel(bl);
CapacityObserver capacityObserver = new CapacityObserver(bl);
HazardObserver hazardObserver = new HazardObserver(bl);
bl.attach(capacityObserver);
bl.attach(hazardObserver);
EventListener lExit = new Listener_Exit();
EventListener lInsertNewCustomer = new Listener_InsertNewCustomer(controlModel);
EventListener lInsertNewCargo = new Listener_InsertNewCargo(controlModel);
EventListener lDeleteCargoAtPosition = new Listener_DeleteCargoAtPosition(controlModel);
EventListener lDeleteCustomerWithName = new Listener_DeleteCustomerWithName(controlModel);
EventListener lAttachObserver = new Listener_AttachObserver(controlModel);
EventListener lDetachObserver = new Listener_DetachObserver(controlModel);
EventListener lUpdateCargo = new Listener_UpdateCargo(controlModel);
EventListener lDisplayCustomer = new Listener_DisplayCustomer(controlModel);
EventListener lDisplayCargo = new Listener_DisplayCargo(controlModel);
EventListener lDisplayHazard = new Listener_DisplayHazard(controlModel);
EventListener lHandlePersistence = new Listener_HandlePersistence(controlModel);
EventListener lHandleCargoPersistence = new Listener_HandleCargoPersistence(controlModel);
cli = new ConsoleReader(
lExit,
lInsertNewCustomer,
lInsertNewCargo,
lDeleteCargoAtPosition,
lDeleteCustomerWithName,
lAttachObserver,
lDetachObserver,
lUpdateCargo,
lDisplayCustomer,
lDisplayCargo,
lDisplayHazard,
lHandlePersistence,
lHandleCargoPersistence
);
}
@AfterEach
public void tearDown() {
System.setIn(standardIn);
System.setOut(standardOut);
outputStreamCaptor.reset();
try {
Files.deleteIfExists(Paths.get("saveJOS.txt"));
Files.deleteIfExists(Paths.get("singleSerialisedCargo.txt"));
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
void getMode() {assertEquals(Mode.menu, cli.getMode());}
//MODE SWITCHES ====================================================================================================
@Test
void getMode_enter_insert_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("c\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mcreate\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"What would you like to insert \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \u001B[31m✖\u001B[0m: invalid input, returning to main menu." +
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_deletion_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("d\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mdelete\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"What would you like to delete \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \u001B[31m✖\u001B[0m: invalid input, returning to main menu." +
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_display_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("r\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please specify what you would like to display:\n" +
"> \u001B[31m✖\u001B[0m: Invalid Input, returning to Main Menu."+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_update_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("u\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mupdate\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please specify which cargo should be updated by entering the storage position:\n" +
"> \u001B[31m✖\u001B[0m: Invalid Format, please refer to natural numbers only - returning to main menu.\n" +
"\u001B[31m✖\u001B[0m: The position you typed in is out of range, returning to main menu"+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_persistence_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("p\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mpersistence\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please specify if you'd like to either <saveJOS>, <loadJOS>, <<save> <CargoPositionToBeSaved>> or <<load> <CargoPositionToBeSaved>>\n" +
"> \u001B[31m✖\u001B[0m: Unable to parse input - returning to main menu."+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void getMode_enter_config_mode() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream(("config\nexit").getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mconfiguration\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"Please refer to the following syntax: <<add/remove> <name_of_the_observer>>\n" +
"> \u001B[31m✖\u001B[0m: Missing argument (ObserverName), returning to Main Menu."+
backToMainMenu
, outputStreamCaptor.toString());
}
@Test
void start() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
String newLine = System.lineSeparator();
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream((newLine).getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> "
, outputStreamCaptor.toString());
}
//complex event chain testing
@Test
void complexEventChain() {
//https://bugsdb.com/_en/debug/09bdbc2d248d31d6785ba772ea8689cb
ByteArrayInputStream simulatedUserInput = new ByteArrayInputStream((
"c\n" + //change from menu to create mode
"cu\n" + //confirm choice on inserting new customer
"Jenny\n" + //entering new customers name
"c\n" + //change from menu to create mode
"ca\n" + //confirm choice on inserting new cargo
"UnitisedCargo Jenny 3345.3 360 n\n" + //passing cargo parameters
"r\n" + //change from main menu to display mode
"customer\n" + //confirm choice on displaying customers and number of associated cargo
"r\n" + //change from main menu to display mode
"cargo\n" + //confirm choice on displaying all cargo currently stored at storehouse
"r\n" + //change from main menu to display mode
"hazard e\n" + //confirm choice on displaying all hazards that are currently not contained in storehouse
"d\n" + //change to deletion mode
"cu\n" + //confirm choice on deleting a customer
"Jenny\n" + //entering customers name to be deleted
"y\n" //confirm choice on cascading deletion
).getBytes());
System.setIn(simulatedUserInput);
cli.start(System.in, System.out);
assertEquals(
successfullInit+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mcreate\u001B[0m"+
System.lineSeparator()+
System.lineSeparator()+
"What would you like to insert \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n"+
"> \n" +
"Please enter customer name: \n" +
">\u001B[0;32m✔\u001B[0m: new customer \u001B[0;32mJenny\u001B[0m was added to database added\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mcreate\u001B[0m\n" +
"\n" +
"What would you like to insert \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \n" +
"For adding a Cargo please follow this syntax:\n" +
"\u001B[0;32m[CargoType] [CustomerName] [Value] [DurationOfStorageInSeconds] [CommaSeparatedHazards*] [CargoIsFragile(y/n)|CargoIsPressurized(y/n)]\u001B[0m\n" +
"\n" +
"*Please note that in case multiple hazards shall be stored the listing must\u001B[31m not \u001B[0mcontain any whitespaces\n" +
"> \u001B[31m✖\u001B[0m: Not enough arguments - returning to main menu.\n" +
"\u001B[31m✖\u001B[0m: Invalid argument(s) - returning to main menu.\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m\n" +
"\n" +
"Please specify what you would like to display:\n" +
"> CustomerName | Number of associated Cargo\n" +
"\n" +
"Jenny | 0\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m\n" +
"\n" +
"Please specify what you would like to display:\n" +
"> (No Filter identified - if you intended to do so, please refer to either [liquidbulk, mixed, unitised])\n" +
"\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mread\u001B[0m\n" +
"\n" +
"Please specify what you would like to display:\n" +
"> The storehouse currently doesn't holds cargo labeled as:\n" +
"\n" +
"[explosive, flammable, toxic, radioactive]\n" +
"Current mode: \u001B[36mmenu\u001B[0m\n" +
"Please select from these options:\n" +
System.lineSeparator()+
MSG_listOfCommands+
System.lineSeparator()+
System.lineSeparator()+
"> \u001B[0;32m✔\u001B[0m: Mode was switched to: \u001B[36mdelete\u001B[0m\n" +
"\n" +
"What would you like to delete \u001B[0;32m[ca]\u001B[0mrgo or \u001B[0;32m[cu]\u001B[0mstomer ?\n" +
"> \n" +
"Please enter customer name: \n" +
">Please be aware that this operation will also delete all Cargo associated with that name. Do you wish to proceed? \u001B[0;32m[y]\u001B[0m/\u001B[0;32m[n]\u001B[0m ?\n" +
"\u001B[0;32m✔\u001B[0m: Customer with name \u001B[0;32mJenny\u001B[0m was successfully removed from Database."+
backToMainMenu
, outputStreamCaptor.toString());
}
} | 18,949 | 0.533997 | 0.494629 | 379 | 48.868073 | 38.210617 | 196 | false | false | 0 | 0 | 0 | 0 | 102 | 0.005397 | 0.448549 | false | false | 9 |
d76e13b3f258aedcc484313b79e8a4f9a2dbd82f | 24,146,306,169,309 | 22ea2a4366fa12c5ffe92274ddc369bd0f3d5311 | /app/src/main/java/com/yey/studio/cutoutscreenadapter/utils/NotchUtils_XiaoMi_8.java | 712430dd9b6a134729eb5140543ed8f66cbb618b | [
"Apache-2.0"
]
| permissive | msmt2017/CutoutScreenAdapter | https://github.com/msmt2017/CutoutScreenAdapter | 940d2e8b4697c46a958fc79aa5b125e0a6378a95 | 03b8d92ae0c6f137f00add43b5444bd5cbcae979 | refs/heads/master | 2022-11-13T11:44:21.932000 | 2020-06-23T06:30:06 | 2020-06-23T06:30:06 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yey.studio.cutoutscreenadapter.utils;
import android.content.Context;
import java.lang.reflect.Method;
// 小米 Android O 官方手机屏幕适配文档: https://dev.mi.com/console/doc/detail?pId=1293
public class NotchUtils_XiaoMi_8 {
/**
* 小米手机中,刘海屏状态栏高度与正常手机的不同,不建议写固定值,应该动态获取.
*
* @param context
* @return
*/
public static int getStatusBarHeight(Context context) {
int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resId > 0) {
return context.getResources().getDimensionPixelSize(resId);
}
return 0;
}
/**
* 小米手机判断屏幕是否有刘海
*
* @return true 有刘海
*/
public static boolean hasNotchAtXiaoMi() {
try {
Class<?> cls = Class.forName("android.os.SystemProperties");
Method getMethod = cls.getMethod("getInt", String.class, int.class);
int defaultVal = (Integer) getMethod.invoke(cls, "ro.miui.notch", 0);
if (defaultVal == 1) {
return true;
} else if (defaultVal == 0) {
return false;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
return false;
}
}
/**
* 获取屏幕中刘海宽高尺寸
* int[0]值为刘海宽度
* int[1]值为刘海高度
*
* @param context
* @return
*/
public static int[] getNotchSize(Context context) {
int[] ret = new int[]{0, 0};
int resourceWidthId = context.getResources().getIdentifier("notch_width", "dimen", "android");
if (resourceWidthId > 0) {
ret[0] = context.getResources().getDimensionPixelSize(resourceWidthId);
}
int resourceHeightId = context.getResources().getIdentifier("notch_height", "dimen", "android");
if (resourceHeightId > 0) {
ret[1] = context.getResources().getDimensionPixelSize(resourceHeightId);
}
return ret;
}
}
| UTF-8 | Java | 2,147 | java | NotchUtils_XiaoMi_8.java | Java | []
| null | []
| package com.yey.studio.cutoutscreenadapter.utils;
import android.content.Context;
import java.lang.reflect.Method;
// 小米 Android O 官方手机屏幕适配文档: https://dev.mi.com/console/doc/detail?pId=1293
public class NotchUtils_XiaoMi_8 {
/**
* 小米手机中,刘海屏状态栏高度与正常手机的不同,不建议写固定值,应该动态获取.
*
* @param context
* @return
*/
public static int getStatusBarHeight(Context context) {
int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resId > 0) {
return context.getResources().getDimensionPixelSize(resId);
}
return 0;
}
/**
* 小米手机判断屏幕是否有刘海
*
* @return true 有刘海
*/
public static boolean hasNotchAtXiaoMi() {
try {
Class<?> cls = Class.forName("android.os.SystemProperties");
Method getMethod = cls.getMethod("getInt", String.class, int.class);
int defaultVal = (Integer) getMethod.invoke(cls, "ro.miui.notch", 0);
if (defaultVal == 1) {
return true;
} else if (defaultVal == 0) {
return false;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
return false;
}
}
/**
* 获取屏幕中刘海宽高尺寸
* int[0]值为刘海宽度
* int[1]值为刘海高度
*
* @param context
* @return
*/
public static int[] getNotchSize(Context context) {
int[] ret = new int[]{0, 0};
int resourceWidthId = context.getResources().getIdentifier("notch_width", "dimen", "android");
if (resourceWidthId > 0) {
ret[0] = context.getResources().getDimensionPixelSize(resourceWidthId);
}
int resourceHeightId = context.getResources().getIdentifier("notch_height", "dimen", "android");
if (resourceHeightId > 0) {
ret[1] = context.getResources().getDimensionPixelSize(resourceHeightId);
}
return ret;
}
}
| 2,147 | 0.576125 | 0.567021 | 66 | 28.954546 | 27.801477 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 9 |
65796e5411b8f5ba82b854408e06ca5aae332a30 | 7,713,761,315,304 | fb22f201bc0a7ccd0543c0111b72677cbf4a5854 | /src/encounter/RemoveCondition.java | a7c53ca91eed3736271eba4ebdfe979f7fdb6d03 | []
| no_license | Kalrog/JamGame | https://github.com/Kalrog/JamGame | ccda1bca94566169cc63fc21f5af0323840054f0 | 0b2e217cdfd27eae054764fc023a3c6565cc4796 | refs/heads/master | 2021-01-11T21:44:18.563000 | 2017-01-15T12:02:50 | 2017-01-15T12:02:50 | 78,844,449 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package encounter;
import player.Player.Condition;
import world.World;
public class RemoveCondition extends Encounter
{
private static Condition condition;
public RemoveCondition(World w, String text, int distance, Condition condition)
{
super(w,null, text, new Solution[] {new RemoveEffect()}, 0, distance, 20, -1);
this.condition = condition;
}
static class RemoveEffect implements Solution
{
@Override
public String[] resolve(World w)
{
w.player.removeCondition(condition);
return null;
}
@Override
public String getText()
{
return "Continue";
}
}
public static Condition getCondition()
{
return condition;
}
}
| UTF-8 | Java | 665 | java | RemoveCondition.java | Java | []
| null | []
| package encounter;
import player.Player.Condition;
import world.World;
public class RemoveCondition extends Encounter
{
private static Condition condition;
public RemoveCondition(World w, String text, int distance, Condition condition)
{
super(w,null, text, new Solution[] {new RemoveEffect()}, 0, distance, 20, -1);
this.condition = condition;
}
static class RemoveEffect implements Solution
{
@Override
public String[] resolve(World w)
{
w.player.removeCondition(condition);
return null;
}
@Override
public String getText()
{
return "Continue";
}
}
public static Condition getCondition()
{
return condition;
}
}
| 665 | 0.715789 | 0.709774 | 39 | 16.051283 | 20.830141 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.589744 | false | false | 9 |
e4ca05abf422f4c8fec02d50cdaa549213a5424f | 35,003,983,492,473 | 5113fad6a2d237498af6c94eb5dd3836cb6367cd | /test/src/JVM/RemoteCallTest/ByteUtils.java | 178e5c459cdb6211705cc848bf8f83529e88bbc6 | [
"MIT"
]
| permissive | LyonDon/Spring | https://github.com/LyonDon/Spring | 55d4bc6970018fa6885fddd1307fd90f59356d68 | e536a5c567d5e8dbaaee7f74eadfc71704c13d52 | refs/heads/master | 2020-05-07T21:49:57.327000 | 2019-09-01T10:42:06 | 2019-09-01T10:42:06 | 180,919,111 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package JVM.RemoteCallTest;
public class ByteUtils {
/**
* 将字节型转化为整型
* @param b 字节数组
* @param start 起始位置
* @param len 偏移量
* @return 整型的常量
*/
public static int bytes2Int(byte[] b,int start,int len) {
int sum=0;
int end=start+len;
for (int i = start; i < end; i++) {
int n=((int)b[i]&0xff);
n<<=(--len)*8;
sum+=n+sum;
}
return sum;
}
public static byte[] int2Bytes(int value,int len) {
byte[] b=new byte[len];
for (int i = 0; i < len; i++) {
b[len-i-1]=(byte)((value>>8*i)&0xff);
}
return b;
}
/**
* byte转化为String
* @param b 要转码为字符的字节
* @param start 要解码的第一个字节的索引
* @param end 要解码的字节数
* @return 转化后的String
*/
public static String bytes2String(byte[] b,int start,int end){
return new String(b,start,end);
}
/**
* string转化为byte
* @param string
* @return
*/
public static byte[] string2Bytes(String string) {
return string.getBytes();//使用平台的默认字符集将此String编码为字节序列,将结果存储到新的字节数组中
}
public static byte[] bytesReplace(byte[] originalBytes, int offset,int len,byte[] replaceBytes) {
byte[] newBytes=new byte[originalBytes.length+(replaceBytes.length-len)];
//arraycopy()将指定源数组中的数组从指定位置复制到目标数组的指定位置。
System.arraycopy(originalBytes, 0, newBytes, 0, offset);
System.arraycopy(replaceBytes, 0, newBytes, offset, replaceBytes.length);
System.arraycopy(originalBytes, offset+len, newBytes, offset+replaceBytes.length, originalBytes.length-offset-len);
return newBytes;
}
}
| UTF-8 | Java | 1,704 | java | ByteUtils.java | Java | []
| null | []
| package JVM.RemoteCallTest;
public class ByteUtils {
/**
* 将字节型转化为整型
* @param b 字节数组
* @param start 起始位置
* @param len 偏移量
* @return 整型的常量
*/
public static int bytes2Int(byte[] b,int start,int len) {
int sum=0;
int end=start+len;
for (int i = start; i < end; i++) {
int n=((int)b[i]&0xff);
n<<=(--len)*8;
sum+=n+sum;
}
return sum;
}
public static byte[] int2Bytes(int value,int len) {
byte[] b=new byte[len];
for (int i = 0; i < len; i++) {
b[len-i-1]=(byte)((value>>8*i)&0xff);
}
return b;
}
/**
* byte转化为String
* @param b 要转码为字符的字节
* @param start 要解码的第一个字节的索引
* @param end 要解码的字节数
* @return 转化后的String
*/
public static String bytes2String(byte[] b,int start,int end){
return new String(b,start,end);
}
/**
* string转化为byte
* @param string
* @return
*/
public static byte[] string2Bytes(String string) {
return string.getBytes();//使用平台的默认字符集将此String编码为字节序列,将结果存储到新的字节数组中
}
public static byte[] bytesReplace(byte[] originalBytes, int offset,int len,byte[] replaceBytes) {
byte[] newBytes=new byte[originalBytes.length+(replaceBytes.length-len)];
//arraycopy()将指定源数组中的数组从指定位置复制到目标数组的指定位置。
System.arraycopy(originalBytes, 0, newBytes, 0, offset);
System.arraycopy(replaceBytes, 0, newBytes, offset, replaceBytes.length);
System.arraycopy(originalBytes, offset+len, newBytes, offset+replaceBytes.length, originalBytes.length-offset-len);
return newBytes;
}
}
| 1,704 | 0.671016 | 0.661401 | 59 | 23.677965 | 25.468119 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.135593 | false | false | 9 |
4e6ac99c77f3a950a3239827a3f4f9c4b7ecd882 | 23,021,024,746,381 | 25e795ca22f7bd40760e4fc67d19c01b74a488d2 | /src/main/java/org/qortal/repository/hsqldb/transaction/HSQLDBCancelGroupInviteTransactionRepository.java | d61fa79bc16de21d01221166014608dbde018105 | []
| no_license | QORT/qortal | https://github.com/QORT/qortal | 8671562cf6540dc98e657f28e60a5f341e7b0eda | d81729d9f7cfef3060e15cbaf8563e89b8e72776 | refs/heads/master | 2023-09-01T07:26:13.299000 | 2020-07-03T11:14:31 | 2020-07-03T11:14:31 | 203,212,201 | 10 | 10 | null | true | 2023-08-11T12:48:21 | 2019-08-19T16:43:59 | 2023-06-05T03:22:37 | 2023-08-11T12:48:20 | 45,871 | 9 | 6 | 5 | Java | false | false | package org.qortal.repository.hsqldb.transaction;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.qortal.data.transaction.BaseTransactionData;
import org.qortal.data.transaction.CancelGroupInviteTransactionData;
import org.qortal.data.transaction.TransactionData;
import org.qortal.repository.DataException;
import org.qortal.repository.hsqldb.HSQLDBRepository;
import org.qortal.repository.hsqldb.HSQLDBSaver;
public class HSQLDBCancelGroupInviteTransactionRepository extends HSQLDBTransactionRepository {
public HSQLDBCancelGroupInviteTransactionRepository(HSQLDBRepository repository) {
this.repository = repository;
}
TransactionData fromBase(BaseTransactionData baseTransactionData) throws DataException {
String sql = "SELECT group_id, invitee, invite_reference FROM CancelGroupInviteTransactions WHERE signature = ?";
try (ResultSet resultSet = this.repository.checkedExecute(sql, baseTransactionData.getSignature())) {
if (resultSet == null)
return null;
int groupId = resultSet.getInt(1);
String invitee = resultSet.getString(2);
byte[] inviteReference = resultSet.getBytes(3);
return new CancelGroupInviteTransactionData(baseTransactionData, groupId, invitee, inviteReference);
} catch (SQLException e) {
throw new DataException("Unable to fetch cancel group invite transaction from repository", e);
}
}
@Override
public void save(TransactionData transactionData) throws DataException {
CancelGroupInviteTransactionData cancelGroupInviteTransactionData = (CancelGroupInviteTransactionData) transactionData;
HSQLDBSaver saveHelper = new HSQLDBSaver("CancelGroupInviteTransactions");
saveHelper.bind("signature", cancelGroupInviteTransactionData.getSignature()).bind("admin", cancelGroupInviteTransactionData.getAdminPublicKey())
.bind("group_id", cancelGroupInviteTransactionData.getGroupId()).bind("invitee", cancelGroupInviteTransactionData.getInvitee())
.bind("invite_reference", cancelGroupInviteTransactionData.getInviteReference());
try {
saveHelper.execute(this.repository);
} catch (SQLException e) {
throw new DataException("Unable to save cancel group invite transaction into repository", e);
}
}
}
| UTF-8 | Java | 2,216 | java | HSQLDBCancelGroupInviteTransactionRepository.java | Java | []
| null | []
| package org.qortal.repository.hsqldb.transaction;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.qortal.data.transaction.BaseTransactionData;
import org.qortal.data.transaction.CancelGroupInviteTransactionData;
import org.qortal.data.transaction.TransactionData;
import org.qortal.repository.DataException;
import org.qortal.repository.hsqldb.HSQLDBRepository;
import org.qortal.repository.hsqldb.HSQLDBSaver;
public class HSQLDBCancelGroupInviteTransactionRepository extends HSQLDBTransactionRepository {
public HSQLDBCancelGroupInviteTransactionRepository(HSQLDBRepository repository) {
this.repository = repository;
}
TransactionData fromBase(BaseTransactionData baseTransactionData) throws DataException {
String sql = "SELECT group_id, invitee, invite_reference FROM CancelGroupInviteTransactions WHERE signature = ?";
try (ResultSet resultSet = this.repository.checkedExecute(sql, baseTransactionData.getSignature())) {
if (resultSet == null)
return null;
int groupId = resultSet.getInt(1);
String invitee = resultSet.getString(2);
byte[] inviteReference = resultSet.getBytes(3);
return new CancelGroupInviteTransactionData(baseTransactionData, groupId, invitee, inviteReference);
} catch (SQLException e) {
throw new DataException("Unable to fetch cancel group invite transaction from repository", e);
}
}
@Override
public void save(TransactionData transactionData) throws DataException {
CancelGroupInviteTransactionData cancelGroupInviteTransactionData = (CancelGroupInviteTransactionData) transactionData;
HSQLDBSaver saveHelper = new HSQLDBSaver("CancelGroupInviteTransactions");
saveHelper.bind("signature", cancelGroupInviteTransactionData.getSignature()).bind("admin", cancelGroupInviteTransactionData.getAdminPublicKey())
.bind("group_id", cancelGroupInviteTransactionData.getGroupId()).bind("invitee", cancelGroupInviteTransactionData.getInvitee())
.bind("invite_reference", cancelGroupInviteTransactionData.getInviteReference());
try {
saveHelper.execute(this.repository);
} catch (SQLException e) {
throw new DataException("Unable to save cancel group invite transaction into repository", e);
}
}
}
| 2,216 | 0.809567 | 0.808213 | 53 | 40.811321 | 41.737751 | 147 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.886792 | false | false | 9 |
71a8fb499a00ac74ec0cfc49ba4bbb0baf10dc4b | 31,344,671,366,680 | 1f033fc20f5ea3deadac0d7b2348ab2a4d5d631b | /app/src/main/java/com/zzt/rxandroiddemo/MainModel.java | 208a7794d6dd6e6a28ffe1b4238a36431d65c759 | []
| no_license | guoyu07/Test-1 | https://github.com/guoyu07/Test-1 | ec9b8644251a6fcc62d7a493621f49aa3257aefd | 7ffb9dac4fa7d37e380ecbf09c5383f3e0b0f43f | refs/heads/master | 2020-03-20T05:00:58.165000 | 2016-10-25T06:49:32 | 2016-10-25T06:49:32 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zzt.rxandroiddemo;
/**
* Created by Android_ZzT on 16/10/25.
*/
public class MainModel {
private String[] datas;
public MainModel() {
datas = new String[] {
"一二三四五",
"上山打老鼠",
"老鼠不在家",
"打到小老虎2"
};
}
public String[] getDatas() {
return datas;
}
public void setDatas(String[] datas) {
this.datas = datas;
}
}
| UTF-8 | Java | 489 | java | MainModel.java | Java | [
{
"context": "package com.zzt.rxandroiddemo;\n\n/**\n * Created by Android_ZzT on 16/10/25.\n */\n\npublic class MainModel {\n pr",
"end": 61,
"score": 0.9991463422775269,
"start": 50,
"tag": "USERNAME",
"value": "Android_ZzT"
}
]
| null | []
| package com.zzt.rxandroiddemo;
/**
* Created by Android_ZzT on 16/10/25.
*/
public class MainModel {
private String[] datas;
public MainModel() {
datas = new String[] {
"一二三四五",
"上山打老鼠",
"老鼠不在家",
"打到小老虎2"
};
}
public String[] getDatas() {
return datas;
}
public void setDatas(String[] datas) {
this.datas = datas;
}
}
| 489 | 0.478842 | 0.463252 | 26 | 16.26923 | 13.44378 | 42 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false | 9 |
1e58e9dbb8a3a972cd64c1840b2988d352a51cc5 | 27,882,927,718,674 | 0cd50acee1c3b51fa1af9f582ecf8b3fe08f6bf3 | /statements/Level1Task4.java | ea737a0b55caeeb187403f464f68ea1951708c5c | []
| no_license | anastasiyaBula/JavaStart | https://github.com/anastasiyaBula/JavaStart | 9fcfd08b3805106ca97f4001493987c95f22ce0d | 764d82e7a736a1c215f24d1fa81608e2a99240b6 | refs/heads/master | 2020-03-30T07:27:43.384000 | 2018-09-30T14:18:01 | 2018-09-30T14:18:01 | 140,311,076 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package statements;
import java.util.Scanner;
public class Level1Task4 {
public static void main(String[] args) {
/*Треугольник существует только тогда, когда сумма любых ее двух сторон больше третьей.
Вводятся стороны треугольника. Программа указывает сущестует ли треугольник.*/
Scanner sc = new Scanner(System.in);
double a;
double b;
double c;
// Вводятся стороны треугольника :
System.out.println("Input a, first side of the triangle : ");
a = sc.nextDouble();
System.out.println("Input b, second side of the triangle : ");
b = sc.nextDouble();
System.out.println("Input c, third side of the triangle : ");
c = sc.nextDouble();
// Просчитывается существует ли треугольник :
if (((a + b) > c) && ((a + c) > b) && ((b + c) > a)) {
System.out.println("Such a triangle exists!");
} else {
System.out.println("Such a triangle does not exist!");
}
}
}
| UTF-8 | Java | 1,225 | java | Level1Task4.java | Java | []
| null | []
| package statements;
import java.util.Scanner;
public class Level1Task4 {
public static void main(String[] args) {
/*Треугольник существует только тогда, когда сумма любых ее двух сторон больше третьей.
Вводятся стороны треугольника. Программа указывает сущестует ли треугольник.*/
Scanner sc = new Scanner(System.in);
double a;
double b;
double c;
// Вводятся стороны треугольника :
System.out.println("Input a, first side of the triangle : ");
a = sc.nextDouble();
System.out.println("Input b, second side of the triangle : ");
b = sc.nextDouble();
System.out.println("Input c, third side of the triangle : ");
c = sc.nextDouble();
// Просчитывается существует ли треугольник :
if (((a + b) > c) && ((a + c) > b) && ((b + c) > a)) {
System.out.println("Such a triangle exists!");
} else {
System.out.println("Such a triangle does not exist!");
}
}
}
| 1,225 | 0.590998 | 0.589041 | 27 | 36.851852 | 26.898581 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 9 |
4af084c301734a3f42634e70d7e3e0b11feef42b | 1,881,195,723,849 | d2446dc84004bceedf782cdc45dbf75013c1104b | /src/SQL/CreateQueries.java | 38bea30dc377f4650e8d0cb0608edc01b1e61244 | []
| no_license | RominaUQ/Advanced_Java_2 | https://github.com/RominaUQ/Advanced_Java_2 | 8d4cf21ef6c08c735f864048ad52749d9ab26ac1 | 5434a164e0f972a8d4f803ab1dd3cd1205f93883 | refs/heads/master | 2020-03-11T08:22:01.711000 | 2018-05-22T13:41:36 | 2018-05-22T13:41:36 | 129,882,230 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package SQL;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* @author Savran Aleksei This class is responsible for queries related to the
* creating new data (new users and their details)
*/
public class CreateQueries {
private static FileInputStream fis;
public static void createNewUser(String name, String status, String sex, int age, String state) {
Connection con = null;
try {
Class.forName("org.sqlite.JDBC");
String url = "jdbc:sqlite:MiniDB.db";
con = DriverManager.getConnection(url);
String sql = "insert into Profiles (name, image, status, sex, age, state) values (?,?,?,?,?,?);";
PreparedStatement pstmn = con.prepareStatement(sql);
pstmn.setString(1, name);
pstmn.setBytes(2, readFile("src/resources/noimagefound.jpg"));
pstmn.setString(3, status);
pstmn.setString(4, sex);
pstmn.setInt(5, age);
pstmn.setString(6, state);
pstmn.execute();
con.commit();
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e2) {
System.out.println(e2.getMessage());
}
}
}
}
public static Boolean addRelation(String name, String relationName, String relation) {
Connection con = null;
try {
Class.forName("org.sqlite.JDBC");
String url = "jdbc:sqlite:MiniDB.db";
con = DriverManager.getConnection(url);
String sql = "insert into relations (profile1, profile2, relation) values (?,?,?);";
PreparedStatement pstmn = con.prepareStatement(sql);
pstmn.setString(1, name);
pstmn.setString(2, relationName);
pstmn.setString(3, relation);
pstmn.execute();
con.commit();
} catch (Exception e) {
System.out.println(e.getMessage());
return false;
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e2) {
System.out.println(e2.getMessage());
}
}
}
return true;
}
private static byte[] readFile(String file) {
ByteArrayOutputStream baos = null;
try {
File f = new File(file);
fis = new FileInputStream(f);
byte[] buffer = new byte[1024];
baos = new ByteArrayOutputStream();
for (int len; (len = fis.read(buffer)) != -1;) {
baos.write(buffer, 0, len);
}
} catch (Exception e) {
e.printStackTrace();
}
return baos != null ? baos.toByteArray() : null;
}
}
| UTF-8 | Java | 2,534 | java | CreateQueries.java | Java | [
{
"context": "ent;\nimport java.sql.SQLException;\n\n/**\n * @author Savran Aleksei This class is responsible for queries related to ",
"end": 259,
"score": 0.9998960494995117,
"start": 245,
"tag": "NAME",
"value": "Savran Aleksei"
}
]
| null | []
| package SQL;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* @author <NAME> This class is responsible for queries related to the
* creating new data (new users and their details)
*/
public class CreateQueries {
private static FileInputStream fis;
public static void createNewUser(String name, String status, String sex, int age, String state) {
Connection con = null;
try {
Class.forName("org.sqlite.JDBC");
String url = "jdbc:sqlite:MiniDB.db";
con = DriverManager.getConnection(url);
String sql = "insert into Profiles (name, image, status, sex, age, state) values (?,?,?,?,?,?);";
PreparedStatement pstmn = con.prepareStatement(sql);
pstmn.setString(1, name);
pstmn.setBytes(2, readFile("src/resources/noimagefound.jpg"));
pstmn.setString(3, status);
pstmn.setString(4, sex);
pstmn.setInt(5, age);
pstmn.setString(6, state);
pstmn.execute();
con.commit();
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e2) {
System.out.println(e2.getMessage());
}
}
}
}
public static Boolean addRelation(String name, String relationName, String relation) {
Connection con = null;
try {
Class.forName("org.sqlite.JDBC");
String url = "jdbc:sqlite:MiniDB.db";
con = DriverManager.getConnection(url);
String sql = "insert into relations (profile1, profile2, relation) values (?,?,?);";
PreparedStatement pstmn = con.prepareStatement(sql);
pstmn.setString(1, name);
pstmn.setString(2, relationName);
pstmn.setString(3, relation);
pstmn.execute();
con.commit();
} catch (Exception e) {
System.out.println(e.getMessage());
return false;
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e2) {
System.out.println(e2.getMessage());
}
}
}
return true;
}
private static byte[] readFile(String file) {
ByteArrayOutputStream baos = null;
try {
File f = new File(file);
fis = new FileInputStream(f);
byte[] buffer = new byte[1024];
baos = new ByteArrayOutputStream();
for (int len; (len = fis.read(buffer)) != -1;) {
baos.write(buffer, 0, len);
}
} catch (Exception e) {
e.printStackTrace();
}
return baos != null ? baos.toByteArray() : null;
}
}
| 2,526 | 0.6618 | 0.653512 | 98 | 24.857143 | 22.191191 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.918367 | false | false | 9 |
cc2c09a2ac4651e57b96643460d207151dfdb2a3 | 5,059,471,520,973 | 12bbc9a4a711e010632efae06355cda6c16ecead | /src/com/zerolg/Stack/Array.java | 802ae992644c178d8a4045c42094d7335e9d15d1 | []
| no_license | gc-china/datastructure | https://github.com/gc-china/datastructure | 3b6ad3e48c1fd743a93d88458e20f652f0471bc0 | acd5b19205941125d3e2133294201bf8a555fc89 | refs/heads/master | 2020-06-01T11:16:15.079000 | 2019-06-07T14:49:26 | 2019-06-07T14:49:26 | 190,761,048 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zerolg.Stack;
/**
* @program: com.zerolg.Array.Array
* @author: Gyc 数组
* @create: 2019-05-20 10:12
**/
public class Array<E> {
/**
* 初始数组
*/
private E[] data;
// 数组当前个数
private int size;
public Array(Integer capaticy) {
data = (E[]) new Object[capaticy];
size = 0;
}
public Array() {
//默认10的容量
this(10);
}
/**
* 获取数组中有多少个容量
*
* @return
*/
public int getSize() {
return size;
}
/**
* 获取容量大小
*
* @return int
*/
public int getCapaticy() {
return data.length;
}
/**
* 判断数组是否为空
*
* @return
*/
public boolean isemply() {
return size == 0;
}
/**
* 向数组尾部中添加元素
*
* @param e
* @throws Exception
*/
public void addlist(E e) throws Exception {
/* if (size == data.length) {
throw new Exception("数组中没有容量了");
}
data[size] = e;
size++;*/
add(size, e);
}
/**
* 往头部添加数据
*
* @param e
* @throws Exception
*/
public void addfrist(E e) throws Exception {
add(0, e);
}
/**
* 往指定位置添加元素
*
* @param index
* @param e
*/
public void add(int index, E e) throws Exception {
if (index < 0 || index > size) {
throw new Exception("索引应该小于" + size);
}
if (size == data.length) {
resize((int) (data.length * 1.5));
}
for (int i = size - 1; i >= index; i--) {
data[i + 1] = data[i];
}
data[index] = e;
size++;
}
/**
* 获取指定位置的元素
*
* @param index
* @return
*/
public E get(int index) throws Exception {
if (index < 0 || index >= size) {
throw new Exception("索引不应该小于0和大于" + size);
}
return data[index];
}
//获取第一个元素
public E getfrist() throws Exception {
return get(0);
}
//获取最后一个元素
public E getlast() throws Exception {
return get(size - 1);
}
/**
* 设置指定位置的元素
*
* @param index
* @param e
* @return
* @throws Exception
*/
public void set(int index, E e) throws Exception {
if (index < 0 || index >= size) {
throw new Exception("索引不应该小于0和大于" + size);
}
data[index] = e;
}
/**
* 数据中是否存在该元素
*
* @param e
* @return
*/
public boolean contains(E e) {
for (int i = 0; i < size; i++) {
if (data[i].equals(e)) {
return true;
}
}
return false;
}
/**
* 查看该元素索引
*
* @param e
* @return
*/
public int find(E e) {
for (int i = 0; i < size; i++) {
if (data[i].equals(e)) {
return i;
}
}
return -1;
}
/**
* 删除元素
*
* @param index
*/
public E remove(int index) throws Exception {
if (index < 0 || index > size) {
throw new Exception("索引应该小于" + size);
}
for (int i = index + 1; i < size; i++) {
data[i - 1] = data[i];
}
if (size <= data.length / 2) {
resize(data.length / 2);
}
size--;
data[size] = null;
return data[index];
}
//从数组中删除第后元素
public E removelast() throws Exception {
remove(size - 1);
return get(size - 1);
}
//从数组中删除第一个元素
public void removefrist() throws Exception {
remove(0);
}
//从数组中删除元素e
public void removeElment(E e) throws Exception {
int i = find(e);
if (i != -1) {
remove(i);
}
}
@Override
public String toString() {
StringBuilder str = new StringBuilder();
str.append(String.format("Array: size= %d , capacity= %d\n", size, data.length));
str.append('[');
for (int i = 0; i < size; i++) {
str.append(data[i]);
if (i != size - 1) {
str.append(",");
}
}
str.append("]");
return str.toString();
}
// 动态扩容
private void resize(int newCapacity) {
E[] newdata = (E[]) new Object[newCapacity];
for (int i = 0; i < size; i++) {
newdata[i] = data[i];
}
data = newdata;
}
}
| UTF-8 | Java | 4,838 | java | Array.java | Java | [
{
"context": "**\n * @program: com.zerolg.Array.Array\n * @author: Gyc 数组\n * @create: 2019-05-20 10:12\n **/\npublic cla",
"end": 80,
"score": 0.44257646799087524,
"start": 79,
"tag": "NAME",
"value": "G"
}
]
| null | []
| package com.zerolg.Stack;
/**
* @program: com.zerolg.Array.Array
* @author: Gyc 数组
* @create: 2019-05-20 10:12
**/
public class Array<E> {
/**
* 初始数组
*/
private E[] data;
// 数组当前个数
private int size;
public Array(Integer capaticy) {
data = (E[]) new Object[capaticy];
size = 0;
}
public Array() {
//默认10的容量
this(10);
}
/**
* 获取数组中有多少个容量
*
* @return
*/
public int getSize() {
return size;
}
/**
* 获取容量大小
*
* @return int
*/
public int getCapaticy() {
return data.length;
}
/**
* 判断数组是否为空
*
* @return
*/
public boolean isemply() {
return size == 0;
}
/**
* 向数组尾部中添加元素
*
* @param e
* @throws Exception
*/
public void addlist(E e) throws Exception {
/* if (size == data.length) {
throw new Exception("数组中没有容量了");
}
data[size] = e;
size++;*/
add(size, e);
}
/**
* 往头部添加数据
*
* @param e
* @throws Exception
*/
public void addfrist(E e) throws Exception {
add(0, e);
}
/**
* 往指定位置添加元素
*
* @param index
* @param e
*/
public void add(int index, E e) throws Exception {
if (index < 0 || index > size) {
throw new Exception("索引应该小于" + size);
}
if (size == data.length) {
resize((int) (data.length * 1.5));
}
for (int i = size - 1; i >= index; i--) {
data[i + 1] = data[i];
}
data[index] = e;
size++;
}
/**
* 获取指定位置的元素
*
* @param index
* @return
*/
public E get(int index) throws Exception {
if (index < 0 || index >= size) {
throw new Exception("索引不应该小于0和大于" + size);
}
return data[index];
}
//获取第一个元素
public E getfrist() throws Exception {
return get(0);
}
//获取最后一个元素
public E getlast() throws Exception {
return get(size - 1);
}
/**
* 设置指定位置的元素
*
* @param index
* @param e
* @return
* @throws Exception
*/
public void set(int index, E e) throws Exception {
if (index < 0 || index >= size) {
throw new Exception("索引不应该小于0和大于" + size);
}
data[index] = e;
}
/**
* 数据中是否存在该元素
*
* @param e
* @return
*/
public boolean contains(E e) {
for (int i = 0; i < size; i++) {
if (data[i].equals(e)) {
return true;
}
}
return false;
}
/**
* 查看该元素索引
*
* @param e
* @return
*/
public int find(E e) {
for (int i = 0; i < size; i++) {
if (data[i].equals(e)) {
return i;
}
}
return -1;
}
/**
* 删除元素
*
* @param index
*/
public E remove(int index) throws Exception {
if (index < 0 || index > size) {
throw new Exception("索引应该小于" + size);
}
for (int i = index + 1; i < size; i++) {
data[i - 1] = data[i];
}
if (size <= data.length / 2) {
resize(data.length / 2);
}
size--;
data[size] = null;
return data[index];
}
//从数组中删除第后元素
public E removelast() throws Exception {
remove(size - 1);
return get(size - 1);
}
//从数组中删除第一个元素
public void removefrist() throws Exception {
remove(0);
}
//从数组中删除元素e
public void removeElment(E e) throws Exception {
int i = find(e);
if (i != -1) {
remove(i);
}
}
@Override
public String toString() {
StringBuilder str = new StringBuilder();
str.append(String.format("Array: size= %d , capacity= %d\n", size, data.length));
str.append('[');
for (int i = 0; i < size; i++) {
str.append(data[i]);
if (i != size - 1) {
str.append(",");
}
}
str.append("]");
return str.toString();
}
// 动态扩容
private void resize(int newCapacity) {
E[] newdata = (E[]) new Object[newCapacity];
for (int i = 0; i < size; i++) {
newdata[i] = data[i];
}
data = newdata;
}
}
| 4,838 | 0.435252 | 0.425135 | 236 | 17.847458 | 15.390195 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.330508 | false | false | 9 |
eef2ae92add69ef4c7e6e80a4d545f717bb44e6a | 2,688,649,528,985 | 1b9edcce2f7f3ace7c7d66bb0a1746908c9a8058 | /all-webgis-java/trmap-personal/src/test/java/com/trgis/trmap/personal/TestUserTopicPermission.java | 49158e65404cedb5c610d7bb6a001065aefeb1e7 | []
| no_license | ideli/csevice | https://github.com/ideli/csevice | 00cac33b7abd9c338ca2aceaf8b67a6ae7ef3e08 | ba3d533e98ced8af15996360deba4a16a2ca5572 | refs/heads/master | 2020-06-12T11:55:19.837000 | 2016-05-24T12:03:50 | 2016-05-24T12:03:50 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.trgis.trmap.personal;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.trgis.trmap.personal.exception.UserTopicPermissionException;
import com.trgis.trmap.personal.service.UserTopicPermissionService;
import com.trgis.trmap.personal.service.UserTopicService;
import com.trgis.trmap.userauth.dao.UserDAO;
@ContextConfiguration(locations = { "classpath:applicationContext-*.xml" })
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("dev")
public class TestUserTopicPermission {
@Autowired
private UserTopicService userTopicService;
@Autowired
private UserTopicPermissionService userTopicPermissionService;
@Autowired
private UserDAO userDao;
@Test
public void testadd(){
try {
userTopicPermissionService.addPermission(16057l, 8l);
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
@Test
public void testList(){
try {
Long[] userId = new Long[2];
userId[0] = 8l;
userId[1] = 723l;
userTopicPermissionService.addPermissions(16057l, userId );
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
@Test
public void testdel(){
try {
userTopicPermissionService.deletePermission(16057l, 8l);
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
@Test
public void testdels(){
try {
userTopicPermissionService.deleteByTopic(16057l);
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 1,711 | java | TestUserTopicPermission.java | Java | []
| null | []
| package com.trgis.trmap.personal;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.trgis.trmap.personal.exception.UserTopicPermissionException;
import com.trgis.trmap.personal.service.UserTopicPermissionService;
import com.trgis.trmap.personal.service.UserTopicService;
import com.trgis.trmap.userauth.dao.UserDAO;
@ContextConfiguration(locations = { "classpath:applicationContext-*.xml" })
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("dev")
public class TestUserTopicPermission {
@Autowired
private UserTopicService userTopicService;
@Autowired
private UserTopicPermissionService userTopicPermissionService;
@Autowired
private UserDAO userDao;
@Test
public void testadd(){
try {
userTopicPermissionService.addPermission(16057l, 8l);
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
@Test
public void testList(){
try {
Long[] userId = new Long[2];
userId[0] = 8l;
userId[1] = 723l;
userTopicPermissionService.addPermissions(16057l, userId );
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
@Test
public void testdel(){
try {
userTopicPermissionService.deletePermission(16057l, 8l);
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
@Test
public void testdels(){
try {
userTopicPermissionService.deleteByTopic(16057l);
} catch (UserTopicPermissionException e) {
e.printStackTrace();
}
}
}
| 1,711 | 0.776154 | 0.757452 | 63 | 26.15873 | 22.896736 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.666667 | false | false | 9 |
f983c3c32927422add0090b3b63785b06e87a7d1 | 21,217,138,446,802 | cd4df955b3e118713aeb7b71ac0dbc2e1ae4d84b | /essentials-uninstaller/src/main/java/org/onehippo/cms7/essentials/plugins/uninstaller/FileObjectFlattener.java | 77056dca9dbc464f2e0a44f237fea7e1b762c289 | []
| no_license | bloomreach/xm-essentials-uninstaller | https://github.com/bloomreach/xm-essentials-uninstaller | 0ddb536cc377b786ea44ad99b44e3eca9d949cd2 | 6febd3a33459bdefa8210a5aaa7a7e7d12f3f992 | refs/heads/master | 2023-07-19T19:58:30.065000 | 2021-09-02T08:16:08 | 2021-09-02T08:16:08 | 402,342,702 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.onehippo.cms7.essentials.plugins.uninstaller;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;
public class FileObjectFlattener {
private FileObject fileObject;
public FileObjectFlattener(FileObject fileObject) {
this.fileObject = fileObject;
}
public List<FileObject> getChildren() {
try {
return fileObject.isFolder() ? Arrays.asList(fileObject.getChildren()) : Collections.emptyList();
} catch (FileSystemException e) {
}
return Collections.emptyList();
}
public FileObject getFileObject() {
return fileObject;
}
public Stream<FileObjectFlattener> flattened() {
return Stream.concat(
Stream.of(this),
getChildren().stream().map(fileObject -> new FileObjectFlattener(fileObject)).flatMap(FileObjectFlattener::flattened));
}
}
| UTF-8 | Java | 1,040 | java | FileObjectFlattener.java | Java | []
| null | []
| package org.onehippo.cms7.essentials.plugins.uninstaller;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;
public class FileObjectFlattener {
private FileObject fileObject;
public FileObjectFlattener(FileObject fileObject) {
this.fileObject = fileObject;
}
public List<FileObject> getChildren() {
try {
return fileObject.isFolder() ? Arrays.asList(fileObject.getChildren()) : Collections.emptyList();
} catch (FileSystemException e) {
}
return Collections.emptyList();
}
public FileObject getFileObject() {
return fileObject;
}
public Stream<FileObjectFlattener> flattened() {
return Stream.concat(
Stream.of(this),
getChildren().stream().map(fileObject -> new FileObjectFlattener(fileObject)).flatMap(FileObjectFlattener::flattened));
}
}
| 1,040 | 0.692308 | 0.689423 | 36 | 27.888889 | 29.559523 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.388889 | false | false | 9 |
467006fc36f6de2310db7edfeb648f542331c177 | 13,632,226,251,275 | 3ee9870756ce9020de03b4e79d1fc5a299ac0c4e | /Sprint3/src/main/java/CampaignManager/domain/entities/valueObjects/click/InstantTime.java | ffea16b3581a6060956917b24b17fade34f41397 | []
| no_license | PolSM95/CampaignManager | https://github.com/PolSM95/CampaignManager | 85938adabc460494e4fee2daf970aa58a2ddc082 | 1242d8253d8af3f66a9107f7182cf73597143085 | refs/heads/master | 2022-12-29T06:15:01.222000 | 2020-05-08T18:06:32 | 2020-05-08T18:06:32 | 262,390,992 | 0 | 0 | null | false | 2020-10-13T21:50:49 | 2020-05-08T17:51:19 | 2020-05-08T18:06:35 | 2020-10-13T21:50:48 | 69 | 0 | 0 | 1 | Java | false | false | package CampaignManager.domain.entities.valueObjects.click;
import CampaignManager.domain.DTOs.click.InstantTimeDTO;
import java.util.Objects;
public class InstantTime {
private String instant;
public InstantTime(String instant) {
this.instant = instant;
}
public InstantTimeDTO serialize(){
InstantTimeDTO instantTimeDTO = new InstantTimeDTO();
instantTimeDTO.instant = instant;
return instantTimeDTO;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InstantTime that = (InstantTime) o;
return Objects.equals(instant, that.instant);
}
@Override
public int hashCode() {
return Objects.hash(instant);
}
}
| UTF-8 | Java | 843 | java | InstantTime.java | Java | []
| null | []
| package CampaignManager.domain.entities.valueObjects.click;
import CampaignManager.domain.DTOs.click.InstantTimeDTO;
import java.util.Objects;
public class InstantTime {
private String instant;
public InstantTime(String instant) {
this.instant = instant;
}
public InstantTimeDTO serialize(){
InstantTimeDTO instantTimeDTO = new InstantTimeDTO();
instantTimeDTO.instant = instant;
return instantTimeDTO;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InstantTime that = (InstantTime) o;
return Objects.equals(instant, that.instant);
}
@Override
public int hashCode() {
return Objects.hash(instant);
}
}
| 843 | 0.634638 | 0.634638 | 32 | 24.34375 | 21.017269 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 9 |
6100d78905792303e498a468cb8844da64b1d4b5 | 3,195,455,699,187 | 2931238de9b3b5a3781b009eca167c9e5ac1e007 | /app/src/main/java/com/example/restaurant/CategoriesRequest.java | 49ffa5bde97437f652077417385949254030cf0d | []
| no_license | JoostBankras/restaurant | https://github.com/JoostBankras/restaurant | e5779acad06ee49dd0cff5eed90d367c4bdbfe17 | e2a51cd5667ebf663ff1f3c6aa689473b79b61f3 | refs/heads/master | 2020-05-22T16:01:20.548000 | 2019-05-23T14:05:48 | 2019-05-23T14:05:48 | 186,419,070 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.restaurant;
import android.content.Context;
import android.content.Intent;
import android.widget.ListView;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class CategoriesRequest implements Response.Listener<JSONObject>, Response.ErrorListener{
// variables
Context context;
String url = "https://resto.mprog.nl/categories";
Callback activity1;
ArrayList<String> list = new ArrayList<String>();
// interface for functions
public interface Callback {
void gotCategories(ArrayList<String> categories);
void gotCategoriesError(String message);
}
// if JSONObject isn't received properly
@Override
public void onErrorResponse(VolleyError error) {
System.out.println(error);
}
// if JSONObject is received properly
@Override
public void onResponse(JSONObject response) {
JSONArray array;
// get the JSONArray's if possible
try{
array = response.getJSONArray("categories");
for (int i = 0; i < array.length(); i++ ){
String object1 = array.get(i).toString();
list.add(object1);
}
activity1.gotCategories(list);
} catch (JSONException e){
e.printStackTrace();
}
}
// constructor for CategoriesRequest
public CategoriesRequest(Context context1){
context = context1;
}
// callable function for Categories
public void getCategories(Callback activity){
activity1 = activity;
RequestQueue queue = Volley.newRequestQueue(context);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(url,null, this, this);
queue.add(jsonObjectRequest);
}
}
| UTF-8 | Java | 2,086 | java | CategoriesRequest.java | Java | []
| null | []
| package com.example.restaurant;
import android.content.Context;
import android.content.Intent;
import android.widget.ListView;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class CategoriesRequest implements Response.Listener<JSONObject>, Response.ErrorListener{
// variables
Context context;
String url = "https://resto.mprog.nl/categories";
Callback activity1;
ArrayList<String> list = new ArrayList<String>();
// interface for functions
public interface Callback {
void gotCategories(ArrayList<String> categories);
void gotCategoriesError(String message);
}
// if JSONObject isn't received properly
@Override
public void onErrorResponse(VolleyError error) {
System.out.println(error);
}
// if JSONObject is received properly
@Override
public void onResponse(JSONObject response) {
JSONArray array;
// get the JSONArray's if possible
try{
array = response.getJSONArray("categories");
for (int i = 0; i < array.length(); i++ ){
String object1 = array.get(i).toString();
list.add(object1);
}
activity1.gotCategories(list);
} catch (JSONException e){
e.printStackTrace();
}
}
// constructor for CategoriesRequest
public CategoriesRequest(Context context1){
context = context1;
}
// callable function for Categories
public void getCategories(Callback activity){
activity1 = activity;
RequestQueue queue = Volley.newRequestQueue(context);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(url,null, this, this);
queue.add(jsonObjectRequest);
}
}
| 2,086 | 0.687919 | 0.684084 | 71 | 28.366198 | 21.495653 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.549296 | false | false | 9 |
fd6c50fa06874f87c7412964c2a5872b5147b6f4 | 26,551,487,864,179 | 23051a4fc50a66247dc7f3d324756b9c9dbf3132 | /offer/Solution_29.java | ed7b611c157f5a8bf5b10cd8e0179be2da78f737 | []
| no_license | caixiong110/LeetCode | https://github.com/caixiong110/LeetCode | 41a7d67b26421a246d3b5d5024f2e491f912a268 | 926d31bc9380dfde86e651e3316b57c55c186117 | refs/heads/master | 2023-03-18T04:45:04.921000 | 2020-11-15T14:37:38 | 2020-11-15T14:37:38 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.str818.offer;
/**
* 顺时针打印矩阵
*
* 标签:数组
*
* Code It Now:https://leetcode-cn.com/problems/shun-shi-zhen-da-yin-ju-zhen-lcof/
*
* Note:https://str818.github.io/2019/07/09/sword-refers-to-offer-middle.html#29-%E9%A1%BA%E6%97%B6%E9%92%88%E6%89%93%E5%8D%B0%E7%9F%A9%E9%98%B5
*
* @author str818
* @date 2020/4/12
*/
public class Solution_29 {
public int[] spiralOrder(int[][] matrix) {
if (matrix.length == 0) return new int[0];
int m = matrix.length, n = matrix[0].length;
int[] ans = new int[m * n];
int r1 = 0, r2 = matrix.length - 1, c1 = 0, c2 = matrix[0].length - 1;
int index = 0;
while (r1 <= r2 && c1 <= c2) {
for (int i = c1; i <= c2; i++) {
ans[index++] = matrix[r1][i];
}
for (int i = r1 + 1; i <= r2; i++) {
ans[index++] = matrix[i][c2];
}
if (r1 != r2) {
for (int i = c2 - 1; i >= c1; i--) {
ans[index++] = matrix[r2][i];
}
}
if (c1 != c2) {
for (int i = r2 - 1; i > r1; i--) {
ans[index++] = matrix[i][c1];
}
}
r1++; r2--; c1++; c2--;
}
return ans;
}
}
| UTF-8 | Java | 1,329 | java | Solution_29.java | Java | [
{
"context": "%E6%89%93%E5%8D%B0%E7%9F%A9%E9%98%B5\n *\n * @author str818\n * @date 2020/4/12\n */\npublic class Solution_29 {",
"end": 308,
"score": 0.999643862247467,
"start": 302,
"tag": "USERNAME",
"value": "str818"
}
]
| null | []
| package com.str818.offer;
/**
* 顺时针打印矩阵
*
* 标签:数组
*
* Code It Now:https://leetcode-cn.com/problems/shun-shi-zhen-da-yin-ju-zhen-lcof/
*
* Note:https://str818.github.io/2019/07/09/sword-refers-to-offer-middle.html#29-%E9%A1%BA%E6%97%B6%E9%92%88%E6%89%93%E5%8D%B0%E7%9F%A9%E9%98%B5
*
* @author str818
* @date 2020/4/12
*/
public class Solution_29 {
public int[] spiralOrder(int[][] matrix) {
if (matrix.length == 0) return new int[0];
int m = matrix.length, n = matrix[0].length;
int[] ans = new int[m * n];
int r1 = 0, r2 = matrix.length - 1, c1 = 0, c2 = matrix[0].length - 1;
int index = 0;
while (r1 <= r2 && c1 <= c2) {
for (int i = c1; i <= c2; i++) {
ans[index++] = matrix[r1][i];
}
for (int i = r1 + 1; i <= r2; i++) {
ans[index++] = matrix[i][c2];
}
if (r1 != r2) {
for (int i = c2 - 1; i >= c1; i--) {
ans[index++] = matrix[r2][i];
}
}
if (c1 != c2) {
for (int i = r2 - 1; i > r1; i--) {
ans[index++] = matrix[i][c1];
}
}
r1++; r2--; c1++; c2--;
}
return ans;
}
}
| 1,329 | 0.426595 | 0.354343 | 44 | 28.568182 | 27.394756 | 144 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.613636 | false | false | 9 |
e705573aa6d82c4fc875e8f130f43f0b06f3de38 | 6,528,350,291,247 | 5d4bcf345bc66af9046535b8079a9e51b30927ec | /frame-common/frame-common-core/src/main/java/com/snaker/common/utils/bean/BeanUtils.java | 19a42bdf9ca4e08b0266ea4fba7f15ce0297375a | [
"MIT"
]
| permissive | snakerfor/sanker-cloud | https://github.com/snakerfor/sanker-cloud | 8237086a794d72bec962f7fc61f4b968d98c6591 | c3919cdae40cac8c37a3641a74476d4e979ec521 | refs/heads/main | 2023-08-27T06:42:21.599000 | 2021-11-11T09:31:21 | 2021-11-11T09:31:21 | 426,943,498 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.snaker.common.utils.bean;
import com.snaker.common.utils.reflect.ReflectUtils;
import org.apache.commons.collections4.CollectionUtils;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Bean 工具类
*
* @author sfd
*/
public class BeanUtils extends org.springframework.beans.BeanUtils {
/**
* Bean方法名中属性名开始的下标
*/
private static final int BEAN_METHOD_PROP_INDEX = 3;
/**
* 匹配getter方法的正则表达式
*/
private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
/**
* 匹配setter方法的正则表达式
*/
private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
/**
* Bean属性复制工具方法。
*
* @param dest 目标对象
* @param src 源对象
*/
public static void copyBeanProp(Object dest, Object src) {
try {
copyProperties(src, dest);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 获取对象的setter方法。
*
* @param obj 对象
* @return 对象的setter方法列表
*/
public static List<Method> getSetterMethods(Object obj) {
// setter方法列表
List<Method> setterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找setter方法
for (Method method : methods) {
Matcher m = SET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 1)) {
setterMethods.add(method);
}
}
// 返回setter方法列表
return setterMethods;
}
/**
* 获取对象的getter方法。
*
* @param obj 对象
* @return 对象的getter方法列表
*/
public static List<Method> getGetterMethods(Object obj) {
// getter方法列表
List<Method> getterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找getter方法
for (Method method : methods) {
Matcher m = GET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 0)) {
getterMethods.add(method);
}
}
// 返回getter方法列表
return getterMethods;
}
/**
* 检查Bean方法名中的属性名是否相等。<br>
* 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
*
* @param m1 方法名1
* @param m2 方法名2
* @return 属性名一样返回true,否则返回false
*/
public static boolean isMethodPropEquals(String m1, String m2) {
return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
}
public static void setFieldNull(Object obj, Set<String> fields) {
if (obj == null || CollectionUtils.isEmpty(fields)) {
return;
}
Field[] allFields = obj.getClass().getDeclaredFields();
for (int index = 0; index < allFields.length; index++) {
Field field = allFields[index];
String fieldName = field.getName();
if (fields.contains(fieldName)) {
ReflectUtils.setFieldValue(obj, fieldName, null);
}
}
}
public static void setFieldNull(Object obj, String[] fields) {
setFieldNull(obj, new HashSet<>(Arrays.asList(fields)));
}
public static Field[] fetchAllFieldWithParentClass(Class tempClass) {
List<Field> fieldList = new ArrayList<>();
while (tempClass != null && !tempClass.getName().toLowerCase().equals("java.lang.object")) {
fieldList.addAll(Arrays.asList(tempClass.getDeclaredFields()));
//得到父类,然后赋给自己
tempClass = tempClass.getSuperclass();
}
return fieldList.toArray(new Field[fieldList.size()]);
}
public static void copyPropertiesWithAppointProperties(Object source, Object target, String[] copyProperties) {
HashSet<String> copyPropertiesSet = new HashSet<>(Arrays.asList(copyProperties));
Class<?> sourceClass = source.getClass();
Class<?> targetClass = target.getClass();
if (!sourceClass.equals(targetClass)) throw new RuntimeException("class不一致!");
Field[] allFields = fetchAllFieldWithParentClass(sourceClass);
String[] ignoreFields = Arrays.stream(allFields).map(Field::getName).filter(item -> !copyPropertiesSet.contains(item)).toArray(String[]::new);
copyProperties(source, target, ignoreFields);
}
}
| UTF-8 | Java | 4,906 | java | BeanUtils.java | Java | [
{
"context": "util.regex.Pattern;\n\n/**\n * Bean 工具类\n *\n * @author sfd\n */\npublic class BeanUtils extends org.springfram",
"end": 332,
"score": 0.9996172189712524,
"start": 329,
"tag": "USERNAME",
"value": "sfd"
}
]
| null | []
| package com.snaker.common.utils.bean;
import com.snaker.common.utils.reflect.ReflectUtils;
import org.apache.commons.collections4.CollectionUtils;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Bean 工具类
*
* @author sfd
*/
public class BeanUtils extends org.springframework.beans.BeanUtils {
/**
* Bean方法名中属性名开始的下标
*/
private static final int BEAN_METHOD_PROP_INDEX = 3;
/**
* 匹配getter方法的正则表达式
*/
private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
/**
* 匹配setter方法的正则表达式
*/
private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
/**
* Bean属性复制工具方法。
*
* @param dest 目标对象
* @param src 源对象
*/
public static void copyBeanProp(Object dest, Object src) {
try {
copyProperties(src, dest);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 获取对象的setter方法。
*
* @param obj 对象
* @return 对象的setter方法列表
*/
public static List<Method> getSetterMethods(Object obj) {
// setter方法列表
List<Method> setterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找setter方法
for (Method method : methods) {
Matcher m = SET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 1)) {
setterMethods.add(method);
}
}
// 返回setter方法列表
return setterMethods;
}
/**
* 获取对象的getter方法。
*
* @param obj 对象
* @return 对象的getter方法列表
*/
public static List<Method> getGetterMethods(Object obj) {
// getter方法列表
List<Method> getterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找getter方法
for (Method method : methods) {
Matcher m = GET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 0)) {
getterMethods.add(method);
}
}
// 返回getter方法列表
return getterMethods;
}
/**
* 检查Bean方法名中的属性名是否相等。<br>
* 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
*
* @param m1 方法名1
* @param m2 方法名2
* @return 属性名一样返回true,否则返回false
*/
public static boolean isMethodPropEquals(String m1, String m2) {
return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
}
public static void setFieldNull(Object obj, Set<String> fields) {
if (obj == null || CollectionUtils.isEmpty(fields)) {
return;
}
Field[] allFields = obj.getClass().getDeclaredFields();
for (int index = 0; index < allFields.length; index++) {
Field field = allFields[index];
String fieldName = field.getName();
if (fields.contains(fieldName)) {
ReflectUtils.setFieldValue(obj, fieldName, null);
}
}
}
public static void setFieldNull(Object obj, String[] fields) {
setFieldNull(obj, new HashSet<>(Arrays.asList(fields)));
}
public static Field[] fetchAllFieldWithParentClass(Class tempClass) {
List<Field> fieldList = new ArrayList<>();
while (tempClass != null && !tempClass.getName().toLowerCase().equals("java.lang.object")) {
fieldList.addAll(Arrays.asList(tempClass.getDeclaredFields()));
//得到父类,然后赋给自己
tempClass = tempClass.getSuperclass();
}
return fieldList.toArray(new Field[fieldList.size()]);
}
public static void copyPropertiesWithAppointProperties(Object source, Object target, String[] copyProperties) {
HashSet<String> copyPropertiesSet = new HashSet<>(Arrays.asList(copyProperties));
Class<?> sourceClass = source.getClass();
Class<?> targetClass = target.getClass();
if (!sourceClass.equals(targetClass)) throw new RuntimeException("class不一致!");
Field[] allFields = fetchAllFieldWithParentClass(sourceClass);
String[] ignoreFields = Arrays.stream(allFields).map(Field::getName).filter(item -> !copyPropertiesSet.contains(item)).toArray(String[]::new);
copyProperties(source, target, ignoreFields);
}
}
| 4,906 | 0.608341 | 0.605472 | 152 | 28.81579 | 29.017332 | 150 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.381579 | false | false | 9 |
3badad1bdd93e0d8dbd13bec08adce30561cd9ac | 8,555,574,920,242 | adb408f34837d4d061d91dfc7d737e57cbf49fa1 | /game/src/main/java/io/bacta/game/object/tangible/installation/InstallationObject.java | a36b5ff82c46f6400d7fdd028fadcdaa654c7389 | []
| no_license | bacta/swg-server | https://github.com/bacta/swg-server | 3a045be60c05520dc7f1045e5499de04aacc2e17 | 71115eea1792960b4bbb448921f262f4fdd86ce2 | refs/heads/develop | 2023-01-09T16:51:37.334000 | 2019-10-30T00:48:24 | 2019-10-30T00:48:24 | 87,016,230 | 8 | 1 | null | false | 2023-01-04T12:33:23 | 2017-04-02T21:06:39 | 2022-12-24T05:49:20 | 2023-01-04T12:33:19 | 3,345 | 6 | 1 | 46 | Java | false | false | package io.bacta.game.object.tangible.installation;
import io.bacta.game.object.tangible.TangibleObject;
import io.bacta.game.object.template.server.ServerObjectTemplate;
import io.bacta.shared.container.SlotIdManager;
import io.bacta.shared.template.ObjectTemplateList;
public class InstallationObject extends TangibleObject {
public InstallationObject(ObjectTemplateList objectTemplateList, SlotIdManager slotIdManager, ServerObjectTemplate template) {
super(objectTemplateList, slotIdManager, template);
}
}
| UTF-8 | Java | 529 | java | InstallationObject.java | Java | []
| null | []
| package io.bacta.game.object.tangible.installation;
import io.bacta.game.object.tangible.TangibleObject;
import io.bacta.game.object.template.server.ServerObjectTemplate;
import io.bacta.shared.container.SlotIdManager;
import io.bacta.shared.template.ObjectTemplateList;
public class InstallationObject extends TangibleObject {
public InstallationObject(ObjectTemplateList objectTemplateList, SlotIdManager slotIdManager, ServerObjectTemplate template) {
super(objectTemplateList, slotIdManager, template);
}
}
| 529 | 0.831758 | 0.831758 | 12 | 43.083332 | 36.065815 | 130 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.833333 | false | false | 9 |
cc6306f2a8fc4c517d2ac19f02665a434edd49fe | 11,235,634,478,497 | e10614f4b6a2183709dd197fea6f9298be2678c1 | /1920Fall/comp3111/project/src/main/java/monster/MonsterType.java | cf006b18cbf6aa2b7bb3b500317ea83adf7bfd9d | []
| no_license | cokenhe/hkust-comp-material | https://github.com/cokenhe/hkust-comp-material | 63a267fff783e6ff53eeaeeeb8ad44599dd23c72 | 43af76fcdf9c47996a9ddd0e7b76b9d99ef8df3c | refs/heads/main | 2023-05-06T18:40:29.057000 | 2021-05-20T10:45:55 | 2021-05-20T10:45:55 | 334,102,018 | 5 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package monster;
/**
* enum class of monster
*/
public enum MonsterType {
FOX,
PENGUIM,
UNICORN,
} | UTF-8 | Java | 122 | java | MonsterType.java | Java | []
| null | []
| package monster;
/**
* enum class of monster
*/
public enum MonsterType {
FOX,
PENGUIM,
UNICORN,
} | 122 | 0.57377 | 0.57377 | 10 | 11.3 | 9.252567 | 29 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false | 9 |
38dd852485cb415182d653e3752e41a632ac29cc | 33,071,248,231,783 | 690e53cd3f142827641dd05b99ac2b8d61555433 | /app/src/main/java/com/darkweb/genesisvpn/application/appManager/appListAdapter.java | a998fd129796b144c731b13bb46448f57ca192ca | []
| no_license | msmannan00/Genesis-VPN-Android | https://github.com/msmannan00/Genesis-VPN-Android | d3f1054bb3318c084b5b312d413335257efb8702 | 395364352347c4ee6a582025babbb89afcc2a0f7 | refs/heads/master | 2023-06-23T11:29:13.301000 | 2021-01-16T15:13:15 | 2021-01-16T15:13:15 | 199,302,033 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.darkweb.genesisvpn.application.appManager;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;
import com.darkweb.genesisvpn.R;
import com.darkweb.genesisvpn.application.constants.strings;
import com.darkweb.genesisvpn.application.homeManager.homeController;
import com.darkweb.genesisvpn.application.stateManager.sharedControllerManager;
import java.util.ArrayList;
public class appListAdapter extends RecyclerView.Adapter<appListAdapter.listViewHolder>
{
private FragmentActivity m_context;
private homeController UI_Thread_Context;
private ArrayList<String> m_disabled_packages;
private ArrayList<appListRowModel> m_app_model = new ArrayList<>();
private ArrayList<appListRowModel> m_app_model_async;
private ViewPager2 m_pager;
boolean isLoaded = false;
appListAdapter(FragmentActivity p_context, ArrayList<String> p_disabled_packages, ArrayList<appListRowModel> p_app_model, ViewPager2 p_pager) {
this.m_context = p_context;
m_pager = p_pager;
m_disabled_packages = p_disabled_packages;
m_app_model_async = p_app_model;
UI_Thread_Context = sharedControllerManager.getInstance().getHomeController();
updateAsync();
}
public void updateAsync(){
new Thread(){
public void run(){
try {
sleep(1000);
for(int counter=0;counter<m_app_model_async.size();counter++){
int finalCounter = counter;
UI_Thread_Context.runOnUiThread(() -> new Handler().postDelayed(() -> {
m_app_model.add(m_app_model_async.get(finalCounter));
appListAdapter.this.notifyItemRangeChanged(finalCounter, 1);
}, 0));
if(!isLoaded && counter==20 && m_pager.getVisibility() == View.INVISIBLE){
isLoaded = true;
UI_Thread_Context.runOnUiThread(() -> new Handler().postDelayed(() -> {
m_pager.setVisibility(View.VISIBLE);
m_pager.animate().cancel();
//m_pager.setAlpha(0);
m_pager.animate().setDuration(250).alpha(1);
}, 0));
}
sleep(0);
}
if(!isLoaded){
m_pager.setAlpha(0);
UI_Thread_Context.runOnUiThread(() -> new Handler().postDelayed(() -> {
m_pager.setVisibility(View.VISIBLE);
m_pager.animate().cancel();
//m_pager.setAlpha(0);
m_pager.animate().setDuration(250).alpha(1);
}, 0));
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}.start();
}
@Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.app_row_view, parent, false);
return new listViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull appListAdapter.listViewHolder holder, int position)
{
holder.bindListView(m_app_model.get(position));
}
@Override
public int getItemCount() {
return m_app_model.size();
}
/*View Holder Extensions*/
class listViewHolder extends RecyclerView.ViewHolder
{
TextView heaaderText;
TextView descriptionText;
TextView connected;
de.hdodenhof.circleimageview.CircleImageView icon;
LinearLayout layout;
Switch m_switch;
listViewHolder(View itemView) {
super(itemView);
}
void bindListView(appListRowModel model) {
heaaderText = itemView.findViewById(R.id.app_header);
descriptionText = itemView.findViewById(R.id.app_description);
connected = itemView.findViewById(R.id.app_connected);
icon = itemView.findViewById(R.id.app_icon);
layout = itemView.findViewById(R.id.app);
m_switch = itemView.findViewById(R.id.is_enabled);
m_switch.clearAnimation();
heaaderText.setText(model.getHeader());
descriptionText.setText(model.getDescription());
icon.setImageDrawable(model.getIcon());
final float scale = m_context.getResources().getDisplayMetrics().density;
int pixels = (int) (70 * scale + 0.5f);
icon.setMinimumWidth(pixels);
icon.setMinimumHeight(pixels);
if(!m_disabled_packages.contains(model.getDescription())){
m_switch.setChecked(true);
connected.setText(strings.AF_CONNECTED);
connected.setTextColor(m_context.getResources().getColor(R.color.green));
} else{
m_switch.setChecked(false);
connected.setText(strings.AF_UNCONNECTED);
connected.setTextColor(m_context.getResources().getColor(R.color.colorAccent));
}
final boolean[] isChecked = {m_switch.isChecked()};
layout.setOnClickListener(view -> {
isChecked[0] = !isChecked[0];
m_switch.setChecked(isChecked[0]);
if(!isChecked[0]){
if(!m_disabled_packages.contains(model.getDescription())){
m_disabled_packages.add(model.getDescription());
}
}else {
m_disabled_packages.remove(model.getDescription());
}
if(!isChecked[0]){
animateConnectText(connected, strings.AF_UNCONNECTED, m_context.getResources().getColor(R.color.colorAccent));
} else{
animateConnectText(connected, strings.AF_CONNECTED, m_context.getResources().getColor(R.color.green));
}
});
}
}
void animateConnectText(TextView p_connected, String p_text, int p_color){
m_context.runOnUiThread(() -> {
try{
if(p_connected.getAlpha()>=0.7f){
p_connected.animate().cancel();
p_connected.animate().alpha(0f).setDuration(250).withEndAction(() -> {
p_connected.setText(p_text);
p_connected.setTextColor(p_color);
p_connected.animate().setDuration(250).alpha(1);
}).start();
}else {
p_connected.animate().cancel();
p_connected.setAlpha(0.3f);
p_connected.setText(p_text);
p_connected.setTextColor(p_color);
p_connected.animate().setDuration(250).alpha(1).start();
}
}catch (Exception ex){
}
});
}
}
| UTF-8 | Java | 7,488 | java | appListAdapter.java | Java | []
| null | []
| package com.darkweb.genesisvpn.application.appManager;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;
import com.darkweb.genesisvpn.R;
import com.darkweb.genesisvpn.application.constants.strings;
import com.darkweb.genesisvpn.application.homeManager.homeController;
import com.darkweb.genesisvpn.application.stateManager.sharedControllerManager;
import java.util.ArrayList;
public class appListAdapter extends RecyclerView.Adapter<appListAdapter.listViewHolder>
{
private FragmentActivity m_context;
private homeController UI_Thread_Context;
private ArrayList<String> m_disabled_packages;
private ArrayList<appListRowModel> m_app_model = new ArrayList<>();
private ArrayList<appListRowModel> m_app_model_async;
private ViewPager2 m_pager;
boolean isLoaded = false;
appListAdapter(FragmentActivity p_context, ArrayList<String> p_disabled_packages, ArrayList<appListRowModel> p_app_model, ViewPager2 p_pager) {
this.m_context = p_context;
m_pager = p_pager;
m_disabled_packages = p_disabled_packages;
m_app_model_async = p_app_model;
UI_Thread_Context = sharedControllerManager.getInstance().getHomeController();
updateAsync();
}
public void updateAsync(){
new Thread(){
public void run(){
try {
sleep(1000);
for(int counter=0;counter<m_app_model_async.size();counter++){
int finalCounter = counter;
UI_Thread_Context.runOnUiThread(() -> new Handler().postDelayed(() -> {
m_app_model.add(m_app_model_async.get(finalCounter));
appListAdapter.this.notifyItemRangeChanged(finalCounter, 1);
}, 0));
if(!isLoaded && counter==20 && m_pager.getVisibility() == View.INVISIBLE){
isLoaded = true;
UI_Thread_Context.runOnUiThread(() -> new Handler().postDelayed(() -> {
m_pager.setVisibility(View.VISIBLE);
m_pager.animate().cancel();
//m_pager.setAlpha(0);
m_pager.animate().setDuration(250).alpha(1);
}, 0));
}
sleep(0);
}
if(!isLoaded){
m_pager.setAlpha(0);
UI_Thread_Context.runOnUiThread(() -> new Handler().postDelayed(() -> {
m_pager.setVisibility(View.VISIBLE);
m_pager.animate().cancel();
//m_pager.setAlpha(0);
m_pager.animate().setDuration(250).alpha(1);
}, 0));
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}.start();
}
@Override
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.app_row_view, parent, false);
return new listViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull appListAdapter.listViewHolder holder, int position)
{
holder.bindListView(m_app_model.get(position));
}
@Override
public int getItemCount() {
return m_app_model.size();
}
/*View Holder Extensions*/
class listViewHolder extends RecyclerView.ViewHolder
{
TextView heaaderText;
TextView descriptionText;
TextView connected;
de.hdodenhof.circleimageview.CircleImageView icon;
LinearLayout layout;
Switch m_switch;
listViewHolder(View itemView) {
super(itemView);
}
void bindListView(appListRowModel model) {
heaaderText = itemView.findViewById(R.id.app_header);
descriptionText = itemView.findViewById(R.id.app_description);
connected = itemView.findViewById(R.id.app_connected);
icon = itemView.findViewById(R.id.app_icon);
layout = itemView.findViewById(R.id.app);
m_switch = itemView.findViewById(R.id.is_enabled);
m_switch.clearAnimation();
heaaderText.setText(model.getHeader());
descriptionText.setText(model.getDescription());
icon.setImageDrawable(model.getIcon());
final float scale = m_context.getResources().getDisplayMetrics().density;
int pixels = (int) (70 * scale + 0.5f);
icon.setMinimumWidth(pixels);
icon.setMinimumHeight(pixels);
if(!m_disabled_packages.contains(model.getDescription())){
m_switch.setChecked(true);
connected.setText(strings.AF_CONNECTED);
connected.setTextColor(m_context.getResources().getColor(R.color.green));
} else{
m_switch.setChecked(false);
connected.setText(strings.AF_UNCONNECTED);
connected.setTextColor(m_context.getResources().getColor(R.color.colorAccent));
}
final boolean[] isChecked = {m_switch.isChecked()};
layout.setOnClickListener(view -> {
isChecked[0] = !isChecked[0];
m_switch.setChecked(isChecked[0]);
if(!isChecked[0]){
if(!m_disabled_packages.contains(model.getDescription())){
m_disabled_packages.add(model.getDescription());
}
}else {
m_disabled_packages.remove(model.getDescription());
}
if(!isChecked[0]){
animateConnectText(connected, strings.AF_UNCONNECTED, m_context.getResources().getColor(R.color.colorAccent));
} else{
animateConnectText(connected, strings.AF_CONNECTED, m_context.getResources().getColor(R.color.green));
}
});
}
}
void animateConnectText(TextView p_connected, String p_text, int p_color){
m_context.runOnUiThread(() -> {
try{
if(p_connected.getAlpha()>=0.7f){
p_connected.animate().cancel();
p_connected.animate().alpha(0f).setDuration(250).withEndAction(() -> {
p_connected.setText(p_text);
p_connected.setTextColor(p_color);
p_connected.animate().setDuration(250).alpha(1);
}).start();
}else {
p_connected.animate().cancel();
p_connected.setAlpha(0.3f);
p_connected.setText(p_text);
p_connected.setTextColor(p_color);
p_connected.animate().setDuration(250).alpha(1).start();
}
}catch (Exception ex){
}
});
}
}
| 7,488 | 0.565705 | 0.558761 | 182 | 40.142857 | 29.427904 | 147 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.653846 | false | false | 9 |
0ea9950e896ab860d8cb6444b9cb07e0b0fd5deb | 11,063,835,762,430 | 40a8cdb2c95fbcbb1f0addf5d8809a35a269dc74 | /src/belinic/game/Game.java | ff8fe1dce012d64e7e4e82594ce077c34749abef | [
"Apache-2.0"
]
| permissive | vbelinic-tgm/Schiebepuzzle | https://github.com/vbelinic-tgm/Schiebepuzzle | b42337781343144b9580b245a2997ce255ddf67a | 045a1513873dac879a541392862cd7d6313dc95d | refs/heads/master | 2016-09-09T17:00:46.710000 | 2014-03-20T21:28:46 | 2014-03-20T21:28:46 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package belinic.game;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import belinic.game.impl.Field;
/**
* Dies Methoden sollte ein Klasse beinhalten die man gegen die derzeitige tauschen moechte.
* @author Vennesa Belinic
* @version 1.0
*/
public interface Game {
//Methodenko(e)pf(e)
/**
* Erzeugt ein neues Spielfeld
* @param image sollte als Icon bei den Buttons gesetzt werden
* @param hoehe damit das Icon auf die Fenstergroesse angepasst wird
* @param breite damit das Icon auf die Fenstergroesse angepasst wird
* @return ein JButton-Array mit allen Buttons, die schon durchgemischt sind
*/
public JButton[] generateField(BufferedImage image, int hoehe, int breite);
/**
* generiert die Icons neu in der Reihenfolge der Loesung
* @param image Das BufferedImage aus dem die Subimmages augeschnitten werden
* @param hoehe damit das Icon auf die Fenstergroesse angepasst wird
* @param breite damit das Icon auf die Fenstergroesse angepasst wird
* @return ein ImageIcon-Array mit der Reihenfolge der Loesung
*/
public ImageIcon[] generateIcon(BufferedImage image, int hoehe, int breite);
/**
* Gibt das ganze Bild als ImageIcon zurueck
* @param image Das BufferedImage aus dem das Icon skaliert wird
* @param hoehe damit das Icon auf die Fenstergroesse angepasst wird
* @param breite damit das Icon auf die Fenstergroesse angepasst wird
* @return Ein ImageIcon mit angepasster Groesse
*/
public ImageIcon winImage(BufferedImage image, int hoehe, int breite);
/**
* Ueberprueft ob das Spiel- un das Loesungsarray gleich sind
* @return ob der Benutzer gewonnen hat
*/
public boolean check();
/**
* Tausch die zwei angegebenen Indizes im Spielarray aus
* @param a Index 1
* @param b Index 2
*/
public void tauschen(int a, int b);
/**
* Gibt die JButtons des Spielfeldes in der aktuelle Reihenfolge aus
* @return die JButtons der Spielfelds in aktueller Reihenfolge
*/
public JButton[] getButtons();
/**
* Gibt die Anzahl der Felder, des Spielfeldes, zurueck
* @return Anzahl der Felder
*/
public int getSize();
/**
* Gibt das aktuelle Spielfeld als Field-Array zurueck
* @return aktuelles Spielfeld Field-Array
*/
public Field[] getField();
/**
* Gibt die Loesung als Field-Array zurueck
* @return Loesung als Field-Array
*/
public Field[] getLoesung();
}
| UTF-8 | Java | 2,424 | java | Game.java | Java | [
{
"context": " gegen die derzeitige tauschen moechte.\n * @author Vennesa Belinic\n * @version 1.0\n */\npublic interface Game {\n\t\n\t\n\t",
"end": 274,
"score": 0.999758243560791,
"start": 259,
"tag": "NAME",
"value": "Vennesa Belinic"
}
]
| null | []
| package belinic.game;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import belinic.game.impl.Field;
/**
* Dies Methoden sollte ein Klasse beinhalten die man gegen die derzeitige tauschen moechte.
* @author <NAME>
* @version 1.0
*/
public interface Game {
//Methodenko(e)pf(e)
/**
* Erzeugt ein neues Spielfeld
* @param image sollte als Icon bei den Buttons gesetzt werden
* @param hoehe damit das Icon auf die Fenstergroesse angepasst wird
* @param breite damit das Icon auf die Fenstergroesse angepasst wird
* @return ein JButton-Array mit allen Buttons, die schon durchgemischt sind
*/
public JButton[] generateField(BufferedImage image, int hoehe, int breite);
/**
* generiert die Icons neu in der Reihenfolge der Loesung
* @param image Das BufferedImage aus dem die Subimmages augeschnitten werden
* @param hoehe damit das Icon auf die Fenstergroesse angepasst wird
* @param breite damit das Icon auf die Fenstergroesse angepasst wird
* @return ein ImageIcon-Array mit der Reihenfolge der Loesung
*/
public ImageIcon[] generateIcon(BufferedImage image, int hoehe, int breite);
/**
* Gibt das ganze Bild als ImageIcon zurueck
* @param image Das BufferedImage aus dem das Icon skaliert wird
* @param hoehe damit das Icon auf die Fenstergroesse angepasst wird
* @param breite damit das Icon auf die Fenstergroesse angepasst wird
* @return Ein ImageIcon mit angepasster Groesse
*/
public ImageIcon winImage(BufferedImage image, int hoehe, int breite);
/**
* Ueberprueft ob das Spiel- un das Loesungsarray gleich sind
* @return ob der Benutzer gewonnen hat
*/
public boolean check();
/**
* Tausch die zwei angegebenen Indizes im Spielarray aus
* @param a Index 1
* @param b Index 2
*/
public void tauschen(int a, int b);
/**
* Gibt die JButtons des Spielfeldes in der aktuelle Reihenfolge aus
* @return die JButtons der Spielfelds in aktueller Reihenfolge
*/
public JButton[] getButtons();
/**
* Gibt die Anzahl der Felder, des Spielfeldes, zurueck
* @return Anzahl der Felder
*/
public int getSize();
/**
* Gibt das aktuelle Spielfeld als Field-Array zurueck
* @return aktuelles Spielfeld Field-Array
*/
public Field[] getField();
/**
* Gibt die Loesung als Field-Array zurueck
* @return Loesung als Field-Array
*/
public Field[] getLoesung();
}
| 2,415 | 0.732673 | 0.731023 | 81 | 28.925926 | 27.454014 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.111111 | false | false | 9 |
894538f8630f2c05853e3d3dadd633e332eeed51 | 6,914,897,408,749 | b309c94b6e1750f058c96c718acb6dd0ab6ec8ff | /app/src/main/java/com/mibtech/aesthetic_am/fragment/AddressAddUpdateFragment.java | 27a45024759ab1ec9209fed6f7abefdef7ef2fef | []
| no_license | anfaas1618/aestheticAM-clientApp | https://github.com/anfaas1618/aestheticAM-clientApp | 967301c3f1efcc046717bab13cab3548dc6f02d8 | a9d9b7de10a2a215b54d2c5912b64a14a41fbc58 | refs/heads/master | 2023-05-30T23:42:02.944000 | 2021-07-03T07:32:02 | 2021-07-03T07:32:02 | 377,737,241 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mibtech.aesthetic_am.fragment;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.gson.Gson;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import com.mibtech.aesthetic_am.R;
import com.mibtech.aesthetic_am.activity.MainActivity;
import com.mibtech.aesthetic_am.adapter.AddressAdapter;
import com.mibtech.aesthetic_am.helper.ApiConfig;
import com.mibtech.aesthetic_am.helper.Constant;
import com.mibtech.aesthetic_am.helper.Session;
import com.mibtech.aesthetic_am.helper.VolleyCallback;
import com.mibtech.aesthetic_am.model.Address;
import com.mibtech.aesthetic_am.model.City;
import static android.content.Context.INPUT_METHOD_SERVICE;
import static com.mibtech.aesthetic_am.fragment.AddressListFragment.addressAdapter;
import static com.mibtech.aesthetic_am.fragment.AddressListFragment.addresses;
import static com.mibtech.aesthetic_am.fragment.AddressListFragment.recyclerView;
public class AddressAddUpdateFragment extends Fragment implements OnMapReadyCallback {
public static TextView tvCurrent;
public static double latitude = 0.00, longitude = 0.00;
public static Address address1;
public static SupportMapFragment mapFragment;
public static OnMapReadyCallback mapReadyCallback;
View root;
Button btnsubmit;
ProgressBar progressBar;
CheckBox chIsDefault;
RadioButton rdHome, rdOffice, rdOther;
Session session;
String isDefault = "0";
TextView tvUpdate, edtName, edtMobile, edtAlternateMobile, edtAddress, edtLanmark, edtPinCode, edtState, edtCounty;
ScrollView scrollView;
String name, mobile, alternateMobile, address2, landmark, pincode, state, country, isdefault, addressType;
int position;
Activity activity;
int offset = 0;
String For;
@SuppressLint("SetTextI18n")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
root = inflater.inflate(R.layout.fragment_address_add_update, container, false);
activity = getActivity();
setHasOptionsMenu(true);
edtName = root.findViewById(R.id.edtName);
edtMobile = root.findViewById(R.id.edtMobile);
edtAlternateMobile = root.findViewById(R.id.edtAlternateMobile);
edtLanmark = root.findViewById(R.id.edtLanmark);
edtAddress = root.findViewById(R.id.edtAddress);
edtPinCode = root.findViewById(R.id.edtPinCode);
edtState = root.findViewById(R.id.edtState);
edtCounty = root.findViewById(R.id.edtCountry);
btnsubmit = root.findViewById(R.id.btnsubmit);
scrollView = root.findViewById(R.id.scrollView);
progressBar = root.findViewById(R.id.progressBar);
chIsDefault = root.findViewById(R.id.chIsDefault);
rdHome = root.findViewById(R.id.rdHome);
rdOffice = root.findViewById(R.id.rdOffice);
rdOther = root.findViewById(R.id.rdOther);
tvCurrent = root.findViewById(R.id.tvCurrent);
tvUpdate = root.findViewById(R.id.tvUpdate);
session = new Session(activity);
edtName.setText(session.getData(Constant.NAME));
edtAddress.setText(session.getData(Constant.ADDRESS));
edtPinCode.setText(session.getData(Constant.PINCODE));
edtMobile.setText(session.getData(Constant.MOBILE));
mapReadyCallback = new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
double saveLatitude, saveLongitude;
if (latitude <= 0 || longitude <= 0) {
saveLatitude = Double.parseDouble(session.getCoordinates(Constant.LATITUDE));
saveLongitude = Double.parseDouble(session.getCoordinates(Constant.LONGITUDE));
} else {
saveLatitude = latitude;
saveLongitude = longitude;
}
googleMap.clear();
LatLng latLng = new LatLng(saveLatitude, saveLongitude);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.addMarker(new MarkerOptions()
.position(latLng)
.draggable(true)
.title(getString(R.string.current_location)));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
googleMap.animateCamera(CameraUpdateFactory.zoomTo(18));
}
};
mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
assert mapFragment != null;
mapFragment.getMapAsync(this);
Bundle bundle = getArguments();
assert bundle != null;
For = bundle.getString("for");
position = bundle.getInt("position");
if (For.equals("update")) {
btnsubmit.setText(getString(R.string.update));
address1 = (Address) bundle.getSerializable("model");
latitude = Double.parseDouble(address1.getLatitude());
longitude = Double.parseDouble(address1.getLongitude());
tvCurrent.setText(getString(R.string.location_1) + ApiConfig.getAddress(latitude, longitude, getActivity()));
mapFragment.getMapAsync(this);
SetData();
} else {
progressBar.setVisibility(View.VISIBLE);
SetSpinnerData();
scrollView.setVisibility(View.VISIBLE);
btnsubmit.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.GONE);
}
btnsubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AddUpdateAddress();
}
});
tvUpdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Fragment fragment = new MapFragment();
Bundle bundle = new Bundle();
bundle.putString(Constant.FROM, "address");
bundle.putDouble("latitude", latitude);
bundle.putDouble("longitude", longitude);
fragment.setArguments(bundle);
MainActivity.fm.beginTransaction().add(R.id.container, fragment).addToBackStack(null).commit();
}
});
chIsDefault.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isDefault.equalsIgnoreCase("0")) {
isDefault = "1";
} else {
isDefault = "0";
}
}
});
return root;
}
void SetData() {
name = address1.getName();
mobile = address1.getMobile();
address2 = address1.getAddress();
alternateMobile = address1.getAlternate_mobile();
landmark = address1.getLandmark();
pincode = address1.getPincode();
state = address1.getState();
country = address1.getCountry();
isdefault = address1.getIs_default();
addressType = address1.getType();
progressBar.setVisibility(View.VISIBLE);
SetSpinnerData();
edtName.setText(name);
edtMobile.setText(mobile);
edtAlternateMobile.setText(alternateMobile);
edtAddress.setText(address2);
edtLanmark.setText(landmark);
edtPinCode.setText(pincode);
edtState.setText(state);
edtCounty.setText(country);
chIsDefault.setChecked(isdefault.equalsIgnoreCase("1"));
if (addressType.equalsIgnoreCase("home")) {
rdHome.setChecked(true);
} else if (addressType.equalsIgnoreCase("office")) {
rdOffice.setChecked(true);
} else {
rdOther.setChecked(true);
}
progressBar.setVisibility(View.GONE);
btnsubmit.setVisibility(View.VISIBLE);
btnsubmit.setVisibility(View.VISIBLE);
}
void AddUpdateAddress() {
String isDefault = chIsDefault.isChecked() ? "1" : "0";
String type = rdHome.isChecked() ? "Home" : rdOffice.isChecked() ? "Office" : "Other";
if (edtName.getText().toString().trim().isEmpty()) {
edtName.requestFocus();
edtName.setError("Please enter name!");
} else if (edtMobile.getText().toString().trim().isEmpty()) {
edtMobile.requestFocus();
edtMobile.setError("Please enter mobile!");
} else if (edtAddress.getText().toString().trim().isEmpty()) {
edtAddress.requestFocus();
edtAddress.setError("Please enter address!");
} else if (edtLanmark.getText().toString().trim().isEmpty()) {
edtLanmark.requestFocus();
edtLanmark.setError("Please enter landmark!");
} else if (edtPinCode.getText().toString().trim().isEmpty()) {
edtPinCode.requestFocus();
edtPinCode.setError("Please enter pin code!");
} else if (edtState.getText().toString().trim().isEmpty()) {
edtState.requestFocus();
edtState.setError("Please enter state!");
} else if (edtCounty.getText().toString().trim().isEmpty()) {
edtCounty.requestFocus();
edtCounty.setError("Please enter country");
} else {
Map<String, String> params = new HashMap<>();
if (For.equalsIgnoreCase("add")) {
params.put(Constant.ADD_ADDRESS, Constant.GetVal);
} else if (For.equalsIgnoreCase("update")) {
params.put(Constant.UPDATE_ADDRESS, Constant.GetVal);
params.put(Constant.ID, address1.getId());
}
params.put(Constant.USER_ID, session.getData(Constant.ID));
params.put(Constant.TYPE, type);
params.put(Constant.NAME, edtName.getText().toString().trim());
params.put(Constant.COUNTRY_CODE, session.getData(Constant.COUNTRY_CODE));
params.put(Constant.MOBILE, edtMobile.getText().toString().trim());
params.put(Constant.ALTERNATE_MOBILE, edtAlternateMobile.getText().toString().trim());
params.put(Constant.ADDRESS, edtAddress.getText().toString().trim());
params.put(Constant.LANDMARK, edtLanmark.getText().toString().trim());
params.put(Constant.CITY_ID, "3");
params.put(Constant.AREA_ID, "5");
params.put(Constant.PINCODE, edtPinCode.getText().toString().trim());
params.put(Constant.STATE, edtState.getText().toString().trim());
params.put(Constant.COUNTRY, edtCounty.getText().toString().trim());
params.put(Constant.IS_DEFAULT, isDefault);
if (address1 != null) {
if (address1.getLongitude() != null || address1.getLatitude() != null) {
params.put(Constant.LONGITUDE, session.getCoordinates(Constant.LONGITUDE));
params.put(Constant.LATITUDE, session.getCoordinates(Constant.LATITUDE));
} else {
params.put(Constant.LONGITUDE, "" + longitude);
params.put(Constant.LATITUDE, "" + latitude);
}
}
ApiConfig.RequestToVolley(new VolleyCallback() {
@Override
public void onSuccess(boolean result, String response) {
if (result) {
try {
String msg;
JSONObject jsonObject = new JSONObject(response);
if (!jsonObject.getBoolean(Constant.ERROR)) {
offset = 0;
Gson g = new Gson();
Address address = g.fromJson(jsonObject.toString(), Address.class);
address.setCity_name("In India");
address.setArea_name("In India");
if (address.getIs_default().equals("1")) {
for (int i = 0; i < addresses.size(); i++) {
addresses.get(i).setIs_default("0");
}
}
if (For.equalsIgnoreCase("add")) {
msg = "Address added.";
if (addressAdapter != null) {
addresses.add(address);
} else {
addresses = new ArrayList<>();
addresses.add(address);
addressAdapter = new AddressAdapter(getContext(), getActivity(), addresses);
recyclerView.setAdapter(addressAdapter);
recyclerView.setVisibility(View.VISIBLE);
}
} else {
addresses.set(position, address);
msg = "Address updated.";
}
AddressListFragment.tvAlert.setVisibility(View.GONE);
if (addressAdapter != null) {
addressAdapter.notifyDataSetChanged();
}
if (address.getIs_default().equals("1")) {
Constant.selectedAddressId = address.getId();
} else {
if (Constant.selectedAddressId.equals(address.getId()))
Constant.selectedAddressId = "";
}
MainActivity.fm.popBackStack();
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
}
}
}
}, getActivity(), Constant.GET_ADDRESS_URL, params, true);
}
}
void SetSpinnerData() {
try {
Map<String, String> params = new HashMap<>();
Activity activity = getActivity();
if (activity != null) {
ApiConfig.RequestToVolley((result, response) -> {
if (result) {
try {
JSONObject objectbject = new JSONObject(response);
int pos = -1;
if (!objectbject.getBoolean(Constant.ERROR)) {
if (getContext() != null) {
JSONArray jsonArray = objectbject.getJSONArray(Constant.DATA);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
}
}
}
} catch (JSONException e) {
}
}
}, activity, Constant.CITY_URL, params, false);
}
} catch (Exception e) {
}
}
@Override
public void onResume() {
super.onResume();
Constant.TOOLBAR_TITLE = getActivity().getString(R.string.address);
getActivity().invalidateOptionsMenu();
hideKeyboard();
}
public void hideKeyboard() {
try {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(INPUT_METHOD_SERVICE);
assert inputMethodManager != null;
inputMethodManager.hideSoftInputFromWindow(root.getApplicationWindowToken(), 0);
} catch (Exception e) {
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
double saveLatitude, saveLongitude;
if (For.equals("update")) {
btnsubmit.setText(getString(R.string.update));
assert getArguments() != null;
address1 = (Address) getArguments().getSerializable("model");
latitude = Double.parseDouble(address1.getLatitude());
longitude = Double.parseDouble(address1.getLongitude());
}
if (latitude <= 0 || longitude <= 0) {
saveLatitude = Double.parseDouble(session.getCoordinates(Constant.LATITUDE));
saveLongitude = Double.parseDouble(session.getCoordinates(Constant.LONGITUDE));
} else {
saveLatitude = latitude;
saveLongitude = longitude;
}
googleMap.clear();
LatLng latLng = new LatLng(saveLatitude, saveLongitude);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.addMarker(new MarkerOptions()
.position(latLng)
.draggable(true)
.title(getString(R.string.current_location)));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
googleMap.animateCamera(CameraUpdateFactory.zoomTo(18));
}
@Override
public void onPrepareOptionsMenu(@NonNull Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.findItem(R.id.toolbar_cart).setVisible(false);
menu.findItem(R.id.toolbar_sort).setVisible(false);
menu.findItem(R.id.toolbar_search).setVisible(false);
}
} | UTF-8 | Java | 19,187 | java | AddressAddUpdateFragment.java | Java | []
| null | []
| package com.mibtech.aesthetic_am.fragment;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.gson.Gson;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import com.mibtech.aesthetic_am.R;
import com.mibtech.aesthetic_am.activity.MainActivity;
import com.mibtech.aesthetic_am.adapter.AddressAdapter;
import com.mibtech.aesthetic_am.helper.ApiConfig;
import com.mibtech.aesthetic_am.helper.Constant;
import com.mibtech.aesthetic_am.helper.Session;
import com.mibtech.aesthetic_am.helper.VolleyCallback;
import com.mibtech.aesthetic_am.model.Address;
import com.mibtech.aesthetic_am.model.City;
import static android.content.Context.INPUT_METHOD_SERVICE;
import static com.mibtech.aesthetic_am.fragment.AddressListFragment.addressAdapter;
import static com.mibtech.aesthetic_am.fragment.AddressListFragment.addresses;
import static com.mibtech.aesthetic_am.fragment.AddressListFragment.recyclerView;
public class AddressAddUpdateFragment extends Fragment implements OnMapReadyCallback {
public static TextView tvCurrent;
public static double latitude = 0.00, longitude = 0.00;
public static Address address1;
public static SupportMapFragment mapFragment;
public static OnMapReadyCallback mapReadyCallback;
View root;
Button btnsubmit;
ProgressBar progressBar;
CheckBox chIsDefault;
RadioButton rdHome, rdOffice, rdOther;
Session session;
String isDefault = "0";
TextView tvUpdate, edtName, edtMobile, edtAlternateMobile, edtAddress, edtLanmark, edtPinCode, edtState, edtCounty;
ScrollView scrollView;
String name, mobile, alternateMobile, address2, landmark, pincode, state, country, isdefault, addressType;
int position;
Activity activity;
int offset = 0;
String For;
@SuppressLint("SetTextI18n")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
root = inflater.inflate(R.layout.fragment_address_add_update, container, false);
activity = getActivity();
setHasOptionsMenu(true);
edtName = root.findViewById(R.id.edtName);
edtMobile = root.findViewById(R.id.edtMobile);
edtAlternateMobile = root.findViewById(R.id.edtAlternateMobile);
edtLanmark = root.findViewById(R.id.edtLanmark);
edtAddress = root.findViewById(R.id.edtAddress);
edtPinCode = root.findViewById(R.id.edtPinCode);
edtState = root.findViewById(R.id.edtState);
edtCounty = root.findViewById(R.id.edtCountry);
btnsubmit = root.findViewById(R.id.btnsubmit);
scrollView = root.findViewById(R.id.scrollView);
progressBar = root.findViewById(R.id.progressBar);
chIsDefault = root.findViewById(R.id.chIsDefault);
rdHome = root.findViewById(R.id.rdHome);
rdOffice = root.findViewById(R.id.rdOffice);
rdOther = root.findViewById(R.id.rdOther);
tvCurrent = root.findViewById(R.id.tvCurrent);
tvUpdate = root.findViewById(R.id.tvUpdate);
session = new Session(activity);
edtName.setText(session.getData(Constant.NAME));
edtAddress.setText(session.getData(Constant.ADDRESS));
edtPinCode.setText(session.getData(Constant.PINCODE));
edtMobile.setText(session.getData(Constant.MOBILE));
mapReadyCallback = new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
double saveLatitude, saveLongitude;
if (latitude <= 0 || longitude <= 0) {
saveLatitude = Double.parseDouble(session.getCoordinates(Constant.LATITUDE));
saveLongitude = Double.parseDouble(session.getCoordinates(Constant.LONGITUDE));
} else {
saveLatitude = latitude;
saveLongitude = longitude;
}
googleMap.clear();
LatLng latLng = new LatLng(saveLatitude, saveLongitude);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.addMarker(new MarkerOptions()
.position(latLng)
.draggable(true)
.title(getString(R.string.current_location)));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
googleMap.animateCamera(CameraUpdateFactory.zoomTo(18));
}
};
mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
assert mapFragment != null;
mapFragment.getMapAsync(this);
Bundle bundle = getArguments();
assert bundle != null;
For = bundle.getString("for");
position = bundle.getInt("position");
if (For.equals("update")) {
btnsubmit.setText(getString(R.string.update));
address1 = (Address) bundle.getSerializable("model");
latitude = Double.parseDouble(address1.getLatitude());
longitude = Double.parseDouble(address1.getLongitude());
tvCurrent.setText(getString(R.string.location_1) + ApiConfig.getAddress(latitude, longitude, getActivity()));
mapFragment.getMapAsync(this);
SetData();
} else {
progressBar.setVisibility(View.VISIBLE);
SetSpinnerData();
scrollView.setVisibility(View.VISIBLE);
btnsubmit.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.GONE);
}
btnsubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AddUpdateAddress();
}
});
tvUpdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Fragment fragment = new MapFragment();
Bundle bundle = new Bundle();
bundle.putString(Constant.FROM, "address");
bundle.putDouble("latitude", latitude);
bundle.putDouble("longitude", longitude);
fragment.setArguments(bundle);
MainActivity.fm.beginTransaction().add(R.id.container, fragment).addToBackStack(null).commit();
}
});
chIsDefault.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isDefault.equalsIgnoreCase("0")) {
isDefault = "1";
} else {
isDefault = "0";
}
}
});
return root;
}
void SetData() {
name = address1.getName();
mobile = address1.getMobile();
address2 = address1.getAddress();
alternateMobile = address1.getAlternate_mobile();
landmark = address1.getLandmark();
pincode = address1.getPincode();
state = address1.getState();
country = address1.getCountry();
isdefault = address1.getIs_default();
addressType = address1.getType();
progressBar.setVisibility(View.VISIBLE);
SetSpinnerData();
edtName.setText(name);
edtMobile.setText(mobile);
edtAlternateMobile.setText(alternateMobile);
edtAddress.setText(address2);
edtLanmark.setText(landmark);
edtPinCode.setText(pincode);
edtState.setText(state);
edtCounty.setText(country);
chIsDefault.setChecked(isdefault.equalsIgnoreCase("1"));
if (addressType.equalsIgnoreCase("home")) {
rdHome.setChecked(true);
} else if (addressType.equalsIgnoreCase("office")) {
rdOffice.setChecked(true);
} else {
rdOther.setChecked(true);
}
progressBar.setVisibility(View.GONE);
btnsubmit.setVisibility(View.VISIBLE);
btnsubmit.setVisibility(View.VISIBLE);
}
void AddUpdateAddress() {
String isDefault = chIsDefault.isChecked() ? "1" : "0";
String type = rdHome.isChecked() ? "Home" : rdOffice.isChecked() ? "Office" : "Other";
if (edtName.getText().toString().trim().isEmpty()) {
edtName.requestFocus();
edtName.setError("Please enter name!");
} else if (edtMobile.getText().toString().trim().isEmpty()) {
edtMobile.requestFocus();
edtMobile.setError("Please enter mobile!");
} else if (edtAddress.getText().toString().trim().isEmpty()) {
edtAddress.requestFocus();
edtAddress.setError("Please enter address!");
} else if (edtLanmark.getText().toString().trim().isEmpty()) {
edtLanmark.requestFocus();
edtLanmark.setError("Please enter landmark!");
} else if (edtPinCode.getText().toString().trim().isEmpty()) {
edtPinCode.requestFocus();
edtPinCode.setError("Please enter pin code!");
} else if (edtState.getText().toString().trim().isEmpty()) {
edtState.requestFocus();
edtState.setError("Please enter state!");
} else if (edtCounty.getText().toString().trim().isEmpty()) {
edtCounty.requestFocus();
edtCounty.setError("Please enter country");
} else {
Map<String, String> params = new HashMap<>();
if (For.equalsIgnoreCase("add")) {
params.put(Constant.ADD_ADDRESS, Constant.GetVal);
} else if (For.equalsIgnoreCase("update")) {
params.put(Constant.UPDATE_ADDRESS, Constant.GetVal);
params.put(Constant.ID, address1.getId());
}
params.put(Constant.USER_ID, session.getData(Constant.ID));
params.put(Constant.TYPE, type);
params.put(Constant.NAME, edtName.getText().toString().trim());
params.put(Constant.COUNTRY_CODE, session.getData(Constant.COUNTRY_CODE));
params.put(Constant.MOBILE, edtMobile.getText().toString().trim());
params.put(Constant.ALTERNATE_MOBILE, edtAlternateMobile.getText().toString().trim());
params.put(Constant.ADDRESS, edtAddress.getText().toString().trim());
params.put(Constant.LANDMARK, edtLanmark.getText().toString().trim());
params.put(Constant.CITY_ID, "3");
params.put(Constant.AREA_ID, "5");
params.put(Constant.PINCODE, edtPinCode.getText().toString().trim());
params.put(Constant.STATE, edtState.getText().toString().trim());
params.put(Constant.COUNTRY, edtCounty.getText().toString().trim());
params.put(Constant.IS_DEFAULT, isDefault);
if (address1 != null) {
if (address1.getLongitude() != null || address1.getLatitude() != null) {
params.put(Constant.LONGITUDE, session.getCoordinates(Constant.LONGITUDE));
params.put(Constant.LATITUDE, session.getCoordinates(Constant.LATITUDE));
} else {
params.put(Constant.LONGITUDE, "" + longitude);
params.put(Constant.LATITUDE, "" + latitude);
}
}
ApiConfig.RequestToVolley(new VolleyCallback() {
@Override
public void onSuccess(boolean result, String response) {
if (result) {
try {
String msg;
JSONObject jsonObject = new JSONObject(response);
if (!jsonObject.getBoolean(Constant.ERROR)) {
offset = 0;
Gson g = new Gson();
Address address = g.fromJson(jsonObject.toString(), Address.class);
address.setCity_name("In India");
address.setArea_name("In India");
if (address.getIs_default().equals("1")) {
for (int i = 0; i < addresses.size(); i++) {
addresses.get(i).setIs_default("0");
}
}
if (For.equalsIgnoreCase("add")) {
msg = "Address added.";
if (addressAdapter != null) {
addresses.add(address);
} else {
addresses = new ArrayList<>();
addresses.add(address);
addressAdapter = new AddressAdapter(getContext(), getActivity(), addresses);
recyclerView.setAdapter(addressAdapter);
recyclerView.setVisibility(View.VISIBLE);
}
} else {
addresses.set(position, address);
msg = "Address updated.";
}
AddressListFragment.tvAlert.setVisibility(View.GONE);
if (addressAdapter != null) {
addressAdapter.notifyDataSetChanged();
}
if (address.getIs_default().equals("1")) {
Constant.selectedAddressId = address.getId();
} else {
if (Constant.selectedAddressId.equals(address.getId()))
Constant.selectedAddressId = "";
}
MainActivity.fm.popBackStack();
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
}
}
}
}, getActivity(), Constant.GET_ADDRESS_URL, params, true);
}
}
void SetSpinnerData() {
try {
Map<String, String> params = new HashMap<>();
Activity activity = getActivity();
if (activity != null) {
ApiConfig.RequestToVolley((result, response) -> {
if (result) {
try {
JSONObject objectbject = new JSONObject(response);
int pos = -1;
if (!objectbject.getBoolean(Constant.ERROR)) {
if (getContext() != null) {
JSONArray jsonArray = objectbject.getJSONArray(Constant.DATA);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
}
}
}
} catch (JSONException e) {
}
}
}, activity, Constant.CITY_URL, params, false);
}
} catch (Exception e) {
}
}
@Override
public void onResume() {
super.onResume();
Constant.TOOLBAR_TITLE = getActivity().getString(R.string.address);
getActivity().invalidateOptionsMenu();
hideKeyboard();
}
public void hideKeyboard() {
try {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(INPUT_METHOD_SERVICE);
assert inputMethodManager != null;
inputMethodManager.hideSoftInputFromWindow(root.getApplicationWindowToken(), 0);
} catch (Exception e) {
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
double saveLatitude, saveLongitude;
if (For.equals("update")) {
btnsubmit.setText(getString(R.string.update));
assert getArguments() != null;
address1 = (Address) getArguments().getSerializable("model");
latitude = Double.parseDouble(address1.getLatitude());
longitude = Double.parseDouble(address1.getLongitude());
}
if (latitude <= 0 || longitude <= 0) {
saveLatitude = Double.parseDouble(session.getCoordinates(Constant.LATITUDE));
saveLongitude = Double.parseDouble(session.getCoordinates(Constant.LONGITUDE));
} else {
saveLatitude = latitude;
saveLongitude = longitude;
}
googleMap.clear();
LatLng latLng = new LatLng(saveLatitude, saveLongitude);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.addMarker(new MarkerOptions()
.position(latLng)
.draggable(true)
.title(getString(R.string.current_location)));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
googleMap.animateCamera(CameraUpdateFactory.zoomTo(18));
}
@Override
public void onPrepareOptionsMenu(@NonNull Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.findItem(R.id.toolbar_cart).setVisible(false);
menu.findItem(R.id.toolbar_sort).setVisible(false);
menu.findItem(R.id.toolbar_search).setVisible(false);
}
} | 19,187 | 0.562516 | 0.559441 | 466 | 39.178112 | 27.779181 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.736051 | false | false | 9 |
f55a2064ba762f8f7cf436c6d4f77e4805969e2c | 26,456,998,602,117 | 85076099af233048a2a547d5b08a75709ec8d661 | /yebserver/src/main/java/com/org/hu/service/impl/MailLogServiceImpl.java | 25a59fe73ac00eb9502b542f5a6606ec2815718b | []
| no_license | huzeli/yeb | https://github.com/huzeli/yeb | 5e037d0313370bab1db5b85b7ad2536bd29c3508 | f0fdfcac7e6851c98d707c9e0ff05e42cf66f67e | refs/heads/master | 2023-03-18T08:15:10.261000 | 2021-03-04T15:16:42 | 2021-03-04T15:16:42 | 340,616,071 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.org.hu.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.org.hu.mapper.MailLogMapper;
import com.org.hu.pojo.MailLog;
import com.org.hu.service.IMailLogService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author jobob
* @since 2021-02-20
*/
@Service
public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> implements IMailLogService {
}
| UTF-8 | Java | 466 | java | MailLogServiceImpl.java | Java | [
{
"context": "rvice;\n\n/**\n * <p>\n * 服务实现类\n * </p>\n *\n * @author jobob\n * @since 2021-02-20\n */\n@Service\npublic class Ma",
"end": 313,
"score": 0.9995819330215454,
"start": 308,
"tag": "USERNAME",
"value": "jobob"
}
]
| null | []
| package com.org.hu.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.org.hu.mapper.MailLogMapper;
import com.org.hu.pojo.MailLog;
import com.org.hu.service.IMailLogService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author jobob
* @since 2021-02-20
*/
@Service
public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> implements IMailLogService {
}
| 466 | 0.767544 | 0.75 | 20 | 21.799999 | 26.547316 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.35 | false | false | 9 |
e0d005a6281650eb16e832a249caff51ebda5f97 | 13,812,614,872,101 | a66273956012604b873fc11f4436db6d4c247479 | /Projeto Final/Funções_finais/OpenPlugin.java | b64e81612064b2f7593ff4fb1249cfef9c83baaf | []
| no_license | gnmmarechal/lfa-projfinal-backup | https://github.com/gnmmarechal/lfa-projfinal-backup | af89f7e25bb742a2aa61ee01b13cf8053bbd2b9c | 31f32d4c1cfd3600ab40f80231788ce4c1f3cd02 | refs/heads/master | 2020-06-21T00:03:09.037000 | 2019-07-07T23:06:49 | 2019-07-07T23:06:49 | 197,294,131 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | public class OpenPlugin implements Plugin
{
private String[] args = {"path"};
private String[] deps = {"cv2"};
private String[] pluginDeps = {"Image"};
public LFACodeGenerator.TargetLanguage getFunctionLanguage()
{
return LFACodeGenerator.TargetLanguage.Python;
}
private String getArgString()
{
String retString = "";
for (int i = 0; i < args.length - 1; i++)
{
retString += args[i] + ", ";
}
retString += args[args.length-1];
return retString;
}
public String getFunctionName()
{
return "open";
}
public String[] getFunctionArguments()
{
return args;
}
public int getFunctionArgumentCount()
{
return this.getFunctionArguments().length;
}
public String[] getFunctionDependencies()
{
return deps;
}
public String[] getPluginDependencies()
{
return pluginDeps;
}
public String getFunction()
{
return "def " + this.getFunctionName() + "(" + this.getArgString() + "):\n" +
"\timg = cv2.imread(path)\n" +
"\treturn Image(img,path))\n";
}
}
| UTF-8 | Java | 1,011 | java | OpenPlugin.java | Java | []
| null | []
| public class OpenPlugin implements Plugin
{
private String[] args = {"path"};
private String[] deps = {"cv2"};
private String[] pluginDeps = {"Image"};
public LFACodeGenerator.TargetLanguage getFunctionLanguage()
{
return LFACodeGenerator.TargetLanguage.Python;
}
private String getArgString()
{
String retString = "";
for (int i = 0; i < args.length - 1; i++)
{
retString += args[i] + ", ";
}
retString += args[args.length-1];
return retString;
}
public String getFunctionName()
{
return "open";
}
public String[] getFunctionArguments()
{
return args;
}
public int getFunctionArgumentCount()
{
return this.getFunctionArguments().length;
}
public String[] getFunctionDependencies()
{
return deps;
}
public String[] getPluginDependencies()
{
return pluginDeps;
}
public String getFunction()
{
return "def " + this.getFunctionName() + "(" + this.getArgString() + "):\n" +
"\timg = cv2.imread(path)\n" +
"\treturn Image(img,path))\n";
}
}
| 1,011 | 0.657765 | 0.652819 | 50 | 19.18 | 19.429554 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.74 | false | false | 9 |
81f4c0be3c13e5fbe3090a8a76743ef6c558688f | 18,365,280,217,185 | 9b005580b4f9cff23df29e21f2c492b42a065b13 | /src/main/java/br/com/servico/votacao/service/VotacaoService.java | a8dde1c694a356eea5a672d4162ddbcf55445b1d | []
| no_license | reawmarco-zz/api-votacao | https://github.com/reawmarco-zz/api-votacao | 2f7ecb606ce305c36717bdc073984e0fd814a93a | 38026cac1d580ac129a246228c3a06eb3fd152b5 | refs/heads/master | 2022-01-05T11:13:48.599000 | 2019-07-23T01:21:57 | 2019-07-23T01:21:57 | 195,463,842 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.servico.votacao.service;
import br.com.servico.votacao.dto.*;
import br.com.servico.votacao.exception.NotFoundException;
import br.com.servico.votacao.exception.SessoEncerradaException;
import br.com.servico.votacao.exception.VotoInvalidoException;
import br.com.servico.votacao.repository.VotacaoRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class VotacaoService {
private static final Logger LOGGER = LoggerFactory.getLogger(VotacaoService.class);
private final VotacaoRepository repository;
private final PautaService pautaService;
private final SessaoVotacaoService sessaoVotacaoService;
private final AssociadoService associadoService;
@Autowired
public VotacaoService(VotacaoRepository repository, PautaService pautaService, SessaoVotacaoService sessaoVotacaoService, AssociadoService associadoService) {
this.repository = repository;
this.pautaService = pautaService;
this.sessaoVotacaoService = sessaoVotacaoService;
this.associadoService = associadoService;
}
/**
* metodo responsavel por realizar as validacoes antes do voto ser computado
* e persistido na base de dados
*
* @param dto - @{@link VotoDTO}
* @return - boolean
*/
@Transactional(readOnly = true)
public boolean isValidaVoto(VotoDTO dto) {
LOGGER.debug("Validando os dados para voto oidSessao = {}, oidPauta = {}, oidAssiciado = {}", dto.getOidSessaoVotacao(), dto.getOidPauta(), dto.getCpfAssociado());
if (!pautaService.isPautaValida(dto.getOidPauta())) {
LOGGER.error("Pauta nao localizada para votacao oidPauta {}", dto.getCpfAssociado());
throw new NotFoundException("Pauta não localizada oid " + dto.getOidPauta());
} else if (!sessaoVotacaoService.isSessaoVotacaoValida(dto.getOidSessaoVotacao())) {
LOGGER.error("Tentativa de voto para sessao encerrada oidSessaoVotacao {}", dto.getOidSessaoVotacao());
throw new SessoEncerradaException("Sessão de votação já encerrada");
} else if (!associadoService.isAssociadoPodeVotar(dto.getCpfAssociado())) {
LOGGER.error("Associado nao esta habilitado para votar {}", dto.getCpfAssociado());
throw new VotoInvalidoException("Não é possível votar mais de 1 vez na mesma pauta");
} else if (!associadoService.isValidaParticipacaoAssociadoVotacao(dto.getCpfAssociado(), dto.getOidPauta())) {
LOGGER.error("Associado tentou votar mais de 1 vez oidAssociado {}", dto.getCpfAssociado());
throw new VotoInvalidoException("Não é possível votar mais de 1 vez na mesma pauta");
}
return Boolean.TRUE;
}
/**
* Se os dados informados para o voto, forem considerados validos
* entao o voto é computado e persistido na base de dados.
*
* @param dto - @{@link VotoDTO}
* @return - String
*/
@Transactional
public String votar(VotoDTO dto) {
if (isValidaVoto(dto)) {
LOGGER.debug("Dados validos para voto oidSessao = {}, oidPauta = {}, oidAssiciado = {}", dto.getOidSessaoVotacao(), dto.getOidPauta(), dto.getCpfAssociado());
VotacaoDTO votacaoDTO = new VotacaoDTO(null,
dto.getOidPauta(),
dto.getOidSessaoVotacao(),
dto.getVoto(),
null,
null);
registrarVoto(votacaoDTO);
registrarAssociadoVotou(dto);
return "Voto validado";
}
return null;
}
/**
* Apos voto ser computado. O associado e registrado na base de dados a fim de
* evitar que o mesmo possa votar novamente na mesma sessao de votacao e na mesma pauta.
* <p>
* A opcao de voto nao e persistido na base de dados.
*
* @param dto - @{@link VotoDTO}
*/
@Transactional
public void registrarAssociadoVotou(VotoDTO dto) {
AssociadoDTO associadoDTO = new AssociadoDTO(null, dto.getCpfAssociado(), dto.getOidPauta());
associadoService.salvarAssociado(associadoDTO);
}
/**
* @param dto - @{@link VotacaoDTO}
*/
@Transactional
public void registrarVoto(VotacaoDTO dto) {
LOGGER.debug("Salvando o voto para oidPauta {}", dto.getOidPauta());
repository.save(VotacaoDTO.toEntity(dto));
}
/**
* Realiza a busca e contagem dos votos positivos e negativos para determinada sessao e pauta de votacao.
*
* @param oidPauta - @{@link br.com.servico.votacao.entity.Pauta} ID
* @param oidSessaoVotacao - @{@link br.com.servico.votacao.entity.SessaoVotacao} ID
* @return - @{@link VotacaoDTO}
*/
@Transactional(readOnly = true)
public VotacaoDTO buscarResultadoVotacao(Integer oidPauta, Integer oidSessaoVotacao) {
LOGGER.debug("Contabilizando os votos para oidPauta = {}, oidSessaoVotacao = {}", oidPauta, oidSessaoVotacao);
VotacaoDTO dto = new VotacaoDTO();
dto.setOidPauta(oidPauta);
dto.setOidSessaoVotacao(oidSessaoVotacao);
dto.setQuantidadeVotosSim(repository.countVotacaoByOidPautaAndOidSessaoVotacaoAndVoto(oidPauta, oidSessaoVotacao, Boolean.TRUE));
dto.setQuantidadeVotosNao(repository.countVotacaoByOidPautaAndOidSessaoVotacaoAndVoto(oidPauta, oidSessaoVotacao, Boolean.FALSE));
return dto;
}
/**
* Realiza a montagem dos objetos referente ao resultado de determinada sessao e pauta de votacao.
* <p>
* Contagem somente e realizada apos a finalizacao da sessao.
*
* @param oidPauta - @{@link br.com.servico.votacao.entity.Pauta} ID
* @param oidSessaoVotacao - @{@link br.com.servico.votacao.entity.SessaoVotacao} ID
* @return - @{@link ResultadoDTO}
*/
@Transactional(readOnly = true)
public ResultadoDTO buscarDadosResultadoVotacao(Integer oidPauta, Integer oidSessaoVotacao) {
if (isValidaSeDadosExistem(oidPauta, oidSessaoVotacao) && sessaoVotacaoService.isSessaoValidaParaContagem(oidSessaoVotacao)) {
LOGGER.debug("Construindo o objeto de retorno do resultado para oidPauta = {}, oidSessaoVotacao = {}", oidPauta, oidSessaoVotacao);
PautaDTO pautaDTO = pautaService.buscarPautaPeloOID(oidPauta);
VotacaoDTO votacaoDTO = buscarResultadoVotacao(oidPauta, oidSessaoVotacao);
return new ResultadoDTO(pautaDTO, votacaoDTO);
}
throw new NotFoundException("Sessão de votação ainda está aberta, não é possível obter a contagem do resultado.");
}
/**
* @param oidPauta - @{@link br.com.servico.votacao.entity.Pauta} ID
* @param oidSessaoVotacao - @{@link br.com.servico.votacao.entity.SessaoVotacao} ID
* @return - boolean
*/
@Transactional(readOnly = true)
public boolean isValidaSeDadosExistem(Integer oidPauta, Integer oidSessaoVotacao) {
return sessaoVotacaoService.isSessaoVotacaoExiste(oidSessaoVotacao) && pautaService.isPautaValida(oidPauta);
}
} | UTF-8 | Java | 7,280 | java | VotacaoService.java | Java | []
| null | []
| package br.com.servico.votacao.service;
import br.com.servico.votacao.dto.*;
import br.com.servico.votacao.exception.NotFoundException;
import br.com.servico.votacao.exception.SessoEncerradaException;
import br.com.servico.votacao.exception.VotoInvalidoException;
import br.com.servico.votacao.repository.VotacaoRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class VotacaoService {
private static final Logger LOGGER = LoggerFactory.getLogger(VotacaoService.class);
private final VotacaoRepository repository;
private final PautaService pautaService;
private final SessaoVotacaoService sessaoVotacaoService;
private final AssociadoService associadoService;
@Autowired
public VotacaoService(VotacaoRepository repository, PautaService pautaService, SessaoVotacaoService sessaoVotacaoService, AssociadoService associadoService) {
this.repository = repository;
this.pautaService = pautaService;
this.sessaoVotacaoService = sessaoVotacaoService;
this.associadoService = associadoService;
}
/**
* metodo responsavel por realizar as validacoes antes do voto ser computado
* e persistido na base de dados
*
* @param dto - @{@link VotoDTO}
* @return - boolean
*/
@Transactional(readOnly = true)
public boolean isValidaVoto(VotoDTO dto) {
LOGGER.debug("Validando os dados para voto oidSessao = {}, oidPauta = {}, oidAssiciado = {}", dto.getOidSessaoVotacao(), dto.getOidPauta(), dto.getCpfAssociado());
if (!pautaService.isPautaValida(dto.getOidPauta())) {
LOGGER.error("Pauta nao localizada para votacao oidPauta {}", dto.getCpfAssociado());
throw new NotFoundException("Pauta não localizada oid " + dto.getOidPauta());
} else if (!sessaoVotacaoService.isSessaoVotacaoValida(dto.getOidSessaoVotacao())) {
LOGGER.error("Tentativa de voto para sessao encerrada oidSessaoVotacao {}", dto.getOidSessaoVotacao());
throw new SessoEncerradaException("Sessão de votação já encerrada");
} else if (!associadoService.isAssociadoPodeVotar(dto.getCpfAssociado())) {
LOGGER.error("Associado nao esta habilitado para votar {}", dto.getCpfAssociado());
throw new VotoInvalidoException("Não é possível votar mais de 1 vez na mesma pauta");
} else if (!associadoService.isValidaParticipacaoAssociadoVotacao(dto.getCpfAssociado(), dto.getOidPauta())) {
LOGGER.error("Associado tentou votar mais de 1 vez oidAssociado {}", dto.getCpfAssociado());
throw new VotoInvalidoException("Não é possível votar mais de 1 vez na mesma pauta");
}
return Boolean.TRUE;
}
/**
* Se os dados informados para o voto, forem considerados validos
* entao o voto é computado e persistido na base de dados.
*
* @param dto - @{@link VotoDTO}
* @return - String
*/
@Transactional
public String votar(VotoDTO dto) {
if (isValidaVoto(dto)) {
LOGGER.debug("Dados validos para voto oidSessao = {}, oidPauta = {}, oidAssiciado = {}", dto.getOidSessaoVotacao(), dto.getOidPauta(), dto.getCpfAssociado());
VotacaoDTO votacaoDTO = new VotacaoDTO(null,
dto.getOidPauta(),
dto.getOidSessaoVotacao(),
dto.getVoto(),
null,
null);
registrarVoto(votacaoDTO);
registrarAssociadoVotou(dto);
return "Voto validado";
}
return null;
}
/**
* Apos voto ser computado. O associado e registrado na base de dados a fim de
* evitar que o mesmo possa votar novamente na mesma sessao de votacao e na mesma pauta.
* <p>
* A opcao de voto nao e persistido na base de dados.
*
* @param dto - @{@link VotoDTO}
*/
@Transactional
public void registrarAssociadoVotou(VotoDTO dto) {
AssociadoDTO associadoDTO = new AssociadoDTO(null, dto.getCpfAssociado(), dto.getOidPauta());
associadoService.salvarAssociado(associadoDTO);
}
/**
* @param dto - @{@link VotacaoDTO}
*/
@Transactional
public void registrarVoto(VotacaoDTO dto) {
LOGGER.debug("Salvando o voto para oidPauta {}", dto.getOidPauta());
repository.save(VotacaoDTO.toEntity(dto));
}
/**
* Realiza a busca e contagem dos votos positivos e negativos para determinada sessao e pauta de votacao.
*
* @param oidPauta - @{@link br.com.servico.votacao.entity.Pauta} ID
* @param oidSessaoVotacao - @{@link br.com.servico.votacao.entity.SessaoVotacao} ID
* @return - @{@link VotacaoDTO}
*/
@Transactional(readOnly = true)
public VotacaoDTO buscarResultadoVotacao(Integer oidPauta, Integer oidSessaoVotacao) {
LOGGER.debug("Contabilizando os votos para oidPauta = {}, oidSessaoVotacao = {}", oidPauta, oidSessaoVotacao);
VotacaoDTO dto = new VotacaoDTO();
dto.setOidPauta(oidPauta);
dto.setOidSessaoVotacao(oidSessaoVotacao);
dto.setQuantidadeVotosSim(repository.countVotacaoByOidPautaAndOidSessaoVotacaoAndVoto(oidPauta, oidSessaoVotacao, Boolean.TRUE));
dto.setQuantidadeVotosNao(repository.countVotacaoByOidPautaAndOidSessaoVotacaoAndVoto(oidPauta, oidSessaoVotacao, Boolean.FALSE));
return dto;
}
/**
* Realiza a montagem dos objetos referente ao resultado de determinada sessao e pauta de votacao.
* <p>
* Contagem somente e realizada apos a finalizacao da sessao.
*
* @param oidPauta - @{@link br.com.servico.votacao.entity.Pauta} ID
* @param oidSessaoVotacao - @{@link br.com.servico.votacao.entity.SessaoVotacao} ID
* @return - @{@link ResultadoDTO}
*/
@Transactional(readOnly = true)
public ResultadoDTO buscarDadosResultadoVotacao(Integer oidPauta, Integer oidSessaoVotacao) {
if (isValidaSeDadosExistem(oidPauta, oidSessaoVotacao) && sessaoVotacaoService.isSessaoValidaParaContagem(oidSessaoVotacao)) {
LOGGER.debug("Construindo o objeto de retorno do resultado para oidPauta = {}, oidSessaoVotacao = {}", oidPauta, oidSessaoVotacao);
PautaDTO pautaDTO = pautaService.buscarPautaPeloOID(oidPauta);
VotacaoDTO votacaoDTO = buscarResultadoVotacao(oidPauta, oidSessaoVotacao);
return new ResultadoDTO(pautaDTO, votacaoDTO);
}
throw new NotFoundException("Sessão de votação ainda está aberta, não é possível obter a contagem do resultado.");
}
/**
* @param oidPauta - @{@link br.com.servico.votacao.entity.Pauta} ID
* @param oidSessaoVotacao - @{@link br.com.servico.votacao.entity.SessaoVotacao} ID
* @return - boolean
*/
@Transactional(readOnly = true)
public boolean isValidaSeDadosExistem(Integer oidPauta, Integer oidSessaoVotacao) {
return sessaoVotacaoService.isSessaoVotacaoExiste(oidSessaoVotacao) && pautaService.isPautaValida(oidPauta);
}
} | 7,280 | 0.691503 | 0.690814 | 169 | 41.970413 | 41.055225 | 171 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.573964 | false | false | 9 |
02a49cb6468ce702e364e52be9e1f2e5a2ad2144 | 764,504,188,135 | 8347f47c99d160b71072e9036b5805a14e47fd78 | /core/src/com/mygdx/game/Box2D_Scratch.java | e35e23a744a0aab975ab7806e9ad01f714f7518d | []
| no_license | bensouthern/Fungeon_Scratch | https://github.com/bensouthern/Fungeon_Scratch | acc742e7c393b2250ffaed35082a100dd5b9775e | 1314f2cb6eef22605f81365f3f280fde26b75225 | refs/heads/master | 2016-09-05T18:16:00.055000 | 2015-04-12T15:13:59 | 2015-04-12T15:13:59 | 33,733,366 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mygdx.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.Box2D;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.physics.box2d.utils.Box2DBuild;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Touchpad;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
import com.badlogic.gdx.utils.Array;
import box2dLight.ChainLight;
import box2dLight.DirectionalLight;
import box2dLight.Light;
import box2dLight.PointLight;
import box2dLight.RayHandler;
/**
* Created by Ben on 2015-03-07.
*/
public class Box2D_Scratch extends ApplicationAdapter {
OrthographicCamera camera;
Vector2 gravity=new Vector2(0,-9.8f), CurMove=new Vector2(0,0);
BodyDef groundDef,squareDef;
Body squareBody, groundBody;
FixtureDef squareFixDef;
PolygonShape squareBox, groundBox;
World world;
RayHandler handler;
int height, width,X,Y;
double VX = 0, VY = 0;
Box2DDebugRenderer b2Renderer;
Array<Body> arWorldBodies = new Array<Body>();
SpriteBatch batch;
Touchpad touchpadMove;
Touchpad.TouchpadStyle touchpadMoveStyle;
Skin touchpadMoveSkin;
Drawable touchMoveKnob, touchMoveBackground;
Stage stage;
Texture imgB, imgLogic, imgG;
Sprite sprite;
@Override
public void create(){
height= Gdx.graphics.getHeight()/4;
width= Gdx.graphics.getWidth()/4;
X=width/2;
Y=height/2;
camera= new OrthographicCamera(width, height);
camera.position.set(width/2f,height/2f,0);
camera.update();
world=new World(gravity,false);
groundDef=new BodyDef();
squareDef=new BodyDef();
groundBox=new PolygonShape();
squareBox=new PolygonShape();
b2Renderer=new Box2DDebugRenderer();
squareFixDef=new FixtureDef();
groundDef.position.set(0.0f, 3);
groundBody= world.createBody(groundDef);
groundBox.setAsBox(width, 10f);
groundBody.createFixture(groundBox, 0f);
squareBox.setAsBox(10f, 10f);
squareDef.position.set(width/2, height/2);
squareDef.type= BodyDef.BodyType.DynamicBody;
squareBody=world.createBody(squareDef);
squareFixDef.restitution=0.3f;
squareFixDef.shape=squareBox;
squareFixDef.density=0.3f;
squareFixDef.friction=0.2f;
squareBody.createFixture(squareFixDef);
handler=new RayHandler(world);
handler.setCombinedMatrix(camera.combined);
new PointLight(handler, 1500, Color.ORANGE, 200, (width/2)-100,(height/2));
new PointLight(handler, 1500, Color.PURPLE, 250, (width/2)+100,(height/2));
stage = new Stage();
batch = new SpriteBatch();
imgLogic = new Texture("badlogic.jpg");
imgB = new Texture("black.png");
imgG = new Texture("grey.png");
touchpadMoveSkin = new Skin();//making a touchpad which is kinda like an analog stick
touchpadMoveSkin.add("touchKnob", imgB);
touchpadMoveSkin.add("touchBackground", imgLogic);
touchMoveKnob = touchpadMoveSkin.getDrawable("touchKnob");
touchMoveBackground = touchpadMoveSkin.getDrawable("touchBackground");
touchpadMoveStyle = new Touchpad.TouchpadStyle();
touchpadMoveStyle.knob = touchMoveKnob;
touchpadMoveStyle.background = touchMoveBackground;
touchpadMove = new Touchpad(1, touchpadMoveStyle);
touchpadMove.setSize(200, 200);
touchpadMove.setPosition(width/2-100, height/2-50);
stage.addActor(touchpadMove);
Gdx.input.setInputProcessor(stage);
sprite = new Sprite(imgLogic);
sprite.setSize(10f*2,10f*2);
sprite.setOrigin(sprite.getWidth()/2,sprite.getHeight()/2);
squareBody.setUserData(sprite);
}
@Override
public void dispose(){
world.dispose();
stage.dispose();
batch.dispose();
}
@Override
public void render(){
super.render();
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
b2Renderer.render(world, camera.combined);
batch.setProjectionMatrix(camera.combined);
batch.begin();
world.getBodies(arWorldBodies);
for(Body body: arWorldBodies){ //this is new to me
if(body.getUserData()!=null && body.getUserData() instanceof Sprite){
Sprite newSprite = (Sprite)body.getUserData();
newSprite.setPosition(body.getPosition().x-newSprite.getWidth()/2
,body.getPosition().y-newSprite.getHeight()/2);
newSprite.setRotation(body.getAngle()* MathUtils.radiansToDegrees);
newSprite.draw(batch);
}
}
batch.end();
CurMove.set(squareBody.getLinearVelocity());
if(touchpadMove.isTouched()){
squareBody.setLinearVelocity(touchpadMove.getKnobPercentX()*10,CurMove.y);
}
handler.updateAndRender();
handler.setAmbientLight(0.5f);
stage.draw();
world.step(1/60f, 6, 2);
}
}
| UTF-8 | Java | 5,866 | java | Box2D_Scratch.java | Java | [
{
"context": ";\nimport box2dLight.RayHandler;\n\n/**\n * Created by Ben on 2015-03-07.\n */\npublic class Box2D_Scratch ext",
"end": 1301,
"score": 0.9896053075790405,
"start": 1298,
"tag": "NAME",
"value": "Ben"
}
]
| null | []
| package com.mygdx.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.Box2D;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.physics.box2d.utils.Box2DBuild;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Touchpad;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
import com.badlogic.gdx.utils.Array;
import box2dLight.ChainLight;
import box2dLight.DirectionalLight;
import box2dLight.Light;
import box2dLight.PointLight;
import box2dLight.RayHandler;
/**
* Created by Ben on 2015-03-07.
*/
public class Box2D_Scratch extends ApplicationAdapter {
OrthographicCamera camera;
Vector2 gravity=new Vector2(0,-9.8f), CurMove=new Vector2(0,0);
BodyDef groundDef,squareDef;
Body squareBody, groundBody;
FixtureDef squareFixDef;
PolygonShape squareBox, groundBox;
World world;
RayHandler handler;
int height, width,X,Y;
double VX = 0, VY = 0;
Box2DDebugRenderer b2Renderer;
Array<Body> arWorldBodies = new Array<Body>();
SpriteBatch batch;
Touchpad touchpadMove;
Touchpad.TouchpadStyle touchpadMoveStyle;
Skin touchpadMoveSkin;
Drawable touchMoveKnob, touchMoveBackground;
Stage stage;
Texture imgB, imgLogic, imgG;
Sprite sprite;
@Override
public void create(){
height= Gdx.graphics.getHeight()/4;
width= Gdx.graphics.getWidth()/4;
X=width/2;
Y=height/2;
camera= new OrthographicCamera(width, height);
camera.position.set(width/2f,height/2f,0);
camera.update();
world=new World(gravity,false);
groundDef=new BodyDef();
squareDef=new BodyDef();
groundBox=new PolygonShape();
squareBox=new PolygonShape();
b2Renderer=new Box2DDebugRenderer();
squareFixDef=new FixtureDef();
groundDef.position.set(0.0f, 3);
groundBody= world.createBody(groundDef);
groundBox.setAsBox(width, 10f);
groundBody.createFixture(groundBox, 0f);
squareBox.setAsBox(10f, 10f);
squareDef.position.set(width/2, height/2);
squareDef.type= BodyDef.BodyType.DynamicBody;
squareBody=world.createBody(squareDef);
squareFixDef.restitution=0.3f;
squareFixDef.shape=squareBox;
squareFixDef.density=0.3f;
squareFixDef.friction=0.2f;
squareBody.createFixture(squareFixDef);
handler=new RayHandler(world);
handler.setCombinedMatrix(camera.combined);
new PointLight(handler, 1500, Color.ORANGE, 200, (width/2)-100,(height/2));
new PointLight(handler, 1500, Color.PURPLE, 250, (width/2)+100,(height/2));
stage = new Stage();
batch = new SpriteBatch();
imgLogic = new Texture("badlogic.jpg");
imgB = new Texture("black.png");
imgG = new Texture("grey.png");
touchpadMoveSkin = new Skin();//making a touchpad which is kinda like an analog stick
touchpadMoveSkin.add("touchKnob", imgB);
touchpadMoveSkin.add("touchBackground", imgLogic);
touchMoveKnob = touchpadMoveSkin.getDrawable("touchKnob");
touchMoveBackground = touchpadMoveSkin.getDrawable("touchBackground");
touchpadMoveStyle = new Touchpad.TouchpadStyle();
touchpadMoveStyle.knob = touchMoveKnob;
touchpadMoveStyle.background = touchMoveBackground;
touchpadMove = new Touchpad(1, touchpadMoveStyle);
touchpadMove.setSize(200, 200);
touchpadMove.setPosition(width/2-100, height/2-50);
stage.addActor(touchpadMove);
Gdx.input.setInputProcessor(stage);
sprite = new Sprite(imgLogic);
sprite.setSize(10f*2,10f*2);
sprite.setOrigin(sprite.getWidth()/2,sprite.getHeight()/2);
squareBody.setUserData(sprite);
}
@Override
public void dispose(){
world.dispose();
stage.dispose();
batch.dispose();
}
@Override
public void render(){
super.render();
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
b2Renderer.render(world, camera.combined);
batch.setProjectionMatrix(camera.combined);
batch.begin();
world.getBodies(arWorldBodies);
for(Body body: arWorldBodies){ //this is new to me
if(body.getUserData()!=null && body.getUserData() instanceof Sprite){
Sprite newSprite = (Sprite)body.getUserData();
newSprite.setPosition(body.getPosition().x-newSprite.getWidth()/2
,body.getPosition().y-newSprite.getHeight()/2);
newSprite.setRotation(body.getAngle()* MathUtils.radiansToDegrees);
newSprite.draw(batch);
}
}
batch.end();
CurMove.set(squareBody.getLinearVelocity());
if(touchpadMove.isTouched()){
squareBody.setLinearVelocity(touchpadMove.getKnobPercentX()*10,CurMove.y);
}
handler.updateAndRender();
handler.setAmbientLight(0.5f);
stage.draw();
world.step(1/60f, 6, 2);
}
}
| 5,866 | 0.682066 | 0.658541 | 161 | 35.434784 | 20.632479 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.062112 | false | false | 9 |
53fbff869c1913179b146b188532220404062d7d | 13,176,959,727,444 | 089337b6ea2cfc138f0961c33d1b37038e5b0530 | /era_bcb_sample/4/selected/2611973.java | 64ca20728a6c4ec646f40d9a1c52ba405a02d543 | []
| no_license | manzibanishi/Parallel_Code_detection | https://github.com/manzibanishi/Parallel_Code_detection | 7b88a49885bde22be3b4dd3c5ae04a1b65e75004 | b93dd45f9e19e79584fa1c3ed98b7e6a74214e75 | refs/heads/master | 2018-01-06T19:12:22.349000 | 2016-10-01T02:24:58 | 2016-10-01T02:24:58 | 69,706,822 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.assimilator.tools.deploymentdirectory.commands;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.logging.Logger;
/**
* Description:
*
* @author Larry Mitchell
* @version $Id: CopyOarFileCommand.java 344 2007-10-09 23:11:43Z khartig $
*/
public class CopyOarFileCommand implements Command {
/**
* the logger for this class
*/
private static final Logger logger = Logger.getLogger("net.assimilator.tools.deploymentdirectory.commands");
/**
* the target deployment directory
*/
private String deploymentDirectory;
/**
* the path to the oar file that we are going to copy
*/
private String oarfilePath;
/**
* ctor for copy command
*
* @param directory the target deployment directory
* @param path the path to the oar file that we are going to copy
* @throws CommandException if the command was improperly formatted
*/
public CopyOarFileCommand(String directory, String path) throws CommandException {
if (directory == null) {
logger.severe("CopyOarFileCommand: base directory is null");
throw new CommandException("CopyOarFileCommand: base directory is null");
}
this.deploymentDirectory = directory;
if (path == null) {
logger.severe("CopyOarFileCommand: oar path is null");
throw new CommandException("CopyOarFileCommand: oar path is null");
}
this.oarfilePath = path;
}
/**
* execute the command
*/
public void execute() {
File sourceFile = new File(oarfilePath);
File destinationFile = new File(deploymentDirectory + File.separator + sourceFile.getName());
try {
FileInputStream fis = new FileInputStream(sourceFile);
FileOutputStream fos = new FileOutputStream(destinationFile);
byte[] readArray = new byte[2048];
while (fis.read(readArray) != -1) {
fos.write(readArray);
}
fis.close();
fos.flush();
fos.close();
} catch (IOException ioe) {
logger.severe("failed to copy the file:" + ioe);
}
}
}
| UTF-8 | Java | 2,287 | java | 2611973.java | Java | [
{
"context": "logging.Logger;\n\n/**\n * Description:\n *\n * @author Larry Mitchell\n * @version $Id: CopyOarFileCommand.java 344 2007",
"end": 257,
"score": 0.9998234510421753,
"start": 243,
"tag": "NAME",
"value": "Larry Mitchell"
}
]
| null | []
| package net.assimilator.tools.deploymentdirectory.commands;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.logging.Logger;
/**
* Description:
*
* @author <NAME>
* @version $Id: CopyOarFileCommand.java 344 2007-10-09 23:11:43Z khartig $
*/
public class CopyOarFileCommand implements Command {
/**
* the logger for this class
*/
private static final Logger logger = Logger.getLogger("net.assimilator.tools.deploymentdirectory.commands");
/**
* the target deployment directory
*/
private String deploymentDirectory;
/**
* the path to the oar file that we are going to copy
*/
private String oarfilePath;
/**
* ctor for copy command
*
* @param directory the target deployment directory
* @param path the path to the oar file that we are going to copy
* @throws CommandException if the command was improperly formatted
*/
public CopyOarFileCommand(String directory, String path) throws CommandException {
if (directory == null) {
logger.severe("CopyOarFileCommand: base directory is null");
throw new CommandException("CopyOarFileCommand: base directory is null");
}
this.deploymentDirectory = directory;
if (path == null) {
logger.severe("CopyOarFileCommand: oar path is null");
throw new CommandException("CopyOarFileCommand: oar path is null");
}
this.oarfilePath = path;
}
/**
* execute the command
*/
public void execute() {
File sourceFile = new File(oarfilePath);
File destinationFile = new File(deploymentDirectory + File.separator + sourceFile.getName());
try {
FileInputStream fis = new FileInputStream(sourceFile);
FileOutputStream fos = new FileOutputStream(destinationFile);
byte[] readArray = new byte[2048];
while (fis.read(readArray) != -1) {
fos.write(readArray);
}
fis.close();
fos.flush();
fos.close();
} catch (IOException ioe) {
logger.severe("failed to copy the file:" + ioe);
}
}
}
| 2,279 | 0.630958 | 0.621338 | 72 | 30.763889 | 27.876461 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.361111 | false | false | 9 |
bdffb4d52cbca5c08297746180c551d0fc887acb | 21,792,664,068,127 | 2da69d5efd08d0f8411b88017a8906a3b4ec5940 | /first_try/Interpreter.java | 76bad6919094800dff6bc5322a1fe66e97532757 | []
| no_license | pforrence/1622-proj2 | https://github.com/pforrence/1622-proj2 | 3db2815216d01baffd298709d407340716e22738 | ea021797f86e5b5e05bb076865498434cbbddab7 | refs/heads/master | 2021-04-27T21:29:37.871000 | 2018-03-12T19:55:40 | 2018-03-12T19:55:40 | 122,401,911 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java_cup.runtime.Symbol;
public class Interpreter
{
public static void main(String[] args)
{
if (args.length != 1)
{
System.err.println("What are ya doin? Gimme an input file");
System.exit(1);
}
Symbol parse_list = null;
try
{
MyParser parser = new MyParser(new Lexer(new java.io.FileInputStream(args[0])));
parse_list = parser.parse();
}
catch (java.io.IOException e)
{
System.err.println("What are ya doin? That input file is a problem!");
}
catch (Exception e)
{
e.printStackTrace(System.err);
}
}
} | UTF-8 | Java | 558 | java | Interpreter.java | Java | []
| null | []
| import java_cup.runtime.Symbol;
public class Interpreter
{
public static void main(String[] args)
{
if (args.length != 1)
{
System.err.println("What are ya doin? Gimme an input file");
System.exit(1);
}
Symbol parse_list = null;
try
{
MyParser parser = new MyParser(new Lexer(new java.io.FileInputStream(args[0])));
parse_list = parser.parse();
}
catch (java.io.IOException e)
{
System.err.println("What are ya doin? That input file is a problem!");
}
catch (Exception e)
{
e.printStackTrace(System.err);
}
}
} | 558 | 0.655914 | 0.650538 | 27 | 19.703703 | 22.692493 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.037037 | false | false | 9 |
b613ea02d337ac224b9e95450527e89e6db374b0 | 28,681,791,669,898 | 144098064ba7c7ec51e7d4c7dbf7abbcb4526b69 | /src/com/aisino2/techsupport/service/impl/TrackingServiceImpl.java | a8b12ce3c99e6745a16727303c38e5a4239ac837 | []
| no_license | radtek/techsupport | https://github.com/radtek/techsupport | cd10fdef255a21d7ce909e314fe46f8274565705 | d11b355c59dc5835e6d249c5f07553629f85afad | refs/heads/master | 2020-05-24T15:59:02.118000 | 2015-06-30T02:48:36 | 2015-06-30T02:48:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.aisino2.techsupport.service.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.jbpm.api.task.Participation;
import org.springframework.stereotype.Component;
import com.aisino2.core.dao.Page;
import com.aisino2.core.service.BaseService;
import com.aisino2.sysadmin.service.IUserService;
import com.aisino2.techsupport.common.Constants;
import com.aisino2.techsupport.dao.TrackingDao;
import com.aisino2.techsupport.domain.SupportTicket;
import com.aisino2.techsupport.domain.Tracking;
import com.aisino2.techsupport.service.SupportTicketService;
import com.aisino2.techsupport.service.TrackingService;
import com.aisino2.techsupport.workflow.WorkflowUtil;
/**
*
* 追踪批复服务
*/
@Component("TrackingServiceImpl")
public class TrackingServiceImpl extends BaseService implements TrackingService {
/**
* Logger for this class
*/
private static final Logger logger = Logger
.getLogger(TrackingServiceImpl.class);
private TrackingDao trackDao;
private SupportTicketService stService;
private IUserService userService;
/**
* 流程控制服务
*/
private WorkflowUtil workflow;
public Tracking insertTracking(Tracking tracking) {
if (logger.isDebugEnabled()) {
logger.debug("insertTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
if (tracking.getType() == null
|| tracking.getType().trim().length() == 0)
tracking.setType(Constants.TRACKING_TYPE_TRACKING);
tracking = trackDao.insertTracking(tracking);
SupportTicket st = new SupportTicket();
st.setId(tracking.getStId());
// 更新最后操作时间
st.setLastUpdateDate(new Date());
stService.updateSupportTicket(st);
} catch (RuntimeException e) {
logger.error(e, e.fillInStackTrace());
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("insertTracking(Tracking) - end"); //$NON-NLS-1$
}
return tracking;
}
public int updateTracking(Tracking tracking) {
int ret = 0;
if (logger.isDebugEnabled()) {
logger.debug("updateTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
ret = trackDao.updateTracking(tracking);
} catch (RuntimeException e) {
logger.error(e, e.fillInStackTrace());
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("updateTracking(Tracking) - end"); //$NON-NLS-1$
}
return ret;
}
public int deleteTracking(Tracking tracking) {
int ret = 0;
if (logger.isDebugEnabled()) {
logger.debug("deleteTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
ret = trackDao.deleteTracking(tracking);
} catch (RuntimeException e) {
logger.error(e, e);
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("deleteTracking(Tracking) - end"); //$NON-NLS-1$
}
return ret;
}
public List<Tracking> getTrackingList(Tracking tracking) {
return this.trackDao.getTrackingList(tracking);
}
public Page getTrackingListForPage(int pageno, int pagesize,
Tracking tracking, String sort, String desc) {
Page trackPage = null;
if (logger.isDebugEnabled()) {
logger.debug("getTrackingListForPage(int, int, Tracking, String, String) - start"); //$NON-NLS-1$
}
try {
trackPage = trackDao.getTrackingListForPage(pageno, pagesize,
tracking, sort, desc);
if (trackPage.getData() != null && trackPage.getData().size() > 0)
for (Tracking track : (List<Tracking>) trackPage.getData()) {
if (track.getProcessor() != null) {
track.setProcessor(userService.getUser(track
.getProcessor()));
track.setProcessorId(track.getProcessor().getUserid());
track.setProcessorName(track.getProcessor()
.getUsername());
}
}
} catch (RuntimeException e) {
logger.error(e, e);
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("getTrackingListForPage(int, int, Tracking, String, String) - end"); //$NON-NLS-1$
}
return trackPage;
}
public Tracking getTracking(Tracking tracking) {
Tracking track = null;
if (logger.isDebugEnabled()) {
logger.debug("getTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
track = trackDao.getTracking(tracking);
} catch (RuntimeException e) {
logger.error(e, e);
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("getTracking(Tracking) - end"); //$NON-NLS-1$
}
return track;
}
@Resource(name = "TrackingDaoImpl")
public void setTrackDao(TrackingDao trackDao) {
this.trackDao = trackDao;
}
public Tracking insertTrackingAndGo(String taskId, SupportTicket st,
Tracking tracking) {
Tracking track = null;
if (logger.isDebugEnabled()) {
logger.debug("insertTrackingAndGo(Tracking) - start"); //$NON-NLS-1$
}
try {
if (taskId == null)
throw new RuntimeException("taskID 为空;");
if (tracking.getType() == null
|| tracking.getType().trim().length() == 0)
tracking.setType(Constants.TRACKING_TYPE_TRACKING);
track = trackDao.insertTracking(tracking);
List<Participation> tracking_users = workflow.getTaskService()
.getTaskParticipations(taskId);
for (Participation p : tracking_users) {
if (tracking.getProcessor().getUserid() == Integer.parseInt(p
.getUserId())) {
workflow.getTaskService().removeTaskParticipatingUser(
taskId, p.getUserId(), Participation.CANDIDATE);
tracking_users.remove(p);
break;
}
}
// 当所有部门的支持单负责人都提请反馈后,才真正的提请反馈。。
if (tracking_users.isEmpty()) {
try {
// 流程开始
workflow.getTaskService().completeTask(taskId);
} catch (Exception e) {
workflow.getTaskService().addTaskParticipatingUser(taskId,
tracking.getProcessor().getUserid().toString(),
Participation.CANDIDATE);
throw new RuntimeException(e);
}
// 设置提请反馈时间
st.setApplyingFeedbackDate(new Date());
// 设置状态
st.setStStatus(Constants.ST_STATUS_WAIT_FEEDBACK);
}
// 更新最后操作时间
st.setLastUpdateDate(new Date());
stService.updateSupportTicket(st);
} catch (RuntimeException e) {
logger.error(e, e.fillInStackTrace());
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("insertTrackingAndGo(Tracking) - end"); //$NON-NLS-1$
}
return track;
}
@Resource(name = "SupportTicketServiceImpl")
public void setStService(SupportTicketService stService) {
this.stService = stService;
}
@Resource(name = "userService")
public void setUserService(IUserService userService) {
this.userService = userService;
}
@Resource(name = "WorkflowUtil")
public void setWorkflow(WorkflowUtil workflow) {
this.workflow = workflow;
}
}
| UTF-8 | Java | 6,916 | java | TrackingServiceImpl.java | Java | []
| null | []
| package com.aisino2.techsupport.service.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.jbpm.api.task.Participation;
import org.springframework.stereotype.Component;
import com.aisino2.core.dao.Page;
import com.aisino2.core.service.BaseService;
import com.aisino2.sysadmin.service.IUserService;
import com.aisino2.techsupport.common.Constants;
import com.aisino2.techsupport.dao.TrackingDao;
import com.aisino2.techsupport.domain.SupportTicket;
import com.aisino2.techsupport.domain.Tracking;
import com.aisino2.techsupport.service.SupportTicketService;
import com.aisino2.techsupport.service.TrackingService;
import com.aisino2.techsupport.workflow.WorkflowUtil;
/**
*
* 追踪批复服务
*/
@Component("TrackingServiceImpl")
public class TrackingServiceImpl extends BaseService implements TrackingService {
/**
* Logger for this class
*/
private static final Logger logger = Logger
.getLogger(TrackingServiceImpl.class);
private TrackingDao trackDao;
private SupportTicketService stService;
private IUserService userService;
/**
* 流程控制服务
*/
private WorkflowUtil workflow;
public Tracking insertTracking(Tracking tracking) {
if (logger.isDebugEnabled()) {
logger.debug("insertTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
if (tracking.getType() == null
|| tracking.getType().trim().length() == 0)
tracking.setType(Constants.TRACKING_TYPE_TRACKING);
tracking = trackDao.insertTracking(tracking);
SupportTicket st = new SupportTicket();
st.setId(tracking.getStId());
// 更新最后操作时间
st.setLastUpdateDate(new Date());
stService.updateSupportTicket(st);
} catch (RuntimeException e) {
logger.error(e, e.fillInStackTrace());
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("insertTracking(Tracking) - end"); //$NON-NLS-1$
}
return tracking;
}
public int updateTracking(Tracking tracking) {
int ret = 0;
if (logger.isDebugEnabled()) {
logger.debug("updateTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
ret = trackDao.updateTracking(tracking);
} catch (RuntimeException e) {
logger.error(e, e.fillInStackTrace());
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("updateTracking(Tracking) - end"); //$NON-NLS-1$
}
return ret;
}
public int deleteTracking(Tracking tracking) {
int ret = 0;
if (logger.isDebugEnabled()) {
logger.debug("deleteTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
ret = trackDao.deleteTracking(tracking);
} catch (RuntimeException e) {
logger.error(e, e);
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("deleteTracking(Tracking) - end"); //$NON-NLS-1$
}
return ret;
}
public List<Tracking> getTrackingList(Tracking tracking) {
return this.trackDao.getTrackingList(tracking);
}
public Page getTrackingListForPage(int pageno, int pagesize,
Tracking tracking, String sort, String desc) {
Page trackPage = null;
if (logger.isDebugEnabled()) {
logger.debug("getTrackingListForPage(int, int, Tracking, String, String) - start"); //$NON-NLS-1$
}
try {
trackPage = trackDao.getTrackingListForPage(pageno, pagesize,
tracking, sort, desc);
if (trackPage.getData() != null && trackPage.getData().size() > 0)
for (Tracking track : (List<Tracking>) trackPage.getData()) {
if (track.getProcessor() != null) {
track.setProcessor(userService.getUser(track
.getProcessor()));
track.setProcessorId(track.getProcessor().getUserid());
track.setProcessorName(track.getProcessor()
.getUsername());
}
}
} catch (RuntimeException e) {
logger.error(e, e);
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("getTrackingListForPage(int, int, Tracking, String, String) - end"); //$NON-NLS-1$
}
return trackPage;
}
public Tracking getTracking(Tracking tracking) {
Tracking track = null;
if (logger.isDebugEnabled()) {
logger.debug("getTracking(Tracking) - start"); //$NON-NLS-1$
}
try {
track = trackDao.getTracking(tracking);
} catch (RuntimeException e) {
logger.error(e, e);
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("getTracking(Tracking) - end"); //$NON-NLS-1$
}
return track;
}
@Resource(name = "TrackingDaoImpl")
public void setTrackDao(TrackingDao trackDao) {
this.trackDao = trackDao;
}
public Tracking insertTrackingAndGo(String taskId, SupportTicket st,
Tracking tracking) {
Tracking track = null;
if (logger.isDebugEnabled()) {
logger.debug("insertTrackingAndGo(Tracking) - start"); //$NON-NLS-1$
}
try {
if (taskId == null)
throw new RuntimeException("taskID 为空;");
if (tracking.getType() == null
|| tracking.getType().trim().length() == 0)
tracking.setType(Constants.TRACKING_TYPE_TRACKING);
track = trackDao.insertTracking(tracking);
List<Participation> tracking_users = workflow.getTaskService()
.getTaskParticipations(taskId);
for (Participation p : tracking_users) {
if (tracking.getProcessor().getUserid() == Integer.parseInt(p
.getUserId())) {
workflow.getTaskService().removeTaskParticipatingUser(
taskId, p.getUserId(), Participation.CANDIDATE);
tracking_users.remove(p);
break;
}
}
// 当所有部门的支持单负责人都提请反馈后,才真正的提请反馈。。
if (tracking_users.isEmpty()) {
try {
// 流程开始
workflow.getTaskService().completeTask(taskId);
} catch (Exception e) {
workflow.getTaskService().addTaskParticipatingUser(taskId,
tracking.getProcessor().getUserid().toString(),
Participation.CANDIDATE);
throw new RuntimeException(e);
}
// 设置提请反馈时间
st.setApplyingFeedbackDate(new Date());
// 设置状态
st.setStStatus(Constants.ST_STATUS_WAIT_FEEDBACK);
}
// 更新最后操作时间
st.setLastUpdateDate(new Date());
stService.updateSupportTicket(st);
} catch (RuntimeException e) {
logger.error(e, e.fillInStackTrace());
throw e;
}
if (logger.isDebugEnabled()) {
logger.debug("insertTrackingAndGo(Tracking) - end"); //$NON-NLS-1$
}
return track;
}
@Resource(name = "SupportTicketServiceImpl")
public void setStService(SupportTicketService stService) {
this.stService = stService;
}
@Resource(name = "userService")
public void setUserService(IUserService userService) {
this.userService = userService;
}
@Resource(name = "WorkflowUtil")
public void setWorkflow(WorkflowUtil workflow) {
this.workflow = workflow;
}
}
| 6,916 | 0.672923 | 0.668637 | 244 | 25.729507 | 22.761967 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.5 | false | false | 9 |
fe18d33f42ec70860c84eec99b5576216c998d30 | 4,793,183,502,967 | 848b11aaa784346fb90bd2572a7cd045b159acc6 | /3_Construccion/SDCE/src/main/java/mx/com/asteca/fachada/AulaFachada.java | 70a7f7a14bfe8737e22da27cfa9c75cf5af17bba | []
| no_license | amaro-coria/mx-com-sdce-asteca | https://github.com/amaro-coria/mx-com-sdce-asteca | f702de57478c47baf62eca2e59471dc1e90289dd | 206e2b1636b97e9aeb4437a22a34dbbc1fd9c683 | refs/heads/master | 2020-03-27T00:09:10.507000 | 2013-12-17T00:22:41 | 2013-12-17T00:22:41 | 37,559,210 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package mx.com.asteca.fachada;
import java.util.List;
import mx.com.asteca.comun.dto.AulaDTO;
import mx.com.asteca.comun.dto.CatGralDTO;
import mx.com.asteca.servicio.ServicioException;
/**
* @author Jorge Amaro Coria
* @version 1.0
* @since 1.0
*
*/
public interface AulaFachada extends BaseFachada<AulaDTO, Integer> {
/**
* Obtiene la lista de sedes
* @return
* @throws FachadaException
*/
List<CatGralDTO> getSedes() throws FachadaException;
/**
* Obtiene la lista de aulas filtradas por sede
* @param sede
* @return
* @throws FachadaException
*/
List<AulaDTO> findBySede(String sede) throws FachadaException;
}
| UTF-8 | Java | 680 | java | AulaFachada.java | Java | [
{
"context": "eca.servicio.ServicioException;\r\n\r\n/**\r\n * @author Jorge Amaro Coria\r\n * @version 1.0\r\n * @since 1.0\r\n *\r\n */\r\npublic ",
"end": 230,
"score": 0.9998309016227722,
"start": 213,
"tag": "NAME",
"value": "Jorge Amaro Coria"
}
]
| null | []
| package mx.com.asteca.fachada;
import java.util.List;
import mx.com.asteca.comun.dto.AulaDTO;
import mx.com.asteca.comun.dto.CatGralDTO;
import mx.com.asteca.servicio.ServicioException;
/**
* @author <NAME>
* @version 1.0
* @since 1.0
*
*/
public interface AulaFachada extends BaseFachada<AulaDTO, Integer> {
/**
* Obtiene la lista de sedes
* @return
* @throws FachadaException
*/
List<CatGralDTO> getSedes() throws FachadaException;
/**
* Obtiene la lista de aulas filtradas por sede
* @param sede
* @return
* @throws FachadaException
*/
List<AulaDTO> findBySede(String sede) throws FachadaException;
}
| 669 | 0.686765 | 0.680882 | 32 | 19.25 | 20.126165 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.65625 | false | false | 9 |
e4a4ccdd6ec418ecf878fe4bad244197a36b2713 | 25,022,479,527,689 | a735ad1b3e722091d715648c46b78ab482fa2e00 | /src/com/cjh/googlemarket_cjh/holder/MoreHolder.java | 71aeebd514a4ac03ff145fc771218b29ac1e3cef | []
| no_license | jiahui6445/Market_cjh | https://github.com/jiahui6445/Market_cjh | 9ae787f820c571b42d7ef9e9fb2c2bc4e8a10882 | c92d7efda7d4bc4285398117f1c2b8e74ca2527e | refs/heads/master | 2016-08-10T17:34:52.644000 | 2015-12-14T08:53:48 | 2015-12-14T08:53:48 | 47,239,252 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cjh.googlemarket_cjh.holder;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.cjh.googlemarket_cjh.R;
import com.cjh.googlemarket_cjh.base.BaseHolder;
import com.cjh.googlemarket_cjh.base.MyBaseAdapter;
import com.cjh.googlemarket_cjh.util.UIUtils;
public class MoreHolder extends BaseHolder {
// 1,有更多,可以去加载
public static final int HAS_MORE = 0;
// 2,没有数据不能加载
public static final int NO_MORE = 1;
// 3,加载失败
public static final int LOAD_MORE_ERROR = 2;
private LinearLayout ll;
private TextView load_error;
private MyBaseAdapter adapter;
public MoreHolder(MyBaseAdapter adapter, boolean hasMore) {
this.adapter = adapter;
setData(hasMore ? HAS_MORE : NO_MORE);
}
@Override
public void refreshView() {
// 拿数据填充给控件的操作
Integer data = (Integer) getData();
if (data == HAS_MORE) {
ll.setVisibility(View.VISIBLE);
load_error.setVisibility(View.GONE);
}
if (data == NO_MORE) {
ll.setVisibility(View.GONE);
load_error.setVisibility(View.GONE);
}
if (data == LOAD_MORE_ERROR) {
ll.setVisibility(View.GONE);
load_error.setVisibility(View.VISIBLE);
}
}
@Override
public View initView() {
View view = UIUtils.inflate(R.layout.load_more_item);
ll = (LinearLayout) view.findViewById(R.id.ll);
load_error = (TextView) view.findViewById(R.id.load_error);
return view;
}
// 1.加载更多的逻辑在何处触发,何处调用,重写getRootView()方法
@Override
public View getRootView() {
if (adapter != null && ((Integer) getData()) == HAS_MORE) {
// 此处调用加载更多的业务逻辑
adapter.onLoadMore();
}
return super.getRootView();
}
}
| UTF-8 | Java | 1,827 | java | MoreHolder.java | Java | []
| null | []
| package com.cjh.googlemarket_cjh.holder;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.cjh.googlemarket_cjh.R;
import com.cjh.googlemarket_cjh.base.BaseHolder;
import com.cjh.googlemarket_cjh.base.MyBaseAdapter;
import com.cjh.googlemarket_cjh.util.UIUtils;
public class MoreHolder extends BaseHolder {
// 1,有更多,可以去加载
public static final int HAS_MORE = 0;
// 2,没有数据不能加载
public static final int NO_MORE = 1;
// 3,加载失败
public static final int LOAD_MORE_ERROR = 2;
private LinearLayout ll;
private TextView load_error;
private MyBaseAdapter adapter;
public MoreHolder(MyBaseAdapter adapter, boolean hasMore) {
this.adapter = adapter;
setData(hasMore ? HAS_MORE : NO_MORE);
}
@Override
public void refreshView() {
// 拿数据填充给控件的操作
Integer data = (Integer) getData();
if (data == HAS_MORE) {
ll.setVisibility(View.VISIBLE);
load_error.setVisibility(View.GONE);
}
if (data == NO_MORE) {
ll.setVisibility(View.GONE);
load_error.setVisibility(View.GONE);
}
if (data == LOAD_MORE_ERROR) {
ll.setVisibility(View.GONE);
load_error.setVisibility(View.VISIBLE);
}
}
@Override
public View initView() {
View view = UIUtils.inflate(R.layout.load_more_item);
ll = (LinearLayout) view.findViewById(R.id.ll);
load_error = (TextView) view.findViewById(R.id.load_error);
return view;
}
// 1.加载更多的逻辑在何处触发,何处调用,重写getRootView()方法
@Override
public View getRootView() {
if (adapter != null && ((Integer) getData()) == HAS_MORE) {
// 此处调用加载更多的业务逻辑
adapter.onLoadMore();
}
return super.getRootView();
}
}
| 1,827 | 0.685393 | 0.681254 | 67 | 23.238806 | 18.392155 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.656716 | false | false | 0 |
d17d17c9e767b2095b463cb9d8751019e08268ee | 36,653,250,932,770 | fff8061c2923c55bcbc39fa05c0daeab955699a1 | /connector/src/main/java/org.apache.flink/connector/nebula/utils/VidTypeEnum.java | 0925178f23624ac172454c3f0e5207f2b3c5a42b | []
| no_license | 861752346/nebula-flink-connector | https://github.com/861752346/nebula-flink-connector | 7497ca39286f6cc765ab948fc59e0549082ff11d | 7272b2e34d29be51c46acc37b71485266464486c | refs/heads/master | 2023-08-28T21:24:09.312000 | 2021-11-01T08:40:32 | 2021-11-01T08:40:32 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
package org.apache.flink.connector.nebula.utils;
public enum VidTypeEnum {
/**
* INT vertex id
*/
INT("INT"),
/**
* STRING vertex id
*/
STRING("STRING");
private String type;
VidTypeEnum(String type) {
this.type = type;
}
public String vidType() {
return type;
}
}
| UTF-8 | Java | 542 | java | VidTypeEnum.java | Java | []
| null | []
| /* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
package org.apache.flink.connector.nebula.utils;
public enum VidTypeEnum {
/**
* INT vertex id
*/
INT("INT"),
/**
* STRING vertex id
*/
STRING("STRING");
private String type;
VidTypeEnum(String type) {
this.type = type;
}
public String vidType() {
return type;
}
}
| 542 | 0.608856 | 0.594096 | 29 | 17.689655 | 19.739866 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.275862 | false | false | 0 |
560697ea6a414f7e8af18b96f61e0442ac47beaa | 36,816,459,692,535 | ef82f13c5226e34eca2ae446440821982acadc88 | /app/src/main/java/com/example/ethan/playandroid/mvp/imp/articles/ArticlePresenter.java | 14daa14e6e852329092fc1e31764fcdaa53409fa | []
| no_license | maokai1229/PlayAndroid | https://github.com/maokai1229/PlayAndroid | 9c52826c78cd2124b10d6f39935e1bbd1226e17c | 1aa41e737db5ff7ac3e2029f561c4985eb88b257 | refs/heads/master | 2018-10-24T18:05:08.448000 | 2018-08-22T10:50:03 | 2018-08-22T10:50:03 | 144,162,867 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.ethan.playandroid.mvp.imp.articles;
import com.example.ethan.playandroid.data.ArticleDataRepository;
import com.example.ethan.playandroid.data.LoginDataRepository;
import com.example.ethan.playandroid.data.bean.ArticleDetailData;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
public class ArticlePresenter implements ArticleContract.Presenter {
private ArticleContract.View view;
private ArticleDataRepository articleDataRepository;
private LoginDataRepository loginDataRepository;
private CompositeDisposable compositeDisposable;
public ArticlePresenter(ArticleContract.View view, ArticleDataRepository articleDataRepository, LoginDataRepository loginDataRepository) {
this.view = view;
this.view.setPresenter(this);
this.articleDataRepository = articleDataRepository;
this.loginDataRepository = loginDataRepository;
compositeDisposable = new CompositeDisposable();
}
@Override
public void getArticles(int page, boolean forceUpdate, boolean clearCache) {
Disposable disposable = articleDataRepository.getArticles(page, forceUpdate, clearCache)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableObserver<List<ArticleDetailData>>() {
@Override
public void onNext(List<ArticleDetailData> detailDataList) {
if (view.isActive()) {
view.showEmptyView(false);
view.showArticles(detailDataList);
}
}
@Override
public void onError(Throwable e) {
if (view.isActive()) {
view.showEmptyView(true);
view.setLoadingIndicator(false);
}
}
@Override
public void onComplete() {
if (view.isActive()) {
view.setLoadingIndicator(false);
}
}
});
compositeDisposable.add(disposable);
}
@Override
public void getBanner() {
}
@Override
public void subscribe() {
}
@Override
public void unSubscribe() {
compositeDisposable.clear();
}
}
| UTF-8 | Java | 2,685 | java | ArticlePresenter.java | Java | []
| null | []
| package com.example.ethan.playandroid.mvp.imp.articles;
import com.example.ethan.playandroid.data.ArticleDataRepository;
import com.example.ethan.playandroid.data.LoginDataRepository;
import com.example.ethan.playandroid.data.bean.ArticleDetailData;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
public class ArticlePresenter implements ArticleContract.Presenter {
private ArticleContract.View view;
private ArticleDataRepository articleDataRepository;
private LoginDataRepository loginDataRepository;
private CompositeDisposable compositeDisposable;
public ArticlePresenter(ArticleContract.View view, ArticleDataRepository articleDataRepository, LoginDataRepository loginDataRepository) {
this.view = view;
this.view.setPresenter(this);
this.articleDataRepository = articleDataRepository;
this.loginDataRepository = loginDataRepository;
compositeDisposable = new CompositeDisposable();
}
@Override
public void getArticles(int page, boolean forceUpdate, boolean clearCache) {
Disposable disposable = articleDataRepository.getArticles(page, forceUpdate, clearCache)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableObserver<List<ArticleDetailData>>() {
@Override
public void onNext(List<ArticleDetailData> detailDataList) {
if (view.isActive()) {
view.showEmptyView(false);
view.showArticles(detailDataList);
}
}
@Override
public void onError(Throwable e) {
if (view.isActive()) {
view.showEmptyView(true);
view.setLoadingIndicator(false);
}
}
@Override
public void onComplete() {
if (view.isActive()) {
view.setLoadingIndicator(false);
}
}
});
compositeDisposable.add(disposable);
}
@Override
public void getBanner() {
}
@Override
public void subscribe() {
}
@Override
public void unSubscribe() {
compositeDisposable.clear();
}
}
| 2,685 | 0.620112 | 0.620112 | 75 | 34.799999 | 27.871611 | 142 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.44 | false | false | 0 |
ba8bd006990d08663eaae4000f76bcb0356604f3 | 35,828,617,222,242 | 69953f4c2f730eadaf21ec76706400c8e1404a30 | /libvlc/src/main/java/org/videolan/libvlc/util/Dumper.java | d1fe6696ec61be55c28171a7acbeacee8fd57df1 | []
| no_license | jacksunshine6/VlcVideoView | https://github.com/jacksunshine6/VlcVideoView | 7770601a6ea138443bde7b34c461e72d4e90a9d6 | 672f27ac5c46a76b377a1ee64711c1757ac662b2 | refs/heads/master | 2022-03-23T13:13:10.611000 | 2019-12-19T03:15:40 | 2019-12-19T03:15:40 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.videolan.libvlc.util;
import android.net.Uri;
import android.support.annotation.MainThread;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.Media;
import org.videolan.libvlc.MediaPlayer;
import java.util.ArrayList;
public class Dumper {
public interface Listener {
void onFinish(boolean success);
void onProgress(float progress);
}
private final LibVLC mLibVLC;
private final MediaPlayer mMediaPlayer;
private final Listener mListener;
/**
* Create a Dumper that will download an Uri into a local filesystem path
*
* @param uri the Uri to dump
* @param filepath local filesystem path where to dump the Uri
* @param listener listener in order to be notified when the dump is finished
*/
@MainThread
public Dumper(Uri uri, String filepath, Listener listener) {
if (uri == null || filepath == null || listener == null)
throw new IllegalArgumentException("arguments shouldn't be null");
mListener = listener;
ArrayList<String> options = new ArrayList<>(8);
options.add("--demux");
options.add("dump2,none");
options.add("--demuxdump-file");
options.add(filepath);
options.add("--no-video");
options.add("--no-audio");
options.add("--no-spu");
options.add("-vv");
mLibVLC = new LibVLC(null, options);
final Media media = new Media(mLibVLC, uri);
mMediaPlayer = new MediaPlayer(media);
mMediaPlayer.setEventListener(new MediaPlayer.EventListener() {
@Override
public void onEvent(MediaPlayer.Event event) {
switch (event.type) {
case MediaPlayer.Event.Buffering:
mListener.onProgress(event.getBuffering());
break;
case MediaPlayer.Event.EncounteredError:
case MediaPlayer.Event.EndReached:
mListener.onFinish(event.type == MediaPlayer.Event.EndReached);
cancel();
break;
}
}
});
media.release();
}
/**
* Start to dump
*/
@MainThread
public void start() {
mMediaPlayer.play();
}
/**
* Cancel the dump of the Uri.
* Don't call this method if you already received the {@link Listener#onFinish(boolean)} callback.
*/
@MainThread
public void cancel() {
mMediaPlayer.stop();
mMediaPlayer.release();
mLibVLC.release();
}
}
| UTF-8 | Java | 2,619 | java | Dumper.java | Java | []
| null | []
| package org.videolan.libvlc.util;
import android.net.Uri;
import android.support.annotation.MainThread;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.Media;
import org.videolan.libvlc.MediaPlayer;
import java.util.ArrayList;
public class Dumper {
public interface Listener {
void onFinish(boolean success);
void onProgress(float progress);
}
private final LibVLC mLibVLC;
private final MediaPlayer mMediaPlayer;
private final Listener mListener;
/**
* Create a Dumper that will download an Uri into a local filesystem path
*
* @param uri the Uri to dump
* @param filepath local filesystem path where to dump the Uri
* @param listener listener in order to be notified when the dump is finished
*/
@MainThread
public Dumper(Uri uri, String filepath, Listener listener) {
if (uri == null || filepath == null || listener == null)
throw new IllegalArgumentException("arguments shouldn't be null");
mListener = listener;
ArrayList<String> options = new ArrayList<>(8);
options.add("--demux");
options.add("dump2,none");
options.add("--demuxdump-file");
options.add(filepath);
options.add("--no-video");
options.add("--no-audio");
options.add("--no-spu");
options.add("-vv");
mLibVLC = new LibVLC(null, options);
final Media media = new Media(mLibVLC, uri);
mMediaPlayer = new MediaPlayer(media);
mMediaPlayer.setEventListener(new MediaPlayer.EventListener() {
@Override
public void onEvent(MediaPlayer.Event event) {
switch (event.type) {
case MediaPlayer.Event.Buffering:
mListener.onProgress(event.getBuffering());
break;
case MediaPlayer.Event.EncounteredError:
case MediaPlayer.Event.EndReached:
mListener.onFinish(event.type == MediaPlayer.Event.EndReached);
cancel();
break;
}
}
});
media.release();
}
/**
* Start to dump
*/
@MainThread
public void start() {
mMediaPlayer.play();
}
/**
* Cancel the dump of the Uri.
* Don't call this method if you already received the {@link Listener#onFinish(boolean)} callback.
*/
@MainThread
public void cancel() {
mMediaPlayer.stop();
mMediaPlayer.release();
mLibVLC.release();
}
}
| 2,619 | 0.590683 | 0.58992 | 85 | 29.811764 | 23.391548 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.541176 | false | false | 0 |
b6f9db4ec5059b1712939902f04a163ae7bda956 | 34,866,544,561,241 | e67d2680e7635f682c201eeb577eedcc02f70c72 | /mybatis-basis/src/main/java/com/reid/config/BoundSql.java | 9c609696120cabf824054b06d46c697c13273d18 | []
| no_license | BeginnerA/mybatis-basis | https://github.com/BeginnerA/mybatis-basis | 6d48a91f92adf8f4f4de107710b420bce5532e4f | 4da41139ebee530587128eab02476df240130577 | refs/heads/main | 2023-03-29T00:13:09.026000 | 2021-03-24T09:08:39 | 2021-03-24T09:08:39 | 339,966,843 | 5 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.reid.config;
import com.reid.utils.ParameterMapping;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 解析后的sql语句和参数
* </p>
*
* @ClassName BoundSql
* @Author REID
* @Blog https://blog.csdn.net/qq_39035773
* @GitHub https://github.com/BeginnerA
* @Data 2021/1/15
* @Version V1.0
**/
public class BoundSql {
/**
* 解析后的sql
*/
private String sqlTest;
/**
* 参数集
*/
private List<ParameterMapping> parameterMappingList = new ArrayList<>();
public BoundSql(String sqlTest, List<ParameterMapping> parameterMappingList) {
this.sqlTest = sqlTest;
this.parameterMappingList = parameterMappingList;
}
public String getSqlTest() {
return sqlTest;
}
public void setSqlTest(String sqlTest) {
this.sqlTest = sqlTest;
}
public List<ParameterMapping> getParameterMappingList() {
return parameterMappingList;
}
public void setParameterMappingList(List<ParameterMapping> parameterMappingList) {
this.parameterMappingList = parameterMappingList;
}
}
| UTF-8 | Java | 1,129 | java | BoundSql.java | Java | [
{
"context": "语句和参数\n * </p>\n *\n * @ClassName BoundSql\n * @Author REID\n * @Blog https://blog.csdn.net/qq_39035773\n * @Gi",
"end": 195,
"score": 0.9983441829681396,
"start": 191,
"tag": "USERNAME",
"value": "REID"
},
{
"context": "ql\n * @Author REID\n * @Blog https://blog.csdn.net/qq_39035773\n * @GitHub https://github.com/BeginnerA\n * @Data ",
"end": 238,
"score": 0.9803525805473328,
"start": 227,
"tag": "USERNAME",
"value": "qq_39035773"
},
{
"context": "sdn.net/qq_39035773\n * @GitHub https://github.com/BeginnerA\n * @Data 2021/1/15\n * @Version V1.0\n **/\npublic c",
"end": 278,
"score": 0.9996420741081238,
"start": 269,
"tag": "USERNAME",
"value": "BeginnerA"
}
]
| null | []
| package com.reid.config;
import com.reid.utils.ParameterMapping;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 解析后的sql语句和参数
* </p>
*
* @ClassName BoundSql
* @Author REID
* @Blog https://blog.csdn.net/qq_39035773
* @GitHub https://github.com/BeginnerA
* @Data 2021/1/15
* @Version V1.0
**/
public class BoundSql {
/**
* 解析后的sql
*/
private String sqlTest;
/**
* 参数集
*/
private List<ParameterMapping> parameterMappingList = new ArrayList<>();
public BoundSql(String sqlTest, List<ParameterMapping> parameterMappingList) {
this.sqlTest = sqlTest;
this.parameterMappingList = parameterMappingList;
}
public String getSqlTest() {
return sqlTest;
}
public void setSqlTest(String sqlTest) {
this.sqlTest = sqlTest;
}
public List<ParameterMapping> getParameterMappingList() {
return parameterMappingList;
}
public void setParameterMappingList(List<ParameterMapping> parameterMappingList) {
this.parameterMappingList = parameterMappingList;
}
}
| 1,129 | 0.666363 | 0.650866 | 52 | 20.096153 | 22.326475 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 0 |
ba3ab5f38448ef304719456e416547244664ccef | 38,963,943,322,079 | b4c77d93db77cf169996daf5886a36a2211a86d8 | /src/javaJungsuk/chap15/FileReaderEx1.java | c94c140eca3ea54b12d80251c3a9734e1e9131b8 | []
| no_license | siyoon210/Java-Practice | https://github.com/siyoon210/Java-Practice | e5fb475d11339eea103feaaa9340bd983902aa7e | 9454e54b8827bba19c59acb5d259c8a0f3ecc4f5 | refs/heads/master | 2023-03-03T16:05:14.692000 | 2022-06-16T12:27:13 | 2022-06-16T12:27:13 | 147,627,167 | 0 | 0 | null | false | 2023-02-28T09:33:38 | 2018-09-06T06:22:33 | 2021-10-26T13:22:53 | 2023-02-28T09:33:38 | 23,761 | 0 | 0 | 22 | Java | false | false | package javaJungsuk.chap15;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class FileReaderEx1 {
public static void main(String[] args) {
String fileName = "C:\\Users\\siyoon\\Documents\\GitHub\\Java-Practice\\src\\javaJungsuk\\chap15\\test.txt";
try {
FileInputStream fis = new FileInputStream(fileName);
FileReader fr = new FileReader(fileName);
int data=0;
while((data = fis.read())!=-1){
// System.out.println(data);
System.out.print((char)data); //문자로 형변환 해주어야 한다.
}
System.out.println();
fis.close();
while ((data=fr.read())!=-1) {
// System.out.println(data);
System.out.print((char)data); //문자로 형변환 해주어야 한다.
}
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 1,056 | java | FileReaderEx1.java | Java | [
{
"context": "g[] args) {\n String fileName = \"C:\\\\Users\\\\siyoon\\\\Documents\\\\GitHub\\\\Java-Practice\\\\src\\\\javaJungs",
"end": 273,
"score": 0.9989959597587585,
"start": 267,
"tag": "USERNAME",
"value": "siyoon"
}
]
| null | []
| package javaJungsuk.chap15;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class FileReaderEx1 {
public static void main(String[] args) {
String fileName = "C:\\Users\\siyoon\\Documents\\GitHub\\Java-Practice\\src\\javaJungsuk\\chap15\\test.txt";
try {
FileInputStream fis = new FileInputStream(fileName);
FileReader fr = new FileReader(fileName);
int data=0;
while((data = fis.read())!=-1){
// System.out.println(data);
System.out.print((char)data); //문자로 형변환 해주어야 한다.
}
System.out.println();
fis.close();
while ((data=fr.read())!=-1) {
// System.out.println(data);
System.out.print((char)data); //문자로 형변환 해주어야 한다.
}
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| 1,056 | 0.551587 | 0.543651 | 34 | 28.647058 | 24.612146 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 0 |
2f6f08a77d74c9bf10e1b7db5810cdc7c44ec57f | 39,075,612,492,211 | 3af2c61331b9460ee3c4038139e24c3307126857 | /BAMSim/src/BAM/BAMRecommender/gui/ResultDialog.java | f98da5b04474a0c55ec24f5e166b7ad88eea9e91 | []
| no_license | rfreale/BAMSim | https://github.com/rfreale/BAMSim | a6f0a89a7b40677f49f7d343c0f3cfe10ebb1898 | 3d3ca559ae7bc2d26f642fb6f8fdbe2f3f8c8a67 | refs/heads/master | 2023-06-07T23:12:36.298000 | 2019-02-21T03:20:44 | 2019-02-21T03:20:44 | 69,345,617 | 0 | 0 | null | false | 2021-06-22T20:50:27 | 2016-09-27T10:30:18 | 2020-10-27T13:49:50 | 2021-06-22T20:48:38 | 200,350 | 0 | 0 | 1 | HTML | false | false | /**
* Travel Recommender example for the jCOLIBRI2 framework.
* @author Juan A. Recio-García.
* GAIA - Group for Artificial Intelligence Applications
* http://gaia.fdi.ucm.es
* 25/07/2006
*/
package BAM.BAMRecommender.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collection;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.SpringLayout;
import javax.swing.UIManager;
import jcolibri.cbrcore.CBRCase;
import BAM.BAMRecommender.BAMDescription;
import BAM.BAMRecommender.BAMRecommender;
import BAM.BAMRecommender.BAMSolution;
import BAM.BAMRecommender.BAMTypes;
import jcolibri.method.retrieve.RetrievalResult;
import jcolibri.util.FileIO;
/**
* Result dialog
* @author Juan A. Recio-Garcia
* @version 1.0
*/
public class ResultDialog extends JDialog {
private static final long serialVersionUID = 1L;
JLabel image;
JLabel caseId;
JLabel gestor;
JLabel BAMAtual;
//JLabel problema;
JLabel SLAUtilizacaoCT0;
JLabel SLAUtilizacaoCT1;
JLabel SLAUtilizacaoCT2;
JLabel SLABloqueiosCT0;
JLabel SLABloqueiosCT1;
JLabel SLABloqueiosCT2;
JLabel SLAPreempcoesCT0;
JLabel SLAPreempcoesCT1;
/*JLabel SLAPreempcoesCT2;
JLabel SLADevolucoesCT0;*/
JLabel SLADevolucoesCT1;
JLabel SLADevolucoesCT2;
JLabel BC0;
JLabel BC1;
JLabel BC2;
JLabel utilizacaoDoEnlaceCT0;
JLabel utilizacaoDoEnlaceCT1;
JLabel utilizacaoDoEnlaceCT2;
JLabel numeroDeBloqueiosCT0;
JLabel numeroDeBloqueiosCT1;
JLabel numeroDeBloqueiosCT2;
JLabel numeroDePreempcoesCT0;
JLabel numeroDePreempcoesCT1;
/*JLabel numeroDePreempcoesCT2;
JLabel numeroDeDevolucoesCT0;*/
JLabel numeroDeDevolucoesCT1;
JLabel numeroDeDevolucoesCT2;
JLabel BAMNovo;
JLabel aceita;
ArrayList<RetrievalResult> cases;
int currentCase;
public ResultDialog(JFrame main)
{
super(main,true);
configureFrame();
}
private void configureFrame()
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e1)
{
}
this.setTitle("Result casos = Casos Recuperados");
image = new JLabel();
image.setIcon(new ImageIcon(FileIO.findFile("BAM/BAMRecommender/gui/step3.png")));
this.getContentPane().setLayout(new BorderLayout());
this.getContentPane().add(image, BorderLayout.WEST);
/**********************************************************/
JPanel panel = new JPanel();
//panel.setLayout(new GridLayout(8,2));
panel.setLayout(new SpringLayout());
JLabel label;
panel.add(label = new JLabel("Description"));
label.setFont(label.getFont().deriveFont(Font.BOLD));
panel.add(label = new JLabel());
panel.add(new JLabel("Gestor"));
panel.add(this.gestor = new JLabel());
panel.add(new JLabel("BAMAtual"));
panel.add(this.BAMAtual = new JLabel());
/*panel.add(new JLabel("Problema"));
panel.add(this.problema = new JLabel());*/
panel.add(new JLabel("SLA Utilização CTO"));
panel.add(this.SLAUtilizacaoCT0= new JLabel());
panel.add(new JLabel("SLA Utilização CT1"));
panel.add(this.SLAUtilizacaoCT1= new JLabel());
panel.add(new JLabel("SLA Utilização CT2"));
panel.add(this.SLAUtilizacaoCT2= new JLabel());
panel.add(new JLabel("SLA Bloqueio CTO"));
panel.add(this.SLABloqueiosCT0= new JLabel());
panel.add(new JLabel("SLA Bloqueio CT1"));
panel.add(this.SLABloqueiosCT1= new JLabel());
panel.add(new JLabel("SLA Bloqueio CT2"));
panel.add(this.SLABloqueiosCT2= new JLabel());
panel.add(new JLabel("SLA Preempção CTO"));
panel.add(this.SLAPreempcoesCT0= new JLabel());
panel.add(new JLabel("SLA Preempção CT1"));
panel.add(this.SLAPreempcoesCT1= new JLabel());
/*panel.add(new JLabel("SLA Preempção CT2"));
panel.add(this.SLAPreempcoesCT2= new JLabel());
panel.add(new JLabel("SLA Devolução CTO"));
panel.add(this.SLADevolucoesCT0= new JLabel());*/
panel.add(new JLabel("SLA Devolução CT1"));
panel.add(this.SLADevolucoesCT1= new JLabel());
panel.add(new JLabel("SLA Devolução CT2"));
panel.add(this.SLADevolucoesCT2= new JLabel());
panel.add(new JLabel("Largura de Banda em BC0"));
panel.add(this.BC0= new JLabel());
panel.add(new JLabel("Largura de Banda em BC1"));
panel.add(this.BC1= new JLabel());
panel.add(new JLabel("Largura de Banda em BC2"));
panel.add(this.BC2= new JLabel());
panel.add(new JLabel("Utilização do Enlace CT0"));
panel.add(this.utilizacaoDoEnlaceCT0= new JLabel());
panel.add(new JLabel("Utilização do Enlace CT1"));
panel.add(this.utilizacaoDoEnlaceCT1= new JLabel());
panel.add(new JLabel("Utilização do Enlace CT2"));
panel.add(this.utilizacaoDoEnlaceCT2= new JLabel());
panel.add(new JLabel("Number de Bloqueios em CT0"));
panel.add(this.numeroDeBloqueiosCT0= new JLabel());
panel.add(new JLabel("Number de Bloqueios em CT1"));
panel.add(this.numeroDeBloqueiosCT1= new JLabel());
panel.add(new JLabel("Number de Bloqueios em CT2"));
panel.add(this.numeroDeBloqueiosCT2= new JLabel());
panel.add(new JLabel("Number de Preempções em CT0"));
panel.add(this.numeroDePreempcoesCT0= new JLabel());
panel.add(new JLabel("Number de Preempções em CT1"));
panel.add(this.numeroDePreempcoesCT1= new JLabel());
/*panel.add(new JLabel("Number de Preempções em CT2"));
panel.add(this.numeroDePreempcoesCT2= new JLabel());
panel.add(new JLabel("Number de Devoluções em CT0"));
panel.add(this.numeroDeDevolucoesCT0= new JLabel());*/
panel.add(new JLabel("Number de Devoluções em CT1"));
panel.add(this.numeroDeDevolucoesCT1= new JLabel());
panel.add(new JLabel("Number de Devoluções em CT2"));
panel.add(this.numeroDeDevolucoesCT2= new JLabel());
panel.add(label = new JLabel("Solution"));
label.setFont(label.getFont().deriveFont(Font.BOLD));
panel.add(label = new JLabel());
panel.add(new JLabel("BAMNovo"));
panel.add(this.BAMNovo = new JLabel());
panel.add(new JLabel("Aceita?"));
panel.add(this.aceita = new JLabel());
// Lay out the panel.
Utils.makeCompactGrid(panel,
29, 2, //rows, cols
6, 6, //initX, initY
30, 10); //xPad, yPad
JPanel casesPanel = new JPanel();
casesPanel.setLayout(new BorderLayout());
casesPanel.add(panel, BorderLayout.CENTER);
JPanel casesIterPanel = new JPanel();
casesIterPanel.setLayout(new FlowLayout());
JButton prev = new JButton("<<");
casesIterPanel.add(prev);
casesIterPanel.add(caseId = new JLabel("Case id"));
JButton follow = new JButton(">>");
casesIterPanel.add(follow);
prev.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
currentCase = (currentCase+cases.size()-1) % cases.size();
showCase();
}
});
follow.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
currentCase = (currentCase+1) % cases.size();
showCase();
}
});
casesPanel.add(casesIterPanel, BorderLayout.NORTH);
JPanel panelAux = new JPanel();
panelAux.setLayout(new BorderLayout());
panelAux.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panelAux.add(casesPanel,BorderLayout.NORTH);
JPanel buttons = new JPanel();
buttons.setLayout(new BorderLayout());
JButton ok = new JButton("Next >>");
ok.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
next();
}
});
buttons.add(ok,BorderLayout.CENTER);
JButton exit = new JButton("Exit");
exit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
try {
BAMRecommender.getInstance().postCycle();
} catch (Exception ex) {
org.apache.commons.logging.LogFactory.getLog(BAMRecommender.class).error(ex);
}
System.exit(-1);
}
});
buttons.add(exit,BorderLayout.WEST);
panelAux.add(buttons, BorderLayout.SOUTH);
this.getContentPane().add(panelAux, BorderLayout.CENTER);
/**********************************************************/
this.pack();
this.setSize(600, this.getHeight());
this.setResizable(false);
Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width - this.getWidth()) / 2,
(screenSize.height - this.getHeight()) / 2,
getWidth(),
getHeight());
}
void next()
{
this.setVisible(false);
}
public void showCases(Collection<RetrievalResult> eval, Collection<CBRCase> selected)
{
cases = new ArrayList<RetrievalResult>();
for(RetrievalResult rr: eval)
if(selected.contains(rr.get_case()))
cases.add(rr);
currentCase = 0;
showCase();
}
public static String valueOf(Object obj) {
return (obj == null) ? "null" : obj.toString();
}
void showCase()
{
RetrievalResult rr = cases.get(currentCase);
double sim = rr.getEval();
CBRCase _case = rr.get_case();
this.caseId.setText(_case.getID().toString()+" -> "+sim+" ("+(currentCase+1)+"/"+cases.size()+")");
BAMDescription desc = (BAMDescription) _case.getDescription();
/*this.gestor.setText(valueOf(desc.getGestor()));
this.BAMAtual.setText(valueOf(desc.getBAMAtual()));
//this.problema.setText(valueOf(desc.getProblema()));
this.SLAUtilizacaoCT0.setText(valueOf(desc.getSLAUtilizacaoCT0()));
this.SLAUtilizacaoCT1.setText(valueOf(desc.getSLAUtilizacaoCT1()));
this.SLAUtilizacaoCT2.setText(valueOf(desc.getSLAUtilizacaoCT2()));
this.SLABloqueiosCT0.setText(valueOf(desc.getSLABloqueiosCT0()));
this.SLABloqueiosCT1.setText(valueOf(desc.getSLABloqueiosCT1()));
this.SLABloqueiosCT2.setText(valueOf(desc.getSLABloqueiosCT2()));
this.SLAPreempcoesCT0.setText(valueOf(desc.getSLAPreempcoesCT0()));
this.SLAPreempcoesCT1.setText(valueOf(desc.getSLAPreempcoesCT1()));
this.SLAPreempcoesCT2.setText(valueOf(desc.getSLAPreempcoesCT2()));
this.SLADevolucoesCT0.setText(valueOf(desc.getSLADevolucoesCT0()));
this.SLADevolucoesCT1.setText(valueOf(desc.getSLADevolucoesCT1()));
this.SLADevolucoesCT2.setText(valueOf(desc.getSLADevolucoesCT2()));*/
this.BC0.setText(valueOf(desc.getBC0()));
this.BC1.setText(valueOf(desc.getBC1()));
this.BC2.setText(valueOf(desc.getBC2()));
this.utilizacaoDoEnlaceCT0.setText(valueOf(desc.getUtilizacaoDoEnlaceCT0()));
this.utilizacaoDoEnlaceCT1.setText(valueOf(desc.getUtilizacaoDoEnlaceCT1()));
this.utilizacaoDoEnlaceCT2.setText(valueOf(desc.getUtilizacaoDoEnlaceCT2()));
this.numeroDeBloqueiosCT0.setText(valueOf(desc.getNumeroDeBloqueiosCT0()));
this.numeroDeBloqueiosCT1.setText(valueOf(desc.getNumeroDeBloqueiosCT1()));
this.numeroDeBloqueiosCT2.setText(valueOf(desc.getNumeroDeBloqueiosCT2()));
this.numeroDePreempcoesCT0.setText(valueOf(desc.getNumeroDePreempcoesCT0()));
this.numeroDePreempcoesCT1.setText(valueOf(desc.getNumeroDePreempcoesCT1()));
/*this.numeroDePreempcoesCT2.setText(valueOf(desc.getNumeroDePreempcoesCT2()));
this.numeroDeDevolucoesCT0.setText(valueOf(desc.getNumeroDeDevolucoesCT0()));*/
this.numeroDeDevolucoesCT1.setText(valueOf(desc.getNumeroDeDevolucoesCT1()));
this.numeroDeDevolucoesCT2.setText(valueOf(desc.getNumeroDeDevolucoesCT2()));
BAMSolution sol = (BAMSolution) _case.getSolution();
this.BAMNovo.setText(sol.getBAMNovo().toString());
this.aceita.setText(sol.getAceita().toString());
}
/**
* @param args
*/
public static void main(String[] args) {
ResultDialog qf = new ResultDialog(null);
qf.setVisible(true);
System.out.println("Bye");
}
} | UTF-8 | Java | 12,037 | java | ResultDialog.java | Java | [
{
"context": "r example for the jCOLIBRI2 framework. \n * @author Juan A. Recio-García.\n * GAIA - Group for Artificial Intelligence Appl",
"end": 95,
"score": 0.9998853802680969,
"start": 75,
"tag": "NAME",
"value": "Juan A. Recio-García"
},
{
"context": "ibri.util.FileIO;\n\n/**\n * Result dialog\n * @author Juan A. Recio-Garcia\n * @version 1.0\n */\npublic class ResultDialog ext",
"end": 1155,
"score": 0.9998895525932312,
"start": 1135,
"tag": "NAME",
"value": "Juan A. Recio-Garcia"
}
]
| null | []
| /**
* Travel Recommender example for the jCOLIBRI2 framework.
* @author <NAME>.
* GAIA - Group for Artificial Intelligence Applications
* http://gaia.fdi.ucm.es
* 25/07/2006
*/
package BAM.BAMRecommender.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collection;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.SpringLayout;
import javax.swing.UIManager;
import jcolibri.cbrcore.CBRCase;
import BAM.BAMRecommender.BAMDescription;
import BAM.BAMRecommender.BAMRecommender;
import BAM.BAMRecommender.BAMSolution;
import BAM.BAMRecommender.BAMTypes;
import jcolibri.method.retrieve.RetrievalResult;
import jcolibri.util.FileIO;
/**
* Result dialog
* @author <NAME>
* @version 1.0
*/
public class ResultDialog extends JDialog {
private static final long serialVersionUID = 1L;
JLabel image;
JLabel caseId;
JLabel gestor;
JLabel BAMAtual;
//JLabel problema;
JLabel SLAUtilizacaoCT0;
JLabel SLAUtilizacaoCT1;
JLabel SLAUtilizacaoCT2;
JLabel SLABloqueiosCT0;
JLabel SLABloqueiosCT1;
JLabel SLABloqueiosCT2;
JLabel SLAPreempcoesCT0;
JLabel SLAPreempcoesCT1;
/*JLabel SLAPreempcoesCT2;
JLabel SLADevolucoesCT0;*/
JLabel SLADevolucoesCT1;
JLabel SLADevolucoesCT2;
JLabel BC0;
JLabel BC1;
JLabel BC2;
JLabel utilizacaoDoEnlaceCT0;
JLabel utilizacaoDoEnlaceCT1;
JLabel utilizacaoDoEnlaceCT2;
JLabel numeroDeBloqueiosCT0;
JLabel numeroDeBloqueiosCT1;
JLabel numeroDeBloqueiosCT2;
JLabel numeroDePreempcoesCT0;
JLabel numeroDePreempcoesCT1;
/*JLabel numeroDePreempcoesCT2;
JLabel numeroDeDevolucoesCT0;*/
JLabel numeroDeDevolucoesCT1;
JLabel numeroDeDevolucoesCT2;
JLabel BAMNovo;
JLabel aceita;
ArrayList<RetrievalResult> cases;
int currentCase;
public ResultDialog(JFrame main)
{
super(main,true);
configureFrame();
}
private void configureFrame()
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e1)
{
}
this.setTitle("Result casos = Casos Recuperados");
image = new JLabel();
image.setIcon(new ImageIcon(FileIO.findFile("BAM/BAMRecommender/gui/step3.png")));
this.getContentPane().setLayout(new BorderLayout());
this.getContentPane().add(image, BorderLayout.WEST);
/**********************************************************/
JPanel panel = new JPanel();
//panel.setLayout(new GridLayout(8,2));
panel.setLayout(new SpringLayout());
JLabel label;
panel.add(label = new JLabel("Description"));
label.setFont(label.getFont().deriveFont(Font.BOLD));
panel.add(label = new JLabel());
panel.add(new JLabel("Gestor"));
panel.add(this.gestor = new JLabel());
panel.add(new JLabel("BAMAtual"));
panel.add(this.BAMAtual = new JLabel());
/*panel.add(new JLabel("Problema"));
panel.add(this.problema = new JLabel());*/
panel.add(new JLabel("SLA Utilização CTO"));
panel.add(this.SLAUtilizacaoCT0= new JLabel());
panel.add(new JLabel("SLA Utilização CT1"));
panel.add(this.SLAUtilizacaoCT1= new JLabel());
panel.add(new JLabel("SLA Utilização CT2"));
panel.add(this.SLAUtilizacaoCT2= new JLabel());
panel.add(new JLabel("SLA Bloqueio CTO"));
panel.add(this.SLABloqueiosCT0= new JLabel());
panel.add(new JLabel("SLA Bloqueio CT1"));
panel.add(this.SLABloqueiosCT1= new JLabel());
panel.add(new JLabel("SLA Bloqueio CT2"));
panel.add(this.SLABloqueiosCT2= new JLabel());
panel.add(new JLabel("SLA Preempção CTO"));
panel.add(this.SLAPreempcoesCT0= new JLabel());
panel.add(new JLabel("SLA Preempção CT1"));
panel.add(this.SLAPreempcoesCT1= new JLabel());
/*panel.add(new JLabel("SLA Preempção CT2"));
panel.add(this.SLAPreempcoesCT2= new JLabel());
panel.add(new JLabel("SLA Devolução CTO"));
panel.add(this.SLADevolucoesCT0= new JLabel());*/
panel.add(new JLabel("SLA Devolução CT1"));
panel.add(this.SLADevolucoesCT1= new JLabel());
panel.add(new JLabel("SLA Devolução CT2"));
panel.add(this.SLADevolucoesCT2= new JLabel());
panel.add(new JLabel("Largura de Banda em BC0"));
panel.add(this.BC0= new JLabel());
panel.add(new JLabel("Largura de Banda em BC1"));
panel.add(this.BC1= new JLabel());
panel.add(new JLabel("Largura de Banda em BC2"));
panel.add(this.BC2= new JLabel());
panel.add(new JLabel("Utilização do Enlace CT0"));
panel.add(this.utilizacaoDoEnlaceCT0= new JLabel());
panel.add(new JLabel("Utilização do Enlace CT1"));
panel.add(this.utilizacaoDoEnlaceCT1= new JLabel());
panel.add(new JLabel("Utilização do Enlace CT2"));
panel.add(this.utilizacaoDoEnlaceCT2= new JLabel());
panel.add(new JLabel("Number de Bloqueios em CT0"));
panel.add(this.numeroDeBloqueiosCT0= new JLabel());
panel.add(new JLabel("Number de Bloqueios em CT1"));
panel.add(this.numeroDeBloqueiosCT1= new JLabel());
panel.add(new JLabel("Number de Bloqueios em CT2"));
panel.add(this.numeroDeBloqueiosCT2= new JLabel());
panel.add(new JLabel("Number de Preempções em CT0"));
panel.add(this.numeroDePreempcoesCT0= new JLabel());
panel.add(new JLabel("Number de Preempções em CT1"));
panel.add(this.numeroDePreempcoesCT1= new JLabel());
/*panel.add(new JLabel("Number de Preempções em CT2"));
panel.add(this.numeroDePreempcoesCT2= new JLabel());
panel.add(new JLabel("Number de Devoluções em CT0"));
panel.add(this.numeroDeDevolucoesCT0= new JLabel());*/
panel.add(new JLabel("Number de Devoluções em CT1"));
panel.add(this.numeroDeDevolucoesCT1= new JLabel());
panel.add(new JLabel("Number de Devoluções em CT2"));
panel.add(this.numeroDeDevolucoesCT2= new JLabel());
panel.add(label = new JLabel("Solution"));
label.setFont(label.getFont().deriveFont(Font.BOLD));
panel.add(label = new JLabel());
panel.add(new JLabel("BAMNovo"));
panel.add(this.BAMNovo = new JLabel());
panel.add(new JLabel("Aceita?"));
panel.add(this.aceita = new JLabel());
// Lay out the panel.
Utils.makeCompactGrid(panel,
29, 2, //rows, cols
6, 6, //initX, initY
30, 10); //xPad, yPad
JPanel casesPanel = new JPanel();
casesPanel.setLayout(new BorderLayout());
casesPanel.add(panel, BorderLayout.CENTER);
JPanel casesIterPanel = new JPanel();
casesIterPanel.setLayout(new FlowLayout());
JButton prev = new JButton("<<");
casesIterPanel.add(prev);
casesIterPanel.add(caseId = new JLabel("Case id"));
JButton follow = new JButton(">>");
casesIterPanel.add(follow);
prev.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
currentCase = (currentCase+cases.size()-1) % cases.size();
showCase();
}
});
follow.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
currentCase = (currentCase+1) % cases.size();
showCase();
}
});
casesPanel.add(casesIterPanel, BorderLayout.NORTH);
JPanel panelAux = new JPanel();
panelAux.setLayout(new BorderLayout());
panelAux.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
panelAux.add(casesPanel,BorderLayout.NORTH);
JPanel buttons = new JPanel();
buttons.setLayout(new BorderLayout());
JButton ok = new JButton("Next >>");
ok.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
next();
}
});
buttons.add(ok,BorderLayout.CENTER);
JButton exit = new JButton("Exit");
exit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
try {
BAMRecommender.getInstance().postCycle();
} catch (Exception ex) {
org.apache.commons.logging.LogFactory.getLog(BAMRecommender.class).error(ex);
}
System.exit(-1);
}
});
buttons.add(exit,BorderLayout.WEST);
panelAux.add(buttons, BorderLayout.SOUTH);
this.getContentPane().add(panelAux, BorderLayout.CENTER);
/**********************************************************/
this.pack();
this.setSize(600, this.getHeight());
this.setResizable(false);
Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width - this.getWidth()) / 2,
(screenSize.height - this.getHeight()) / 2,
getWidth(),
getHeight());
}
void next()
{
this.setVisible(false);
}
public void showCases(Collection<RetrievalResult> eval, Collection<CBRCase> selected)
{
cases = new ArrayList<RetrievalResult>();
for(RetrievalResult rr: eval)
if(selected.contains(rr.get_case()))
cases.add(rr);
currentCase = 0;
showCase();
}
public static String valueOf(Object obj) {
return (obj == null) ? "null" : obj.toString();
}
void showCase()
{
RetrievalResult rr = cases.get(currentCase);
double sim = rr.getEval();
CBRCase _case = rr.get_case();
this.caseId.setText(_case.getID().toString()+" -> "+sim+" ("+(currentCase+1)+"/"+cases.size()+")");
BAMDescription desc = (BAMDescription) _case.getDescription();
/*this.gestor.setText(valueOf(desc.getGestor()));
this.BAMAtual.setText(valueOf(desc.getBAMAtual()));
//this.problema.setText(valueOf(desc.getProblema()));
this.SLAUtilizacaoCT0.setText(valueOf(desc.getSLAUtilizacaoCT0()));
this.SLAUtilizacaoCT1.setText(valueOf(desc.getSLAUtilizacaoCT1()));
this.SLAUtilizacaoCT2.setText(valueOf(desc.getSLAUtilizacaoCT2()));
this.SLABloqueiosCT0.setText(valueOf(desc.getSLABloqueiosCT0()));
this.SLABloqueiosCT1.setText(valueOf(desc.getSLABloqueiosCT1()));
this.SLABloqueiosCT2.setText(valueOf(desc.getSLABloqueiosCT2()));
this.SLAPreempcoesCT0.setText(valueOf(desc.getSLAPreempcoesCT0()));
this.SLAPreempcoesCT1.setText(valueOf(desc.getSLAPreempcoesCT1()));
this.SLAPreempcoesCT2.setText(valueOf(desc.getSLAPreempcoesCT2()));
this.SLADevolucoesCT0.setText(valueOf(desc.getSLADevolucoesCT0()));
this.SLADevolucoesCT1.setText(valueOf(desc.getSLADevolucoesCT1()));
this.SLADevolucoesCT2.setText(valueOf(desc.getSLADevolucoesCT2()));*/
this.BC0.setText(valueOf(desc.getBC0()));
this.BC1.setText(valueOf(desc.getBC1()));
this.BC2.setText(valueOf(desc.getBC2()));
this.utilizacaoDoEnlaceCT0.setText(valueOf(desc.getUtilizacaoDoEnlaceCT0()));
this.utilizacaoDoEnlaceCT1.setText(valueOf(desc.getUtilizacaoDoEnlaceCT1()));
this.utilizacaoDoEnlaceCT2.setText(valueOf(desc.getUtilizacaoDoEnlaceCT2()));
this.numeroDeBloqueiosCT0.setText(valueOf(desc.getNumeroDeBloqueiosCT0()));
this.numeroDeBloqueiosCT1.setText(valueOf(desc.getNumeroDeBloqueiosCT1()));
this.numeroDeBloqueiosCT2.setText(valueOf(desc.getNumeroDeBloqueiosCT2()));
this.numeroDePreempcoesCT0.setText(valueOf(desc.getNumeroDePreempcoesCT0()));
this.numeroDePreempcoesCT1.setText(valueOf(desc.getNumeroDePreempcoesCT1()));
/*this.numeroDePreempcoesCT2.setText(valueOf(desc.getNumeroDePreempcoesCT2()));
this.numeroDeDevolucoesCT0.setText(valueOf(desc.getNumeroDeDevolucoesCT0()));*/
this.numeroDeDevolucoesCT1.setText(valueOf(desc.getNumeroDeDevolucoesCT1()));
this.numeroDeDevolucoesCT2.setText(valueOf(desc.getNumeroDeDevolucoesCT2()));
BAMSolution sol = (BAMSolution) _case.getSolution();
this.BAMNovo.setText(sol.getBAMNovo().toString());
this.aceita.setText(sol.getAceita().toString());
}
/**
* @param args
*/
public static void main(String[] args) {
ResultDialog qf = new ResultDialog(null);
qf.setVisible(true);
System.out.println("Bye");
}
} | 12,008 | 0.7115 | 0.697 | 416 | 27.848558 | 23.749365 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.237981 | false | false | 0 |
ed393cf9339b72aa3b43e36c6eebbd187be22c15 | 34,402,688,103,374 | f0dc6669183c797e0a4fd0e034897c4550283230 | /src/main/java/pl/awolny/controller/ShoppingCartController.java | f84ca55380e2a26363353ac8cd3c5a09a8e66dda | []
| no_license | alwolny/FridgeShop | https://github.com/alwolny/FridgeShop | 82257a116898a5b5c95b600ace6ffefa25606cda | 8c99144923385e9bab05d41cf2fe8311c1c08ca2 | refs/heads/master | 2021-08-24T11:09:17.502000 | 2017-12-09T12:37:11 | 2017-12-09T12:37:11 | 108,190,828 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pl.awolny.controller;
import java.math.BigDecimal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import pl.awolny.model.Product;
import pl.awolny.model.User;
import pl.awolny.service.ProductService;
import pl.awolny.service.ShoppingCartService;
import pl.awolny.service.UserService;
@Controller
public class ShoppingCartController {
@Autowired
private ProductService productService;
@Autowired
private ShoppingCartService cartService;
@Autowired
private UserService userService;
@RequestMapping("/addToCart")
public String addProductToCart(@RequestParam("name") String productName, Model model){
Product prod = productService.getProductByName(productName);
User user = userService.getAuthUser();
cartService.addProduct(user, prod);
return "redirect:cart";
}
@RequestMapping("/cart")
public String showCart(Model model) {
User user = userService.getAuthUser();
model.addAttribute("items", user.getCart().getItems());
BigDecimal sum = new BigDecimal(0);
sum = cartService.getTotal();
model.addAttribute("total", sum);
return "cart";
}
} | UTF-8 | Java | 1,331 | java | ShoppingCartController.java | Java | []
| null | []
| package pl.awolny.controller;
import java.math.BigDecimal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import pl.awolny.model.Product;
import pl.awolny.model.User;
import pl.awolny.service.ProductService;
import pl.awolny.service.ShoppingCartService;
import pl.awolny.service.UserService;
@Controller
public class ShoppingCartController {
@Autowired
private ProductService productService;
@Autowired
private ShoppingCartService cartService;
@Autowired
private UserService userService;
@RequestMapping("/addToCart")
public String addProductToCart(@RequestParam("name") String productName, Model model){
Product prod = productService.getProductByName(productName);
User user = userService.getAuthUser();
cartService.addProduct(user, prod);
return "redirect:cart";
}
@RequestMapping("/cart")
public String showCart(Model model) {
User user = userService.getAuthUser();
model.addAttribute("items", user.getCart().getItems());
BigDecimal sum = new BigDecimal(0);
sum = cartService.getTotal();
model.addAttribute("total", sum);
return "cart";
}
} | 1,331 | 0.781367 | 0.780616 | 48 | 26.75 | 21.652079 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.395833 | false | false | 0 |
927940851af872e4192bf3d22a65ec1ddc87de5d | 34,402,688,101,696 | 6e4507fabfc18e1fcb8a555cd1ab0c02e85d2089 | /src/com/company/BarberShop.java | 38255b6f4bdc99030b498a7c9c5ae5c7f0536f2c | []
| no_license | JanekMichal/SalonFryzjerski | https://github.com/JanekMichal/SalonFryzjerski | ec5299bb28fb80d6d34f107d46a0cd89fb7ea648 | eccc77eb091c84af0959c15d022266aeb3822bf3 | refs/heads/master | 2023-02-10T12:17:55.876000 | 2020-12-14T10:30:48 | 2020-12-14T10:30:48 | 318,565,790 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.company;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
public class BarberShop {
public static String[] clientsList = new String[8];
public static List<Barber> clients = new ArrayList<>();
public static synchronized void showUpdatedReservations() throws IOException {
for (Barber barber : clients) {
barber.showAvailableHours();
}
}
public static void main(String[] args) {
int PORT_NUMBER = 9091;
System.out.println("Server is running...");
int clientID = 0;
try {
ServerSocket serverSocket = new ServerSocket(PORT_NUMBER);
while (true) {
Socket socket = serverSocket.accept();
clientID++;
System.out.println("Client" + clientID + " connected");
Barber barber = new Barber(socket, clientID);
clients.add(barber);
Thread t = new Thread(barber);
t.start();
}
} catch (IOException IOE) {
System.out.println("Failed to connect with Client");
}
}
} | UTF-8 | Java | 1,208 | java | BarberShop.java | Java | []
| null | []
| package com.company;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
public class BarberShop {
public static String[] clientsList = new String[8];
public static List<Barber> clients = new ArrayList<>();
public static synchronized void showUpdatedReservations() throws IOException {
for (Barber barber : clients) {
barber.showAvailableHours();
}
}
public static void main(String[] args) {
int PORT_NUMBER = 9091;
System.out.println("Server is running...");
int clientID = 0;
try {
ServerSocket serverSocket = new ServerSocket(PORT_NUMBER);
while (true) {
Socket socket = serverSocket.accept();
clientID++;
System.out.println("Client" + clientID + " connected");
Barber barber = new Barber(socket, clientID);
clients.add(barber);
Thread t = new Thread(barber);
t.start();
}
} catch (IOException IOE) {
System.out.println("Failed to connect with Client");
}
}
} | 1,208 | 0.585265 | 0.580298 | 39 | 30 | 22.448803 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.564103 | false | false | 0 |
5a734c4d3b7560c804affbf4cc5bab1ae24e6b11 | 39,359,080,344,835 | 7691e3061786ae3b861182be8023c06e12af48dc | /services/src/main/java/org/broadleafcommerce/vendor/paypal/service/DefaultPayPalPaymentService.java | 7433f2039549e1bbbc07d36a13573f2a43d7d338 | [
"Apache-2.0"
]
| permissive | BroadleafCommerce/blc-paypal | https://github.com/BroadleafCommerce/blc-paypal | e920d61349d54beb398fd1c8bca2eb661c7ff8c1 | 96b7625425d71f98175e27c94253cc5c013317d5 | refs/heads/develop-ms | 2023-07-27T09:43:05.442000 | 2023-04-22T19:39:36 | 2023-04-22T19:39:36 | 5,317,414 | 8 | 17 | Apache-2.0 | false | 2023-09-11T22:17:39 | 2012-08-06T17:51:49 | 2023-08-12T04:47:14 | 2023-09-11T22:17:38 | 1,381 | 9 | 32 | 4 | Java | false | false | /*
* Copyright (C) 2009 - 2020 Broadleaf Commerce
*
* Licensed under the Broadleaf End User License Agreement (EULA), Version 1.1 (the
* "Commercial License" located at http://license.broadleafcommerce.org/commercial_license-1.1.txt).
*
* Alternatively, the Commercial License may be replaced with a mutually agreed upon license (the
* "Custom License") between you and Broadleaf Commerce. You may not use this file except in
* compliance with the applicable license.
*
* NOTICE: All information contained herein is, and remains the property of Broadleaf Commerce, LLC
* The intellectual and technical concepts contained herein are proprietary to Broadleaf Commerce,
* LLC and may be covered by U.S. and Foreign Patents, patents in process, and are protected by
* trade secret or copyright law. Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained from Broadleaf Commerce, LLC.
*/
package org.broadleafcommerce.vendor.paypal.service;
import org.apache.commons.lang3.StringUtils;
import org.broadleafcommerce.payment.service.gateway.PayPalCheckoutExternalCallService;
import org.broadleafcommerce.payment.service.gateway.PayPalCheckoutRestConfigurationProperties;
import org.broadleafcommerce.payment.service.gateway.PayPalGatewayConfiguration;
import org.broadleafcommerce.vendor.paypal.service.payment.MessageConstants;
import org.broadleafcommerce.vendor.paypal.service.payment.PayPalCreatePaymentRequest;
import org.broadleafcommerce.vendor.paypal.service.payment.PayPalCreatePaymentResponse;
import org.broadleafcommerce.vendor.paypal.service.payment.PayPalUpdatePaymentRequest;
import com.broadleafcommerce.paymentgateway.domain.PaymentRequest;
import com.broadleafcommerce.paymentgateway.service.exception.PaymentException;
import com.paypal.api.payments.Amount;
import com.paypal.api.payments.ItemList;
import com.paypal.api.payments.Patch;
import com.paypal.api.payments.Payer;
import com.paypal.api.payments.Payment;
import com.paypal.api.payments.RedirectUrls;
import com.paypal.api.payments.Transaction;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class DefaultPayPalPaymentService implements PayPalPaymentService {
private static final String ADD_OP_TYPE = "add";
private static final String REPLACE_OP_TYPE = "replace";
@Getter(AccessLevel.PROTECTED)
private final PayPalCheckoutExternalCallService paypalCheckoutService;
@Getter(AccessLevel.PROTECTED)
private final PayPalCheckoutRestConfigurationProperties configProperties;
@Getter(AccessLevel.PROTECTED)
private final PayPalGatewayConfiguration gatewayConfiguration;
@Getter(AccessLevel.PROTECTED)
private final PayPalWebExperienceProfileService webExperienceProfileService;
@Getter(AccessLevel.PROTECTED)
private final boolean shouldPopulateShippingOnPaymentCreation;
@Override
public Payment createPayPalPayment(@lombok.NonNull PaymentRequest paymentRequest,
boolean performCheckoutOnReturn,
boolean capture)
throws PaymentException {
// Set payer details
Payer payer = constructPayer(paymentRequest);
// Set redirect URLs
RedirectUrls redirectUrls = new RedirectUrls();
redirectUrls.setCancelUrl(configProperties.getCancelUrl(paymentRequest));
redirectUrls.setReturnUrl(configProperties.getReturnUrl(paymentRequest));
Amount amount = paypalCheckoutService.getPayPalAmountFromOrder(paymentRequest);
// Transaction information
Transaction transaction = new Transaction();
transaction.setAmount(amount);
transaction.setDescription(configProperties.getPaymentDescription());
transaction.setCustom(
paymentRequest.getTransactionReferenceId() + "|" + performCheckoutOnReturn);
ItemList itemList = paypalCheckoutService.getPayPalItemList(paymentRequest,
shouldPopulateShippingOnPaymentCreation);
if (itemList != null) {
transaction.setItemList(itemList);
}
// Add transaction to a list
List<Transaction> transactions = new ArrayList<>();
transactions.add(transaction);
// Add payment details
Payment payment = new Payment();
payment.setIntent(getIntent(performCheckoutOnReturn, capture));
payment.setPayer(payer);
payment.setRedirectUrls(redirectUrls);
payment.setTransactions(transactions);
String webExperienceProfileId =
webExperienceProfileService.getWebExperienceProfileId(paymentRequest);
if (StringUtils.isNotBlank(webExperienceProfileId)) {
payment.setExperienceProfileId(webExperienceProfileId);
}
return createPayment(payment, paymentRequest);
}
protected Payer constructPayer(PaymentRequest paymentRequest) {
Payer payer = new Payer();
payer.setPaymentMethod(MessageConstants.PAYER_PAYMENTMETHOD_PAYPAL);
return payer;
}
@Override
public void updatePayPalPaymentForFulfillment(@lombok.NonNull PaymentRequest paymentRequest)
throws PaymentException {
String paymentId = (String) paymentRequest.getAdditionalField(MessageConstants.PAYMENTID);
if (StringUtils.isBlank(paymentId)) {
throw new PaymentException(
"Unable to update the current PayPal payment because no PayPal payment id was found on the order");
}
List<Patch> patches = new ArrayList<>();
Patch amountPatch = new Patch(ADD_OP_TYPE, "/transactions/0/amount");
Amount amount = paypalCheckoutService.getPayPalAmountFromOrder(paymentRequest);
amountPatch.setValue(amount);
patches.add(amountPatch);
ItemList itemList = paypalCheckoutService.getPayPalItemList(paymentRequest, true);
if (itemList != null) {
Patch itemListPatch = new Patch(ADD_OP_TYPE, "/transactions/0/item_list");
itemListPatch.setValue(itemList);
patches.add(itemListPatch);
}
Patch customPatch = new Patch(ADD_OP_TYPE, "/transactions/0/custom");
customPatch.setValue(paymentRequest.getOrderId() + "|" + true);
patches.add(customPatch);
Payment paypalPayment = new Payment();
paypalPayment.setId(paymentId);
updatePayment(paypalPayment, patches, paymentRequest);
}
@Override
public void updatePaymentCustom(@lombok.NonNull String paymentId, @lombok.NonNull String custom)
throws PaymentException {
if (StringUtils.isBlank(paymentId)) {
throw new PaymentException(
"Unable to update the current PayPal payment because no PayPal payment id was found on the order");
}
Patch customPatch = new Patch(ADD_OP_TYPE, "/transactions/0/custom");
customPatch.setValue(custom);
Payment payment = new Payment();
payment.setId(paymentId);
List<Patch> patches = Collections.singletonList(customPatch);
PaymentRequest paymentRequest = new PaymentRequest();
updatePayment(payment, patches, paymentRequest);
}
protected Payment createPayment(Payment payment, PaymentRequest paymentRequest)
throws PaymentException {
PayPalCreatePaymentResponse response =
(PayPalCreatePaymentResponse) paypalCheckoutService.call(
new PayPalCreatePaymentRequest(payment,
paypalCheckoutService.constructAPIContext(paymentRequest)));
return response.getPayment();
}
protected void updatePayment(Payment payment,
List<Patch> patches,
PaymentRequest paymentRequest) throws PaymentException {
paypalCheckoutService.call(
new PayPalUpdatePaymentRequest(payment,
patches,
paypalCheckoutService.constructAPIContext(paymentRequest)));
}
@Deprecated
public String getIntent(boolean performCheckoutOnReturn) {
return getIntent(performCheckoutOnReturn, false);
}
protected String getIntent(boolean performCheckoutOnReturn, boolean capture) {
if (capture) {
return "sale";
}
return "authorize";
}
}
| UTF-8 | Java | 8,495 | java | DefaultPayPalPaymentService.java | Java | []
| null | []
| /*
* Copyright (C) 2009 - 2020 Broadleaf Commerce
*
* Licensed under the Broadleaf End User License Agreement (EULA), Version 1.1 (the
* "Commercial License" located at http://license.broadleafcommerce.org/commercial_license-1.1.txt).
*
* Alternatively, the Commercial License may be replaced with a mutually agreed upon license (the
* "Custom License") between you and Broadleaf Commerce. You may not use this file except in
* compliance with the applicable license.
*
* NOTICE: All information contained herein is, and remains the property of Broadleaf Commerce, LLC
* The intellectual and technical concepts contained herein are proprietary to Broadleaf Commerce,
* LLC and may be covered by U.S. and Foreign Patents, patents in process, and are protected by
* trade secret or copyright law. Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained from Broadleaf Commerce, LLC.
*/
package org.broadleafcommerce.vendor.paypal.service;
import org.apache.commons.lang3.StringUtils;
import org.broadleafcommerce.payment.service.gateway.PayPalCheckoutExternalCallService;
import org.broadleafcommerce.payment.service.gateway.PayPalCheckoutRestConfigurationProperties;
import org.broadleafcommerce.payment.service.gateway.PayPalGatewayConfiguration;
import org.broadleafcommerce.vendor.paypal.service.payment.MessageConstants;
import org.broadleafcommerce.vendor.paypal.service.payment.PayPalCreatePaymentRequest;
import org.broadleafcommerce.vendor.paypal.service.payment.PayPalCreatePaymentResponse;
import org.broadleafcommerce.vendor.paypal.service.payment.PayPalUpdatePaymentRequest;
import com.broadleafcommerce.paymentgateway.domain.PaymentRequest;
import com.broadleafcommerce.paymentgateway.service.exception.PaymentException;
import com.paypal.api.payments.Amount;
import com.paypal.api.payments.ItemList;
import com.paypal.api.payments.Patch;
import com.paypal.api.payments.Payer;
import com.paypal.api.payments.Payment;
import com.paypal.api.payments.RedirectUrls;
import com.paypal.api.payments.Transaction;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class DefaultPayPalPaymentService implements PayPalPaymentService {
private static final String ADD_OP_TYPE = "add";
private static final String REPLACE_OP_TYPE = "replace";
@Getter(AccessLevel.PROTECTED)
private final PayPalCheckoutExternalCallService paypalCheckoutService;
@Getter(AccessLevel.PROTECTED)
private final PayPalCheckoutRestConfigurationProperties configProperties;
@Getter(AccessLevel.PROTECTED)
private final PayPalGatewayConfiguration gatewayConfiguration;
@Getter(AccessLevel.PROTECTED)
private final PayPalWebExperienceProfileService webExperienceProfileService;
@Getter(AccessLevel.PROTECTED)
private final boolean shouldPopulateShippingOnPaymentCreation;
@Override
public Payment createPayPalPayment(@lombok.NonNull PaymentRequest paymentRequest,
boolean performCheckoutOnReturn,
boolean capture)
throws PaymentException {
// Set payer details
Payer payer = constructPayer(paymentRequest);
// Set redirect URLs
RedirectUrls redirectUrls = new RedirectUrls();
redirectUrls.setCancelUrl(configProperties.getCancelUrl(paymentRequest));
redirectUrls.setReturnUrl(configProperties.getReturnUrl(paymentRequest));
Amount amount = paypalCheckoutService.getPayPalAmountFromOrder(paymentRequest);
// Transaction information
Transaction transaction = new Transaction();
transaction.setAmount(amount);
transaction.setDescription(configProperties.getPaymentDescription());
transaction.setCustom(
paymentRequest.getTransactionReferenceId() + "|" + performCheckoutOnReturn);
ItemList itemList = paypalCheckoutService.getPayPalItemList(paymentRequest,
shouldPopulateShippingOnPaymentCreation);
if (itemList != null) {
transaction.setItemList(itemList);
}
// Add transaction to a list
List<Transaction> transactions = new ArrayList<>();
transactions.add(transaction);
// Add payment details
Payment payment = new Payment();
payment.setIntent(getIntent(performCheckoutOnReturn, capture));
payment.setPayer(payer);
payment.setRedirectUrls(redirectUrls);
payment.setTransactions(transactions);
String webExperienceProfileId =
webExperienceProfileService.getWebExperienceProfileId(paymentRequest);
if (StringUtils.isNotBlank(webExperienceProfileId)) {
payment.setExperienceProfileId(webExperienceProfileId);
}
return createPayment(payment, paymentRequest);
}
protected Payer constructPayer(PaymentRequest paymentRequest) {
Payer payer = new Payer();
payer.setPaymentMethod(MessageConstants.PAYER_PAYMENTMETHOD_PAYPAL);
return payer;
}
@Override
public void updatePayPalPaymentForFulfillment(@lombok.NonNull PaymentRequest paymentRequest)
throws PaymentException {
String paymentId = (String) paymentRequest.getAdditionalField(MessageConstants.PAYMENTID);
if (StringUtils.isBlank(paymentId)) {
throw new PaymentException(
"Unable to update the current PayPal payment because no PayPal payment id was found on the order");
}
List<Patch> patches = new ArrayList<>();
Patch amountPatch = new Patch(ADD_OP_TYPE, "/transactions/0/amount");
Amount amount = paypalCheckoutService.getPayPalAmountFromOrder(paymentRequest);
amountPatch.setValue(amount);
patches.add(amountPatch);
ItemList itemList = paypalCheckoutService.getPayPalItemList(paymentRequest, true);
if (itemList != null) {
Patch itemListPatch = new Patch(ADD_OP_TYPE, "/transactions/0/item_list");
itemListPatch.setValue(itemList);
patches.add(itemListPatch);
}
Patch customPatch = new Patch(ADD_OP_TYPE, "/transactions/0/custom");
customPatch.setValue(paymentRequest.getOrderId() + "|" + true);
patches.add(customPatch);
Payment paypalPayment = new Payment();
paypalPayment.setId(paymentId);
updatePayment(paypalPayment, patches, paymentRequest);
}
@Override
public void updatePaymentCustom(@lombok.NonNull String paymentId, @lombok.NonNull String custom)
throws PaymentException {
if (StringUtils.isBlank(paymentId)) {
throw new PaymentException(
"Unable to update the current PayPal payment because no PayPal payment id was found on the order");
}
Patch customPatch = new Patch(ADD_OP_TYPE, "/transactions/0/custom");
customPatch.setValue(custom);
Payment payment = new Payment();
payment.setId(paymentId);
List<Patch> patches = Collections.singletonList(customPatch);
PaymentRequest paymentRequest = new PaymentRequest();
updatePayment(payment, patches, paymentRequest);
}
protected Payment createPayment(Payment payment, PaymentRequest paymentRequest)
throws PaymentException {
PayPalCreatePaymentResponse response =
(PayPalCreatePaymentResponse) paypalCheckoutService.call(
new PayPalCreatePaymentRequest(payment,
paypalCheckoutService.constructAPIContext(paymentRequest)));
return response.getPayment();
}
protected void updatePayment(Payment payment,
List<Patch> patches,
PaymentRequest paymentRequest) throws PaymentException {
paypalCheckoutService.call(
new PayPalUpdatePaymentRequest(payment,
patches,
paypalCheckoutService.constructAPIContext(paymentRequest)));
}
@Deprecated
public String getIntent(boolean performCheckoutOnReturn) {
return getIntent(performCheckoutOnReturn, false);
}
protected String getIntent(boolean performCheckoutOnReturn, boolean capture) {
if (capture) {
return "sale";
}
return "authorize";
}
}
| 8,495 | 0.726898 | 0.724897 | 202 | 41.054455 | 32.287724 | 119 | true | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.589109 | false | false | 0 |
08d393dfb892358727a9feacf455e1f96cff6361 | 39,651,138,091,197 | 6aca836fdfb7e3d9be842297d78e3a5f33ae2bd1 | /1.7.02-Exercise-AddStubClasses/core/src/com/udacity/gamedev/icicles/Player.java | 3c6d1cfea984c55b079e0591372e97e073697c5b | [
"MIT"
]
| permissive | IanEdington/ud405 | https://github.com/IanEdington/ud405 | ac410b3ae257c0b129b93b6ce27e67143b01563a | 709ac782c32d11c7eb3410ea2857b0aa4a124c9e | refs/heads/master | 2021-01-18T17:28:23.606000 | 2017-01-15T02:19:09 | 2017-01-15T02:19:09 | 78,229,071 | 0 | 0 | null | true | 2017-01-06T18:30:42 | 2017-01-06T18:30:42 | 2017-01-06T11:22:54 | 2016-07-29T03:14:02 | 15,558 | 0 | 0 | 0 | null | null | null | package com.udacity.gamedev.icicles;
public class Player {
}
| UTF-8 | Java | 62 | java | Player.java | Java | []
| null | []
| package com.udacity.gamedev.icicles;
public class Player {
}
| 62 | 0.774194 | 0.774194 | 4 | 14.5 | 14.974979 | 36 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 0 |
39d67d020404b4f44774b9b21bf0caa0b644da5e | 38,920,993,657,189 | 67e1e7395153494d69476267b2dfd016b40585a6 | /src/main/java/kitchenpos/menu/dto/menu/MenuProductResponse.java | 3c3dd5128fa664184a1002bce1e5cb1049d9074e | []
| no_license | mingyu-lee/jwp-refactoring | https://github.com/mingyu-lee/jwp-refactoring | bcfd30bfa928ba06f256b91b15d0eb5349195e9d | 33ff664b7231da8bab33daf92ae3738d1703abdb | refs/heads/main | 2023-03-20T10:52:41.409000 | 2021-03-19T10:02:10 | 2021-03-19T10:02:10 | 333,475,065 | 0 | 0 | null | true | 2021-03-19T10:02:11 | 2021-01-27T15:40:22 | 2021-01-27T15:40:24 | 2021-03-19T10:02:10 | 2,402 | 0 | 0 | 0 | null | false | false | package kitchenpos.menu.dto.menu;
import java.util.List;
import java.util.stream.Collectors;
import kitchenpos.menu.domain.menu.MenuProduct;
public class MenuProductResponse {
private Long seq;
private Long menuId;
private Long productId;
private long quantity;
protected MenuProductResponse() {
}
public MenuProductResponse(final Long seq, final Long menuId, final Long productId, long quantity) {
this.seq = seq;
this.menuId = menuId;
this.productId = productId;
this.quantity = quantity;
}
public static List<MenuProductResponse> ofList(final List<MenuProduct> menuProducts) {
return menuProducts.stream()
.map(MenuProductResponse::of)
.collect(Collectors.toList());
}
public Long getSeq() {
return seq;
}
public Long getMenuId() {
return menuId;
}
public Long getProductId() {
return productId;
}
public long getQuantity() {
return quantity;
}
public static MenuProductResponse of(final MenuProduct menuProduct) {
return new MenuProductResponse(menuProduct.getSeq(), menuProduct.getMenuId(), menuProduct.getProductId(),
menuProduct.getQuantity());
}
}
| UTF-8 | Java | 1,118 | java | MenuProductResponse.java | Java | []
| null | []
| package kitchenpos.menu.dto.menu;
import java.util.List;
import java.util.stream.Collectors;
import kitchenpos.menu.domain.menu.MenuProduct;
public class MenuProductResponse {
private Long seq;
private Long menuId;
private Long productId;
private long quantity;
protected MenuProductResponse() {
}
public MenuProductResponse(final Long seq, final Long menuId, final Long productId, long quantity) {
this.seq = seq;
this.menuId = menuId;
this.productId = productId;
this.quantity = quantity;
}
public static List<MenuProductResponse> ofList(final List<MenuProduct> menuProducts) {
return menuProducts.stream()
.map(MenuProductResponse::of)
.collect(Collectors.toList());
}
public Long getSeq() {
return seq;
}
public Long getMenuId() {
return menuId;
}
public Long getProductId() {
return productId;
}
public long getQuantity() {
return quantity;
}
public static MenuProductResponse of(final MenuProduct menuProduct) {
return new MenuProductResponse(menuProduct.getSeq(), menuProduct.getMenuId(), menuProduct.getProductId(),
menuProduct.getQuantity());
}
}
| 1,118 | 0.748658 | 0.748658 | 52 | 20.5 | 24.701681 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.403846 | false | false | 0 |
21d2d94de0a63206bd5a7cad1d0c88901e71a729 | 16,329,465,664,840 | 93635390b645124953d82942249fb2fe02ba39e9 | /PF/SCF-Session8/Square.java | f64366ee1d2011754d5a304237f27c32a0a76cd9 | []
| no_license | meta-shubham-joshi/GET2018 | https://github.com/meta-shubham-joshi/GET2018 | 2e49d5a1aff2e8f733e3800e739c103d8afce027 | 62327ad8aea474fc80af1bfedd908dc9d2e28299 | refs/heads/master | 2020-03-22T23:23:51.622000 | 2019-07-24T09:24:15 | 2019-07-24T09:24:15 | 140,807,787 | 0 | 0 | null | false | 2018-11-13T06:30:43 | 2018-07-13T06:41:15 | 2018-10-16T12:16:54 | 2018-11-13T06:30:27 | 70,722 | 0 | 0 | 33 | Java | false | null | package Com;
import java.util.ArrayList;
public class Square implements Shape{
private String type = "Square";
private int x_Coordinate;
private int y_Coordinate;
private int width;
private int id;
public Square(int x_Coordinate,int y_Coordinate, int width,int id){
this.x_Coordinate = x_Coordinate;
this.y_Coordinate = y_Coordinate;
this.width = width;
this.id = id;
}
public String getType(){
return this.type;
}
public int getId(){
return this.id;
}
public int getWidth(){
return this.width;
}
public double getArea(){
return ((this.width) * (this.width));
}
public double getPerimeter(){
return (4*(this.width));
}
public ArrayList<Integer> getOrigin(){
ArrayList<Integer> originCoordinates = new ArrayList<Integer>();
originCoordinates.add(x_Coordinate);
originCoordinates.add(y_Coordinate);
return originCoordinates;
}
public int isPointEnclosed(){
}
public int getDate(){
}
}
| UTF-8 | Java | 968 | java | Square.java | Java | []
| null | []
| package Com;
import java.util.ArrayList;
public class Square implements Shape{
private String type = "Square";
private int x_Coordinate;
private int y_Coordinate;
private int width;
private int id;
public Square(int x_Coordinate,int y_Coordinate, int width,int id){
this.x_Coordinate = x_Coordinate;
this.y_Coordinate = y_Coordinate;
this.width = width;
this.id = id;
}
public String getType(){
return this.type;
}
public int getId(){
return this.id;
}
public int getWidth(){
return this.width;
}
public double getArea(){
return ((this.width) * (this.width));
}
public double getPerimeter(){
return (4*(this.width));
}
public ArrayList<Integer> getOrigin(){
ArrayList<Integer> originCoordinates = new ArrayList<Integer>();
originCoordinates.add(x_Coordinate);
originCoordinates.add(y_Coordinate);
return originCoordinates;
}
public int isPointEnclosed(){
}
public int getDate(){
}
}
| 968 | 0.688017 | 0.686983 | 57 | 15.982456 | 16.588404 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.596491 | false | false | 0 |
d3bfd1ada84da5b34144b162b862a05fbd5488f8 | 23,940,147,716,557 | ec67dc750e434c8813b0d85d48953374d52cbc4d | /src/main/java/com/school/library/controller/BookController.java | 108ffd7887ac1930a8d2a56fe1b2c91d2acd6d82 | []
| no_license | JithinKM/LibraryApplication | https://github.com/JithinKM/LibraryApplication | f198c70822dabd359153a935ecad48c26bb605e4 | 8d86ec37a3aaa874ab396da1fc55e5fcee9d925f | refs/heads/main | 2023-06-25T18:34:12.523000 | 2021-07-31T10:46:07 | 2021-07-31T10:46:07 | 303,069,805 | 0 | 0 | null | false | 2021-05-02T16:21:40 | 2020-10-11T07:53:14 | 2021-05-02T16:21:19 | 2021-05-02T16:21:14 | 3,561 | 0 | 0 | 0 | JavaScript | false | false | package com.school.library.controller;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.school.library.config.UserPrincipal;
import com.school.library.entity.BookUserEntity;
import com.school.library.exception.Message;
import com.school.library.model.Book;
import com.school.library.service.BookService;
import com.school.library.service.UserService;
@Controller
public class BookController {
public static final Logger logger = LoggerFactory.getLogger(BookController.class);
@Value("${max.allowed.book.count}")
private int maxBooks;
@Value("${admin.book.visible.order}")
private String visibleOrder;
@Autowired
private BookService bookService;
@Autowired
private UserService userService;
@GetMapping("/book")
public String getBooksListPage(@RequestParam(value = "keyword", required = false) String keyword, Model model) {
if (StringUtils.isNotBlank(keyword)) {
model.addAttribute("books", bookService.searchBookDetails(keyword));
model.addAttribute("keyword", keyword);
return "books-list";
}
model.addAttribute("books", bookService.getDefaultBooks(visibleOrder));
return "books-list";
}
@PostMapping("/book")
public String createBooks(Book book) {
bookService.createBooks(book);
return "redirect:/book";
}
@GetMapping("/book/block/{bookDetailsId}")
public String blockBook(@AuthenticationPrincipal UserPrincipal userPrincipal,
@PathVariable("bookDetailsId") Long bookDetailsId, RedirectAttributes redirectAttrs) {
//need to handle same books different copy is getting assigned
String username = userPrincipal.getUsername();
int currentOwnedBooks = userService.getCurrentOwnedBooks(username).size();
if(currentOwnedBooks >= maxBooks) {
System.out.println("Maximum number of books are requested/alloted");
redirectAttrs.addFlashAttribute("message", new Message("danger","Limit Reached", "Maximum number of books are requested/alloted"));
return "redirect:/home";
}
BookUserEntity bookUserEntity = userService.blockBook(bookDetailsId, username);
String details = "Book with id: " + bookUserEntity.getBook().getId() + " Blocked Successfully.";
redirectAttrs.addFlashAttribute("message", new Message("success","Book Blocked", details));
return "redirect:/home";
}
@GetMapping("/book/renew/{bookUserId}")
public String renewBook(@AuthenticationPrincipal UserPrincipal userPrincipal,
@PathVariable("bookUserId") Long bookUserId, RedirectAttributes redirectAttrs) {
String username = userPrincipal.getUsername();
BookUserEntity bookUserEntity = userService.renewBook(bookUserId, username);
String details = "Book with id: " + bookUserEntity.getBook().getId() + " Renew requested by user "
+ bookUserEntity.getUser().getUsername();
System.out.println(details);
redirectAttrs.addFlashAttribute("message", new Message("success","Renew Approved", details));
return "redirect:/user/profile";
}
@GetMapping("/book/cancel/{bookUserId}")
public String cancelBookRequest(@AuthenticationPrincipal UserPrincipal userPrincipal,
@PathVariable("bookUserId") Long bookUserId, RedirectAttributes redirectAttrs) {
String username = userPrincipal.getUsername();
BookUserEntity bookUserEntity = userService.cancelBookRequest(bookUserId, username);
String details = "Book with id: " + bookUserEntity.getBook().getId() + " Cancel requested by user "
+ bookUserEntity.getUser().getUsername();
System.out.println(details);
redirectAttrs.addFlashAttribute("message", new Message("success","Book Cancelled", details));
return "redirect:/user/profile";
}
}
| UTF-8 | Java | 4,247 | java | BookController.java | Java | [
{
"context": "etting assigned\n\t\tString username = userPrincipal.getUsername();\n\t\tint currentOwnedBooks = userService.getCurre",
"end": 2258,
"score": 0.8395565152168274,
"start": 2247,
"tag": "USERNAME",
"value": "getUsername"
},
{
"context": "edirectAttrs) {\n\t\tString username = userPrincipal.getUsername();\n\t\t\n\t\tBookUserEntity bookUserEntity = userServi",
"end": 3175,
"score": 0.8986884951591492,
"start": 3164,
"tag": "USERNAME",
"value": "getUsername"
},
{
"context": "edirectAttrs) {\n\t\tString username = userPrincipal.getUsername();\n\t\t\n\t\tBookUserEntity bookUserEntity = userServi",
"end": 3835,
"score": 0.7581490278244019,
"start": 3824,
"tag": "USERNAME",
"value": "getUsername"
}
]
| null | []
| package com.school.library.controller;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.school.library.config.UserPrincipal;
import com.school.library.entity.BookUserEntity;
import com.school.library.exception.Message;
import com.school.library.model.Book;
import com.school.library.service.BookService;
import com.school.library.service.UserService;
@Controller
public class BookController {
public static final Logger logger = LoggerFactory.getLogger(BookController.class);
@Value("${max.allowed.book.count}")
private int maxBooks;
@Value("${admin.book.visible.order}")
private String visibleOrder;
@Autowired
private BookService bookService;
@Autowired
private UserService userService;
@GetMapping("/book")
public String getBooksListPage(@RequestParam(value = "keyword", required = false) String keyword, Model model) {
if (StringUtils.isNotBlank(keyword)) {
model.addAttribute("books", bookService.searchBookDetails(keyword));
model.addAttribute("keyword", keyword);
return "books-list";
}
model.addAttribute("books", bookService.getDefaultBooks(visibleOrder));
return "books-list";
}
@PostMapping("/book")
public String createBooks(Book book) {
bookService.createBooks(book);
return "redirect:/book";
}
@GetMapping("/book/block/{bookDetailsId}")
public String blockBook(@AuthenticationPrincipal UserPrincipal userPrincipal,
@PathVariable("bookDetailsId") Long bookDetailsId, RedirectAttributes redirectAttrs) {
//need to handle same books different copy is getting assigned
String username = userPrincipal.getUsername();
int currentOwnedBooks = userService.getCurrentOwnedBooks(username).size();
if(currentOwnedBooks >= maxBooks) {
System.out.println("Maximum number of books are requested/alloted");
redirectAttrs.addFlashAttribute("message", new Message("danger","Limit Reached", "Maximum number of books are requested/alloted"));
return "redirect:/home";
}
BookUserEntity bookUserEntity = userService.blockBook(bookDetailsId, username);
String details = "Book with id: " + bookUserEntity.getBook().getId() + " Blocked Successfully.";
redirectAttrs.addFlashAttribute("message", new Message("success","Book Blocked", details));
return "redirect:/home";
}
@GetMapping("/book/renew/{bookUserId}")
public String renewBook(@AuthenticationPrincipal UserPrincipal userPrincipal,
@PathVariable("bookUserId") Long bookUserId, RedirectAttributes redirectAttrs) {
String username = userPrincipal.getUsername();
BookUserEntity bookUserEntity = userService.renewBook(bookUserId, username);
String details = "Book with id: " + bookUserEntity.getBook().getId() + " Renew requested by user "
+ bookUserEntity.getUser().getUsername();
System.out.println(details);
redirectAttrs.addFlashAttribute("message", new Message("success","Renew Approved", details));
return "redirect:/user/profile";
}
@GetMapping("/book/cancel/{bookUserId}")
public String cancelBookRequest(@AuthenticationPrincipal UserPrincipal userPrincipal,
@PathVariable("bookUserId") Long bookUserId, RedirectAttributes redirectAttrs) {
String username = userPrincipal.getUsername();
BookUserEntity bookUserEntity = userService.cancelBookRequest(bookUserId, username);
String details = "Book with id: " + bookUserEntity.getBook().getId() + " Cancel requested by user "
+ bookUserEntity.getUser().getUsername();
System.out.println(details);
redirectAttrs.addFlashAttribute("message", new Message("success","Book Cancelled", details));
return "redirect:/user/profile";
}
}
| 4,247 | 0.778667 | 0.777961 | 106 | 39.066036 | 32.338501 | 134 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.962264 | false | false | 0 |
780dbdc717de9528c9ee8a4ce1dfb63b41462aa0 | 6,871,947,685,239 | 83115106d29a4e4641bfca8e70e89b67dae1619c | /src/main/java/com/moduleforge/libraries/java3dfacade/Polygon.java | 7aefb039df69290e1af4546443fd96df44ec3a00 | []
| no_license | a-star-search/java3dfacade | https://github.com/a-star-search/java3dfacade | b62b2ce4715e030ec704824fa3d749b927a6f423 | 09237e5dbaba3c41b34110f5c35028faa7357e3b | refs/heads/master | 2020-12-23T05:19:43.944000 | 2017-09-07T11:40:49 | 2017-09-07T11:40:49 | 237,048,562 | 0 | 0 | null | false | 2020-10-13T19:09:12 | 2020-01-29T18:01:31 | 2020-01-29T18:02:13 | 2020-10-13T19:09:11 | 7 | 0 | 0 | 1 | Java | false | false | package com.moduleforge.libraries.java3dfacade;
import static com.moduleforge.libraries.java3dfacade.PolygonFactory.makePolygon;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.media.j3d.Appearance;
import javax.media.j3d.GeometryArray;
import javax.media.j3d.Material;
import javax.media.j3d.Node;
import javax.media.j3d.Shape3D;
import javax.media.j3d.Texture;
import javax.media.j3d.Texture2D;
import javax.media.j3d.TextureAttributes;
import javax.vecmath.Color3f;
import javax.vecmath.Color4f;
import javax.vecmath.Point3d;
import org.javatuples.Pair;
import com.google.common.base.Preconditions;
import com.moduleforge.libraries.geometry.GeometryUtil;
import com.sun.j3d.utils.geometry.GeometryInfo;
import com.sun.j3d.utils.geometry.NormalGenerator;
import com.sun.j3d.utils.picking.PickTool;
public abstract class Polygon {
protected Shape3D shape;
/**
* Points do have an order that determines the face direction
*/
protected List<Point3d> _points;
private transient Set<Pair<Point3d, Point3d>> _segments;
protected Polygon(List<Point3d> points) {
_points = points;
_segments = makeSegments(_points);
}
public Shape3D getShape() {
return shape;
}
public List<Point3d> getPoints(){
return Collections.unmodifiableList(_points);
}
public Set<Pair<Point3d, Point3d>> getSegments(){
return Collections.unmodifiableSet(_segments);
}
private static Set<Pair<Point3d, Point3d>> makeSegments(List<Point3d> points) {
Set<Pair<Point3d, Point3d>> segments = new HashSet<>();
Point3d previousPoint = points.get(points.size() - 1);
for(Point3d point : points) {
Pair<Point3d, Point3d> segment = new Pair<>(previousPoint, point);
segments.add(segment);
previousPoint = point;
}
return segments;
}
static Shape3D makeShape(GeometryArray geometryArray, Appearance appearance) {
GeometryInfo geometryInfo = Polygon.generateNormals(geometryArray);
GeometryArray front = geometryInfo.getGeometryArray();
Shape3D shape3d = new Shape3D(front, appearance);
shape3d.setCapability(Node.ENABLE_PICK_REPORTING);
PickTool.setCapabilities(shape3d, PickTool.INTERSECT_FULL);
return shape3d;
}
static GeometryInfo generateNormals(GeometryArray ga) {
GeometryInfo geometryInfo = new GeometryInfo(ga);
NormalGenerator ng = new NormalGenerator();
ng.generateNormals(geometryInfo);
return geometryInfo;
}
static Appearance makeDefaultAppearance() {
return makeAppearance(makeDefaultMaterial());
}
static Appearance makeAppearance(Material material) {
Texture texture = new Texture2D();
TextureAttributes texAttr = new TextureAttributes();
texAttr.setTextureMode(TextureAttributes.MODULATE);
texture.setBoundaryModeS(Texture.WRAP);
texture.setBoundaryModeT(Texture.WRAP);
texture.setBoundaryColor(new Color4f(0.0f, 1.0f, 0.0f, 0.0f));
Appearance appearance = new Appearance();
appearance.setTextureAttributes(texAttr);
appearance.setMaterial(material);
appearance.setTexture(texture);
return appearance;
}
static Material makeDefaultMaterial() {
Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
Material mat = new Material(white, black, white, white, 70f);
return mat;
}
static Material makeMaterial(Color3f color) {
Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
Material mat = new Material(color, black, color, white, 70f);
return mat;
}
/**
* The faces created are all connected to each other.
*
* All the vertices must lay on the same plane. They must also have an ordering,
* so that the direction of the face can be stablished. As you can suppose all
* faces created in this way should face the same direction
*
*/
public static List<Polygon> polygonsFromPointsOnAPlane(List<Point3d> pointsOnPlane) {
Preconditions.checkNotNull(pointsOnPlane);
Preconditions.checkArgument(pointsOnPlane.size() >= 3, "There should be a minimum of three vertices.");
Preconditions.checkArgument(allPointsAreDifferentEnough(pointsOnPlane), "Some of the vertices are equal or almost equal.");
Preconditions.checkArgument(GeometryUtil.inSamePlane(pointsOnPlane), "The vertices do not lay on a plane.");
List<Point3d> pointsCopy = new ArrayList<>();
pointsCopy.addAll(pointsOnPlane);
List<Polygon> polygons = new ArrayList<>();
polygonsFromPointsOnAPlaneRecursive(pointsCopy, polygons);
return polygons;
}
private static boolean allPointsAreDifferentEnough(List<Point3d> points) {
for (int i = 0; i < points.size(); i++) {
for (int j = i + 1; j < points.size(); j++) {
Point3d outerLoopVertex = points.get(i);
Point3d innerLoopVertex = points.get(j);
if (!GeometryUtil.differentEnough(outerLoopVertex, innerLoopVertex)) {
return false;
}
}
}
return true;
}
private static void polygonsFromPointsOnAPlaneRecursive(List<Point3d> points, List<Polygon> polygons) {
List<Point3d> pointsNewPolygon = makePointListNextPolygon(points);
polygons.add(makePolygon(pointsNewPolygon));
boolean morePolygons = points.size() > 4;
if (morePolygons) {
cullPointList(points, pointsNewPolygon.size());
polygonsFromPointsOnAPlaneRecursive(points, polygons);
}
}
private static List<Point3d> makePointListNextPolygon(List<Point3d> points) {
//a polygon is made of either three or four elements
List<Point3d> pointsNewPolygon = (points.size() == 3) ?
Arrays.asList(new Point3d[] { points.get(0), points.get(1), points.get(2) }) :
Arrays.asList(new Point3d[] { points.get(0), points.get(1), points.get(2), points.get(3) });
return pointsNewPolygon;
}
private static void cullPointList(List<Point3d> points, int pointCountOfLastPolygon) {
int fromIndex = 1; //the first element is not removed, as it is part of the next polygon
int elementCountToRemove = (pointCountOfLastPolygon == 3) ? 1 : 2; //remove one if a triangle was made, two if it was a quad
int toIndex = fromIndex + elementCountToRemove;
points.subList(fromIndex, toIndex).clear();
}
}
| UTF-8 | Java | 6,836 | java | Polygon.java | Java | []
| null | []
| package com.moduleforge.libraries.java3dfacade;
import static com.moduleforge.libraries.java3dfacade.PolygonFactory.makePolygon;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.media.j3d.Appearance;
import javax.media.j3d.GeometryArray;
import javax.media.j3d.Material;
import javax.media.j3d.Node;
import javax.media.j3d.Shape3D;
import javax.media.j3d.Texture;
import javax.media.j3d.Texture2D;
import javax.media.j3d.TextureAttributes;
import javax.vecmath.Color3f;
import javax.vecmath.Color4f;
import javax.vecmath.Point3d;
import org.javatuples.Pair;
import com.google.common.base.Preconditions;
import com.moduleforge.libraries.geometry.GeometryUtil;
import com.sun.j3d.utils.geometry.GeometryInfo;
import com.sun.j3d.utils.geometry.NormalGenerator;
import com.sun.j3d.utils.picking.PickTool;
public abstract class Polygon {
protected Shape3D shape;
/**
* Points do have an order that determines the face direction
*/
protected List<Point3d> _points;
private transient Set<Pair<Point3d, Point3d>> _segments;
protected Polygon(List<Point3d> points) {
_points = points;
_segments = makeSegments(_points);
}
public Shape3D getShape() {
return shape;
}
public List<Point3d> getPoints(){
return Collections.unmodifiableList(_points);
}
public Set<Pair<Point3d, Point3d>> getSegments(){
return Collections.unmodifiableSet(_segments);
}
private static Set<Pair<Point3d, Point3d>> makeSegments(List<Point3d> points) {
Set<Pair<Point3d, Point3d>> segments = new HashSet<>();
Point3d previousPoint = points.get(points.size() - 1);
for(Point3d point : points) {
Pair<Point3d, Point3d> segment = new Pair<>(previousPoint, point);
segments.add(segment);
previousPoint = point;
}
return segments;
}
static Shape3D makeShape(GeometryArray geometryArray, Appearance appearance) {
GeometryInfo geometryInfo = Polygon.generateNormals(geometryArray);
GeometryArray front = geometryInfo.getGeometryArray();
Shape3D shape3d = new Shape3D(front, appearance);
shape3d.setCapability(Node.ENABLE_PICK_REPORTING);
PickTool.setCapabilities(shape3d, PickTool.INTERSECT_FULL);
return shape3d;
}
static GeometryInfo generateNormals(GeometryArray ga) {
GeometryInfo geometryInfo = new GeometryInfo(ga);
NormalGenerator ng = new NormalGenerator();
ng.generateNormals(geometryInfo);
return geometryInfo;
}
static Appearance makeDefaultAppearance() {
return makeAppearance(makeDefaultMaterial());
}
static Appearance makeAppearance(Material material) {
Texture texture = new Texture2D();
TextureAttributes texAttr = new TextureAttributes();
texAttr.setTextureMode(TextureAttributes.MODULATE);
texture.setBoundaryModeS(Texture.WRAP);
texture.setBoundaryModeT(Texture.WRAP);
texture.setBoundaryColor(new Color4f(0.0f, 1.0f, 0.0f, 0.0f));
Appearance appearance = new Appearance();
appearance.setTextureAttributes(texAttr);
appearance.setMaterial(material);
appearance.setTexture(texture);
return appearance;
}
static Material makeDefaultMaterial() {
Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
Material mat = new Material(white, black, white, white, 70f);
return mat;
}
static Material makeMaterial(Color3f color) {
Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
Material mat = new Material(color, black, color, white, 70f);
return mat;
}
/**
* The faces created are all connected to each other.
*
* All the vertices must lay on the same plane. They must also have an ordering,
* so that the direction of the face can be stablished. As you can suppose all
* faces created in this way should face the same direction
*
*/
public static List<Polygon> polygonsFromPointsOnAPlane(List<Point3d> pointsOnPlane) {
Preconditions.checkNotNull(pointsOnPlane);
Preconditions.checkArgument(pointsOnPlane.size() >= 3, "There should be a minimum of three vertices.");
Preconditions.checkArgument(allPointsAreDifferentEnough(pointsOnPlane), "Some of the vertices are equal or almost equal.");
Preconditions.checkArgument(GeometryUtil.inSamePlane(pointsOnPlane), "The vertices do not lay on a plane.");
List<Point3d> pointsCopy = new ArrayList<>();
pointsCopy.addAll(pointsOnPlane);
List<Polygon> polygons = new ArrayList<>();
polygonsFromPointsOnAPlaneRecursive(pointsCopy, polygons);
return polygons;
}
private static boolean allPointsAreDifferentEnough(List<Point3d> points) {
for (int i = 0; i < points.size(); i++) {
for (int j = i + 1; j < points.size(); j++) {
Point3d outerLoopVertex = points.get(i);
Point3d innerLoopVertex = points.get(j);
if (!GeometryUtil.differentEnough(outerLoopVertex, innerLoopVertex)) {
return false;
}
}
}
return true;
}
private static void polygonsFromPointsOnAPlaneRecursive(List<Point3d> points, List<Polygon> polygons) {
List<Point3d> pointsNewPolygon = makePointListNextPolygon(points);
polygons.add(makePolygon(pointsNewPolygon));
boolean morePolygons = points.size() > 4;
if (morePolygons) {
cullPointList(points, pointsNewPolygon.size());
polygonsFromPointsOnAPlaneRecursive(points, polygons);
}
}
private static List<Point3d> makePointListNextPolygon(List<Point3d> points) {
//a polygon is made of either three or four elements
List<Point3d> pointsNewPolygon = (points.size() == 3) ?
Arrays.asList(new Point3d[] { points.get(0), points.get(1), points.get(2) }) :
Arrays.asList(new Point3d[] { points.get(0), points.get(1), points.get(2), points.get(3) });
return pointsNewPolygon;
}
private static void cullPointList(List<Point3d> points, int pointCountOfLastPolygon) {
int fromIndex = 1; //the first element is not removed, as it is part of the next polygon
int elementCountToRemove = (pointCountOfLastPolygon == 3) ? 1 : 2; //remove one if a triangle was made, two if it was a quad
int toIndex = fromIndex + elementCountToRemove;
points.subList(fromIndex, toIndex).clear();
}
}
| 6,836 | 0.677297 | 0.659743 | 184 | 35.152172 | 29.656891 | 130 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.777174 | false | false | 0 |
00d1dc0d0c1361b18ce4acee6f198309f0b8e15c | 13,563,506,730,307 | 0fc67dc81f5e467bbc6ccf20a6f4b512e21fc335 | /basic-parent/basic-personInterface/src/main/java/com/basic/person/model/User.java | bd02305096fc75b547c248dbbafd8fece41428af | []
| no_license | wangkeng/WebBasicProject | https://github.com/wangkeng/WebBasicProject | 529b4ad3242b59c6b4a7e46f7ba3c90546229286 | cbb3deae688d99cd9fdcac875cc4dff474e642ae | refs/heads/master | 2020-09-17T08:25:27.513000 | 2017-06-20T06:28:45 | 2017-06-20T06:28:45 | 94,493,523 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.basic.person.model;
import java.io.Serializable;
import java.util.Date;
import com.basic.common.base.model.BaseQueryParam;
public class User extends BaseQueryParam implements Serializable{
private static final long serialVersionUID = 1L;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.id
*
* @mbggenerated
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.name
*
* @mbggenerated
*/
private String name;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.phone
*
* @mbggenerated
*/
private String phone;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.mail
*
* @mbggenerated
*/
private String mail;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.password
*
* @mbggenerated
*/
private String password;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.status
*
* @mbggenerated
*/
private Integer status;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.headImg
*
* @mbggenerated
*/
private String headimg;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.sex
*
* @mbggenerated
*/
private String sex;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.description
*
* @mbggenerated
*/
private String description;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.createTime
*
* @mbggenerated
*/
private Date createtime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.updateTime
*
* @mbggenerated
*/
private Date updatetime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.uploadFlag
*
* @mbggenerated
*/
private Integer uploadflag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.account
*
* @mbggenerated
*/
private String account;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.category
*
* @mbggenerated
*/
private Integer category;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.autoName
*
* @mbggenerated
*/
private String autoname;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.id
*
* @return the value of TOPIC_USER_INFO.id
*
* @mbggenerated
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.id
*
* @param id the value for TOPIC_USER_INFO.id
*
* @mbggenerated
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.name
*
* @return the value of TOPIC_USER_INFO.name
*
* @mbggenerated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.name
*
* @param name the value for TOPIC_USER_INFO.name
*
* @mbggenerated
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.phone
*
* @return the value of TOPIC_USER_INFO.phone
*
* @mbggenerated
*/
public String getPhone() {
return phone;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.phone
*
* @param phone the value for TOPIC_USER_INFO.phone
*
* @mbggenerated
*/
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.mail
*
* @return the value of TOPIC_USER_INFO.mail
*
* @mbggenerated
*/
public String getMail() {
return mail;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.mail
*
* @param mail the value for TOPIC_USER_INFO.mail
*
* @mbggenerated
*/
public void setMail(String mail) {
this.mail = mail == null ? null : mail.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.password
*
* @return the value of TOPIC_USER_INFO.password
*
* @mbggenerated
*/
public String getPassword() {
return password;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.password
*
* @param password the value for TOPIC_USER_INFO.password
*
* @mbggenerated
*/
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.status
*
* @return the value of TOPIC_USER_INFO.status
*
* @mbggenerated
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.status
*
* @param status the value for TOPIC_USER_INFO.status
*
* @mbggenerated
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.headImg
*
* @return the value of TOPIC_USER_INFO.headImg
*
* @mbggenerated
*/
public String getHeadimg() {
return headimg;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.headImg
*
* @param headimg the value for TOPIC_USER_INFO.headImg
*
* @mbggenerated
*/
public void setHeadimg(String headimg) {
this.headimg = headimg == null ? null : headimg.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.sex
*
* @return the value of TOPIC_USER_INFO.sex
*
* @mbggenerated
*/
public String getSex() {
return sex;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.sex
*
* @param sex the value for TOPIC_USER_INFO.sex
*
* @mbggenerated
*/
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.description
*
* @return the value of TOPIC_USER_INFO.description
*
* @mbggenerated
*/
public String getDescription() {
return description;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.description
*
* @param description the value for TOPIC_USER_INFO.description
*
* @mbggenerated
*/
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.createTime
*
* @return the value of TOPIC_USER_INFO.createTime
*
* @mbggenerated
*/
public Date getCreatetime() {
return createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.createTime
*
* @param createtime the value for TOPIC_USER_INFO.createTime
*
* @mbggenerated
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.updateTime
*
* @return the value of TOPIC_USER_INFO.updateTime
*
* @mbggenerated
*/
public Date getUpdatetime() {
return updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.updateTime
*
* @param updatetime the value for TOPIC_USER_INFO.updateTime
*
* @mbggenerated
*/
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.uploadFlag
*
* @return the value of TOPIC_USER_INFO.uploadFlag
*
* @mbggenerated
*/
public Integer getUploadflag() {
return uploadflag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.uploadFlag
*
* @param uploadflag the value for TOPIC_USER_INFO.uploadFlag
*
* @mbggenerated
*/
public void setUploadflag(Integer uploadflag) {
this.uploadflag = uploadflag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.account
*
* @return the value of TOPIC_USER_INFO.account
*
* @mbggenerated
*/
public String getAccount() {
return account;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.account
*
* @param account the value for TOPIC_USER_INFO.account
*
* @mbggenerated
*/
public void setAccount(String account) {
this.account = account == null ? null : account.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.category
*
* @return the value of TOPIC_USER_INFO.category
*
* @mbggenerated
*/
public Integer getCategory() {
return category;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.category
*
* @param category the value for TOPIC_USER_INFO.category
*
* @mbggenerated
*/
public void setCategory(Integer category) {
this.category = category;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.autoName
*
* @return the value of TOPIC_USER_INFO.autoName
*
* @mbggenerated
*/
public String getAutoname() {
return autoname;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.autoName
*
* @param autoname the value for TOPIC_USER_INFO.autoName
*
* @mbggenerated
*/
public void setAutoname(String autoname) {
this.autoname = autoname == null ? null : autoname.trim();
}
} | UTF-8 | Java | 13,614 | java | User.java | Java | []
| null | []
| package com.basic.person.model;
import java.io.Serializable;
import java.util.Date;
import com.basic.common.base.model.BaseQueryParam;
public class User extends BaseQueryParam implements Serializable{
private static final long serialVersionUID = 1L;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.id
*
* @mbggenerated
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.name
*
* @mbggenerated
*/
private String name;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.phone
*
* @mbggenerated
*/
private String phone;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.mail
*
* @mbggenerated
*/
private String mail;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.password
*
* @mbggenerated
*/
private String password;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.status
*
* @mbggenerated
*/
private Integer status;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.headImg
*
* @mbggenerated
*/
private String headimg;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.sex
*
* @mbggenerated
*/
private String sex;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.description
*
* @mbggenerated
*/
private String description;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.createTime
*
* @mbggenerated
*/
private Date createtime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.updateTime
*
* @mbggenerated
*/
private Date updatetime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.uploadFlag
*
* @mbggenerated
*/
private Integer uploadflag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.account
*
* @mbggenerated
*/
private String account;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.category
*
* @mbggenerated
*/
private Integer category;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TOPIC_USER_INFO.autoName
*
* @mbggenerated
*/
private String autoname;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.id
*
* @return the value of TOPIC_USER_INFO.id
*
* @mbggenerated
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.id
*
* @param id the value for TOPIC_USER_INFO.id
*
* @mbggenerated
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.name
*
* @return the value of TOPIC_USER_INFO.name
*
* @mbggenerated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.name
*
* @param name the value for TOPIC_USER_INFO.name
*
* @mbggenerated
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.phone
*
* @return the value of TOPIC_USER_INFO.phone
*
* @mbggenerated
*/
public String getPhone() {
return phone;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.phone
*
* @param phone the value for TOPIC_USER_INFO.phone
*
* @mbggenerated
*/
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.mail
*
* @return the value of TOPIC_USER_INFO.mail
*
* @mbggenerated
*/
public String getMail() {
return mail;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.mail
*
* @param mail the value for TOPIC_USER_INFO.mail
*
* @mbggenerated
*/
public void setMail(String mail) {
this.mail = mail == null ? null : mail.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.password
*
* @return the value of TOPIC_USER_INFO.password
*
* @mbggenerated
*/
public String getPassword() {
return password;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.password
*
* @param password the value for TOPIC_USER_INFO.password
*
* @mbggenerated
*/
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.status
*
* @return the value of TOPIC_USER_INFO.status
*
* @mbggenerated
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.status
*
* @param status the value for TOPIC_USER_INFO.status
*
* @mbggenerated
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.headImg
*
* @return the value of TOPIC_USER_INFO.headImg
*
* @mbggenerated
*/
public String getHeadimg() {
return headimg;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.headImg
*
* @param headimg the value for TOPIC_USER_INFO.headImg
*
* @mbggenerated
*/
public void setHeadimg(String headimg) {
this.headimg = headimg == null ? null : headimg.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.sex
*
* @return the value of TOPIC_USER_INFO.sex
*
* @mbggenerated
*/
public String getSex() {
return sex;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.sex
*
* @param sex the value for TOPIC_USER_INFO.sex
*
* @mbggenerated
*/
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.description
*
* @return the value of TOPIC_USER_INFO.description
*
* @mbggenerated
*/
public String getDescription() {
return description;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.description
*
* @param description the value for TOPIC_USER_INFO.description
*
* @mbggenerated
*/
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.createTime
*
* @return the value of TOPIC_USER_INFO.createTime
*
* @mbggenerated
*/
public Date getCreatetime() {
return createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.createTime
*
* @param createtime the value for TOPIC_USER_INFO.createTime
*
* @mbggenerated
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.updateTime
*
* @return the value of TOPIC_USER_INFO.updateTime
*
* @mbggenerated
*/
public Date getUpdatetime() {
return updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.updateTime
*
* @param updatetime the value for TOPIC_USER_INFO.updateTime
*
* @mbggenerated
*/
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.uploadFlag
*
* @return the value of TOPIC_USER_INFO.uploadFlag
*
* @mbggenerated
*/
public Integer getUploadflag() {
return uploadflag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.uploadFlag
*
* @param uploadflag the value for TOPIC_USER_INFO.uploadFlag
*
* @mbggenerated
*/
public void setUploadflag(Integer uploadflag) {
this.uploadflag = uploadflag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.account
*
* @return the value of TOPIC_USER_INFO.account
*
* @mbggenerated
*/
public String getAccount() {
return account;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.account
*
* @param account the value for TOPIC_USER_INFO.account
*
* @mbggenerated
*/
public void setAccount(String account) {
this.account = account == null ? null : account.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.category
*
* @return the value of TOPIC_USER_INFO.category
*
* @mbggenerated
*/
public Integer getCategory() {
return category;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.category
*
* @param category the value for TOPIC_USER_INFO.category
*
* @mbggenerated
*/
public void setCategory(Integer category) {
this.category = category;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TOPIC_USER_INFO.autoName
*
* @return the value of TOPIC_USER_INFO.autoName
*
* @mbggenerated
*/
public String getAutoname() {
return autoname;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TOPIC_USER_INFO.autoName
*
* @param autoname the value for TOPIC_USER_INFO.autoName
*
* @mbggenerated
*/
public void setAutoname(String autoname) {
this.autoname = autoname == null ? null : autoname.trim();
}
} | 13,614 | 0.602909 | 0.602835 | 491 | 25.731161 | 25.604008 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.105906 | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.