blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
56eb8b0d5d80aca7c05c21865022bca3128041ee | 7a9c57f92114ff25fca74f5b3ee3715cba716d59 | /src/main/java/apirest/DTO/ProdutoDTO.java | b2ecad5f1ae01f8e93a9f5a9fec3c14c0a8d2b4c | [] | no_license | henriquesan14/app-spring-rest-back-end | 34791bc494322547eecd7c463327f493daf1acd6 | 5986c6ff07ee7b399246223b270e6f1d9cca6af0 | refs/heads/master | 2020-04-15T08:43:43.735048 | 2019-01-12T03:05:16 | 2019-01-12T03:05:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 815 | java | package apirest.DTO;
import apirest.domain.Produto;
import java.io.Serializable;
public class ProdutoDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String nome;
private Double preco;
public ProdutoDTO() {
}
public ProdutoDTO(Produto obj){
id = obj.getId();
nome = obj.getNome();
preco = obj.getPreco();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public Double getPreco() {
return preco;
}
public void setPreco(Double preco) {
this.preco = preco;
}
}
| [
"[email protected]"
] | |
b59195e450563c327c726ad7564bcdbb9915207e | 2826abe4ad041498e79ddd3c0a609e9caf7ed1cf | /org.star.uml.designer.application/src/org/star/uml/designer/application/StarUMLApplication.java | f6a71861171b3e03c8f7ef3babefa91a0b062cf2 | [] | no_license | MichalKrasowski/staruml | 07284a0c8c77c03d2c36bc2e2e87e15f2bad839e | 779ef9da8bfe38a95291b9542ad0c7d15e219938 | refs/heads/master | 2020-06-03T23:12:44.948100 | 2010-11-11T01:58:26 | 2010-11-11T01:58:26 | 23,065,870 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,272 | java | package org.star.uml.designer.application;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
/**
* This class controls all aspects of the application's execution
*/
public class StarUMLApplication implements IApplication {
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
*/
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#stop()
*/
public void stop() {
final IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench == null)
return;
final Display display = workbench.getDisplay();
display.syncExec(new Runnable() {
public void run() {
if (!display.isDisposed())
workbench.close();
}
});
}
}
| [
"yongcheon@b9e46a60-ae53-4943-9168-c4293e321482"
] | yongcheon@b9e46a60-ae53-4943-9168-c4293e321482 |
866474cfa63d642e14e84cae580929ee5dc442f0 | 23bac451e30e9823afa66eecc636821a1822560e | /java/AP2DX/lib/jmockit/main/src/mockit/internal/expectations/mocking/MockedType.java | 95c36ea9959e44cf04905761d7287cdf22828d00 | [
"MIT"
] | permissive | JJWTimmer/AP2DX | 39927d3f06e911f7be6ae4b26f40cba07c8636c5 | 1da312eeb96fe8524ce7cea3fd54ce904ac17cb5 | refs/heads/master | 2016-09-05T17:46:42.580677 | 2011-07-10T20:14:14 | 2011-07-10T20:14:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,655 | java | /*
* Copyright (c) 2006-2011 Rogério Liesenfeld
* This file is subject to the terms of the MIT license (see LICENSE.txt).
*/
package mockit.internal.expectations.mocking;
import java.lang.annotation.*;
import java.lang.reflect.*;
import static java.lang.reflect.Modifier.*;
import static mockit.internal.util.Utilities.getAnnotation;
import mockit.*;
import mockit.internal.filtering.*;
import mockit.internal.state.*;
@SuppressWarnings({"ClassWithTooManyFields", "EqualsAndHashcode"})
public final class MockedType
{
@SuppressWarnings({"UnusedDeclaration"})
@Mocked private static final Object DUMMY = null;
private static final int DUMMY_HASHCODE;
static
{
int h = 0;
try {
h = MockedType.class.getDeclaredField("DUMMY").getAnnotation(Mocked.class).hashCode();
}
catch (NoSuchFieldException ignore) {}
DUMMY_HASHCODE = h;
}
public final Field field;
public final boolean fieldFromTestClass;
private final int accessModifiers;
private final Mocked mocked;
public final Capturing capturing;
final Cascading cascading;
public final boolean nonStrict;
public final boolean injectable;
final Type declaredType;
final String mockId;
MockingConfiguration mockingCfg;
MockedType(Field field, boolean fromTestClass)
{
this.field = field;
fieldFromTestClass = fromTestClass;
accessModifiers = field.getModifiers();
mocked = field.getAnnotation(Mocked.class);
capturing = field.getAnnotation(Capturing.class);
cascading = field.getAnnotation(Cascading.class);
nonStrict = field.isAnnotationPresent(NonStrict.class);
injectable = field.isAnnotationPresent(Injectable.class);
declaredType = field.getGenericType();
mockId = field.getName();
registerCascadingIfSpecified();
}
private void registerCascadingIfSpecified()
{
if (cascading != null) {
String mockedTypeDesc = getClassType().getName().replace('.', '/');
TestRun.getExecutingTest().addCascadingType(mockedTypeDesc, fieldFromTestClass);
}
}
MockedType(int paramIndex, Type parameterType, Annotation[] annotationsOnParameter)
{
field = null;
fieldFromTestClass = false;
accessModifiers = 0;
mocked = getAnnotation(annotationsOnParameter, Mocked.class);
capturing = getAnnotation(annotationsOnParameter, Capturing.class);
cascading = getAnnotation(annotationsOnParameter, Cascading.class);
nonStrict = getAnnotation(annotationsOnParameter, NonStrict.class) != null;
injectable = getAnnotation(annotationsOnParameter, Injectable.class) != null;
declaredType = parameterType;
mockId = "param" + paramIndex;
registerCascadingIfSpecified();
}
MockedType(Class<?> cascadedType)
{
field = null;
fieldFromTestClass = false;
accessModifiers = 0;
mocked = null;
capturing = null;
cascading = null;
nonStrict = true;
injectable = true;
declaredType = cascadedType;
mockId = "cascaded_" + cascadedType.getName();
}
public Class<?> getClassType()
{
if (declaredType instanceof Class) {
return (Class<?>) declaredType;
}
if (declaredType instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) declaredType;
return (Class<?>) parameterizedType.getRawType();
}
return null;
}
boolean isMockField()
{
boolean mock = mocked != null || capturing != null || cascading != null || nonStrict || injectable;
return (mock || !fieldFromTestClass && !isPrivate(accessModifiers)) && isMockableType();
}
private boolean isMockableType()
{
if (declaredType instanceof Class) {
Class<?> classType = (Class<?>) declaredType;
return !classType.isPrimitive() && !classType.isArray() && classType != Integer.class;
}
return true;
}
boolean isMockParameter()
{
return isMockableType();
}
boolean isFinalFieldOrParameter()
{
return field == null || isFinal(accessModifiers);
}
void buildMockingConfiguration()
{
if (mocked == null) {
return;
}
String[] filters = getFilters();
if (filters.length > 0) {
mockingCfg = new MockingConfiguration(filters, !mocked.inverse());
}
}
private String[] getFilters()
{
String[] filters = mocked.methods();
if (filters.length == 0) {
filters = mocked.value();
}
return filters;
}
boolean isClassInitializationToBeStubbedOut()
{
return mocked != null && mocked.stubOutClassInitialization();
}
int getMaxInstancesToCapture()
{
if (capturing != null) {
return capturing.maxInstances();
}
else if (mocked != null) {
return mocked.capture();
}
return 0;
}
String getRealClassName()
{
return mocked == null ? "" : mocked.realClassName();
}
@Override
public int hashCode()
{
int result = declaredType.hashCode();
if (isFinal(accessModifiers)) {
result *= 31;
}
if (injectable) {
result *= 37;
}
if (mocked != null) {
int h = mocked.hashCode();
if (h != DUMMY_HASHCODE) {
result = 31 * result + h;
}
}
return result;
}
}
| [
"[email protected]"
] | |
ad0217f2d9ecd053a7bd8552d6dcbe9848a84c17 | de8bf885da696e3c5fa253c6a7ceb2fd659efd3c | /cas/src/main/java/cas/controller/SystemController.java | f17693e882693a7f4dbc2d390a523859a8a5f4a8 | [] | no_license | learningtcc/RedisSSO | d10de54305c0326d6996d6a05ba7147bff88c549 | a321858b742fd88f3c548c83b9515e6edf9b5fed | refs/heads/master | 2021-07-07T06:02:19.555315 | 2017-09-30T02:21:41 | 2017-09-30T02:21:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,105 | java | package cas.controller;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import cas.custom.component.request.CustomHttpServletRequest;
import cas.models.User;
import cas.mq.message.LogoutMessage;
import cas.mq.sender.LogoutMessageSender;
import cas.mq.sender.Sender;
import cas.mq.support.LogoutReceiverDispatcher;
import cas.service.UserService;
import cas.utils.CookieUtil;
import cas.utils.UrlBuilder;
@Controller
public class SystemController {
/** "记住我"过期策略为15天,作用于Cookie的maxAge,Session的MaxInactiveInterval */
private static final int REMEMBER_LOGIN_STATE_TIME = 15 * 24 * 60 * 60;
/** 票据传递参数名 */
private static final String TICKET_KEY = "token";
/** 返回地址参数名 */
private static final String RETURN_URL_KEY = "returnUrl";
/** 注销地址参数名 */
private static final String LOGOUT_URL_KEY = "logoutUrl";
private static final String URL_ENCODING_CHARSET = "UTF-8";
protected final Logger logger = LoggerFactory.getLogger(getClass());
private static Sender logoutMessageSender = new LogoutMessageSender();
static {
LogoutReceiverDispatcher.start();
}
@Autowired
private UserService userService;
@RequestMapping(value = "/login", method = RequestMethod.GET)
public String login(String returnUrl,
String logoutUrl,
HttpSession session,
HttpServletResponse response,
HttpServletRequest request,
Model model) throws IOException {
User user = (User) session.getAttribute("user");
if (user != null) {
if (StringUtils.isNotBlank(returnUrl) && StringUtils.isNotBlank(logoutUrl)) {
logger.debug("user {} login from {} logout url is {}", new Object[]{user.getName(), returnUrl, logoutUrl});
//存储客户端注销地址
storeLogoutUrl(session, logoutUrl);
//直接携带token返回客户端站点
backToClient(returnUrl, session, response);
return null;
}
else {
return "redirect:index";//不允许重复登录
}
}
else {
//返回地址、注销地址存入表单隐藏域
model.addAttribute(RETURN_URL_KEY, returnUrl);
model.addAttribute(LOGOUT_URL_KEY, logoutUrl);
}
return "login";
}
/**
* 处理网页登录
* @param username
* @param passwd
* @param rememberMe
* @param returnUrl
* @param session
* @param response
* @param request
* @param model
* @return
* @throws UnsupportedEncodingException
* @throws IOException
*/
@RequestMapping(value = "/processLogin", method = RequestMethod.POST)
public String processLogin(User inputUser,
Boolean rememberMe,
String returnUrl,
String logoutUrl,
HttpSession session,
HttpServletResponse response,
HttpServletRequest request,
Model model) throws UnsupportedEncodingException, IOException {
User user = userService.verifyUserLogin(inputUser);
if (user == null) {
//回传返回地址、注销地址到隐藏域
model.addAttribute(RETURN_URL_KEY, returnUrl);
model.addAttribute(LOGOUT_URL_KEY, logoutUrl);
model.addAttribute("error", "用户名或密码错误!");
return "login";
}
else {
session.setAttribute("user", user);
if (rememberMe == Boolean.TRUE) {
//"记住我"
session.setMaxInactiveInterval(REMEMBER_LOGIN_STATE_TIME);
Cookie sessionCookie = CookieUtil.getCookie(request, CustomHttpServletRequest.COOKIE_SESSION_KEY);
if (sessionCookie != null) {
sessionCookie.setMaxAge(REMEMBER_LOGIN_STATE_TIME);
response.addCookie(sessionCookie);
}
}
if (StringUtils.isNotBlank(returnUrl) && StringUtils.isNotBlank(logoutUrl)) {
logger.debug("user {} login from {} logout url is {}", new Object[]{user.getName(), returnUrl, logoutUrl});
}
else {
logger.debug("user {} login", user.getName());
}
//存储客户端注销地址
storeLogoutUrl(session, logoutUrl);
//携带token返回客户端站点
if (StringUtils.isNotBlank(returnUrl)) {
backToClient(returnUrl, session, response);
return null;
}
return "redirect:/index";
}
}
/**
* 存储客户端站点登出地址到session
* @param session
* @param logoutUrl 登出地址
* @throws UnsupportedEncodingException
*/
private void storeLogoutUrl(HttpSession session, String logoutUrl) throws UnsupportedEncodingException {
if (StringUtils.isBlank(logoutUrl))
return;
@SuppressWarnings("unchecked")
List<String> logoutUrls = (List<String>) session.getAttribute(LOGOUT_URL_KEY);
if (logoutUrls == null) {
logoutUrls = new ArrayList<>();
}
logoutUrls.add(URLDecoder.decode(logoutUrl, URL_ENCODING_CHARSET));
//即时交互缓存的序列化实现的session,对象实例变化,此处需要重新set
session.setAttribute(LOGOUT_URL_KEY, logoutUrls);
}
/**
* 携带token返回客户端站点
* @param returnUrl
* @param session
* @param response
* @throws IOException
*/
private void backToClient(String returnUrl, HttpSession session, HttpServletResponse response) throws IOException {
UrlBuilder builder = UrlBuilder.parse(URLDecoder.decode(returnUrl, URL_ENCODING_CHARSET));
builder.addParameter(TICKET_KEY, session.getId());
response.sendRedirect(builder.toString());
}
/**
* 注销全局会话,并向客户端站点发送注销消息
*
* @param session
* @return
*/
@RequestMapping(value = "/logout")
public String logout(HttpSession session, HttpServletResponse response) {
@SuppressWarnings("unchecked")
List<String> logoutUrls = (List<String>) session.getAttribute(LOGOUT_URL_KEY);
//send logout message
if (logoutUrls != null) {
logoutMessageSender.sendMessage(new LogoutMessage(session.getId(), logoutUrls));
}
Cookie c = new Cookie(CustomHttpServletRequest.COOKIE_SESSION_KEY, "");
c.setMaxAge(0);
response.addCookie(c);
session.invalidate();
return "redirect:/login";
}
/**
* 为客户端站点验证token
* @param session
* @return JSON格式的用户信息
*/
@RequestMapping(value = "/validatetoken", method = RequestMethod.POST)
@ResponseBody
public Object validatetoken(HttpSession session) {
return session.getAttribute("user");
}
/**
* 网页轮询验证扫码登录
* @param session
* @return 用户是否已登录
*/
@RequestMapping(value = "/verifyQRCodeLogin", method = RequestMethod.POST)
@ResponseBody
public Boolean verifyQRCodeLogin(HttpSession session) {
if (session.getAttribute("user") == null) {
return Boolean.FALSE;
}
else {
return Boolean.TRUE;
}
}
/**
* 处理手机客户端扫码登录
* @param username
* @param passwd
* @param session
* @return 登录结果提示消息
*/
@RequestMapping(value = "/processQRCodeLogin", method = RequestMethod.POST)
@ResponseBody
public String processQRCodeLogin(User inputUser, HttpSession session) {
String msg = "";
User user = userService.verifyUserLogin(inputUser);
if (user == null) {
msg = "用户名或密码错误!";
}
else {
session.setAttribute("user", user);
msg = "登录成功!";
}
return msg;
}
}
| [
"[email protected]"
] | |
e9f4f9788bee695503e6715a421d2779ee4de9cb | 1654233932883d55e0c82c69e8199b5c86f5117a | /app/src/main/java/com/example/the_strox/meroshareremade/LiveActivity.java | c882e0fcda9d19749c0675d827e30507478c0e24 | [] | no_license | thestrox/meroshare | 4e8953df23c34c18e915139fd1ea7ec89616f212 | e75f1b99d8fdaa6986ba4eef0fec466326d9e16e | refs/heads/master | 2021-01-17T09:27:15.515782 | 2017-05-16T15:54:10 | 2017-05-16T15:54:10 | 83,986,268 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,300 | java | package com.example.the_strox.meroshareremade;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.HashMap;
import com.example.the_strox.meroshareremade.Common;
import com.github.rahatarmanahmed.cpv.CircularProgressView;
public class LiveActivity extends BaseActivity {
ListView listview;
LiveListViewAdapter1 adapter;
ProgressDialog mProgressDialog;
ArrayList<HashMap<String, String>> arraylist;
ArrayList<HashMap<String, String>> arraylist1;
static String Company = "company";
static String Lastprice = "lastprice";
static String Open = "open";
static String Difference = "difference";
SearchView searchView;
Common common=new Common(this);
DBHelper myDb;
private CircularProgressView progressView;
private SwipeRefreshLayout mSwipeRefreshLayout;
private LinearLayout linearLayout;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the view from listview_main.xml
FrameLayout contentFrameLayout = (FrameLayout) findViewById(R.id.content_frame); //Remember this is the FrameLayout area within your activity_main.xml
getLayoutInflater().inflate(R.layout.live1, contentFrameLayout);
// get Instance of Database Adapter
getSupportActionBar().setTitle("Live Stock");
navigationView.getMenu().getItem(1).setChecked(true);
myDb=new DBHelper(this);
mSwipeRefreshLayout=(SwipeRefreshLayout) findViewById(R.id.swiperefresh);
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent);
progressView =(CircularProgressView)findViewById(R.id.progress_view);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Intent intent=new Intent(getApplicationContext(),LiveActivity.class).addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
mSwipeRefreshLayout.setRefreshing(false);
}
});
if (common.isOnline()) {
//myDb.deleteData();
progressView.startAnimation();
new LiveListView().execute();
}
if(!common.isOnline()) {
Toast.makeText(getApplicationContext(), "No Internet Connection.", Toast.LENGTH_SHORT).show();
}
String comp, last, openn, diff;
arraylist1 = new ArrayList<HashMap<String, String>>();
Cursor res=myDb.getData();
Cursor res2=myDb.getindexData();
res.moveToFirst();
res2.moveToFirst();
for(int i=0;i<res.getCount();i++){
HashMap<String, String> mapp = new HashMap<String, String>();
comp = res.getString(0);
last = res.getString(3);
openn = res.getString(4);
diff = res.getString(5);
mapp.put("company", comp);
mapp.put("lastprice", last);
mapp.put("open", openn);
mapp.put("difference", diff);
arraylist1.add(mapp);
res.moveToNext();
}
listview = (ListView) findViewById(R.id.LiveListView);
adapter = new LiveListViewAdapter1(LiveActivity.this, arraylist1);
listview.setAdapter(adapter);
TextView txtindex = (TextView) findViewById(R.id.textView_indexlabel);
txtindex.setText(res2.getString(1));
TextView txtchange = (TextView) findViewById(R.id.textView_diff);
txtchange.setText(res2.getString(2));
TextView txtdate = (TextView)appBarLayout. findViewById(R.id.toolbar_date);
txtdate.setVisibility(View.VISIBLE);
txtdate.setText("As of "+res2.getString(3));
TextView txtopen=(TextView) findViewById(R.id.textView_openlabel);
float x= Float.parseFloat(res2.getString(1).replace(",",""))-Float.parseFloat(res2.getString(2).replace(",",""));
txtopen.setText(Float.toString(x));
linearLayout = (LinearLayout) findViewById(R.id.nepse);
if (txtchange.getText().toString().charAt(0) == '-') {
linearLayout.setBackgroundColor(Color.parseColor("#FF0000"));
} else if (txtchange.getText().toString().charAt(0) == '0') {
linearLayout.setBackgroundColor(Color.parseColor("#0000FF"));
} else {
linearLayout.setBackgroundColor(Color.parseColor("#00AF00"));
}
}
public class LiveListView extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Void doInBackground(Void... params) {
common.downloaddata();
return null;
}
@Override
protected void onPostExecute (Void result){
progressView.stopAnimation();
progressView.setVisibility(View.GONE);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_listed, menu);
final MenuItem myActionMenuItem = menu.findItem( R.id.action_search);
searchView = (SearchView) myActionMenuItem.getActionView();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
if( ! searchView.isIconified()) {
searchView.setIconified(true);
}
myActionMenuItem.collapseActionView();
return false;
}
@Override
public boolean onQueryTextChange(String s) {
adapter.getFilter().filter(s);
return false;
}
});
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == android.R.id.home) {
mDrawerLayout.openDrawer(GravityCompat.START);
}
return super.onOptionsItemSelected(item);
}
} | [
"[email protected]"
] | |
f92cc7c04cb11cfe6589ffb837c17a5b3fc818a6 | 3ae665af9e1f888ea90c27d714394d3021f19d31 | /Particule/src/fr/raphael/particule/commands/Commands.java | fde271c4fb15e64b683b32cd2e03067d3cbd8f13 | [] | no_license | raphaaell/minecraft-particle | d8ae90c3c0d076c4a7dec63df56d8d2cba67a1d0 | 17d97bb292cf3fca83a21a46f1b07da85320de1f | refs/heads/master | 2021-04-11T14:51:22.676986 | 2020-03-21T17:52:21 | 2020-03-21T17:52:21 | 249,030,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,198 | java | package fr.raphael.particule.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import fr.raphael.particule.Main;
public class Commands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
Inventory inv1 = Main.getinfo().inv(4);
Inventory inv2 = Main.getinfo().inv(1);
Inventory inv3 = Main.getinfo().inv(2);
if(cmd.getName().equalsIgnoreCase("particle")) {
if(sender instanceof Player) {
Player p = (Player)sender;
if(args.length == 0 || args[0].equalsIgnoreCase("gui")) {
p.openInventory(inv1);
} else if(args[0].equalsIgnoreCase("buy") || args[0].equalsIgnoreCase("marché") || args[0].equalsIgnoreCase("achat")) {
p.openInventory(inv2);
} else if(args[0].equalsIgnoreCase("inventaire")) {
p.openInventory(inv3);
} else {
p.sendMessage("Arguments invalide");
}
}
else {
System.out.println("Cette commande ne peux être éxécuter que par un joueur !");
}
}
return false;
}
} | [
"[email protected]"
] | |
e510f30daf1f83e7402841809c28e3cb868359ca | 003596ddc5641a3a93675e9597a57c118c0bb690 | /src/main/java/com/archos/mediacenter/video/browser/adapters/PresenterAdapterInterface.java | dfdda269f5950f91e1f0c80173c255b9f3d95acf | [
"Apache-2.0"
] | permissive | nova-video-player/aos-Video | b23607dd71932182b48823b2a1272304f939ebf7 | 3a5693454fda2cf7c2d226aea604282f5c4e0977 | refs/heads/v6.1 | 2023-09-01T08:13:46.295840 | 2023-08-31T19:16:28 | 2023-08-31T19:16:28 | 133,509,664 | 59 | 46 | Apache-2.0 | 2023-09-12T16:53:30 | 2018-05-15T11:58:31 | Java | UTF-8 | Java | false | false | 868 | java | // Copyright 2017 Archos SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.archos.mediacenter.video.browser.adapters;
import com.archos.mediacenter.video.browser.presenter.Presenter;
/**
* Created by alexandre on 06/11/15.
*/
public interface PresenterAdapterInterface {
void setPresenter(Class<?> objectClass, Presenter presenter);
}
| [
"[email protected]"
] | |
d4a3342570800a076a43b8b17a0c430bd5765e4d | ac308bfa5880bffe923bb653c4f5b6de96764179 | /ubms-ops/src/main/java/com/github/xhrg/ubms/ops/UbmsOps.java | 2dd324f3ddaf97e9c93294150772a8bec93a6919 | [] | no_license | xhrg-product/ubms | 4a93be7554f04b173d459d0e8192db2affc6a1d5 | fe83f02e5bc22703b24d2c5190bda3461c257899 | refs/heads/main | 2023-04-01T06:25:33.504231 | 2021-04-08T06:50:48 | 2021-04-08T06:50:48 | 355,751,236 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | package com.github.xhrg.ubms.ops;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class UbmsOps {
public static void main(String[] args) {
SpringApplication.run(UbmsOps.class, args);
}
}
| [
"[email protected]"
] | |
7379a653b0b5cdfabc7af022a5671d4a6666a1a6 | b12f89ef54a12ad8cdb37db121f86328aab1eeb1 | /target/generated-sources/annotations/pl/zarzadzanie/hotelem/database/EnityModels/Rabat_.java | 7f805b005882a72f9f263adb0cfee1232e5bbedc | [] | no_license | qopeq/ZarzadzanieHotelem | 6fd157ddd71ce399b0585b36d8a059cf89165bb8 | 21edcfd1c1ce7ad0a141d316292787fbb869a23a | refs/heads/master | 2023-07-03T05:16:52.739461 | 2021-08-03T10:26:25 | 2021-08-03T10:26:25 | 262,158,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package pl.zarzadzanie.hotelem.database.EnityModels;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
@StaticMetamodel(Rabat.class)
public abstract class Rabat_ {
public static volatile SingularAttribute<Rabat, Long> kod;
public static volatile SingularAttribute<Rabat, Double> wielkosc_rabatu;
public static volatile SingularAttribute<Rabat, Long> rabat_id;
public static final String KOD = "kod";
public static final String WIELKOSC_RABATU = "wielkosc_rabatu";
public static final String RABAT_ID = "rabat_id";
}
| [
"[email protected]"
] | |
7400dd28c728fa9c7bd64f007d8b3723973a0a55 | 66c25be41ec19232abad6af85ce44ae3c6b1a338 | /demo-springcloud/dsc-hoxton/dsc-h-java8/src/main/java/com/demo/springcloud/java8/swing/toolBar/ToolBarFrame.java | 65acf1f3f077fa9f16a7d32abd7727da84738f13 | [] | no_license | c0Alan/Repo-IDEA | 524096f142bd065fd9de5ae8b0ad161762ebc6a3 | c41db068773f02b02a5cb300f52e37493562bdd9 | refs/heads/master | 2023-09-01T17:54:41.032633 | 2023-08-26T14:57:08 | 2023-08-26T14:57:08 | 115,800,388 | 4 | 2 | null | 2022-12-06T00:37:13 | 2017-12-30T14:01:43 | Java | UTF-8 | Java | false | false | 2,499 | java | package com.demo.springcloud.java8.swing.toolBar;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
/**
* A frame with a toolbar and menu for color changes.
*/
public class ToolBarFrame extends JFrame {
private static final int DEFAULT_WIDTH = 300;
private static final int DEFAULT_HEIGHT = 200;
private JPanel panel;
public ToolBarFrame() {
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
// add a panel for color change
panel = new JPanel();
add(panel, BorderLayout.CENTER);
// set up actions
String iconPath = Thread.currentThread().getContextClassLoader().getResource("").getPath() + "static" + File.separator;
Action blueAction = new ColorAction("Blue", new ImageIcon(iconPath + "blue-ball.gif"), Color.BLUE);
Action yellowAction = new ColorAction("Yellow", new ImageIcon(iconPath + "yellow-ball.gif"),
Color.YELLOW);
Action redAction = new ColorAction("Red", new ImageIcon(iconPath + "red-ball.gif"), Color.RED);
Action exitAction = new AbstractAction("Exit", new ImageIcon(iconPath + "exit.gif")) {
@Override
public void actionPerformed(ActionEvent event) {
System.exit(0);
}
};
exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit");
// populate toolbar
JToolBar bar = new JToolBar();
bar.add(blueAction);
bar.add(yellowAction);
bar.add(redAction);
bar.addSeparator();
bar.add(exitAction);
add(bar, BorderLayout.NORTH);
// populate menu
JMenu menu = new JMenu("Color");
menu.add(yellowAction);
menu.add(blueAction);
menu.add(redAction);
menu.add(exitAction);
JMenuBar menuBar = new JMenuBar();
menuBar.add(menu);
setJMenuBar(menuBar);
}
/**
* The color action sets the background of the frame to a given color.
*/
class ColorAction extends AbstractAction {
public ColorAction(String name, Icon icon, Color c) {
putValue(Action.NAME, name);
putValue(Action.SMALL_ICON, icon);
putValue(Action.SHORT_DESCRIPTION, name + " background");
putValue("Color", c);
}
@Override
public void actionPerformed(ActionEvent event) {
Color c = (Color) getValue("Color");
panel.setBackground(c);
}
}
}
| [
"[email protected]"
] | |
d12b249ae4950fe4a224d54e649fa6c31dc4fa34 | 72a1639a178f6c8ef36d950e381f9cdb0a348724 | /JAVA_LAB-master 실습자료/Chapter12/src/collection/arraylist/MemberArrayList.java | 8dfe68e143d74d3bb33c5394346c19486dca51bf | [] | no_license | Junaem/doitJavaProgramming | 650145ed6c78f9431e603cc43237ff4a6e63ec14 | ebfd0af545ec9be15c038e445a2bcf32c7faee05 | refs/heads/master | 2023-03-18T19:43:48.542160 | 2021-03-17T19:02:43 | 2021-03-17T19:02:43 | 345,573,166 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 1,602 | java | package collection.arraylist;
import java.util.ArrayList; // 사용할 클래스 import
import java.util.Iterator;
import collection.Member;
public class MemberArrayList {
private ArrayList<Member> arrayList; // ArrayList 선언
public MemberArrayList(){
arrayList = new ArrayList<Member>(); //멤버로 선언한 ArrayList 생성
}
public void addMember(Member member){ //ArrayList 에 멤버 추가
arrayList.add(member);
}
public boolean removeMember(int memberId){ // 멤버 아이디를 매개변수로, 삭제 여부를 반환
for(int i =0; i<arrayList.size(); i++){ // 해당 아이디를 가진 멤버를 ArrayList에서 찾음
Member member = arrayList.get(i);
int tempId = member.getMemberId();
if(tempId == memberId){ // 멤버아이디가 매개변수와 일치하면
arrayList.remove(i); // 해당 멤버를 삭제
return true; // true 반환
}
}
Iterator<Member> ir = arrayList.iterator();
while(ir.hasNext()) {
Member member = ir.next();
int tempId = member.getMemberId();
if(tempId == memberId){ // 멤버아이디가 매개변수와 일치하면
arrayList.remove(member); // 해당 멤버를 삭제
return true; // true 반환
}
}
System.out.println(memberId + "가 존재하지 않습니다"); //for 가 끝날때 까지 return 이 안된경우
return false;
}
public void showAllMember(){
for(Member member : arrayList){
System.out.println(member);
}
System.out.println();
}
}
| [
"[email protected]"
] | |
c0ebb89cff773dd3ad605cef599d75682c32ec54 | 274f8671623737d8248eb395233e9bd0d013e1f8 | /SolicitudOferenteWeb/src/mx/org/infonavit/solicitud/oferente/persistence/CatalogoTipoLineaDao.java | bbf3b6738f319773df3fb8cae7641cbd49bef7f7 | [] | no_license | jesusrosete93/SolicitudOferente | c2d7b50efee3faf89614485a538f3ae10cebe638 | e3fc3557eca26f5b586c71387a647d9293a12b12 | refs/heads/main | 2023-01-01T11:09:12.221650 | 2020-10-21T01:29:13 | 2020-10-21T01:29:13 | 305,867,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,162 | java | /**
*
*/
package mx.org.infonavit.solicitud.oferente.persistence;
import static mx.org.infonavit.solicitud.oferente.utils.Cadenas.validar;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import mx.org.infonavit.solicitud.oferente.persistence.vo.CatalogoVO;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
/**
* @author
*
*/
@Repository("CatalogoTipoLineaDao")
public class CatalogoTipoLineaDao extends AbstractDao<CatalogoVO> {
private static String FIND_ALL = " SELECT * FROM TC_tipo_linea WITH(NOLOCK) ";
private class CatalogoCampoMapper implements RowMapper<CatalogoVO>
{
@Override
public CatalogoVO mapRow(ResultSet resultSet, int fetch) throws SQLException {
// TODO Auto-generated method stub
return new CatalogoVO( validar(resultSet.getString("id_tipo_linea"),""),validar(resultSet.getString("descripcion"),"") );
}
}
/* (non-Javadoc)
* @see mx.org.infonavit.reporteuvs.persistence.AbstractDao#buscar(java.lang.Object)
*/
@Override
public CatalogoVO buscar(CatalogoVO registro) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see mx.org.infonavit.reporteuvs.persistence.AbstractDao#buscarLista(java.lang.Object)
*/
@Override
public List<CatalogoVO> buscarLista(CatalogoVO registro) {
try
{
return this.jdbcAvaluos.query(FIND_ALL,new CatalogoCampoMapper());
}catch (EmptyResultDataAccessException empty) {
return new ArrayList<CatalogoVO>();
}
}
@Override
public String generarCriterios(CatalogoVO registro, List<Object> args) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean guardar(CatalogoVO registro) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean guardar(List<CatalogoVO> registros) {
// TODO Auto-generated method stub
return false;
}
@Override
public Set<CatalogoVO> buscarUnicos(CatalogoVO registro) {
// TODO Auto-generated method stub
return null;
}
}
| [
"[email protected]"
] | |
b95b9ec727a43e891fe017c50041ade1bb966ecd | cf9b17b0eeca4788b409c6470b8189cf9476ad29 | /src/main/java/cn/et/lesson02/controller/SbController.java | bfd9c26ce23cd64481415d374e8dbab070c69916 | [] | no_license | aikehao148184/Spring-Boot | 23b5bfe8bea1cabbff94b5f608552110ef8fbfd3 | cadaa8eb3990e7fdf161c0dc5f33a45adf5fbe93 | refs/heads/master | 2021-09-01T22:46:38.860973 | 2017-12-29T01:25:48 | 2017-12-29T01:26:59 | 115,673,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 659 | java | package cn.et.lesson02.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.et.lesson02.EmpMapper;
import cn.et.lesson02.entity.Emp;
/**
* helloworld例子
* @author Administrator
*
*/
@RestController
public class SbController {
@Autowired
EmpMapper emp;
@RequestMapping("/queryall")
public List<Emp> queryall(){
List<Emp> queryAll = emp.queryAll();
return queryAll;
}
}
| [
"[email protected]"
] | |
eb1a1589c4e302ae9f765c4049e96b42bc879446 | 1949890d1d0857c4c9b81b67a6f5774859258ba3 | /src/harshendra/assignment/main/Main.java | 58c7dc5b44957c8a11584f940c24ad6c8f83da7a | [] | no_license | harshendravarma/javaassignment5 | 6194ec93d003b42eec05c449af6e422637ef1c54 | 61a958ef189ba2711f805dc00bc02be3ffb96fc4 | refs/heads/master | 2020-06-30T12:36:22.645660 | 2019-09-18T07:33:08 | 2019-09-18T07:33:08 | 200,827,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 483 | java | package harshendra.assignment.main;
import harshendra.assignment.data.Data;
import harshendra.assignment.singleton.Singleton;
public class Main {
public static void main(String[] args) {
Data d = new Data();
d.printClassMembers();// for class members java provides default values
d.printLocalVaribles();// for local variables java does not provide default value
Singleton.getInstance("hihi").printS();// static method cannot initialize object level members
}
}
| [
"[email protected]"
] | |
bbffa16d174646a5097e937249d287a4ea580cc7 | 19bc4cdc322f30dc8f777da01f0409ed47fb9585 | /Twitter/src/com/twitter/poruke/TwitterPoruka.java | b12085cc9fe61fbe6018d4e68097fc5c7f7ced38 | [] | no_license | cubi96/Twitter | c08cc486d77b2300a2866e380a7be8435ce14e6d | f799771b487b465a35d7048b4c6c1d54f6582de6 | refs/heads/master | 2020-04-30T10:17:01.478785 | 2017-04-03T10:37:36 | 2017-04-03T10:37:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,070 | java | package com.twitter.poruke;
/**
* Klasa koja definise korisnika i poruke
* @author Ivan Stanimirovic
* @version 1.0
*/
public class TwitterPoruka {
/**
* atribut korisnik koji sadzrzi String vrednost, i oznacava korisnika
*/
private String korisnik;
/**
* atribut poruka koja sadrzi String vrednost, i oznacava poruku koju korisnik unosi
*/
private String poruka;
/**
* metoda vraca korisnika
* @return vraca String vrednost koja oznacava ime korisnika
*/
public String getKorisnik() {
return korisnik;
}
/**
* metoda postavlja vrednost korisnika na unetu vrednost
* @param korisnik oznacava String koji se postavlja kao vrednost privatnog atributa korisnik, koji ne sme da bude:
* <ul>
* <li>null</li>
* <li>prazan String</li>
* </ul>
* @throws java.lang.RuntimeException ako parametar korisnik ne odgovara uslovima
*/
public void setKorisnik(String korisnik) {
if (korisnik == null || korisnik.isEmpty())
throw new RuntimeException("Ime korisnika mora biti uneto");
this.korisnik = korisnik;
}
/**
* Metoda koja vraca poruku
* @return String, sadrzaj privatnog atributa poruka
*/
public String getPoruka() {
return poruka;
}
/**
* metoda postavlja vrednost privatnog atrbuta poruka na unetu vrednost
* @param poruka oznacava String koji se postavlja kao vrednost privatnog atributa poruka, koji ne sme da bude:
* <ul>
* <li>null</li>
* <li>prazan String</li>
* <li>String veci od 140 znakova</li>
* </ul>
* @throws java.lang.RuntimeException ako parametar poruka ne odgovara uslovima
*/
public void setPoruka(String poruka) {
if (poruka == null || poruka.equals("") || poruka.length() > 140)
throw new RuntimeException("Poruka mora biti uneta i mora imati najvise 140 znakova");
this.poruka = poruka;
}
/**
* Metoda vraca String sa sadrzajem atributa Korisnik i Poruka
* @return String vrednost
*/
public String toString() {
return "KORISNIK:" + korisnik + " PORUKA:" + poruka;
}
}
| [
"[email protected]"
] | |
de889df6d8ac3b24484b17ed3dd3d7802786bb37 | 3dadd99f332ab7981d3802aea37e3c701cfa0452 | /软件学院——课件和笔记/软件体系结构与设计模式/03-SA-Homework-Projects-完美更新-20201005/HW4-Bridge-AgentInfo-更新-20190914/EncryptedInfo2.java | 710888a791b7175870b3ac11bcb264da4fe822a8 | [
"MIT"
] | permissive | drsf864/Awesome-HITWH-Resources-Sharing | d974b41ee5a3f212d9eea2b18369474c441ae51d | 0b7c065a2aae2cdc646460b146d73e5ab808f363 | refs/heads/master | 2023-07-08T10:31:02.168871 | 2021-08-20T14:18:39 | 2021-08-20T14:18:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,576 | java | /*---------------------------------------------------------------------------------------------------------------*/
/* This is a subclass to implement interface Encryption.
/* a) This class keeps a reference logger of MessageWriter.
/* b) This logger is used to call logMsg in class MessageLogger
/* c) The object is created from the ClientGUI file, like, logger = new FileLogger();
/* Then logger is passed into THIS class TextMessage by Message
/* msg = new EncryptedMessage(logger);
/* d) Agent names must be formed by English characters, and no other forms are allowed;
/* Agent Code can be formed by English characters mixed with digital numbers. THe length
/* of Agent code must be exactly 12
/* Encryption Algorithm:
/* a-->b, b-->a; c-->d, d-->c; e-->f, f-->e;, ..., y-->z, z-->y
/* 0-->1, 1-->0; 2-->3, 3-->2; ...8-->9, 9-->8
/*----------------------------------------------------------------------------------------------------------------*/
import java.util.*;
public class EncryptedInfo2 extends AgentInfo {
private MessageWriter writer;
private char[] chars;
private char[][] coupledLowerCaseChar = new char[13][2];
private char[][] coupledUpperCaseChar = new char[13][2];
public EncryptedInfo2(MessageWriter w) {
writer = w;
coupledLowerCaseChar = createCoupledCharArr("lowerCase");
coupledUpperCaseChar = createCoupledCharArr("upperCase");
}
public void log(String lastNm, String firstNm, String code){
if( isValidAgentName(lastNm) == false || isValidAgentName(firstNm) == false ){
System.out.println("Invalid agent name. Only English characters are allowed.");
System.exit(1);
}
if( isValidCode(code) == false){
System.out.println("Invalid agent code. Only English characters and numbers are allowed.");
System.exit(1);
}
String fName = encryptName(firstNm);
ClientGUI.resultTxt.append("Encrypted agent first name: "+ fName +"\n");
String lName = encryptName(lastNm);
ClientGUI.resultTxt.append("Encrypted agent last name: "+ lName +"\n");
String codeStr = encryptCode(code);
ClientGUI.resultTxt.append("Encrypted agent code: "+ codeStr +"\n\n");
try{
writer.logMsg(lName, fName, codeStr);
}
catch (Exception e) {
e.printStackTrace();
}
}
//This method can be used to encrypt the first name or the last name
private String encryptName(String inputStr){
chars = inputStr.toCharArray();
int length = chars.length;
for (int i = 0; i < length; i++) {
char c = shiftChar(chars[i]);
chars[i] = c;
}
return new String(chars);
}
//This method can be used to encrypt the agent code
private String encryptCode (String code) {
char[ ] codeChars = code.toCharArray();
if(codeChars.length != 12){
System.out.println("Incorrect code length.");
}
else{
for (int m = 0; m < codeChars.length; m++){
if(Character.isLetter(codeChars[m]) == true){
char c = shiftChar(codeChars[m]);
codeChars[m] = c;
}
else if (Character.isDigit(codeChars[m]) == true){
char c = shiftNum(codeChars[m]);
codeChars[m] = c;
}
}
}
return new String(codeChars);
}
//create a special char array to encapsulate all the lower case english alphabets
//or the upper case english alphabets
private char[][] createCoupledCharArr(String style){
String lowerStr = "abcdefghijklmnopqrstuvwxyz";
String upperStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char[] lowerCharArr = lowerStr.toCharArray();
char[] upperCharArr = upperStr.toCharArray();
char[][] coupledCharArr = new char[13][2];
if(style.equals("lowerCase") ) {
for(int m=0; m<13; m++){
coupledCharArr[m][0] = lowerCharArr[2*m];
coupledCharArr[m][1] = lowerCharArr[2*m+1];
}
}
if(style.equals("upperCase") ) {
for(int m=0; m<13; m++){
coupledCharArr[m][0] = upperCharArr[2*m];
coupledCharArr[m][1] = upperCharArr[2*m+1];
}
}
return coupledCharArr;
}
//Shift a character according to rule a<-->b, b-->a; c-->d, d-->c;...y-->z, z-->y
private char shiftChar(char aChar){
char inChar = aChar;
char outChar = 'a';
if(Character.isLowerCase(inChar)==true){
for(int m=0; m<13; m++){
if( coupledLowerCaseChar[m][0] == inChar)
outChar = coupledLowerCaseChar[m][1];
else if(coupledLowerCaseChar[m][1] == inChar )
outChar = coupledLowerCaseChar[m][0];
}
}
if(Character.isUpperCase(inChar)==true){
for(int m=0; m<13; m++){
if( coupledUpperCaseChar[m][0] == inChar)
outChar = coupledUpperCaseChar[m][1];
else if(coupledUpperCaseChar[m][1] == inChar )
outChar = coupledUpperCaseChar[m][0];
}
}
return outChar;
}
//shif a char type number based on the rule 0-->1, 1-->0; 2-->3, 3-->2; ...8-->9, 9-->8
private char shiftNum(char intputNum){
char[][] num = new char[5][2];
num[0] [0]= '0';
num[0] [1]= '1';
num[1] [0]= '2';
num[1] [1]= '3';
num[2] [0]= '4';
num[2] [1]= '5';
num[3] [0]= '6';
num[3] [1]= '7';
num[4] [0]= '8';
num[4] [1]= '9';
char shiftedNum = '1';
for(int m=0; m<5; m++){
if( intputNum == num[m][0] )
shiftedNum = num[m][1];
else if( intputNum == num[m][1] )
shiftedNum = num[m][0];
}
return shiftedNum;
}
}
| [
"[email protected]"
] | |
ca0aaa1a9035bcb7e79f738204e8288eb5648e76 | 42fe03fc85e447c7e0dd117706cf92fcd9a6b847 | /src/main/java/actionmodel/mediator/common/ConcreteColleagueA.java | f7d2d3265b1fe659c377ed351cd53a3bd6fd089a | [] | no_license | yuerugou54/designmodel | 2378b4fc26fc21265beb464db49051fef53a7fcd | 5e9639ea9c76eb6f28adf9d530f193b51dddaf99 | refs/heads/master | 2020-04-23T06:18:43.633951 | 2019-02-19T12:15:34 | 2019-02-19T12:15:34 | 170,969,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | package actionmodel.mediator.common;
public class ConcreteColleagueA extends Colleague {
public ConcreteColleagueA(Mediator mediator) {
super (mediator);
}
//转发消息给同事A
public void send(String message) {
mediator.send (message, this);
}
//收消息
public void getMessage(String message) {
System.out.println ("colleague A got a message:" + message);
}
}
| [
"[email protected]"
] | |
8349fdde9a1b5a2f1c03ae68f3e4c1e5fbf3d315 | 885007ac33e43b4de2768ea6bdf955433b45ab53 | /src/service/UserManager.java | 1a2d0ff9f9fc0850e32737ea17add1664b36baa1 | [] | no_license | JisuKong/wobby | c21defb248f9a972dcdcfb72b4b0ce6e47a9dbf0 | 12b07de8e2067a91f21b07b8e59ae244d649c235 | refs/heads/develop | 2023-01-21T18:10:24.132731 | 2020-11-28T15:32:05 | 2020-11-28T15:32:05 | 310,673,379 | 0 | 1 | null | 2020-11-28T20:38:53 | 2020-11-06T18:16:39 | Java | UTF-8 | Java | false | false | 7,109 | java | package service;
/**
* Ŀ�´�Ƽ ���� API�� ����ϴ� �����ڵ��� ���� �����ϰ� �Ǵ� Ŭ����.
* UserDAO/CommunityDAO�� �̿��Ͽ� �����ͺ��̽��� ������ ���� �۾��� �����ϵ��� �ϸ�,
* �����ͺ��̽��� �����͵��� �̿��Ͽ� �����Ͻ� ������ �����ϴ� ������ �Ѵ�.
* �����Ͻ� ������ ������ ��쿡�� �����Ͻ� �������� �����ϴ� Ŭ������
* ������ �� �� �ִ�.
*/
import java.sql.SQLException;
import java.util.List;
import service.UserManager;
import persistence.dao.UserDAO;
import persistence.dao.impl.UserDAOImpl;
import persistence.dao.MsgDAO;
import persistence.dao.ScrapBoxDAO;
import persistence.dao.ClubDAO; //regionmathcing
import service.dto.UserDTO;
import service.dto.MsgDTO;
import service.dto.PostDTO;
import service.dto.ScrapBoxDTO;
import service.dto.ClubDTO;
import service.dto.CommunityDTO;
public class UserManager {
private static UserManager userMan = new UserManager();
private UserDAOImpl userDAOImpl = new UserDAOImpl();
private MsgDAO msgDAO;
private ScrapBoxDAO scrapBoxDAO;
private ClubDAO clubDAO;
// private UserManager() {
// try {
// userDAO = new UserDAO();
// commDAO = new CommunityDAO();
// userAanlysis = new UserAnalysis(userDAO);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
public UserManager() {
super();
}
public static UserManager getInstance() {
return userMan;
}
//UserDTO�� matchPassword �߰��ؾ�
public boolean login(String userId, String password)
throws SQLException, UserNotFoundException, PasswordMismatchException {
System.out.println("UserManager login call success");
UserDTO user = findUser(userId);
if (!user.matchPassword(password)) {
System.out.println("matchPassword success");
throw new PasswordMismatchException("��й�ȣ�� ��ġ���� �ʽ��ϴ�.");
}
return true;
}
public int create(UserDTO user) throws SQLException, ExistingUserException {
if (userDAOImpl.existingUser(user.getUserId()) == true) {
throw new ExistingUserException(user.getUserId() + "�� �����ϴ� ���̵��Դϴ�.");
}
return userDAOImpl.create(user);
}
/*
//UserDTO�� clubId�ֱ�
public int update(UserDTO user) throws SQLException, UserNotFoundException {
String oldClubId = findUser(user.getUserId()).getClubId();
if (user.getClubId() != oldClubId) { // �Ҽ� Ŀ��Ƽ�ϰ� �����
ClubDTO club = clubDAO.findClub(oldClubId); // ���� �Ҽ� Ŀ�´�Ƽ
if (club != null && user.getUserId().equals(club.getChairId())) {
// ����ڰ� ���� �Ҽ� Ŀ�´�Ƽ�� ȸ���� ��� -> �� Ŀ�´�Ƽ�� ȸ���� null�� ���� �� ����
club.setChairId(null);
clubDAO.updateChair(club);
}
}
return userDAO.update(user);
}
public int remove(String userId) throws SQLException, UserNotFoundException {
String clubId = findUser(userId).getClubId();
ClubDTO club = clubDAO.findClub(clubId); // �Ҽ� Ŀ�´�Ƽ
if (club != null && userId.equals(club.getChairId())) {
// ����ڰ� �Ҽ� Ŀ�´�Ƽ�� ȸ���� ��� -> �� Ŀ�´�Ƽ�� ȸ���� null�� ���� �� ����
club.setChairId(null);
clubDAO.updateChair(club);
}
return userDAO.remove(userId);
}
*/
public UserDTO findUser(String userId)
throws SQLException, UserNotFoundException {
System.out.println("usermanager finduser");
UserDTO user = userDAOImpl.findUser(userId);
if (user == null) {
throw new UserNotFoundException(userId + "�� �������� �ʴ� ���̵��Դϴ�.");
}
return user;
}
/*
public List<UserDTO> findUserList() throws SQLException {
return userDAO.findUserList();
}
public String findId(String name, String email)
throws SQLException, UserNotFoundException {
UserDTO user = userDAO.findUser(email);
if (user == null) {
throw new UserNotFoundException(email + "�� �������� �ʴ� �̸����Դϴ�.");
}
return user.getUserId();
}
//findPw �����ؾ�
public String findPw(String userId, String name, String email)
throws SQLException, UserNotFoundException {
UserDTO user = userDAO.findUser(userId);
if (user == null) {
throw new UserNotFoundException(userId + "�� �������� �ʴ� ���̵��Դϴ�.");
}
return user.getUserId();
}
public List<ScrapBoxDTO> findScrapList(String userId) throws SQLException {
return ScrapBoxDAO.getScrapList(userId);
}
public List<MsgDTO> findMessageList(String userId) throws SQLException {
return MsgDAO.ReceiveMsgList(userId); //ReceiveMsgList static���� �ٲ�
}
public ClubDTO findMyClub(int clubId) throws SQLException {
ClubDTO club = clubDAO.findCommunity(clubId);
List<UserDTO> memberList = userDAO.findUsersInCommunity(clubId); //UserDAO�� �߰�
club.setMemberList(memberList);
int numOfMembers = userDAO.getNumberOfUsersInCommunity(clubId); //UserDAO�� �߰�
club.setNumOfMembers(numOfMembers);
return club;
}
public List<ClubDTO> findClubList() throws SQLException {
return clubDAO.findClubList();
}
/*
* public int removePost(int postId) throws SQLException, PostNotFoundException{
if (findPost(postId) == null) {
throw new PostNotFoundException(postId + "�� �������� �ʴ� �Խñ��Դϴ�.");
}
return postDAO.delete(postId);
}
public int deleteScrapList(String scrapId) throws SQLException, PostNotFoundException{
if (findScrap(scrapId) == null) {
throw new PostNotFoundException(scrapId + "�� �������� �ʴ� ��ũ���Դϴ�.");
}
return scrapBoxDAO.deleteScrap(scrapId);
}
public int deleteMessageList(String msgNo) throws SQLException, PostNotFoundException{
if (findMsg(msgNo) == null) {
throw new PostNotFoundException(msgNo + "�� �������� �ʴ� �����Դϴ�.");
}
return msgDAO.deleteMsg(msgNo);
}
*/
//sendMessage(), insertMessage(), receivedMessage() ?
//
public int outClub(String userId, int clubId) {
UserDTO user = userDAOImpl.findUser(userId);
return 0;
}
public int registerClub(String userId, int clubId) {
UserDTO user = userDAOImpl.findUser(userId);
return 0;
}
public UserDAO getUserDAO() {
return this.userDAOImpl;
}
} | [
"[email protected]"
] | |
7f14a1b2154ff6fa6586f69bc137d4db1e2d7947 | 947a387f53e3e900ac72ce33dc178f621b47296e | /43 Multiplying Strings/Solution.java | ed240eaa484ad1e3cd0b5ff7d18ddc4019e2ffd7 | [] | no_license | weitianyi321/LeetCode | 084b1a1ffac296553a12154987a6a0a08c0c45f0 | 7800d3ffa6b76d85d0d5b93b9138dcfdf98433a1 | refs/heads/master | 2020-04-02T04:24:36.892155 | 2016-09-19T04:30:14 | 2016-09-19T04:30:14 | 63,698,182 | 0 | 0 | null | 2016-07-19T14:06:21 | 2016-07-19T13:54:51 | null | UTF-8 | Java | false | false | 934 | java | public class Solution {
public String multiply(String num1, String num2) {
int[] res = new int[num1.length() + num2.length()];
for (int i = num1.length() - 1; i >= 0; i--) {
for (int j = num2.length() - 1; j >= 0 ; j--) {
int d1 = num1.charAt(i) - '0';
int d2 = num2.charAt(j) - '0';
res[i + j + 1] += d1 * d2;
}
}
/* proceed calculation to the array that has just been created */
int carry = 0;
for (int i = res.length - 1; i >= 0; i--) {
int tmp = (res[i] + carry) % 10;
carry = (res[i] + carry) / 10;
res[i] = tmp;
}
StringBuilder sb = new StringBuilder();
for (int num : res) sb.append(num);
while (sb.length() != 0 && sb.charAt(0) == '0') sb.deleteCharAt(0);
return sb.length() == 0 ? "0" : sb.toString();
}
public static void main(String[] args) {
Solution s1 = new Solution();
String a = s1.multiply("123", "123");
System.out.println(a);
}
} | [
"[email protected]"
] | |
426982e0cf530b5f1215e54202a0fb74604214c4 | 9d32980f5989cd4c55cea498af5d6a413e08b7a2 | /A72n_10_0_0/src/main/java/com/android/internal/telephony/cat/SetEventListParams.java | 6416ca997327896ea80c670b4e5e57faeaacd257 | [] | no_license | liuhaosource/OppoFramework | e7cc3bcd16958f809eec624b9921043cde30c831 | ebe39acabf5eae49f5f991c5ce677d62b683f1b6 | refs/heads/master | 2023-06-03T23:06:17.572407 | 2020-11-30T08:40:07 | 2020-11-30T08:40:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 271 | java | package com.android.internal.telephony.cat;
public class SetEventListParams extends CommandParams {
public int[] mEventInfo;
public SetEventListParams(CommandDetails cmdDet, int[] eventInfo) {
super(cmdDet);
this.mEventInfo = eventInfo;
}
}
| [
"[email protected]"
] | |
b73e1a9789fd37425592201ef1742432387c0418 | 008a439c73abcea36c26ec9d1d45762b5ec903f4 | /lib/src/main/java/com/arun/practise/Trees/UniqueBstGeneration.java | 5ea3bf93b1fec7a43cc22130bb4ec2357419cb46 | [] | no_license | arunzingh/MySolutions | a1b09c6cbcf77336fb54c67d02e45b114c444673 | f1c64c7c6851970ac88bb6a88734dc9c2beb3872 | refs/heads/master | 2020-04-09T02:47:00.825440 | 2019-06-23T09:45:14 | 2019-06-23T09:45:14 | 159,953,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,316 | java | package com.arun.practise.trees;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
public class UniqueBstGeneration {
public List<TreeNode> generateTrees(int n) {
if (n < 1) {
return new ArrayList<>();
}
return generateTreeUtil(1, n);
}
private List<TreeNode> generateTreeUtil(int start, int end) {
List<TreeNode> result = new ArrayList<>();
if (start > end) {
result.add(null);
return result;
}
for (int i = start; i <= end; i++) {
List<TreeNode> leftTrees = generateTreeUtil(start, i - 1);
List<TreeNode> rightTrees = generateTreeUtil(i + 1, end);
for (TreeNode left : leftTrees) {
for (TreeNode right : rightTrees) {
TreeNode node = new TreeNode(i);
node.left = left;
node.right = right;
result.add(node);
}
}
}
return result;
}
@Test
public void test_generateTrees() {
UniqueBstGeneration solution = new UniqueBstGeneration();
List<TreeNode> result = solution.generateTrees(3);
for (TreeNode n : result) {
BTreePrinter.printNode(n);
}
}
}
| [
"[email protected]"
] | |
e42448229ea0f2aa19eb9c81231ac223d32bc082 | e27942cce249f7d62b7dc8c9b86cd40391c1ddd4 | /modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201708/cm/SharedSetPage.java | 806caffa66984d28be9e83f0b72524c4ecc7453f | [
"Apache-2.0"
] | permissive | mo4ss/googleads-java-lib | b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a | efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641 | refs/heads/master | 2022-12-05T00:30:56.740813 | 2022-11-16T10:47:15 | 2022-11-16T10:47:15 | 108,132,394 | 0 | 0 | Apache-2.0 | 2022-11-16T10:47:16 | 2017-10-24T13:41:43 | Java | UTF-8 | Java | false | false | 2,626 | java | // Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.adwords.jaxws.v201708.cm;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
*
* Contains a list of criterion lists resulting from the filtering and paging of
* {@link SharedSetService#get} call.
*
*
* <p>Java class for SharedSetPage complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="SharedSetPage">
* <complexContent>
* <extension base="{https://adwords.google.com/api/adwords/cm/v201708}NullStatsPage">
* <sequence>
* <element name="entries" type="{https://adwords.google.com/api/adwords/cm/v201708}SharedSet" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SharedSetPage", propOrder = {
"entries"
})
public class SharedSetPage
extends NullStatsPage
{
protected List<SharedSet> entries;
/**
* Gets the value of the entries property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the entries property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getEntries().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SharedSet }
*
*
*/
public List<SharedSet> getEntries() {
if (entries == null) {
entries = new ArrayList<SharedSet>();
}
return this.entries;
}
}
| [
"[email protected]"
] | |
2db43c8659b51da80b39ba2e8cb0e02e9fe31f56 | 8a16e89076555639e857cf98331be6fad7464d66 | /app/src/main/java/com/kbqnzc/news/entity/NewsofJuhe.java | 2b3a2f706e4757da7f52731e62244acc61fa1ac9 | [] | no_license | kbqnzc/News | e7457fd7c2cc6ff6e869e8be25669835ffd3b5b2 | 14addd8af2817704d189d7d0f2a7b416dfd12531 | refs/heads/master | 2020-05-22T19:01:20.543435 | 2017-03-12T12:43:21 | 2017-03-12T12:43:21 | 84,716,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,326 | java | package com.kbqnzc.news.entity;
import java.util.List;
/**
* Created by Administrator on 2017/3/12.
*/
public class NewsofJuhe {
String reason;
Result result;
public Result getResult() {
return result;
}
public String getReason() {
return reason;
}
public class Result {
int stat;
List<Data> data;
public int getStat() {
return stat;
}
public List<Data> getData() {
return data;
}
}
public class Data {
/**
* "uniquekey": "aed11809b7efddd34165a2255512cc44",
* "title": "燃!这群平凡的中国男人,征服了最挑剔的日本人",
* "date": "2017-03-12 19:54",
* "category": "头条",
* "author_name": "环球网",
* "url": "http://mini.eastday.com/mobile/170312195428613.html",
* "thumbnail_pic_s": "http://05.imgmini.eastday.com/mobile/20170312/20170312195428_3453eb137ec1156829eec18118233071_2_mwpm_03200403.png",
* "thumbnail_pic_s02": "http://05.imgmini.eastday.com/mobile/20170312/20170312195428_3453eb137ec1156829eec18118233071_2_mwpm_03200403.png",
* "thumbnail_pic_s03": "http://05.imgmini.eastday.com/mobile/20170312/20170312195428_3453eb137ec1156829eec18118233071_3_mwpm_03200403.png"
*/
String uniquekey;
String title;
String date;
String category;
String author_name;
String url;
String thumbnail_pic_s;
String thumbnail_pic_s02;
String thumbnail_pic_s03;
public String getUniquekey() {
return uniquekey;
}
public String getTitle() {
return title;
}
public String getDate() {
return date;
}
public String getCategory() {
return category;
}
public String getAuthor_name() {
return author_name;
}
public String getUrl() {
return url;
}
public String getThumbnail_pic_s() {
return thumbnail_pic_s;
}
public String getThumbnail_pic_s02() {
return thumbnail_pic_s02;
}
public String getThumbnail_pic_s03() {
return thumbnail_pic_s03;
}
}
}
| [
"[email protected]"
] | |
5eb0138fbc9db54fbe38da80880a9b212e972694 | 98c13c9994b7d5a55fd2dfe8a1806ecb012ea970 | /permission-controllers/src/main/java/com/permission/controllers/annotation/Anonymous.java | 90147942a5a88bc3574c7ec3b0eb5293a2f0c627 | [] | no_license | a123demi/permission | 6cd48f9967a6bfa9fdbc43041ed0f917a7fa3beb | ebdaacb92b7e116ee8d1e2a173cb8a1549293b36 | refs/heads/master | 2021-01-18T07:48:08.603993 | 2016-06-14T16:54:50 | 2016-06-14T16:54:50 | 61,481,939 | 3 | 3 | null | 2016-06-19T13:38:44 | 2016-06-19T13:38:44 | null | UTF-8 | Java | false | false | 329 | java | package com.permission.controllers.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Anonymous {
}
| [
"[email protected]"
] | |
4658c324254d649414208a9a4eb41e2602f6e7e4 | 6dbae30c806f661bcdcbc5f5f6a366ad702b1eea | /Corpus/eclipse.pde.ui/4364.java | 3face10742dc38a4e4f3f1400b617b9dab93d6e3 | [
"MIT"
] | permissive | SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018 | d3fd21745dfddb2979e8ac262588cfdfe471899f | 0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0 | refs/heads/master | 2020-03-31T15:52:01.005505 | 2018-10-01T23:38:50 | 2018-10-01T23:38:50 | 152,354,327 | 1 | 0 | MIT | 2018-10-10T02:57:02 | 2018-10-10T02:57:02 | null | UTF-8 | Java | false | false | 5,756 | java | /*******************************************************************************
* Copyright (c) 2008, 2015 Code 9 Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Code 9 Corporation - initial API and implementation
* EclipseSource Corporation - ongoing enhancements
* Rafael Oliveira Nobrega <[email protected]> - bug 242028
*******************************************************************************/
package org.eclipse.pde.internal.ds.ui.editor;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.pde.internal.ds.ui.Activator;
import org.eclipse.pde.internal.ds.ui.IConstants;
import org.eclipse.pde.internal.ui.editor.ISortableContentOutlinePage;
import org.eclipse.pde.internal.ui.editor.MultiSourceEditor;
import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
import org.eclipse.pde.internal.ui.editor.PDESourcePage;
import org.eclipse.pde.internal.ui.editor.context.InputContext;
import org.eclipse.pde.internal.ui.editor.context.InputContextManager;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.FileStoreEditorInput;
public class DSEditor extends MultiSourceEditor {
public DSEditor() {
super();
}
@Override
protected void addEditorPages() {
try {
addPage(new DSOverviewPage(this));
addPage(new DSServicesPage(this));
} catch (PartInitException e) {
Activator.logException(e);
}
// Add source page
addSourcePage(DSInputContext.CONTEXT_ID);
}
@Override
public void contributeToToolbar(IToolBarManager manager) {
// TODO add help icon here maybe?
}
@Override
protected ISortableContentOutlinePage createContentOutline() {
return new DSFormOutlinePage(this);
}
@Override
protected InputContextManager createInputContextManager() {
return new DSInputContextManager(this);
}
@Override
protected void createResourceContexts(InputContextManager contexts, IFileEditorInput input) {
contexts.putContext(input, new DSInputContext(this, input, true));
contexts.monitorFile(input.getFile());
}
@Override
protected void createStorageContexts(InputContextManager contexts, IStorageEditorInput input) {
contexts.putContext(input, new DSInputContext(this, input, true));
}
@Override
protected void createSystemFileContexts(InputContextManager contexts, FileStoreEditorInput input) {
try {
IFileStore store = EFS.getStore(input.getURI());
IEditorInput in = new FileStoreEditorInput(store);
contexts.putContext(in, new DSInputContext(this, in, true));
} catch (CoreException e) {
Activator.logException(e);
}
}
private void addDSBuilder(IFile file) {
try {
// Add builder
IProject project = file.getProject();
IProjectDescription description = project.getDescription();
ICommand[] commands = description.getBuildSpec();
for (ICommand command : commands) {
if (command.getBuilderName().equals(IConstants.ID_BUILDER)) {
return;
}
}
ICommand[] newCommands = new ICommand[commands.length + 1];
System.arraycopy(commands, 0, newCommands, 0, commands.length);
ICommand command = description.newCommand();
command.setBuilderName(IConstants.ID_BUILDER);
newCommands[newCommands.length - 1] = command;
description.setBuildSpec(newCommands);
project.setDescription(description, null);
} catch (CoreException e) {
Activator.logException(e, null, null);
}
}
@Override
public void editorContextAdded(InputContext context) {
addSourcePage(context.getId());
}
@Override
protected String getEditorID() {
return IConstants.ID_EDITOR;
}
@Override
protected InputContext getInputContext(Object object) {
return fInputContextManager.findContext(DSInputContext.CONTEXT_ID);
}
@Override
public void contextRemoved(InputContext context) {
close(false);
}
@Override
public void monitoredFileAdded(IFile monitoredFile) {
// no op
}
@Override
public boolean monitoredFileRemoved(IFile monitoredFile) {
return true;
}
@Override
public boolean isSaveAsAllowed() {
return true;
}
@Override
public void doSave(IProgressMonitor monitor) {
IEditorInput input = getEditorInput();
if (input instanceof IFileEditorInput) {
IFileEditorInput fileInput = (IFileEditorInput) input;
addDSBuilder(fileInput.getFile());
}
super.doSave(monitor);
}
@Override
protected PDESourcePage createSourcePage(PDEFormEditor editor, String title, String name, String contextId) {
return new DSSourcePage(editor, title, name);
}
}
| [
"[email protected]"
] | |
3595555f63bcfd29cd6144d07b404d1378db394e | f17382def3da0f1a7e4e1f9e3468a8c80f06da9f | /Datastructure/src/oops/Bike.java | eb1cf96e913eae307906bc069042213905ed5715 | [] | no_license | saawanth/DataStructures | 000f165ef76d4d5b222dad9598987b0a17881c32 | 57b6b2b2878870e01b76ca4396a53378c7906555 | refs/heads/master | 2021-04-13T20:34:27.096982 | 2018-03-26T18:08:14 | 2018-03-26T18:08:14 | 126,623,347 | 0 | 0 | null | 2018-03-26T18:08:15 | 2018-03-24T17:27:31 | Java | UTF-8 | Java | false | false | 510 | java | package oops;
public class Bike extends Vehicle {
public boolean fourStroke = true;
public Bike(String name, String color, String model, String company, String engine, boolean fourStroke) {
super(name, color, model, company, engine);
this.fourStroke = fourStroke;
}
public boolean isFourStroke() {
return fourStroke;
}
public void setFourStroke(boolean fourStroke) {
this.fourStroke = fourStroke;
}
public String getInfo() {
return "This is a Bike";
}
}
| [
"[email protected]"
] | |
ff005a8cdff7fdc6519289a08e194b456c946875 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/23/23_ac6b89576907e936c46f275396139a62108d862d/AbstractFlexCompilerMojo/23_ac6b89576907e936c46f275396139a62108d862d_AbstractFlexCompilerMojo_s.java | cfc9594313dfc757f4beb6d8d16957872bf1993f | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 91,532 | java | /**
* Copyright 2008 Marvin Herman Froeder
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*
*/
package org.sonatype.flexmojos.compiler;
import static org.sonatype.flexmojos.common.FlexExtension.RB_SWC;
import static org.sonatype.flexmojos.common.FlexExtension.SWF;
import static org.sonatype.flexmojos.common.FlexExtension.SWZ;
import static org.sonatype.flexmojos.utilities.MavenUtils.searchFor;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.AgeFileFilter;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Contributor;
import org.apache.maven.model.Developer;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.PluginParameterExpressionEvaluator;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
import org.jvnet.animal_sniffer.IgnoreJRERequirement;
import org.sonatype.flexmojos.AbstractIrvinMojo;
import org.sonatype.flexmojos.common.FlexClassifier;
import org.sonatype.flexmojos.common.FlexScopes;
import org.sonatype.flexmojos.compatibilitykit.FlexCompatibility;
import org.sonatype.flexmojos.compatibilitykit.FlexMojo;
import org.sonatype.flexmojos.utilities.FDKConfigResolver;
import org.sonatype.flexmojos.utilities.MavenUtils;
import org.sonatype.flexmojos.utilities.Namespace;
import flex2.tools.oem.Builder;
import flex2.tools.oem.Configuration;
import flex2.tools.oem.Report;
import flex2.tools.oem.internal.OEMConfiguration;
public abstract class AbstractFlexCompilerMojo<E extends Builder>
extends AbstractIrvinMojo
implements FlexMojo, FlexScopes
{
protected static final String REPORT_LINK = "link";
protected static final String REPORT_CONFIG = "config";
protected static final String REPORT_RESOURCE_BUNDLE = "resource-bundle";
public static final String[] DEFAULT_RSL_URLS =
new String[] { "/{contextRoot}/rsl/{artifactId}-{version}.{extension}" };
public static final String DEFAULT_RUNTIME_LOCALE_OUTPUT_PATH =
"/{contextRoot}/locales/{artifactId}-{version}-{locale}.{extension}";
private static final String COMPATIBILITY_2_0_0 = "2.0.0";
private static final String COMPATIBILITY_2_0_1 = "2.0.1";
private static final String COMPATIBILITY_3_0_0 = "3.0.0";
/**
* license.properties locations get from http://livedocs.adobe.com/flex/3/html/configuring_environment_2.html
*/
private static final File[] licensePropertiesLocations =
new File[] { new File( // Windows XP
"C:/Documents and Settings/All Users/Application Data/Adobe/Flex/license.properties" ),
new File( // Windows Vista
"C:/ProgramData/Adobe/Flex/license.properties" ),
new File( // Mac OSX
"/Library/Application Support/Adobe/Flex/license.properties" ),
new File( // Linux
System.getProperty( "user.home" ), ".adobe/Flex/license.properties" ) };
/**
* Turn on generation of accessible SWFs.
*
* @parameter default-value="false"
*/
private boolean accessible;
/**
* LW : needed for expression evaluation Note : needs at least maven 2.0.8 because of MNG-3062 The maven
* MojoExecution needed for ExpressionEvaluation
*
* @parameter expression="${mojoExecution}"
* @required
* @readonly
*/
protected MojoExecution execution;
/**
* LW : needed for expression evaluation The maven MojoExecution needed for ExpressionEvaluation
*
* @parameter expression="${session}"
* @required
* @readonly
*/
protected MavenSession context;
/**
* Sets the locales that the compiler uses to replace <code>{locale}</code> tokens that appear in some configuration
* values. This is equivalent to using the <code>compiler.locale</code> option of the mxmlc or compc compilers. <BR>
* Usage:
*
* <pre>
* <locales>
* <locale>en_US</locale>
* <locale>pt_BR</locale>
* <locale>es_ES</locale>
* </locales>
* </pre>
*
* @parameter
* @deprecated
*/
protected String[] locales;
/**
* List of path elements that form the roots of ActionScript class hierarchies.<BR>
* Usage:
*
* <pre>
* <sourcePaths>
* <path>${baseDir}/src/main/flex</path>
* </sourcePaths>
* </pre>
*
* By default use Maven source and resources folders.
*
* @parameter
*/
// * @readonly
protected File[] sourcePaths;
/**
* Allow the source-path to have path-elements which contain other path-elements
*
* @parameter default-value="false"
*/
private boolean allowSourcePathOverlap;
/**
* Run the AS3 compiler in a mode that detects legal but potentially incorrect code. Equivalent compiler option:
* warnings
*
* @parameter default-value="true"
*/
private boolean showWarnings;
/**
* Enables checking of the following ActionScript warnings:
*
* <pre>
* --compiler.warn-array-tostring-changes
* --compiler.warn-assignment-within-conditional
* --compiler.warn-bad-array-cast
* --compiler.warn-bad-bool-assignment
* --compiler.warn-bad-date-cast
* --compiler.warn-bad-es3-type-method
* --compiler.warn-bad-es3-type-prop
* --compiler.warn-bad-nan-comparison
* --compiler.warn-bad-null-assignment
* --compiler.warn-bad-null-comparison
* --compiler.warn-bad-undefined-comparison
* --compiler.warn-boolean-constructor-with-no-args
* --compiler.warn-changes-in-resolve
* --compiler.warn-class-is-sealed
* --compiler.warn-const-not-initialized
* --compiler.warn-constructor-returns-value
* --compiler.warn-deprecated-event-handler-error
* --compiler.warn-deprecated-function-error
* --compiler.warn-deprecated-property-error
* --compiler.warn-duplicate-argument-names
* --compiler.warn-duplicate-variable-def
* --compiler.warn-for-var-in-changes
* --compiler.warn-import-hides-class
* --compiler.warn-instance-of-changes
* --compiler.warn-internal-error
* --compiler.warn-level-not-supported
* --compiler.warn-missing-namespace-decl
* --compiler.warn-negative-uint-literal
* --compiler.warn-no-constructor
* --compiler.warn-no-explicit-super-call-in-constructor
* --compiler.warn-no-type-decl
* --compiler.warn-number-from-string-changes
* --compiler.warn-scoping-change-in-this
* --compiler.warn-slow-text-field-addition
* --compiler.warn-unlikely-function-value
* --compiler.warn-xml-class-has-changed
* </pre>
*
* <BR>
* Usage:
*
* <pre>
* <warnigs>
* <arrayTostringChanges>true</arrayTostringChanges>
* <assignmentWithinConditional>false</assignmentWithinConditional>
* </warnigs>
* </pre>
*
* @see Warning
* @parameter
*/
private Warning warnings;
/**
* A password that is embedded in the application
*
* @parameter
*/
protected String debugPassword;
/**
* Turn on writing of generated/*.as files to disk. These files are generated by the compiler during mxml
* translation and are helpful with understanding and debugging Flex applications.
*
* @parameter default-value="false"
*/
private boolean keepGeneratedActionscript;
/**
* Specify a URI to associate with a manifest of components for use as MXML elements.<BR>
* Usage:
*
* <pre>
* <namespaces>
* <namespace>
* <uri>http://www.adobe.com/2006/mxml</uri>
* <manifest>${basedir}/manifest.xml</manifest>
* </namespace>
* </namespaces>
* </pre>
*
* @parameter
*/
private Namespace[] namespaces;
/**
* Enable post-link SWF optimization.
*
* @parameter default-value="true"
*/
private boolean optimize;
/**
* If the <code>incremental</code> input argument is <code>false</code>, this method recompiles all parts of the
* object. If the <code>incremental</code> input argument is <code>true</code>, this method compiles only the parts
* of the object that have changed since the last compilation.
*
* @parameter default-value="false" expression="${incremental}"
*/
private boolean incremental;
/**
* Keep the following AS3 metadata in the bytecodes.<BR>
* Usage:
*
* <pre>
* <keepAs3Metadatas>
* <keepAs3Metadata>Bindable</keepAs3Metadata>
* <keepAs3Metadata>Events</keepAs3Metadata>
* </keepAs3Metadatas>
* </pre>
*
* @parameter
*/
private String[] keepAs3Metadatas;
/**
* Run the AS3 compiler in strict error checking mode.
*
* @parameter default-value="true"
*/
private boolean strict;
/**
* Use the ActionScript 3 class based object model for greater performance and better error reporting. In the class
* based object model most built-in functions are implemented as fixed methods of classes (-strict is recommended,
* but not required, for earlier errors)
*
* @parameter default-value="true"
*/
private boolean as3;
/**
* Use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype properties. In
* the prototype based object model built-in functions are implemented as dynamic properties of prototype objects
* (-strict is allowed, but may result in compiler errors for references to dynamic properties)
*
* @parameter default-value="false"
*/
private boolean es;
/**
* Turns on the display of stack traces for uncaught runtime errors.
*
* @parameter default-value="false"
*/
private boolean verboseStacktraces;
/**
* Local Fonts Snapshot File containing cached system font licensing information produced via
* <code>java -cp mxmlc.jar flex2.tools.FontSnapshot (fontpath)</code>. Will default to winFonts.ser on Windows XP
* and macFonts.ser on Mac OS X.<BR>
* Usage:
*
* <pre>
* <fonts>
* <advancedAntiAliasing>true</advancedAntiAliasing>
* <flashType>true</flashType>
* <languages>
* <englishRange>U+0020-U+007E</englishRange>
* </languages>
* <localFontsSnapshot>${baseDir}/src/main/resources/fonts.ser</localFontsSnapshot>
* <managers>
* <manager>flash.fonts.BatikFontManager</manager>
* </managers>
* <maxCachedFonts>20</maxCachedFonts>
* <maxGlyphsPerFace>1000</maxGlyphsPerFace>
* </fonts>
* </pre>
*
* @parameter
*/
private Font fonts;
/**
* Enables SWFs to access the network.
*
* @parameter default-value="true"
*/
private boolean useNetwork;
/**
* licenses: specifies a list of product and serial number pairs.<BR>
* Usage:
*
* <pre>
* <licenses>
* <flexbuilder3>xxxx-xxxx-xxxx-xxxx</flexbuilder3>
* </licenses>
* </pre>
*
* @parameter
*/
private Map<String, String> licenses;
/**
* defines: specifies a list of define directive key and value pairs. For example, CONFIG::debugging<BR>
* Usage:
*
* <pre>
* <defines>
* <SOMETHING::aNumber>2.2</SOMETHING::aNumber>
* <SOMETHING::aString>"text"</SOMETHING::aString>
* </defines>
* </pre>
*
* @parameter
* @deprecated See definesDeclaration
*/
private Map<String, String> defines;
/**
* defines: specifies a list of define directive key and value pairs. For example, CONFIG::debugging<BR>
* Usage:
*
* <pre>
* <definesDeclaration>
* <property>
* <name>SOMETHING::aNumber</name>
* <value>2.2</value>
* </property>
* <property>
* <name>SOMETHING::aString</name>
* <value>"text"</value>
* </property>
* </definesDeclaration>
* </pre>
*
* @parameter
*/
private Properties definesDeclaration;
/**
* Sets the context root path so that the compiler can replace <code>{context.root}</code> tokens for service
* channel endpoints.
*
* @parameter
*/
private String contextRoot;
/**
* Uses the default compiler options as base
*
* @parameter default-value="false"
*/
protected boolean linkReport;
/**
* Writes the configuration report to a file after the build.
*
* @parameter default-value="false" expression="${configurationReport}"
*/
protected boolean configurationReport;
/**
* Sets a list of artifacts to omit from linking when building an application. This is equivalent to using the
* <code>load-externs</code> option of the mxmlc or compc compilers.<BR>
* Usage:
*
* <pre>
* <loadExterns>
* <loadExtern>
* <groupId>com.acme</groupId>
* <artifactId>flexmodule</artifactId>
* <version>1.0.0</version>
* </loadExtern>
* <loadExtern>
* <groupId>org.tabajara</groupId>
* <artifactId>flexmodule</artifactId>
* <version>1.0.0</version>
* </loadExtern>
* </loadExterns>
* </pre>
*
* @parameter
*/
protected MavenArtifact[] loadExterns;
/**
* Load a file containing configuration options If not defined, by default will search for one on resources folder.
*
* @parameter
*/
protected File configFile;
/**
* specifies the version of the player the application is targeting. Features requiring a later version will not be
* compiled into the application. The minimum value supported is "9.0.0". If not defined will take the default value
* from current playerglobal dependency.
*
* @parameter
*/
private String targetPlayer;
/**
* Sets the metadata section of the application SWF. This is equivalent to the <code>raw-metadata</code> option of
* the mxmlc or compc compilers. Need a well-formed XML fragment
*
* @parameter
*/
private String rawMetadata;
/**
* SWF metadata useless there is no API to read it.<BR>
* Usage:
*
* <pre>
* <metadata>
* <contributor>buddy</contributor>
* <creator>me</creator>
* <date>01/01/01</date>
* <descriptions>
* <en_US>Simple description</en_US>
* </descriptions>
* <language>en_US</language>
* <publishers>
* <publisher>publisher1</publisher>
* <publisher>publisher2</publisher>
* </publishers>
* <titles>
* <en_US>Project title</en_US>
* </titles>
* </metadata>
* </pre>
*
* @parameter
*/
private Metadata metadata;
/**
* rslUrls array of URLs. The first RSL URL in the list is the primary RSL. The remaining RSL URLs will only be
* loaded if the primary RSL fails to load. Accept some special tokens:
*
* <pre>
* {contextRoot} - replace by defined context root
* {groupId} - replace by library groupId
* {artifactId} - replace by library artifactId
* {version} - replace by library version
* {extension} - replace by library extension swf or swz
* </pre>
*
* default-value="/{contextRoot}/rsl/{artifactId}-{version}.{extension}" <BR>
* Usage:
*
* <pre>
* <rslUrls>
* <url>/{contextRoot}/rsl/{artifactId}-{version}.{extension}</url>
* </rslUrls>
* </pre>
*
* @parameter
*/
private String[] rslUrls;
/**
* Resource module or resource library output path
*
* @parameter
* default-value="${project.build.directory}/locales/${project.artifactId}-${project.version}-{locale}.{extension}"
*/
private String runtimeLocaleOutputPath;
/**
* policyFileUrls array of policy file URLs. Each entry in the rslUrls array must have a corresponding entry in this
* array. A policy file may be needed in order to allow the player to read an RSL from another domain. If a policy
* file is not required, then set it to an empty string. Accept some special tokens:
*
* <pre>
* {contextRoot} - replace by defined context root
* {groupId} - replace by library groupId
* {artifactId} - replace by library artifactId
* {version} - replace by library version
* {extension} - replace by library extension swf or swz
* </pre>
*
* <BR>
* Usage:
*
* <pre>
* <policyFileUrls>
* <url>/{contextRoot}/rsl/policy-{artifactId}-{version}.xml</url>
* </policyFileUrls>
* </pre>
*
* @parameter
*/
private String[] policyFileUrls;
/**
* Sets the location of the Flex Data Services service configuration file. This is equivalent to using the
* <code>compiler.services</code> option of the mxmlc and compc compilers. If not define will look inside resources
* directory for services-config.xml
*
* @parameter
*/
private File services;
/**
* When true resources are compiled into Application or Library. When false resources are compiled into separated
* Application or Library files. If not defined no resourceBundle generation is done
*
* @parameter
* @deprecated
*/
private Boolean mergeResourceBundle;
/**
* Define the base path to locate resouce bundle files Accept some special tokens:
*
* <pre>
* {locale} - replace by locale name
* </pre>
*
* @parameter default-value="${basedir}/src/main/locales/{locale}"
*/
protected String resourceBundlePath;
/**
* This is equilvalent to the <code>compiler.mxmlc.compatibility-version</code> option of the compc compiler. Must
* be in the form <major>.<minor>.<revision> Valid values: <tt>2.0.0</tt>, <tt>2.0.1</tt> and <tt>3.0.0</tt>
*
* @see http://livedocs.adobe.com/flex/3/html/help.html?content=versioning_4. html
* @parameter
*/
private String compatibilityVersion;
/**
* Sets the ActionScript file encoding. The compiler uses this encoding to read the ActionScript source files. This
* is equivalent to using the <code>actionscript-file-encoding</code> option of the mxmlc or compc compilers.
* <p>
* The character encoding; for example <code>UTF-8</code> or <code>Big5</code>.
*
* @parameter default-value="UTF-8"
*/
private String encoding;
/**
* Sets the location of the default CSS file. This is equivalent to using the <code>compiler.defaults-css-url</code>
* option of the mxmlc or compc compilers</code>.
*
* @parameter
*/
private File defaultsCss;
/**
* Sets the default background color. You can override this by using the application code. This is the equivalent of
* the <code>default-background-color</code> option of the mxmlc or compc compilers.
*
* @parameter default-value="869CA7"
*/
private String defaultBackgroundColor;
/**
* Sets the default frame rate to be used in the application. This is the equivalent of the
* <code>default-frame-rate</code> option of the mxmlc or compc compilers.
*
* @parameter default-value="24"
*/
private int defaultFrameRate;
/**
* Sets the default script execution limits (which can be overridden by root attributes). This is equivalent to
* using the <code>default-script-limits</code> option of the mxmlc or compc compilers. Recursion depth
*
* @parameter default-value="1000"
*/
private int scriptMaxRecursionDepth;
/**
* Sets the default script execution limits (which can be overridden by root attributes). This is equivalent to
* using the <code>default-script-limits</code> option of the mxmlc or compc compilers. Execution time, in seconds
*
* @parameter default-value="60"
*/
private int scriptMaxExecutionTime;
/**
* Sets the default application width in pixels. This is equivalent to using the <code>default-size</code> option of
* the mxmlc or compc compilers.
*
* @parameter default-value="500"
*/
private int defaultSizeWidth;
/**
* Sets the default application height in pixels. This is equivalent to using the <code>default-size</code> option
* of the mxmlc or compc compilers.
*
* @parameter default-value="375"
*/
private int defaultSizeHeight;
/**
* Sets a list of definitions to omit from linking when building an application. This is equivalent to using the
* <code>externs</code> option of the mxmlc and compc compilers. An array of definitions (for example, classes,
* functions, variables, or namespaces).<BR>
* Usage:
*
* <pre>
* <externs>
* <extern>com.acme.AClass</extern>
* </externs>
* </pre>
*
* @parameter
*/
private String[] externs;
/**
* Sets a SWF frame label with a sequence of class names that are linked onto the frame. This is equivalent to using
* the <code>frames.frame</code> option of the mxmlc or compc compilers.<BR>
* Usage:
*
* <pre>
* <frames>
* <frame>
* <label>frame1</label>
* <classNames>
* <className>com.acme.AClass</className>
* </classNames>
* </frame>
* </frames>
* </pre>
*
* @parameter
*/
private FrameLabel[] frames;
/**
* Sets a list of definitions to always link in when building an application. This is equivalent to using the
* <code>includes</code> option of the mxmlc or compc compilers. An array of definitions (for example, classes,
* functions, variables, or namespaces).<BR>
* Usage:
*
* <pre>
* <includes>
* <include>com.acme.AClass</include>
* </includes>
* </pre>
*
* @parameter
*/
private String[] includes;
/**
* Sets the compiler when it runs on a server without a display. This is equivalent to using the
* <code>compiler.headless-server</code> option of the mxmlc or compc compilers. that value determines if the
* compiler is running on a server without a display.
*
* @parameter default-value="false"
*/
private boolean headlessServer;
/**
* Instructs the compiler to keep a style sheet's type selector in a SWF file, even if that type (the class) is not
* used in the application. This is equivalent to using the <code>compiler.keep-all-type-selectors</code> option of
* the mxmlc or compc compilers.
*
* @parameter default-value="false"
*/
private boolean keepAllTypeSelectors;
/**
* Determines whether resources bundles are included in the application. This is equivalent to using the
* <code>compiler.use-resource-bundle-metadata</code> option of the mxmlc or compc compilers.
*
* @parameter default-value="true"
*/
private boolean useResourceBundleMetadata;
/**
* Determines whether to compile against libraries statically or use RSLs. Set this option to true to ignore the
* RSLs specified by the <code>rslUrls</code>. Set this option to false to use the RSLs.
*
* @parameter default-value="true"
*/
private boolean staticLinkRuntimeSharedLibraries;
/**
* Verifies the RSL loaded has the same digest as the RSL specified when the application was compiled. This is
* equivalent to using the <code>verify-digests</code> option in the mxmlc compiler.
*
* @parameter default-value="true"
*/
private boolean verifyDigests;
/**
* Previous compilation data, used to incremental builds
*/
private File compilationData;
/**
* Builder to be used by compiler
*/
protected E builder;
/**
* Flex OEM compiler configurations We can not use interface, because Flex SDK 3.2.0.3958 has method
* "setConfiguration(java.lang.String[] strings)" only in OEMConfiguration (Flex SDK 4 is ok)
*/
protected Configuration configuration;
/**
* When true sets the artifact generated by this mojos as pom artifact
*/
protected boolean isSetProjectFile = true;
/**
* Generated link report file
*/
protected File linkReportFile;
/**
* Quick compile mode. When true, flexmojos will check if the last artifact available at maven repository is newer
* then sources. If so, will not recompile.
*
* @parameter default-value="false" expression="${quick.compile}"
*/
private boolean quick;
/**
* When enabled flexmojos will add a custom path resolver to flex compiler. This allow flexmojos to resolve Embed
* assets located at src/main/resources. This is a workaround and it is described at
* http://bugs.adobe.com/jira/browse/SDK-15466
*
* @parameter default-value="true" expression="${enableMavenResourcesResolver}"
*/
private boolean enableMavenResourcesResolver;
/**
* Sets the locales that should be used to generate resource bundles. <BR>
* Usage:
*
* <pre>
* <runtimeLocales>
* <locale>en_US</locale>
* <locale>pt_BR</locale>
* <locale>es_ES</locale>
* </runtimeLocales>
* </pre>
*
* @parameter
*/
protected String[] runtimeLocales;
/**
* Sets the locales that the compiler uses to replace <code>{locale}</code> tokens that appear in some configuration
* values. This is equivalent to using the <code>compiler.locale</code> option of the mxmlc or compc compilers. <BR>
* Usage:
*
* <pre>
* <compiledLocales>
* <locale>en_US</locale>
* <locale>pt_BR</locale>
* <locale>es_ES</locale>
* </compiledLocales>
* </pre>
*
* @parameter
*/
protected String[] compiledLocales;
/**
* List of CSS or SWC files to apply as a theme. <>BR Usage:
*
* <pre>
* <themes>
* <theme>css/main.css</theme>
* </themes>
* </pre>
*
* If you are using SWC theme should be better keep it's version controlled, so is advised to use a dependency with
* theme scope.<BR>
* Like this:
*
* <pre>
* <dependency>
* <groupId>com.acme</groupId>
* <artifactId>acme-theme</artifactId>
* <type>swc</type>
* <scope>theme</scope>
* <version>1.0</version>
* </dependency>
* </pre>
*
* @parameter
*/
private String[] themes;
/**
* This is equilvalent to the <code>include-resource-bundles</code> option of the compc compiler.<BR>
* Usage:
*
* <pre>
* <includeResourceBundles>
* <bundle>SharedResources</bundle>
* <bundle>collections</bundle>
* <bundle>containers</bundle>
* </includeResourceBundles>
* </pre>
*
* @parameter
*/
protected String[] includeResourceBundles;
/**
* if true, manifest entries with lookupOnly=true are included in SWC catalog. default is false. This exists only so
* that manifests can mention classes that come in from filespec rather than classpath, e.g. in playerglobal.swc.
*
* @parameter default-value="false"
*/
private boolean includeLookupOnly;
/**
* When true, flexmojos will check if the compiler and the framework versions match. Usually, you must use the same
* compiler and framework versions. Set this to true to avoid this check. EXTREMELLY UN-ADVISIBLE.
*
* @parameter default-value="false" expression="${ignore.version.issues}"
*/
private boolean ignoreVersionIssues;
/**
* Classifier to add to the artifact generated. If given, the artifact will be an attachment instead.
*
* @parameter expression="${flexmojos.classifier}"
*/
private String classifier;
/**
* The filename of the compiled artifact
*
* @parameter
*/
private File output;
/**
* Construct instance
*/
public AbstractFlexCompilerMojo()
{
super();
}
/**
* Setup before compilation of source
*/
@SuppressWarnings( "unchecked" )
@Override
public void setUp()
throws MojoExecutionException, MojoFailureException
{
checkFrameworkCompilerVersion();
processLocales();
if ( sourcePaths == null )
{
List<String> sourceRoots;
if ( project.getExecutionProject() != null )
{
sourceRoots = project.getExecutionProject().getCompileSourceRoots();
}
else
{
sourceRoots = project.getCompileSourceRoots();
}
List<File> sources = getValidSourceRoots( sourceRoots );
if ( compiledLocales != null )
{
File resourceBundleDirectory = new File( resourceBundlePath );
if ( resourceBundleDirectory.getParentFile().exists() )
{
sources.add( resourceBundleDirectory );
}
}
sourcePaths = sources.toArray( new File[sources.size()] );
}
if ( configFile == null )
{
List<Resource> resources = build.getResources();
for ( Resource resource : resources )
{
File cfg = new File( resource.getDirectory(), "config.xml" );
if ( cfg.exists() )
{
configFile = cfg;
break;
}
}
}
if ( configFile != null )
{
getLog().info( "Using configuration file " + configFile );
}
if ( services == null )
{
List<Resource> resources = build.getResources();
for ( Resource resource : resources )
{
File cfg = new File( resource.getDirectory(), "services-config.xml" );
if ( cfg.exists() )
{
services = cfg;
break;
}
}
}
if ( rslUrls == null )
{
rslUrls = DEFAULT_RSL_URLS;
}
if ( policyFileUrls == null )
{
policyFileUrls = new String[rslUrls.length];
}
for ( int i = 0; i < policyFileUrls.length; i++ )
{
policyFileUrls[i] = policyFileUrls[i] == null ? "" : policyFileUrls[i];
}
if ( runtimeLocaleOutputPath == null )
{
runtimeLocaleOutputPath = DEFAULT_RUNTIME_LOCALE_OUTPUT_PATH;
}
if ( metadata == null )
{
metadata = new Metadata();
if ( project.getDevelopers() != null && !project.getDevelopers().isEmpty() )
{
List<Developer> developers = project.getDevelopers();
for ( Developer d : developers )
{
metadata.setCreator( d.getName() );
break;
}
}
if ( project.getContributors() != null && !project.getContributors().isEmpty() )
{
List<Contributor> contributors = project.getContributors();
for ( Contributor c : contributors )
{
metadata.setContributor( c.getName() );
break;
}
}
metadata.setDate( new Date() );
// FIXME what to do here?
// if ( locales != null )
// {
// metadata.setLanguage( locales[0] );
// metadata.addDescription( locales[0], project.getDescription() );
// metadata.addTitle( locales[0], project.getName() );
// }
}
if ( licenses == null )
{
licenses = getLicenses();
}
if ( licenses != null )
{
try
{
Class.forName( "flex.license.License" );
}
catch ( ClassNotFoundException e )
{
getLog().warn(
"Unable to find license.jar on classpath. Check wiki for instructions about how to add it:\n https://docs.sonatype.org/display/FLEXMOJOS/FAQ#FAQ-1.3" );
getLog().debug( "Java classpath: " + System.getProperty( "java.class.path" ) );
}
}
configuration = builder.getDefaultConfiguration();
configure();
compilationData = new File( build.getDirectory(), build.getFinalName() + ".incr" );
setMavenPathResolver( builder );
// compiler didn't create parent if it doesn't exists
getOutput().getParentFile().mkdirs();
}
private void checkFrameworkCompilerVersion()
throws MojoExecutionException, MojoFailureException
{
if ( ignoreVersionIssues )
{
return;
}
String compilerVersion = getCompilerVersion();
String frameworkVersion = getFrameworkVersion();
if ( compilerVersion == null || frameworkVersion == null )
{
// ignore, missing version
return;
}
if ( !compilerVersion.equals( frameworkVersion ) )
{
String msg =
"Flex compiler and flex framework versions doesn't match. Compiler: '"
+ compilerVersion
+ "' - Framework: '"
+ frameworkVersion
+ "'.\n"
+ " You can use 'ignoreVersionIssues' to disable this check. Please refer to Flexmojos maven doc.\n"
+ "If you prefer fixing it instead of ignoring, take a look at: https://docs.sonatype.org/display/FLEXMOJOS/How+to+set+Flex+SDK+version";
throw new MojoFailureException( msg );
}
}
@SuppressWarnings( "deprecation" )
private void processLocales()
{
if ( this.locales != null )
{
if ( this.mergeResourceBundle == null )
{
getLog().warn( "Not defined if locales should be merged or not" );
return;
}
if ( this.mergeResourceBundle )
{
this.compiledLocales = locales;
}
else
{
this.runtimeLocales = locales;
}
}
}
protected List<File> getValidSourceRoots( List<?> sourceRoots )
{
List<File> sources = new ArrayList<File>();
for ( Object sourceRoot : sourceRoots )
{
File source = new File( sourceRoot.toString() );
if ( source.exists() )
{
sources.add( source );
}
}
return sources;
}
@SuppressWarnings( "unchecked" )
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
protected void setMavenPathResolver( E builder )
{
if ( enableMavenResourcesResolver )
{
builder.setPathResolver( new MavenPathResolver( build.getResources() ) );
}
}
private Map<String, String> getLicenses()
throws MojoExecutionException
{
File licensePropertyFile = null;
for ( File lpl : licensePropertiesLocations )
{
if ( lpl.exists() )
{
licensePropertyFile = lpl;
break;
}
}
if ( licensePropertyFile == null )
{
return null;
}
Properties props = new Properties();
try
{
props.load( new FileInputStream( licensePropertyFile ) );
}
catch ( IOException e )
{
getLog().warn( "Unable to read license files " + licensePropertyFile.getAbsolutePath(), e );
return null;
}
Map<String, String> licenses = new HashMap<String, String>();
Enumeration<?> names = props.propertyNames();
while ( names.hasMoreElements() )
{
String name = (String) names.nextElement();
String value = props.getProperty( name );
licenses.put( name, value );
}
return licenses;
}
/**
* Perform compilation of Flex source
*/
public void run()
throws MojoExecutionException, MojoFailureException
{
builder.setLogger( new CompileLogger( getLog() ) );
builder.setConfiguration( configuration );
build( builder, true );
}
/**
* Writes compilation data to a file to support incremental compilation
*
* @return OutputStream with compilation data
* @throws FileNotFoundException
*/
private OutputStream saveCompilationData()
throws FileNotFoundException
{
return new BufferedOutputStream( new FileOutputStream( compilationData ) );
}
/**
* Loads compilation data to support incremental compilation
*
* @return InputStream of compilation data
* @throws FileNotFoundException
*/
private InputStream loadCompilationData()
throws FileNotFoundException
{
return new BufferedInputStream( new FileInputStream( compilationData ) );
}
/**
* Setup builder configuration
*
* @throws MojoExecutionException
* @throws MojoFailureException
*/
protected void configure()
throws MojoExecutionException, MojoFailureException
{
resolveDependencies();
configuration.enableAccessibility( accessible );
configuration.allowSourcePathOverlap( allowSourcePathOverlap );
configuration.useActionScript3( as3 );
configuration.enableDebugging( isDebug(), debugPassword );
configuration.useECMAScript( es );
FDKConfigResolver sdkConfigResolver =
new FDKConfigResolver( getDependencyArtifacts(), build, getCompilerVersion() );
// Fonts
if ( fonts != null )
{
configureFontsAntiAliasing();
enableFlashType();
configuration.setMaximumCachedFonts( fonts.getMaxCachedFonts() );
configuration.setMaximumGlyphsPerFace( fonts.getMaxGlyphsPerFace() );
if ( fonts.getLanguages() != null && !fonts.getLanguages().isEmpty() )
{
for ( String language : fonts.getLanguages().keySet() )
{
configuration.setFontLanguageRange( language, fonts.getLanguages().get( language ) );
}
}
}
if ( fonts != null && fonts.getManagers() != null )
{
configuration.setFontManagers( fonts.getManagers() );
}
else
{
String[] defaultFontManagers = sdkConfigResolver.getFontManagers();
if ( defaultFontManagers != null )
{
configuration.setFontManagers( defaultFontManagers );
}
}
File fontsSnapshot = getFontsSnapshot();
if ( fontsSnapshot == null || !fontsSnapshot.exists() )
{
throw new MojoExecutionException( "LocalFontSnapshot not found " + fontsSnapshot );
}
configuration.setLocalFontSnapshot( fontsSnapshot );
configuration.setActionScriptMetadata( keepAs3Metadatas );
configuration.keepCompilerGeneratedActionScript( keepGeneratedActionscript );
if ( licenses != null )
{
for ( String licenseName : licenses.keySet() )
{
String key = licenses.get( licenseName );
configuration.setLicense( licenseName, key );
}
}
addDefines();
if ( compiledLocales == null && runtimeLocales == null && isApplication() )
{
setLocales( getDefaultLocale() );
}
else if ( compiledLocales != null )
{
setLocales( compiledLocales );
}
else
{
// When using the resource-bundle-list option, you must also set the
// value of the locale option to an empty string.
setLocales();
}
configureNamespaces( sdkConfigResolver );
configuration.optimize( optimize );
if ( this.warnings != null )
{
configureWarnings( configuration );
}
configuration.setSourcePath( sourcePaths );
configuration.enableStrictChecking( strict );
configuration.useNetwork( useNetwork );
configuration.enableVerboseStacktraces( verboseStacktraces );
if ( contextRoot != null )
{
configuration.setContextRoot( contextRoot );
}
configuration.keepLinkReport( linkReport );
configuration.keepConfigurationReport( configurationReport );
configuration.setServiceConfiguration( services );
configureExterns();
if ( rawMetadata != null )
{
configuration.setSWFMetaData( rawMetadata );
}
if ( metadata != null )
{
if ( metadata.getContributor() != null )
{
configuration.setSWFMetaData( Configuration.CONTRIBUTOR, metadata.getContributor() );
}
if ( metadata.getCreator() != null )
{
configuration.setSWFMetaData( Configuration.CREATOR, metadata.getCreator() );
}
if ( metadata.getDate() != null )
{
configuration.setSWFMetaData( Configuration.DATE, metadata.getDate() );
}
if ( metadata.getDescriptions() != null )
{
configuration.setSWFMetaData( Configuration.DESCRIPTION, metadata.getDescriptions() );
}
if ( metadata.getTitles() != null )
{
configuration.setSWFMetaData( Configuration.TITLE, metadata.getTitles() );
}
if ( metadata.getLanguage() != null )
{
configuration.setSWFMetaData( Configuration.LANGUAGE, metadata.getLanguage() );
}
}
setCompatibilityMode();
configuration.setActionScriptFileEncoding( encoding );
setTargetPlayer();
if ( defaultsCss != null )
configuration.setDefaultCSS( defaultsCss );
configuration.setDefaultBackgroundColor( Integer.parseInt( defaultBackgroundColor, 16 ) );
configuration.setDefaultFrameRate( defaultFrameRate );
configuration.setDefaultScriptLimits( scriptMaxRecursionDepth, scriptMaxExecutionTime );
configuration.setDefaultSize( defaultSizeWidth, defaultSizeHeight );
if ( frames != null && frames.length > 0 )
{
for ( FrameLabel frame : frames )
{
configuration.setFrameLabel( frame.getLabel(), frame.getClassNames() );
}
}
if ( includes != null && includes.length > 0 )
{
configuration.setIncludes( includes );
}
configuration.useHeadlessServer( headlessServer );
configuration.keepAllTypeSelectors( keepAllTypeSelectors );
configuration.useResourceBundleMetaData( useResourceBundleMetadata );
if ( configFile != null )
{
configuration.setConfiguration( configFile );
}
if ( configuration instanceof OEMConfiguration )
{
// http://bugs.adobe.com/jira/browse/SDK-15581
// http://bugs.adobe.com/jira/browse/SDK-18719
// workaround
OEMConfiguration oemConfig = (OEMConfiguration) configuration;
List<String> commandLineArguments = new ArrayList<String>();
commandLineArguments.add( "-static-link-runtime-shared-libraries=" + staticLinkRuntimeSharedLibraries );
configureIncludeResourceBundles( oemConfig );
if ( configFile == null )
{
commandLineArguments.add( "-load-config=" );
}
if ( includeLookupOnly )
{
commandLineArguments.add( "-include-lookup-only" );
}
oemConfig.setConfiguration( commandLineArguments.toArray( new String[commandLineArguments.size()] ) );
}
else
{
throw new MojoFailureException( "Flex-compiler API change, unable to use suggested 'solutions'!" );
}
verifyDigests();
}
private void configureExterns()
throws MojoExecutionException
{
List<File> externsFiles = new ArrayList<File>();
if ( loadExterns == null )
{
for ( Artifact artifact : getDependencyArtifacts() )
{
if ( FlexClassifier.LINK_REPORT.equals( artifact.getClassifier() ) )
{
externsFiles.add( artifact.getFile() );
}
}
}
else
// legacy implementation
{
for ( MavenArtifact mvnArtifact : loadExterns )
{
Artifact artifact =
artifactFactory.createArtifactWithClassifier( mvnArtifact.getGroupId(),
mvnArtifact.getArtifactId(),
mvnArtifact.getVersion(), "xml",
FlexClassifier.LINK_REPORT );
artifact =
MavenUtils.resolveArtifact( project, artifact, resolver, localRepository, remoteRepositories );
externsFiles.add( artifact.getFile() );
}
}
if ( externsFiles.size() > 0 )
{
configuration.setExterns( externsFiles.toArray( new File[externsFiles.size()] ) );
}
if ( externs != null && externs.length > 0 )
{
configuration.setExterns( externs );
}
}
private void configureNamespaces( FDKConfigResolver sdkConfigResolver )
throws MojoExecutionException
{
List<Namespace> defaultNamespaces = sdkConfigResolver.getNamespaces();
if ( defaultNamespaces != null )
{
for ( Namespace namespace : defaultNamespaces )
{
configuration.setComponentManifest( namespace.getUri(), namespace.getManifest() );
}
}
if ( namespaces != null )
{
for ( Namespace namespace : namespaces )
{
configuration.setComponentManifest( namespace.getUri(), namespace.getManifest() );
}
}
}
@FlexCompatibility( minVersion = "3.1" )
@IgnoreJRERequirement
protected abstract void configureIncludeResourceBundles( OEMConfiguration oemConfig );
protected abstract String getDefaultLocale();
protected abstract boolean isApplication();
/**
* @return if should be compiled as debug
*/
protected abstract boolean isDebug();
protected void resolveDependencies()
throws MojoExecutionException, MojoFailureException
{
configuration.setExternalLibraryPath( getGlobalDependency() );
configuration.addExternalLibraryPath( getDependenciesPath( EXTERNAL ) );
configuration.includeLibraries( getDependenciesPath( INTERNAL ) );
configuration.setLibraryPath( getDependenciesPath( Artifact.SCOPE_COMPILE ) );
configuration.addLibraryPath( getDependenciesPath( MERGED ) );
if ( compiledLocales == null && runtimeLocales == null && isApplication() )
{
configuration.addLibraryPath( getResourcesBundles( getDefaultLocale() ) );
}
else if ( compiledLocales != null )
{
configuration.addLibraryPath( getResourcesBundles( compiledLocales ) );
}
resolveRuntimeLibraries();
configuration.setTheme( getThemes() );
}
protected File[] getThemes()
throws MojoExecutionException, MojoFailureException
{
List<File> themeFiles = new ArrayList<File>();
if ( this.themes != null )
{
for ( String theme : themes )
{
File themeFile = MavenUtils.resolveResourceFile( project, theme );
themeFiles.add( themeFile );
}
}
themeFiles.addAll( Arrays.asList( getDependenciesPath( "theme" ) ) );
if ( themeFiles.isEmpty() )
{
return null;
}
return themeFiles.toArray( new File[0] );
}
@SuppressWarnings( "deprecation" )
@FlexCompatibility( maxVersion = "2" )
@IgnoreJRERequirement
private void enableFlashType()
{
configuration.enableFlashType( fonts.isFlashType() );
}
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
private void verifyDigests()
{
configuration.enableDigestVerification( verifyDigests );
}
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
private void setTargetPlayer()
throws MojoExecutionException, MojoFailureException
{
String playerGlobalVersion = getGlobalArtifact().getClassifier();
if ( targetPlayer == null && playerGlobalVersion != null )
{
targetPlayer = playerGlobalVersion + ".0.0";
}
if ( targetPlayer == null )
{
return;
}
String[] nodes = targetPlayer.split( "\\." );
if ( nodes.length != 3 )
{
throw new MojoExecutionException( "Invalid player version " + targetPlayer );
}
int[] versions = new int[nodes.length];
for ( int i = 0; i < nodes.length; i++ )
{
try
{
versions[i] = Integer.parseInt( nodes[i] );
}
catch ( NumberFormatException e )
{
throw new MojoExecutionException( "Invalid player version " + targetPlayer );
}
}
if ( versions[0] < 9 )
{
throw new MojoExecutionException( "Invalid player version " + targetPlayer );
}
if ( playerGlobalVersion != null )
{
if ( !nodes[0].equals( playerGlobalVersion ) )
{
throw new MojoFailureException(
"TargetPlayer and playerglobal dependency version doesn't match! Target player: "
+ targetPlayer + ", player global: " + playerGlobalVersion );
}
}
configuration.setTargetPlayer( versions[0], versions[1], versions[2] );
}
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
private void setCompatibilityMode()
throws MojoExecutionException
{
if ( compatibilityVersion != null )
{
if ( !COMPATIBILITY_2_0_0.equals( compatibilityVersion )
&& !COMPATIBILITY_2_0_1.equals( compatibilityVersion )
&& !COMPATIBILITY_3_0_0.equals( compatibilityVersion ) )
{
throw new MojoExecutionException( "Invalid compatibility version " + compatibilityVersion );
}
else if ( COMPATIBILITY_2_0_0.equals( compatibilityVersion ) )
{
configuration.setCompatibilityVersion( 2, 0, 0 );
}
else if ( COMPATIBILITY_2_0_1.equals( compatibilityVersion ) )
{
configuration.setCompatibilityVersion( 2, 0, 1 );
}
else if ( COMPATIBILITY_3_0_0.equals( compatibilityVersion ) )
{
configuration.setCompatibilityVersion( 3, 0, 0 );
}
else
{
throw new IllegalStateException( "Should never reach this" );
}
}
}
protected void setLocales( String... locales )
throws MojoExecutionException
{
setLocales2( locales );
setLocales3( locales );
}
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
private void setLocales3( String[] locales )
{
configuration.setLocale( locales );
}
@SuppressWarnings( "deprecation" )
@FlexCompatibility( maxVersion = "2" )
@IgnoreJRERequirement
private void setLocales2( String[] locales )
throws MojoExecutionException
{
if ( locales.length == 1 )
{
configuration.setLocale( new Locale( locales[0] ) );
}
else if ( locales.length != 0 )
{
throw new MojoExecutionException( "Only one locale is allowed" );
}
}
@SuppressWarnings( "deprecation" )
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
private void addDefines()
throws MojoExecutionException
{
ExpressionEvaluator expressionEvaluator =
new PluginParameterExpressionEvaluator( context, execution, null, null, project, project.getProperties() );
if ( defines != null )
{
if ( definesDeclaration == null )
{
definesDeclaration = new Properties();
}
definesDeclaration.putAll( defines );
}
if ( definesDeclaration != null )
{
for ( Object definekey : definesDeclaration.keySet() )
{
String defineName = definekey.toString();
String value = definesDeclaration.getProperty( defineName );
if ( value.contains( "${" ) )
{
// Fix bug in maven which doesn't always evaluate ${} constructions
try
{
value = (String) expressionEvaluator.evaluate( value );
}
catch ( ExpressionEvaluationException e )
{
throw new MojoExecutionException( "Expression error in " + defineName, e );
}
}
getLog().debug( "define " + defineName + " = " + value );
configuration.addDefineDirective( defineName, value );
}
}
}
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
private void configureFontsAntiAliasing()
{
configuration.enableAdvancedAntiAliasing( fonts.isAdvancedAntiAliasing() );
}
protected Artifact getGlobalArtifact()
throws MojoExecutionException
{
Set<Artifact> dependencies = getDependencyArtifacts();
for ( Artifact artifact : dependencies )
{
if ( "playerglobal".equals( artifact.getArtifactId() ) || //
"airglobal".equals( artifact.getArtifactId() ) )
{
return artifact;
}
}
throw new MojoExecutionException( "Player/Air Global dependency not found." );
}
protected File[] getGlobalDependency()
throws MojoExecutionException
{
return new File[] { MavenUtils.getArtifactFile( getGlobalArtifact(), build ) };
}
/**
* Resolves all runtime libraries, that includes RSL and framework CACHING
*
* @throws MojoExecutionException
*/
private void resolveRuntimeLibraries()
throws MojoExecutionException
{
List<Artifact> rsls = getDependencyArtifacts( RSL, CACHING );
rslsSort( rsls );
for ( Artifact artifact : rsls )
{
addRuntimeLibrary( artifact );
}
}
protected void addRuntimeLibrary( Artifact artifact )
{
String scope = artifact.getScope();
File artifactFile = artifact.getFile();
String artifactPath = artifactFile.getAbsolutePath();
String extension;
if ( CACHING.equals( scope ) )
{
extension = SWZ;
}
else
{
extension = SWF;
}
String[] rslUrls = getRslUrls( artifact, extension );
String[] rslPolicyFileUrls = getRslPolicyFileUrls( artifact );
configuration.addRuntimeSharedLibraryPath( artifactPath, rslUrls, rslPolicyFileUrls );
// when -static-link-runtime-shared-libraries=true ignore -runtime-shared-library-path,
// not put all RSLs to -library-path (tested on 3.2.0.3958 and 4.0.0.4600)
if ( staticLinkRuntimeSharedLibraries )
{
configuration.addLibraryPath( new File[] { artifactFile } );
}
}
public void rslsSort( List<Artifact> rslArtifacts )
throws MojoExecutionException
{
Map<Artifact, List<Artifact>> dependencies = getDependencies( rslArtifacts );
List<Artifact> ordered = new ArrayList<Artifact>();
for ( Artifact a : rslArtifacts )
{
if ( dependencies.get( a ) == null || dependencies.get( a ).isEmpty() )
{
ordered.add( a );
}
}
rslArtifacts.removeAll( ordered );
while ( !rslArtifacts.isEmpty() )
{
int original = rslArtifacts.size();
for ( Artifact a : rslArtifacts )
{
List<Artifact> deps = dependencies.get( a );
if ( ordered.containsAll( deps ) )
{
ordered.add( a );
}
}
rslArtifacts.removeAll( ordered );
if ( original == rslArtifacts.size() )
{
throw new MojoExecutionException( "Unable to resolve " + rslArtifacts );
}
}
rslArtifacts.addAll( ordered );
}
@SuppressWarnings( "unchecked" )
private Map<Artifact, List<Artifact>> getDependencies( List<Artifact> rslArtifacts )
throws MojoExecutionException
{
Map<Artifact, List<Artifact>> dependencies = new HashMap<Artifact, List<Artifact>>();
for ( Artifact pomArtifact : rslArtifacts )
{
try
{
MavenProject pomProject =
mavenProjectBuilder.buildFromRepository( pomArtifact, remoteRepositories, localRepository );
Set pomArtifacts = pomProject.createArtifacts( artifactFactory, null, null );
ArtifactResolutionResult arr =
resolver.resolveTransitively( pomArtifacts, pomArtifact, remoteRepositories, localRepository,
artifactMetadataSource );
List<Artifact> artifactDependencies = new ArrayList<Artifact>( arr.getArtifacts() );
artifactDependencies = removeNonRSLDependencies( rslArtifacts, artifactDependencies );
dependencies.put( pomArtifact, artifactDependencies );
}
catch ( Exception e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
return dependencies;
}
private List<Artifact> removeNonRSLDependencies( List<Artifact> rslArtifacts, List<Artifact> artifactDependencies )
{
List<Artifact> cleanArtifacts = new ArrayList<Artifact>();
artifacts: for ( Artifact artifact : artifactDependencies )
{
for ( Artifact rslArtifact : rslArtifacts )
{
if ( artifact.getGroupId().equals( rslArtifact.getGroupId() )
&& artifact.getArtifactId().equals( rslArtifact.getArtifactId() )
&& artifact.getType().equals( rslArtifact.getType() ) )
{
cleanArtifacts.add( rslArtifact );
continue artifacts;
}
}
}
return cleanArtifacts;
}
/**
* Gets RslPolicyFileUrls for given artifact
*
* @param artifact
* @return Array of urls
*/
private String[] getRslPolicyFileUrls( Artifact artifact )
{
String[] domains = new String[policyFileUrls.length];
for ( int i = 0; i < policyFileUrls.length; i++ )
{
String domain = policyFileUrls[i];
if ( contextRoot != null )
{
domain = domain.replace( "{contextRoot}", contextRoot );
}
domain = domain.replace( "{groupId}", artifact.getGroupId() );
domain = domain.replace( "{artifactId}", artifact.getArtifactId() );
domain = domain.replace( "{version}", artifact.getVersion() );
domains[i] = domain;
}
return domains;
}
/**
* Get RslUrls
*
* @param artifact
* @param extension
* @return Array of url's
*/
private String[] getRslUrls( Artifact artifact, String extension )
{
String[] rsls = new String[rslUrls.length];
for ( int i = 0; i < rslUrls.length; i++ )
{
String rsl = rslUrls[i];
if ( contextRoot == null || "".equals( contextRoot ) )
{
rsl = rsl.replace( "/{contextRoot}/", "" );
}
else
{
rsl = rsl.replace( "{contextRoot}", contextRoot );
}
rsl = MavenUtils.getRslUrl( rsl, artifact, extension );
rsls[i] = rsl;
}
return rsls;
}
protected File getRuntimeLocaleOutputFile( String locale, String extension )
{
String path = runtimeLocaleOutputPath.replace( "/{contextRoot}", project.getBuild().getDirectory() );
File output =
new File( MavenUtils.getRuntimeLocaleOutputPath( path, project.getArtifact(), locale, extension ) );
output.getParentFile().mkdirs();
return output;
}
/**
* Get Fonts snapshot
*
* @return File of font snapshot
* @throws MojoExecutionException
*/
protected File getFontsSnapshot()
throws MojoExecutionException
{
if ( fonts != null && fonts.getLocalFontsSnapshot() != null )
{
return fonts.getLocalFontsSnapshot();
}
else
{
getLog().debug( "No fonts snapshot found, generating one!" );
return MavenUtils.getFontsFile( build );
}
}
/**
* Get resource bundles for the given locale
*
* @param requestedLocales the locale for which you want bundles, null for all locales
* @return Array of resource bundle files
* @throws MojoExecutionException
*/
protected File[] getResourcesBundles( String... requestedLocales )
throws MojoExecutionException
{
if ( requestedLocales == null )
{
return new File[0];
}
List<File> resourceBundles = new ArrayList<File>();
for ( Artifact resourceBundleBeacon : getDependencyArtifacts() )
{
if ( !RB_SWC.equals( resourceBundleBeacon.getType() ) )
{
continue;
}
// resouceBundles.add(artifact.getFile());
for ( String requestLocale : requestedLocales )
{
Artifact resolvedResourceBundle =
artifactFactory.createArtifactWithClassifier( resourceBundleBeacon.getGroupId(),
resourceBundleBeacon.getArtifactId(),
resourceBundleBeacon.getVersion(),
resourceBundleBeacon.getType(), requestLocale );
resolvedResourceBundle =
MavenUtils.resolveArtifact( project, resolvedResourceBundle, resolver, localRepository,
remoteRepositories );
resourceBundles.add( resolvedResourceBundle.getFile() );
}
}
getLog().debug( "getResourcesBundles(" + requestedLocales + ") returning resourceBundles: " + resourceBundles );
return resourceBundles.toArray( new File[resourceBundles.size()] );
}
/**
* Get array of files for dependency artifacts for given scope
*
* @param scopes for which to get files
* @return Array of dependency artifact files
* @throws MojoExecutionException
*/
protected File[] getDependenciesPath( String... scopes )
throws MojoExecutionException
{
if ( scopes == null )
return null;
List<File> files = new ArrayList<File>();
for ( Artifact a : getDependencyArtifacts( scopes ) )
{
if ( "playerglobal".equals( a.getArtifactId() ) || //
"airglobal".equals( a.getArtifactId() ) )
{
continue;
}
files.add( a.getFile() );
}
return files.toArray( new File[files.size()] );
}
/**
* Perform actions after compilation has run
*/
@Override
protected void tearDown()
throws MojoExecutionException, MojoFailureException
{
if ( isSetProjectFile )
{
if ( classifier == null )
{
project.getArtifact().setFile( getOutput() );
}
else
{
projectHelper.attachArtifact( project, project.getArtifact().getType(), classifier, getOutput() );
}
}
Report report = builder.getReport();
if ( linkReport )
{
writeLinkReport( report );
}
if ( configurationReport )
{
writeConfigurationReport( report );
}
if ( runtimeLocales != null )
{
writeResourceBundle( report );
}
}
/**
* Write a resource bundle
*
* @param report from which to obtain info about resource bundle
* @throws MojoExecutionException
*/
protected void writeResourceBundle( Report report )
throws MojoExecutionException
{
getLog().info( "Compiling resources bundles!" );
String[] bundles = report.getResourceBundleNames();
if ( bundles == null || bundles.length == 0 )
{
getLog().warn( "Resource-bundle generation fail: No resource-bundle found." );
return;
}
// install resource bundle beacon
try
{
File tempFile = File.createTempFile( build.getFinalName(), "." + RB_SWC );
tempFile.deleteOnExit();
FileUtils.copyURLToFile( getClass().getResource( "/rb.swc" ), tempFile );
getLog().info( "Installing resource bundle beacon: " + tempFile );
projectHelper.attachArtifact( project, "resource-bundle", tempFile );
}
catch ( IOException e )
{
throw new MojoExecutionException( "Failed to create beacon resource bundle. " + build.getFinalName()
+ ".rb.swc", e );
}
for ( String locale : runtimeLocales )
{
getLog().info( "Generating resource bundle for locale: " + locale );
File localePath = MavenUtils.getLocaleResourcePath( resourceBundlePath, locale );
writeResourceBundle( bundles, locale, localePath );
}
}
/**
* Write resource bundle
*
* @param bundles
* @param locale
* @param localePath
* @throws MojoExecutionException
*/
protected abstract void writeResourceBundle( String[] bundles, String locale, File localePath )
throws MojoExecutionException;
/**
* Configure warnings
*
* @param cfg Configuration instance to configure
*/
private void configureWarnings( Configuration cfg )
{
if ( !warnings.getActionScript() || !showWarnings )
{
cfg.showActionScriptWarnings( false );
}
if ( !warnings.getBinding() || !showWarnings )
{
cfg.showBindingWarnings( false );
}
if ( !warnings.getDeprecation() || !showWarnings )
{
cfg.showDeprecationWarnings( false );
}
if ( !warnings.getUnusedTypeSelector() || !showWarnings )
{
cfg.showUnusedTypeSelectorWarnings( false );
}
if ( !showWarnings )
{
return;
}
configureWarningIfTrue( Configuration.WARN_ARRAY_TOSTRING_CHANGES, warnings.getArrayTostringChanges(), cfg );
configureWarningIfFalse( Configuration.WARN_ASSIGNMENT_WITHIN_CONDITIONAL,
warnings.getAssignmentWithinConditional(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_ARRAY_CAST, warnings.getBadArrayCast(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_BOOLEAN_ASSIGNMENT, warnings.getBadBooleanAssignment(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_DATE_CAST, warnings.getBadDateCast(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_ES3_TYPE_METHOD, warnings.getBadEs3TypeMethod(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_ES3_TYPE_PROP, warnings.getBadEs3TypeProp(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_NAN_COMPARISON, warnings.getBadNanComparison(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_NULL_ASSIGNMENT, warnings.getBadNullAssignment(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_NULL_COMPARISON, warnings.getBadNullComparison(), cfg );
configureWarningIfFalse( Configuration.WARN_BAD_UNDEFINED_COMPARISON, warnings.getBadUndefinedComparison(), cfg );
configureWarningIfTrue( Configuration.WARN_BOOLEAN_CONSTRUCTOR_WITH_NO_ARGS,
warnings.getBooleanConstructorWithNoArgs(), cfg );
configureWarningIfTrue( Configuration.WARN_CHANGES_IN_RESOLVE, warnings.getChangesInResolve(), cfg );
configureWarningIfFalse( Configuration.WARN_CLASS_IS_SEALED, warnings.getClassIsSealed(), cfg );
configureWarningIfFalse( Configuration.WARN_CONST_NOT_INITIALIZED, warnings.getConstNotInitialized(), cfg );
configureWarningIfTrue( Configuration.WARN_CONSTRUCTOR_RETURNS_VALUE, warnings.getConstructorReturnsValue(),
cfg );
configureWarningIfTrue( Configuration.WARN_DEPRECATED_EVENT_HANDLER_ERROR,
warnings.getDeprecatedEventHandlerError(), cfg );
configureWarningIfFalse( Configuration.WARN_DEPRECATED_FUNCTION_ERROR, warnings.getDeprecatedFunctionError(),
cfg );
configureWarningIfFalse( Configuration.WARN_DEPRECATED_PROPERTY_ERROR, warnings.getDeprecatedPropertyError(),
cfg );
configureWarningIfFalse( Configuration.WARN_DUPLICATE_ARGUMENT_NAMES, warnings.getDuplicateArgumentNames(), cfg );
configureWarningIfFalse( Configuration.WARN_DUPLICATE_VARIABLE_DEF, warnings.getDuplicateVariableDef(), cfg );
configureWarningIfTrue( Configuration.WARN_FOR_VAR_IN_CHANGES, warnings.getForVarInChanges(), cfg );
configureWarningIfFalse( Configuration.WARN_IMPORT_HIDES_CLASS, warnings.getImportHidesClass(), cfg );
configureWarningIfFalse( Configuration.WARN_INSTANCEOF_CHANGES, warnings.getInstanceOfChanges(), cfg );
configureWarningIfFalse( Configuration.WARN_INTERNAL_ERROR, warnings.getInternalError(), cfg );
configureWarningIfFalse( Configuration.WARN_LEVEL_NOT_SUPPORTED, warnings.getLevelNotSupported(), cfg );
configureWarningIfFalse( Configuration.WARN_MISSING_NAMESPACE_DECL, warnings.getMissingNamespaceDecl(), cfg );
configureWarningIfFalse( Configuration.WARN_NEGATIVE_UINT_LITERAL, warnings.getNegativeUintLiteral(), cfg );
configureWarningIfFalse( Configuration.WARN_NO_CONSTRUCTOR, warnings.getNoConstructor(), cfg );
configureWarningIfTrue( Configuration.WARN_NO_EXPLICIT_SUPER_CALL_IN_CONSTRUCTOR,
warnings.getNoExplicitSuperCallInConstructor(), cfg );
configureWarningIfFalse( Configuration.WARN_NO_TYPE_DECL, warnings.getNoTypeDecl(), cfg );
configureWarningIfTrue( Configuration.WARN_NUMBER_FROM_STRING_CHANGES, warnings.getNumberFromStringChanges(),
cfg );
configureWarningIfTrue( Configuration.WARN_SCOPING_CHANGE_IN_THIS, warnings.getScopingChangeInThis(), cfg );
configureWarningIfFalse( Configuration.WARN_SLOW_TEXTFIELD_ADDITION, warnings.getSlowTextFieldAddition(), cfg );
configureWarningIfFalse( Configuration.WARN_UNLIKELY_FUNCTION_VALUE, warnings.getUnlikelyFunctionValue(), cfg );
configureWarningIfTrue( Configuration.WARN_XML_CLASS_HAS_CHANGED, warnings.getXmlClassHasChanged(), cfg );
configureWarnings3( cfg );
}
private void configureWarningIfTrue( int code, boolean value, Configuration cfg )
{
if ( value )
{
cfg.checkActionScriptWarning( code, true );
}
}
private void configureWarningIfFalse( int code, boolean value, Configuration cfg )
{
if ( !value )
{
cfg.checkActionScriptWarning( code, false );
}
}
@FlexCompatibility( minVersion = "3" )
@IgnoreJRERequirement
private void configureWarnings3( Configuration cfg )
{
if ( !warnings.getShadowedDeviceFont() )
{
cfg.showShadowedDeviceFontWarnings( warnings.getShadowedDeviceFont() );
}
}
/**
* Writes configuration report to file
*
* @param report contains info to write
* @throws MojoExecutionException throw if an error occurs during writing of report to file
*/
protected void writeLinkReport( Report report )
throws MojoExecutionException
{
writeReport( report, REPORT_LINK );
}
/**
* Writes configuration report to file
*
* @param report contains info to write
* @throws MojoExecutionException throw if an error occurs during writing of report to file
*/
private void writeConfigurationReport( Report report )
throws MojoExecutionException
{
writeReport( report, REPORT_CONFIG );
}
/**
* Writes a report to a file.
*
* @param report Report containing info to write to file
* @param type Type of report to write. Valid types are <code>link</code> and <code>config</code>.
* @throws MojoExecutionException throw if an error occurs during writing of report to file
*/
protected void writeReport( Report report, String type )
throws MojoExecutionException
{
File fileReport = getReportFile( type );
try
{
StringWriter writer = new StringWriter();
if ( REPORT_LINK.equals( type ) )
{
report.writeLinkReport( writer );
linkReportFile = fileReport;
FileUtils.writeStringToFile( fileReport, writer.toString() );
}
else if ( REPORT_CONFIG.equals( type ) )
{
report.writeConfigurationReport( writer );
FlexConfigBuilder configBuilder = new FlexConfigBuilder( writer.toString() );
fixConfigReport( configBuilder );
configBuilder.write( fileReport );
}
getLog().info( "Written " + type + " report to " + fileReport );
}
catch ( Exception e )
{
throw new MojoExecutionException( "An error has ocurried while recording " + type + "-report", e );
}
if ( !( REPORT_CONFIG.equals( type ) ) )
{
projectHelper.attachArtifact( project, "xml", type + "-report", fileReport );
}
}
@SuppressWarnings( "unchecked" )
protected void fixConfigReport( FlexConfigBuilder configBuilder )
{
configBuilder.addOutput( getOutput() );
if ( compiledLocales == null )
{
configBuilder.addEmptyLocale();
}
for ( Resource resource : (List<Resource>) project.getResources() )
{
File resourceDirectory = new File( resource.getDirectory() );
if ( resourceDirectory.exists() )
{
configBuilder.addSourcePath( resourceDirectory );
}
}
}
protected void build( E builder, boolean printConfigurations )
throws MojoExecutionException
{
if ( !isCompilationRequired() )
{
return;
}
long bytes;
if ( printConfigurations )
{
getLog().info( "Flex compiler configurations:" + configuration.toString().replace( "--", "\n-" ) );
}
else
{
getLog().debug( "Flex compiler configurations:" + configuration.toString().replace( "--", "\n-" ) );
}
try
{
if ( incremental && compilationData.exists() )
{
builder.load( loadCompilationData() );
}
bytes = builder.build( incremental );
if ( incremental )
{
if ( compilationData.exists() )
{
compilationData.delete();
compilationData.createNewFile();
}
builder.save( saveCompilationData() );
}
}
catch ( IOException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
catch ( Exception e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
if ( bytes == 0 )
{
throw new MojoExecutionException( "Error compiling!" );
}
}
@SuppressWarnings( "unchecked" )
private boolean isCompilationRequired()
throws MojoExecutionException
{
if ( !quick )
{
// not running at quick mode
return true;
}
Artifact artifact =
artifactFactory.createArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(), null,
project.getPackaging() );
try
{
resolver.resolve( artifact, remoteRepositories, localRepository );
}
catch ( AbstractArtifactResolutionException e )
{
// Not available at repository
return true;
}
File artifactFile = artifact.getFile();
if ( artifactFile == null || !artifactFile.exists() )
{
// Recompile, file doesn't exists
getLog().warn( "Can't find any older instaled version." );
return true;
}
try
{
FileUtils.copyFile( artifactFile, getOutput() );
}
catch ( IOException e )
{
throw new MojoExecutionException( "Unable to copy instaled version to target folder.", e );
}
long lastCompiledArtifact = artifactFile.lastModified();
Set<Artifact> dependencies = getDependencyArtifacts();
for ( Artifact dependency : dependencies )
{
if ( FileUtils.isFileNewer( dependency.getFile(), lastCompiledArtifact ) )
{
// a dependency is newer, recompile
getLog().warn( "Found a updated dependency: " + dependency );
return true;
}
}
List<File> paths = new ArrayList<File>( Arrays.asList( sourcePaths ) );
if ( compiledLocales != null )
{
// resourceBundlePath is unresolved
paths.remove( new File( resourceBundlePath ) );
// resolving it
for ( String locale : compiledLocales )
{
paths.add( MavenUtils.getLocaleResourcePath( resourceBundlePath, locale ) );
}
}
if ( runtimeLocales != null )
{
// resolving locale
for ( String locale : runtimeLocales )
{
paths.add( MavenUtils.getLocaleResourcePath( resourceBundlePath, locale ) );
}
}
for ( File sourcePath : paths )
{
Collection<File> files =
FileUtils.listFiles( sourcePath, new AgeFileFilter( lastCompiledArtifact, false ),
TrueFileFilter.INSTANCE );
// If has any newer file
if ( files.size() > 0 )
{
getLog().warn( "Found some updated files." );
return true;
}
}
// nothing new was found.
return false;
}
public String getCompilerVersion()
{
Artifact compiler = MavenUtils.searchFor( pluginArtifacts, "com.adobe.flex", "compiler", null, "pom", null );
return compiler.getVersion();
}
private String getFrameworkVersion()
throws MojoExecutionException
{
Artifact dep;
dep = searchFor( getDependencyArtifacts(), "com.adobe.flex.framework", "flex-framework", null, "pom", null );
if ( dep == null )
{
dep = searchFor( getDependencyArtifacts(), "com.adobe.flex.framework", "air-framework", null, "pom", null );
}
if ( dep == null )
{
dep = searchFor( getDependencyArtifacts(), "com.adobe.flex.framework", "framework", null, "pom", null );
}
if ( dep == null )
{
dep = searchFor( getDependencyArtifacts(), "com.adobe.flex.framework", "airframework", null, "pom", null );
}
if ( dep == null )
{
return null;
}
return dep.getVersion();
}
protected File getOutput()
{
if ( output == null )
{
String name = build.getFinalName();
if ( classifier != null )
{
name += "-" + classifier;
}
name += "." + getType();
output = new File( build.getDirectory(), name );
}
return output;
}
protected String getType()
{
return project.getPackaging();
}
protected File getReportFile( String type )
{
return new File( getReportPathname( type ) );
}
protected String getReportPathname( String type )
{
String name = build.getFinalName();
if ( classifier != null )
{
name += "-" + classifier;
}
name += "-" + type + "-report.xml";
return build.getDirectory() + "/" + name;
}
protected FlexConfigBuilder createFlexConfigBuilderWithoutBuild( Configuration configuration )
throws MojoExecutionException
{
FlexConfigBuilder configBuilder;
try
{
configBuilder = new FlexConfigBuilder( configuration, builder.getLogger(), isApplication() );
}
catch ( Exception e )
{
throw new MojoExecutionException( "An error has ocurried while parse config-report", e );
}
return configBuilder;
}
}
| [
"[email protected]"
] | |
e1d49698985fd73755df277123198aac07c60b68 | d8804fc4807c687603c15cf0144cf2166ec1b48f | /src/BmiService.java | 0e5e07e432a85e21e44d62837934ff83bdfea252 | [] | no_license | turaved/Java_2_2_2 | 2b971f1715a823c24cba69c388064b6443a546da | 63cd7083e97d7b4af355bd24bf7fcf5ad9d4170a | refs/heads/master | 2023-01-15T20:03:49.001115 | 2020-11-25T15:06:06 | 2020-11-25T15:06:06 | 315,973,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | public class BmiService {
public double calculate(double weight, double height){
double bmi = weight/(height*height);
return bmi;
}
}
| [
"[email protected]"
] | |
ab30d14f2bf1b4772dc5bda27fa0bd0b8961ed72 | 9099e63655a6381d941076fa404025dd7772703b | /example/src/main/java/com/ncorti/slidetoact/example/SampleActivity.java | 40a36bd53a88fa5023d70b66a339340d0aacf327 | [
"MIT"
] | permissive | ScratchMyTail/slidetoact | 965e214d49b5fa2b568a69dcde0d498c2fc4a4b1 | 11ab7760ec916ad4d018084a7940f0251aef87a0 | refs/heads/master | 2021-07-15T18:31:50.179715 | 2017-10-17T16:17:09 | 2017-10-18T00:26:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,201 | java | package com.ncorti.slidetoact.example;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ncorti.slidetoact.SlideToActView;
import org.jetbrains.annotations.NotNull;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SampleActivity extends AppCompatActivity {
public static final String EXTRA_PRESSED_BUTTON = "extra_pressed_button";
private List<SlideToActView> mSlideList;
private SimpleDateFormat dateFormat;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
final int pressedButton = getIntent().getExtras().getInt(EXTRA_PRESSED_BUTTON, 0);
dateFormat = new SimpleDateFormat("HH:mm:ss", getResources().getConfiguration().locale);
switch (pressedButton) {
case R.id.button_area_margin:
setContentView(R.layout.content_area_margin);
break;
case R.id.button_colors:
setContentView(R.layout.content_color);
break;
case R.id.button_border_radius:
setContentView(R.layout.content_border_radius);
break;
case R.id.button_elevation:
setContentView(R.layout.content_elevation);
break;
case R.id.button_text_size:
setContentView(R.layout.content_text_size);
break;
case R.id.button_slider_dimension:
setContentView(R.layout.content_slider_dimensions);
break;
case R.id.button_event_callbacks:
setContentView(R.layout.content_event_callbacks);
setupEventCallbacks();
break;
case R.id.button_locked_slider:
setContentView(R.layout.content_locked_slider);
break;
default:
finish();
break;
}
mSlideList = getSlideList();
}
private List<SlideToActView> getSlideList() {
final List<SlideToActView> slideList = new ArrayList<>();
final LinearLayout container = (LinearLayout) findViewById(R.id.slide_container);
for (int i = 0; i < container.getChildCount(); i++) {
final View child = container.getChildAt(i);
if (child instanceof SlideToActView) {
slideList.add((SlideToActView) child);
}
}
return slideList;
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.reset:
for (SlideToActView slide : mSlideList) {
slide.resetSlider();
}
return true;
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
private void setupEventCallbacks() {
final SlideToActView slide = (SlideToActView) findViewById(R.id.event_slider);
final TextView log = (TextView) findViewById(R.id.event_log);
slide.setOnSlideCompleteListener(new SlideToActView.OnSlideCompleteListener() {
@Override
public void onSlideComplete(@NotNull SlideToActView view) {
log.append("\n" + getTime() + " onSlideComplete");
}
});
slide.setOnSlideResetListener(new SlideToActView.OnSlideResetListener() {
@Override
public void onSlideReset(@NotNull SlideToActView view) {
log.append("\n" + getTime() + " onSlideReset");
}
});
slide.setOnSlideToActAnimationEventListener(new SlideToActView.OnSlideToActAnimationEventListener() {
@Override
public void onSlideCompleteAnimationStarted(@NotNull SlideToActView view, float threshold) {
log.append("\n" + getTime() + " onSlideCompleteAnimationStarted - " + threshold + "");
}
@Override
public void onSlideCompleteAnimationEnded(@NotNull SlideToActView view) {
log.append("\n" + getTime() + " onSlideCompleteAnimationEnded");
}
@Override
public void onSlideResetAnimationStarted(@NotNull SlideToActView view) {
log.append("\n" + getTime() + " onSlideResetAnimationStarted");
}
@Override
public void onSlideResetAnimationEnded(@NotNull SlideToActView view) {
log.append("\n" + getTime() + " onSlideResetAnimationEnded");
}
});
}
private String getTime() {
return dateFormat.format(new Date());
}
}
| [
"[email protected]"
] | |
701cd138f1c337067c16b578d6fd5641d4e6bc07 | a2cf6093632c085a3f7b1fb7352479fd7ba99eef | /jgnash-fx/src/main/java/jgnash/uifx/control/SecurityComboBox.java | be60e512fb05d459bdf490abde5b453e20490371 | [] | no_license | 3men2kbson/jgnash | 041914535cbdf2707200fc01df46f75b175b1f1a | add7b82746706bf411616b319739d2f49bea81a3 | refs/heads/master | 2021-01-17T17:18:46.499650 | 2016-04-14T09:56:41 | 2016-04-14T09:56:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,991 | java | /*
* jGnash, a personal finance application
* Copyright (C) 2001-2016 Craig Cavanaugh
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package jgnash.uifx.control;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import javafx.application.Platform;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.ObservableList;
import javafx.collections.transformation.SortedList;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.ComboBox;
import jgnash.engine.Account;
import jgnash.engine.Engine;
import jgnash.engine.EngineFactory;
import jgnash.engine.SecurityNode;
import jgnash.engine.message.Message;
import jgnash.engine.message.MessageBus;
import jgnash.engine.message.MessageChannel;
import jgnash.engine.message.MessageListener;
import jgnash.engine.message.MessageProperty;
/**
* ComboBox that allows selection of a SecurityNode and manages it's own model
* <p>
* The default operation is to load all known {@code SecurityNodes}. If the
* {@code accountProperty} is set, then only the account's {@code SecurityNodes}
* will be available for selection.
*
* @author Craig Cavanaugh
*/
public class SecurityComboBox extends ComboBox<SecurityNode> implements MessageListener {
/**
* Model for the ComboBox
*/
final private ObservableList<SecurityNode> items;
final private ObjectProperty<Account> accountProperty = new SimpleObjectProperty<>();
public SecurityComboBox() {
final FXMLLoader loader = new FXMLLoader(getClass().getResource("SecurityComboBox.fxml"));
loader.setRoot(this);
loader.setController(this);
// extract and reuse the default model
items = getItems();
// warp in a sorted list
setItems(new SortedList<>(items, null));
try {
loader.load();
} catch (final IOException exception) {
throw new RuntimeException(exception);
}
Platform.runLater(this::loadModel); // lazy load to let the ui build happen faster
accountProperty.addListener((observable, oldValue, newValue) -> {
loadModel();
});
MessageBus.getInstance().registerListener(this, MessageChannel.ACCOUNT, MessageChannel.COMMODITY, MessageChannel.SYSTEM);
}
public void setSecurityNode(final SecurityNode securityNode) {
// Selection is not always consistent unless pushed to the EDT
Platform.runLater(() -> setValue(securityNode));
}
private void loadModel() {
final Collection<SecurityNode> securityNodes;
if (accountProperty.get() != null) {
items.clear();
securityNodes = accountProperty.get().getSecurities();
} else {
final Engine engine = EngineFactory.getEngine(EngineFactory.DEFAULT);
Objects.requireNonNull(engine);
securityNodes = engine.getSecurities();
}
if (!securityNodes.isEmpty()) {
final List<SecurityNode> sortedNodeList = new ArrayList<>(securityNodes);
Collections.sort(sortedNodeList);
items.addAll(sortedNodeList);
getSelectionModel().select(0);
}
}
@Override
public void messagePosted(final Message event) {
if (event.getObject(MessageProperty.COMMODITY) instanceof SecurityNode) {
final SecurityNode node = event.getObject(MessageProperty.COMMODITY);
final Account account = event.getObject(MessageProperty.ACCOUNT);
Platform.runLater(() -> {
switch (event.getEvent()) {
case ACCOUNT_SECURITY_ADD:
if (account != null && account.equals(accountProperty.get())) {
final int index = Collections.binarySearch(items, node);
if (index < 0) {
items.add(-index -1, node);
}
}
break;
case ACCOUNT_SECURITY_REMOVE:
if (account != null && account.equals(accountProperty.get())) {
items.removeAll(node);
}
break;
case SECURITY_REMOVE:
items.removeAll(node);
break;
case SECURITY_ADD:
final int index = Collections.binarySearch(items, node);
if (index < 0) {
items.add(-index -1, node);
}
break;
case SECURITY_MODIFY:
items.removeAll(node);
final int i = Collections.binarySearch(items, node);
if (i < 0) {
items.add(-i - 1, node);
}
break;
case FILE_CLOSING:
items.clear();
default:
break;
}
});
}
}
public ObjectProperty<Account> accountProperty() {
return accountProperty;
}
}
| [
"[email protected]"
] | |
b8255be9380336f84fde3da92098bf20db3b3f9c | fd0549864570344a2ebee709692dcabf5017e882 | /task1/src/main/java/org/reactive/part1/ReactiveToBlockingExample.java | 8192946f0a96d8c01a8ac9012bb141df7754f2c4 | [] | no_license | gabrysiam8/zti-reactive-programming-tasks | 033d74ae392d76786aea71e8bc8d9305d2665b03 | 7fe2c16d7e087918ed4e37c60860cefe3875e605 | refs/heads/master | 2022-12-26T13:59:16.958529 | 2020-05-24T15:46:51 | 2020-05-24T15:46:51 | 266,361,218 | 0 | 0 | null | 2020-10-13T22:14:13 | 2020-05-23T15:10:49 | Java | UTF-8 | Java | false | false | 436 | java | package org.reactive.part1;
import org.reactive.part1.model.Book;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
public class ReactiveToBlockingExample {
// TODO: Return the user contained in that Mono
Book monoToValue(Mono<Book> mono) {
return null;
}
// TODO: Return the users contained in that Flux
Iterable<Book> fluxToValues(Flux<Book> flux) {
return null;
}
}
| [
"[email protected]"
] | |
80cf15268a3c8daf8056ede320f4ad46a5d995b5 | a2bed991d00c29764f307ee67f1b9e18a86cfa9c | /bigdata/bigdataproject/wenpan-project-ct/ct-producer/src/main/java/com/wp/ct/producer/bean/Calllog.java | 66ac9cf1f4e95d2eb43ed64471e7e44173b755ca | [] | no_license | wenpanwenpan/BigDataProject | 5984a18740a994a7f2e5c156428e4ce6ba3d0a48 | b0b7a2f57bffec5502c910b0099f96778c42b591 | refs/heads/master | 2020-04-17T16:40:00.218272 | 2019-01-21T04:59:32 | 2019-01-21T04:59:32 | 166,750,440 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,168 | java | package com.wp.ct.producer.bean;
/**
* Created by Administrator on 2019/1/5.
* 通话记录
*/
public class Calllog {
private String call1;
private String call2;
private String calltime;
private String duration;
public Calllog(String call1, String call2, String calltime, String duration) {
this.call1 = call1;
this.call2 = call2;
this.calltime = calltime;
this.duration = duration;
}
public String getCall1() {
return call1;
}
public void setCall1(String call1) {
this.call1 = call1;
}
public String getCall2() {
return call2;
}
public void setCall2(String call2) {
this.call2 = call2;
}
public String getCalltime() {
return calltime;
}
public void setCalltime(String calltime) {
this.calltime = calltime;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
@Override
public String toString() {
return this.call1 + "\t" + this.call2 + "\t" + this.calltime + "\t" + duration;
}
}
| [
"[email protected]"
] | |
33a0225e8f0439ff69a26fa743a8399625c0edf7 | ef79abf86858dcd0fca314387af8956f71db591c | /xtext/dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguageParser.java | c88c6311ed60e41b5bea031ca854bbc18014132f | [] | no_license | ulrikpaghschultz/spreadsheet-parsing | 546601af62890a72e2643e764d7895603fcc5e71 | 9d5cc4c13c40454192537fa5780267561f3fb538 | refs/heads/master | 2020-05-05T08:27:06.229150 | 2016-10-24T20:05:50 | 2016-10-24T20:05:50 | 37,013,771 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 93,877 | java | package dk.sdu.mmmi.sgl.parser.antlr.internal;
import org.eclipse.xtext.*;
import org.eclipse.xtext.parser.*;
import org.eclipse.xtext.parser.impl.*;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
import dk.sdu.mmmi.sgl.services.SpreadsheetGrammarLanguageGrammarAccess;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class InternalSpreadsheetGrammarLanguageParser extends AbstractInternalAntlrParser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_STRING", "RULE_INT", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'language'", "':'", "';'", "'block'", "'{'", "'}'", "'*'", "'='", "'?='", "'column'", "'ID'", "'STR'", "'INT'", "'@'", "'rule'", "'|'"
};
public static final int RULE_STRING=5;
public static final int RULE_SL_COMMENT=8;
public static final int T__19=19;
public static final int T__15=15;
public static final int T__16=16;
public static final int T__17=17;
public static final int T__18=18;
public static final int T__11=11;
public static final int T__12=12;
public static final int T__13=13;
public static final int T__14=14;
public static final int EOF=-1;
public static final int RULE_ID=4;
public static final int RULE_WS=9;
public static final int RULE_ANY_OTHER=10;
public static final int T__26=26;
public static final int RULE_INT=6;
public static final int T__22=22;
public static final int RULE_ML_COMMENT=7;
public static final int T__23=23;
public static final int T__24=24;
public static final int T__25=25;
public static final int T__20=20;
public static final int T__21=21;
// delegates
// delegators
public InternalSpreadsheetGrammarLanguageParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public InternalSpreadsheetGrammarLanguageParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
public String[] getTokenNames() { return InternalSpreadsheetGrammarLanguageParser.tokenNames; }
public String getGrammarFileName() { return "../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g"; }
private SpreadsheetGrammarLanguageGrammarAccess grammarAccess;
public InternalSpreadsheetGrammarLanguageParser(TokenStream input, SpreadsheetGrammarLanguageGrammarAccess grammarAccess) {
this(input);
this.grammarAccess = grammarAccess;
registerRules(grammarAccess.getGrammar());
}
@Override
protected String getFirstRuleName() {
return "Grammar";
}
@Override
protected SpreadsheetGrammarLanguageGrammarAccess getGrammarAccess() {
return grammarAccess;
}
// $ANTLR start "entryRuleGrammar"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:67:1: entryRuleGrammar returns [EObject current=null] : iv_ruleGrammar= ruleGrammar EOF ;
public final EObject entryRuleGrammar() throws RecognitionException {
EObject current = null;
EObject iv_ruleGrammar = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:68:2: (iv_ruleGrammar= ruleGrammar EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:69:2: iv_ruleGrammar= ruleGrammar EOF
{
newCompositeNode(grammarAccess.getGrammarRule());
pushFollow(FOLLOW_ruleGrammar_in_entryRuleGrammar75);
iv_ruleGrammar=ruleGrammar();
state._fsp--;
current =iv_ruleGrammar;
match(input,EOF,FOLLOW_EOF_in_entryRuleGrammar85);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleGrammar"
// $ANTLR start "ruleGrammar"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:76:1: ruleGrammar returns [EObject current=null] : (otherlv_0= 'language' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (otherlv_3= RULE_ID ) ) otherlv_4= ';' ( (lv_elements_5_0= ruleElement ) )* ) ;
public final EObject ruleGrammar() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_3=null;
Token otherlv_4=null;
EObject lv_elements_5_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:79:28: ( (otherlv_0= 'language' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (otherlv_3= RULE_ID ) ) otherlv_4= ';' ( (lv_elements_5_0= ruleElement ) )* ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:80:1: (otherlv_0= 'language' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (otherlv_3= RULE_ID ) ) otherlv_4= ';' ( (lv_elements_5_0= ruleElement ) )* )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:80:1: (otherlv_0= 'language' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (otherlv_3= RULE_ID ) ) otherlv_4= ';' ( (lv_elements_5_0= ruleElement ) )* )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:80:3: otherlv_0= 'language' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (otherlv_3= RULE_ID ) ) otherlv_4= ';' ( (lv_elements_5_0= ruleElement ) )*
{
otherlv_0=(Token)match(input,11,FOLLOW_11_in_ruleGrammar122);
newLeafNode(otherlv_0, grammarAccess.getGrammarAccess().getLanguageKeyword_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:84:1: ( (lv_name_1_0= RULE_ID ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:85:1: (lv_name_1_0= RULE_ID )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:85:1: (lv_name_1_0= RULE_ID )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:86:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGrammar139);
newLeafNode(lv_name_1_0, grammarAccess.getGrammarAccess().getNameIDTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getGrammarRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"ID");
}
}
otherlv_2=(Token)match(input,12,FOLLOW_12_in_ruleGrammar156);
newLeafNode(otherlv_2, grammarAccess.getGrammarAccess().getColonKeyword_2());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:106:1: ( (otherlv_3= RULE_ID ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:107:1: (otherlv_3= RULE_ID )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:107:1: (otherlv_3= RULE_ID )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:108:3: otherlv_3= RULE_ID
{
if (current==null) {
current = createModelElement(grammarAccess.getGrammarRule());
}
otherlv_3=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGrammar176);
newLeafNode(otherlv_3, grammarAccess.getGrammarAccess().getRootBlockCrossReference_3_0());
}
}
otherlv_4=(Token)match(input,13,FOLLOW_13_in_ruleGrammar188);
newLeafNode(otherlv_4, grammarAccess.getGrammarAccess().getSemicolonKeyword_4());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:123:1: ( (lv_elements_5_0= ruleElement ) )*
loop1:
do {
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0==14||LA1_0==25) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:124:1: (lv_elements_5_0= ruleElement )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:124:1: (lv_elements_5_0= ruleElement )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:125:3: lv_elements_5_0= ruleElement
{
newCompositeNode(grammarAccess.getGrammarAccess().getElementsElementParserRuleCall_5_0());
pushFollow(FOLLOW_ruleElement_in_ruleGrammar209);
lv_elements_5_0=ruleElement();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getGrammarRule());
}
add(
current,
"elements",
lv_elements_5_0,
"Element");
afterParserOrEnumRuleCall();
}
}
break;
default :
break loop1;
}
} while (true);
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleGrammar"
// $ANTLR start "entryRuleElement"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:149:1: entryRuleElement returns [EObject current=null] : iv_ruleElement= ruleElement EOF ;
public final EObject entryRuleElement() throws RecognitionException {
EObject current = null;
EObject iv_ruleElement = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:150:2: (iv_ruleElement= ruleElement EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:151:2: iv_ruleElement= ruleElement EOF
{
newCompositeNode(grammarAccess.getElementRule());
pushFollow(FOLLOW_ruleElement_in_entryRuleElement246);
iv_ruleElement=ruleElement();
state._fsp--;
current =iv_ruleElement;
match(input,EOF,FOLLOW_EOF_in_entryRuleElement256);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleElement"
// $ANTLR start "ruleElement"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:158:1: ruleElement returns [EObject current=null] : (this_Block_0= ruleBlock | this_Rule_1= ruleRule ) ;
public final EObject ruleElement() throws RecognitionException {
EObject current = null;
EObject this_Block_0 = null;
EObject this_Rule_1 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:161:28: ( (this_Block_0= ruleBlock | this_Rule_1= ruleRule ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:162:1: (this_Block_0= ruleBlock | this_Rule_1= ruleRule )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:162:1: (this_Block_0= ruleBlock | this_Rule_1= ruleRule )
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0==14) ) {
alt2=1;
}
else if ( (LA2_0==25) ) {
alt2=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 2, 0, input);
throw nvae;
}
switch (alt2) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:163:5: this_Block_0= ruleBlock
{
newCompositeNode(grammarAccess.getElementAccess().getBlockParserRuleCall_0());
pushFollow(FOLLOW_ruleBlock_in_ruleElement303);
this_Block_0=ruleBlock();
state._fsp--;
current = this_Block_0;
afterParserOrEnumRuleCall();
}
break;
case 2 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:173:5: this_Rule_1= ruleRule
{
newCompositeNode(grammarAccess.getElementAccess().getRuleParserRuleCall_1());
pushFollow(FOLLOW_ruleRule_in_ruleElement330);
this_Rule_1=ruleRule();
state._fsp--;
current = this_Rule_1;
afterParserOrEnumRuleCall();
}
break;
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleElement"
// $ANTLR start "entryRuleBlock"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:189:1: entryRuleBlock returns [EObject current=null] : iv_ruleBlock= ruleBlock EOF ;
public final EObject entryRuleBlock() throws RecognitionException {
EObject current = null;
EObject iv_ruleBlock = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:190:2: (iv_ruleBlock= ruleBlock EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:191:2: iv_ruleBlock= ruleBlock EOF
{
newCompositeNode(grammarAccess.getBlockRule());
pushFollow(FOLLOW_ruleBlock_in_entryRuleBlock365);
iv_ruleBlock=ruleBlock();
state._fsp--;
current =iv_ruleBlock;
match(input,EOF,FOLLOW_EOF_in_entryRuleBlock375);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleBlock"
// $ANTLR start "ruleBlock"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:198:1: ruleBlock returns [EObject current=null] : (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_columns_3_0= ruleColumn ) )* otherlv_4= '}' ) ;
public final EObject ruleBlock() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_columns_3_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:201:28: ( (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_columns_3_0= ruleColumn ) )* otherlv_4= '}' ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:202:1: (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_columns_3_0= ruleColumn ) )* otherlv_4= '}' )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:202:1: (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_columns_3_0= ruleColumn ) )* otherlv_4= '}' )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:202:3: otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_columns_3_0= ruleColumn ) )* otherlv_4= '}'
{
otherlv_0=(Token)match(input,14,FOLLOW_14_in_ruleBlock412);
newLeafNode(otherlv_0, grammarAccess.getBlockAccess().getBlockKeyword_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:206:1: ( (lv_name_1_0= RULE_ID ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:207:1: (lv_name_1_0= RULE_ID )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:207:1: (lv_name_1_0= RULE_ID )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:208:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleBlock429);
newLeafNode(lv_name_1_0, grammarAccess.getBlockAccess().getNameIDTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getBlockRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"ID");
}
}
otherlv_2=(Token)match(input,15,FOLLOW_15_in_ruleBlock446);
newLeafNode(otherlv_2, grammarAccess.getBlockAccess().getLeftCurlyBracketKeyword_2());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:228:1: ( (lv_columns_3_0= ruleColumn ) )*
loop3:
do {
int alt3=2;
int LA3_0 = input.LA(1);
if ( (LA3_0==RULE_ID) ) {
alt3=1;
}
switch (alt3) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:229:1: (lv_columns_3_0= ruleColumn )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:229:1: (lv_columns_3_0= ruleColumn )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:230:3: lv_columns_3_0= ruleColumn
{
newCompositeNode(grammarAccess.getBlockAccess().getColumnsColumnParserRuleCall_3_0());
pushFollow(FOLLOW_ruleColumn_in_ruleBlock467);
lv_columns_3_0=ruleColumn();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getBlockRule());
}
add(
current,
"columns",
lv_columns_3_0,
"Column");
afterParserOrEnumRuleCall();
}
}
break;
default :
break loop3;
}
} while (true);
otherlv_4=(Token)match(input,16,FOLLOW_16_in_ruleBlock480);
newLeafNode(otherlv_4, grammarAccess.getBlockAccess().getRightCurlyBracketKeyword_4());
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleBlock"
// $ANTLR start "entryRuleColumn"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:258:1: entryRuleColumn returns [EObject current=null] : iv_ruleColumn= ruleColumn EOF ;
public final EObject entryRuleColumn() throws RecognitionException {
EObject current = null;
EObject iv_ruleColumn = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:259:2: (iv_ruleColumn= ruleColumn EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:260:2: iv_ruleColumn= ruleColumn EOF
{
newCompositeNode(grammarAccess.getColumnRule());
pushFollow(FOLLOW_ruleColumn_in_entryRuleColumn516);
iv_ruleColumn=ruleColumn();
state._fsp--;
current =iv_ruleColumn;
match(input,EOF,FOLLOW_EOF_in_entryRuleColumn526);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleColumn"
// $ANTLR start "ruleColumn"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:267:1: ruleColumn returns [EObject current=null] : ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_multiple_1_0= '*' ) )? ( (lv_def_2_0= ruleColumnDefinition ) ) otherlv_3= ';' ) ;
public final EObject ruleColumn() throws RecognitionException {
EObject current = null;
Token lv_name_0_0=null;
Token lv_multiple_1_0=null;
Token otherlv_3=null;
EObject lv_def_2_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:270:28: ( ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_multiple_1_0= '*' ) )? ( (lv_def_2_0= ruleColumnDefinition ) ) otherlv_3= ';' ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:271:1: ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_multiple_1_0= '*' ) )? ( (lv_def_2_0= ruleColumnDefinition ) ) otherlv_3= ';' )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:271:1: ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_multiple_1_0= '*' ) )? ( (lv_def_2_0= ruleColumnDefinition ) ) otherlv_3= ';' )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:271:2: ( (lv_name_0_0= RULE_ID ) ) ( (lv_multiple_1_0= '*' ) )? ( (lv_def_2_0= ruleColumnDefinition ) ) otherlv_3= ';'
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:271:2: ( (lv_name_0_0= RULE_ID ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:272:1: (lv_name_0_0= RULE_ID )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:272:1: (lv_name_0_0= RULE_ID )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:273:3: lv_name_0_0= RULE_ID
{
lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleColumn568);
newLeafNode(lv_name_0_0, grammarAccess.getColumnAccess().getNameIDTerminalRuleCall_0_0());
if (current==null) {
current = createModelElement(grammarAccess.getColumnRule());
}
setWithLastConsumed(
current,
"name",
lv_name_0_0,
"ID");
}
}
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:289:2: ( (lv_multiple_1_0= '*' ) )?
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0==17) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:290:1: (lv_multiple_1_0= '*' )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:290:1: (lv_multiple_1_0= '*' )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:291:3: lv_multiple_1_0= '*'
{
lv_multiple_1_0=(Token)match(input,17,FOLLOW_17_in_ruleColumn591);
newLeafNode(lv_multiple_1_0, grammarAccess.getColumnAccess().getMultipleAsteriskKeyword_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getColumnRule());
}
setWithLastConsumed(current, "multiple", true, "*");
}
}
break;
}
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:304:3: ( (lv_def_2_0= ruleColumnDefinition ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:305:1: (lv_def_2_0= ruleColumnDefinition )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:305:1: (lv_def_2_0= ruleColumnDefinition )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:306:3: lv_def_2_0= ruleColumnDefinition
{
newCompositeNode(grammarAccess.getColumnAccess().getDefColumnDefinitionParserRuleCall_2_0());
pushFollow(FOLLOW_ruleColumnDefinition_in_ruleColumn626);
lv_def_2_0=ruleColumnDefinition();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getColumnRule());
}
set(
current,
"def",
lv_def_2_0,
"ColumnDefinition");
afterParserOrEnumRuleCall();
}
}
otherlv_3=(Token)match(input,13,FOLLOW_13_in_ruleColumn638);
newLeafNode(otherlv_3, grammarAccess.getColumnAccess().getSemicolonKeyword_3());
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleColumn"
// $ANTLR start "entryRuleColumnDefinition"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:334:1: entryRuleColumnDefinition returns [EObject current=null] : iv_ruleColumnDefinition= ruleColumnDefinition EOF ;
public final EObject entryRuleColumnDefinition() throws RecognitionException {
EObject current = null;
EObject iv_ruleColumnDefinition = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:335:2: (iv_ruleColumnDefinition= ruleColumnDefinition EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:336:2: iv_ruleColumnDefinition= ruleColumnDefinition EOF
{
newCompositeNode(grammarAccess.getColumnDefinitionRule());
pushFollow(FOLLOW_ruleColumnDefinition_in_entryRuleColumnDefinition674);
iv_ruleColumnDefinition=ruleColumnDefinition();
state._fsp--;
current =iv_ruleColumnDefinition;
match(input,EOF,FOLLOW_EOF_in_entryRuleColumnDefinition684);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleColumnDefinition"
// $ANTLR start "ruleColumnDefinition"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:343:1: ruleColumnDefinition returns [EObject current=null] : (this_MandatoryColumn_0= ruleMandatoryColumn | this_OptionalColumn_1= ruleOptionalColumn ) ;
public final EObject ruleColumnDefinition() throws RecognitionException {
EObject current = null;
EObject this_MandatoryColumn_0 = null;
EObject this_OptionalColumn_1 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:346:28: ( (this_MandatoryColumn_0= ruleMandatoryColumn | this_OptionalColumn_1= ruleOptionalColumn ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:347:1: (this_MandatoryColumn_0= ruleMandatoryColumn | this_OptionalColumn_1= ruleOptionalColumn )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:347:1: (this_MandatoryColumn_0= ruleMandatoryColumn | this_OptionalColumn_1= ruleOptionalColumn )
int alt5=2;
int LA5_0 = input.LA(1);
if ( (LA5_0==18) ) {
alt5=1;
}
else if ( (LA5_0==19) ) {
alt5=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 5, 0, input);
throw nvae;
}
switch (alt5) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:348:5: this_MandatoryColumn_0= ruleMandatoryColumn
{
newCompositeNode(grammarAccess.getColumnDefinitionAccess().getMandatoryColumnParserRuleCall_0());
pushFollow(FOLLOW_ruleMandatoryColumn_in_ruleColumnDefinition731);
this_MandatoryColumn_0=ruleMandatoryColumn();
state._fsp--;
current = this_MandatoryColumn_0;
afterParserOrEnumRuleCall();
}
break;
case 2 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:358:5: this_OptionalColumn_1= ruleOptionalColumn
{
newCompositeNode(grammarAccess.getColumnDefinitionAccess().getOptionalColumnParserRuleCall_1());
pushFollow(FOLLOW_ruleOptionalColumn_in_ruleColumnDefinition758);
this_OptionalColumn_1=ruleOptionalColumn();
state._fsp--;
current = this_OptionalColumn_1;
afterParserOrEnumRuleCall();
}
break;
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleColumnDefinition"
// $ANTLR start "entryRuleMandatoryColumn"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:374:1: entryRuleMandatoryColumn returns [EObject current=null] : iv_ruleMandatoryColumn= ruleMandatoryColumn EOF ;
public final EObject entryRuleMandatoryColumn() throws RecognitionException {
EObject current = null;
EObject iv_ruleMandatoryColumn = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:375:2: (iv_ruleMandatoryColumn= ruleMandatoryColumn EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:376:2: iv_ruleMandatoryColumn= ruleMandatoryColumn EOF
{
newCompositeNode(grammarAccess.getMandatoryColumnRule());
pushFollow(FOLLOW_ruleMandatoryColumn_in_entryRuleMandatoryColumn793);
iv_ruleMandatoryColumn=ruleMandatoryColumn();
state._fsp--;
current =iv_ruleMandatoryColumn;
match(input,EOF,FOLLOW_EOF_in_entryRuleMandatoryColumn803);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleMandatoryColumn"
// $ANTLR start "ruleMandatoryColumn"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:383:1: ruleMandatoryColumn returns [EObject current=null] : (otherlv_0= '=' ( (lv_spec_1_0= ruleColumnSpec ) ) ) ;
public final EObject ruleMandatoryColumn() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
EObject lv_spec_1_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:386:28: ( (otherlv_0= '=' ( (lv_spec_1_0= ruleColumnSpec ) ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:387:1: (otherlv_0= '=' ( (lv_spec_1_0= ruleColumnSpec ) ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:387:1: (otherlv_0= '=' ( (lv_spec_1_0= ruleColumnSpec ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:387:3: otherlv_0= '=' ( (lv_spec_1_0= ruleColumnSpec ) )
{
otherlv_0=(Token)match(input,18,FOLLOW_18_in_ruleMandatoryColumn840);
newLeafNode(otherlv_0, grammarAccess.getMandatoryColumnAccess().getEqualsSignKeyword_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:391:1: ( (lv_spec_1_0= ruleColumnSpec ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:392:1: (lv_spec_1_0= ruleColumnSpec )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:392:1: (lv_spec_1_0= ruleColumnSpec )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:393:3: lv_spec_1_0= ruleColumnSpec
{
newCompositeNode(grammarAccess.getMandatoryColumnAccess().getSpecColumnSpecParserRuleCall_1_0());
pushFollow(FOLLOW_ruleColumnSpec_in_ruleMandatoryColumn861);
lv_spec_1_0=ruleColumnSpec();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getMandatoryColumnRule());
}
set(
current,
"spec",
lv_spec_1_0,
"ColumnSpec");
afterParserOrEnumRuleCall();
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleMandatoryColumn"
// $ANTLR start "entryRuleOptionalColumn"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:417:1: entryRuleOptionalColumn returns [EObject current=null] : iv_ruleOptionalColumn= ruleOptionalColumn EOF ;
public final EObject entryRuleOptionalColumn() throws RecognitionException {
EObject current = null;
EObject iv_ruleOptionalColumn = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:418:2: (iv_ruleOptionalColumn= ruleOptionalColumn EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:419:2: iv_ruleOptionalColumn= ruleOptionalColumn EOF
{
newCompositeNode(grammarAccess.getOptionalColumnRule());
pushFollow(FOLLOW_ruleOptionalColumn_in_entryRuleOptionalColumn897);
iv_ruleOptionalColumn=ruleOptionalColumn();
state._fsp--;
current =iv_ruleOptionalColumn;
match(input,EOF,FOLLOW_EOF_in_entryRuleOptionalColumn907);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleOptionalColumn"
// $ANTLR start "ruleOptionalColumn"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:426:1: ruleOptionalColumn returns [EObject current=null] : (otherlv_0= '?=' ( (lv_spec_1_0= ruleColumnSpec ) ) ) ;
public final EObject ruleOptionalColumn() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
EObject lv_spec_1_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:429:28: ( (otherlv_0= '?=' ( (lv_spec_1_0= ruleColumnSpec ) ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:430:1: (otherlv_0= '?=' ( (lv_spec_1_0= ruleColumnSpec ) ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:430:1: (otherlv_0= '?=' ( (lv_spec_1_0= ruleColumnSpec ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:430:3: otherlv_0= '?=' ( (lv_spec_1_0= ruleColumnSpec ) )
{
otherlv_0=(Token)match(input,19,FOLLOW_19_in_ruleOptionalColumn944);
newLeafNode(otherlv_0, grammarAccess.getOptionalColumnAccess().getQuestionMarkEqualsSignKeyword_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:434:1: ( (lv_spec_1_0= ruleColumnSpec ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:435:1: (lv_spec_1_0= ruleColumnSpec )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:435:1: (lv_spec_1_0= ruleColumnSpec )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:436:3: lv_spec_1_0= ruleColumnSpec
{
newCompositeNode(grammarAccess.getOptionalColumnAccess().getSpecColumnSpecParserRuleCall_1_0());
pushFollow(FOLLOW_ruleColumnSpec_in_ruleOptionalColumn965);
lv_spec_1_0=ruleColumnSpec();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getOptionalColumnRule());
}
set(
current,
"spec",
lv_spec_1_0,
"ColumnSpec");
afterParserOrEnumRuleCall();
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleOptionalColumn"
// $ANTLR start "entryRuleColumnSpec"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:460:1: entryRuleColumnSpec returns [EObject current=null] : iv_ruleColumnSpec= ruleColumnSpec EOF ;
public final EObject entryRuleColumnSpec() throws RecognitionException {
EObject current = null;
EObject iv_ruleColumnSpec = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:461:2: (iv_ruleColumnSpec= ruleColumnSpec EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:462:2: iv_ruleColumnSpec= ruleColumnSpec EOF
{
newCompositeNode(grammarAccess.getColumnSpecRule());
pushFollow(FOLLOW_ruleColumnSpec_in_entryRuleColumnSpec1001);
iv_ruleColumnSpec=ruleColumnSpec();
state._fsp--;
current =iv_ruleColumnSpec;
match(input,EOF,FOLLOW_EOF_in_entryRuleColumnSpec1011);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleColumnSpec"
// $ANTLR start "ruleColumnSpec"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:469:1: ruleColumnSpec returns [EObject current=null] : (this_RowSpec_0= ruleRowSpec | this_BlockSpec_1= ruleBlockSpec ) ;
public final EObject ruleColumnSpec() throws RecognitionException {
EObject current = null;
EObject this_RowSpec_0 = null;
EObject this_BlockSpec_1 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:472:28: ( (this_RowSpec_0= ruleRowSpec | this_BlockSpec_1= ruleBlockSpec ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:473:1: (this_RowSpec_0= ruleRowSpec | this_BlockSpec_1= ruleBlockSpec )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:473:1: (this_RowSpec_0= ruleRowSpec | this_BlockSpec_1= ruleBlockSpec )
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==20) ) {
alt6=1;
}
else if ( (LA6_0==14) ) {
alt6=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 6, 0, input);
throw nvae;
}
switch (alt6) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:474:5: this_RowSpec_0= ruleRowSpec
{
newCompositeNode(grammarAccess.getColumnSpecAccess().getRowSpecParserRuleCall_0());
pushFollow(FOLLOW_ruleRowSpec_in_ruleColumnSpec1058);
this_RowSpec_0=ruleRowSpec();
state._fsp--;
current = this_RowSpec_0;
afterParserOrEnumRuleCall();
}
break;
case 2 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:484:5: this_BlockSpec_1= ruleBlockSpec
{
newCompositeNode(grammarAccess.getColumnSpecAccess().getBlockSpecParserRuleCall_1());
pushFollow(FOLLOW_ruleBlockSpec_in_ruleColumnSpec1085);
this_BlockSpec_1=ruleBlockSpec();
state._fsp--;
current = this_BlockSpec_1;
afterParserOrEnumRuleCall();
}
break;
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleColumnSpec"
// $ANTLR start "entryRuleRowSpec"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:500:1: entryRuleRowSpec returns [EObject current=null] : iv_ruleRowSpec= ruleRowSpec EOF ;
public final EObject entryRuleRowSpec() throws RecognitionException {
EObject current = null;
EObject iv_ruleRowSpec = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:501:2: (iv_ruleRowSpec= ruleRowSpec EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:502:2: iv_ruleRowSpec= ruleRowSpec EOF
{
newCompositeNode(grammarAccess.getRowSpecRule());
pushFollow(FOLLOW_ruleRowSpec_in_entryRuleRowSpec1120);
iv_ruleRowSpec=ruleRowSpec();
state._fsp--;
current =iv_ruleRowSpec;
match(input,EOF,FOLLOW_EOF_in_entryRuleRowSpec1130);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRowSpec"
// $ANTLR start "ruleRowSpec"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:509:1: ruleRowSpec returns [EObject current=null] : (otherlv_0= 'column' ( (lv_header_1_0= RULE_STRING ) ) otherlv_2= ':' ( (lv_syntax_3_0= ruleSyntax ) ) ) ;
public final EObject ruleRowSpec() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_header_1_0=null;
Token otherlv_2=null;
EObject lv_syntax_3_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:512:28: ( (otherlv_0= 'column' ( (lv_header_1_0= RULE_STRING ) ) otherlv_2= ':' ( (lv_syntax_3_0= ruleSyntax ) ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:513:1: (otherlv_0= 'column' ( (lv_header_1_0= RULE_STRING ) ) otherlv_2= ':' ( (lv_syntax_3_0= ruleSyntax ) ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:513:1: (otherlv_0= 'column' ( (lv_header_1_0= RULE_STRING ) ) otherlv_2= ':' ( (lv_syntax_3_0= ruleSyntax ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:513:3: otherlv_0= 'column' ( (lv_header_1_0= RULE_STRING ) ) otherlv_2= ':' ( (lv_syntax_3_0= ruleSyntax ) )
{
otherlv_0=(Token)match(input,20,FOLLOW_20_in_ruleRowSpec1167);
newLeafNode(otherlv_0, grammarAccess.getRowSpecAccess().getColumnKeyword_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:517:1: ( (lv_header_1_0= RULE_STRING ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:518:1: (lv_header_1_0= RULE_STRING )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:518:1: (lv_header_1_0= RULE_STRING )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:519:3: lv_header_1_0= RULE_STRING
{
lv_header_1_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_ruleRowSpec1184);
newLeafNode(lv_header_1_0, grammarAccess.getRowSpecAccess().getHeaderSTRINGTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getRowSpecRule());
}
setWithLastConsumed(
current,
"header",
lv_header_1_0,
"STRING");
}
}
otherlv_2=(Token)match(input,12,FOLLOW_12_in_ruleRowSpec1201);
newLeafNode(otherlv_2, grammarAccess.getRowSpecAccess().getColonKeyword_2());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:539:1: ( (lv_syntax_3_0= ruleSyntax ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:540:1: (lv_syntax_3_0= ruleSyntax )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:540:1: (lv_syntax_3_0= ruleSyntax )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:541:3: lv_syntax_3_0= ruleSyntax
{
newCompositeNode(grammarAccess.getRowSpecAccess().getSyntaxSyntaxParserRuleCall_3_0());
pushFollow(FOLLOW_ruleSyntax_in_ruleRowSpec1222);
lv_syntax_3_0=ruleSyntax();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getRowSpecRule());
}
set(
current,
"syntax",
lv_syntax_3_0,
"Syntax");
afterParserOrEnumRuleCall();
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRowSpec"
// $ANTLR start "entryRuleBlockSpec"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:565:1: entryRuleBlockSpec returns [EObject current=null] : iv_ruleBlockSpec= ruleBlockSpec EOF ;
public final EObject entryRuleBlockSpec() throws RecognitionException {
EObject current = null;
EObject iv_ruleBlockSpec = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:566:2: (iv_ruleBlockSpec= ruleBlockSpec EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:567:2: iv_ruleBlockSpec= ruleBlockSpec EOF
{
newCompositeNode(grammarAccess.getBlockSpecRule());
pushFollow(FOLLOW_ruleBlockSpec_in_entryRuleBlockSpec1258);
iv_ruleBlockSpec=ruleBlockSpec();
state._fsp--;
current =iv_ruleBlockSpec;
match(input,EOF,FOLLOW_EOF_in_entryRuleBlockSpec1268);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleBlockSpec"
// $ANTLR start "ruleBlockSpec"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:574:1: ruleBlockSpec returns [EObject current=null] : (otherlv_0= 'block' ( (otherlv_1= RULE_ID ) ) ) ;
public final EObject ruleBlockSpec() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:577:28: ( (otherlv_0= 'block' ( (otherlv_1= RULE_ID ) ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:578:1: (otherlv_0= 'block' ( (otherlv_1= RULE_ID ) ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:578:1: (otherlv_0= 'block' ( (otherlv_1= RULE_ID ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:578:3: otherlv_0= 'block' ( (otherlv_1= RULE_ID ) )
{
otherlv_0=(Token)match(input,14,FOLLOW_14_in_ruleBlockSpec1305);
newLeafNode(otherlv_0, grammarAccess.getBlockSpecAccess().getBlockKeyword_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:582:1: ( (otherlv_1= RULE_ID ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:583:1: (otherlv_1= RULE_ID )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:583:1: (otherlv_1= RULE_ID )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:584:3: otherlv_1= RULE_ID
{
if (current==null) {
current = createModelElement(grammarAccess.getBlockSpecRule());
}
otherlv_1=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleBlockSpec1325);
newLeafNode(otherlv_1, grammarAccess.getBlockSpecAccess().getKindBlockCrossReference_1_0());
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleBlockSpec"
// $ANTLR start "entryRuleSyntax"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:603:1: entryRuleSyntax returns [EObject current=null] : iv_ruleSyntax= ruleSyntax EOF ;
public final EObject entryRuleSyntax() throws RecognitionException {
EObject current = null;
EObject iv_ruleSyntax = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:604:2: (iv_ruleSyntax= ruleSyntax EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:605:2: iv_ruleSyntax= ruleSyntax EOF
{
newCompositeNode(grammarAccess.getSyntaxRule());
pushFollow(FOLLOW_ruleSyntax_in_entryRuleSyntax1361);
iv_ruleSyntax=ruleSyntax();
state._fsp--;
current =iv_ruleSyntax;
match(input,EOF,FOLLOW_EOF_in_entryRuleSyntax1371);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleSyntax"
// $ANTLR start "ruleSyntax"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:612:1: ruleSyntax returns [EObject current=null] : ( ( (lv_is_id_0_0= 'ID' ) ) | ( (lv_is_string_1_0= 'STR' ) ) | ( (lv_is_int_2_0= 'INT' ) ) | (otherlv_3= '@' ( (lv_token_4_0= RULE_STRING ) ) ) | (otherlv_5= 'rule' ( (otherlv_6= RULE_ID ) ) ) ) ;
public final EObject ruleSyntax() throws RecognitionException {
EObject current = null;
Token lv_is_id_0_0=null;
Token lv_is_string_1_0=null;
Token lv_is_int_2_0=null;
Token otherlv_3=null;
Token lv_token_4_0=null;
Token otherlv_5=null;
Token otherlv_6=null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:615:28: ( ( ( (lv_is_id_0_0= 'ID' ) ) | ( (lv_is_string_1_0= 'STR' ) ) | ( (lv_is_int_2_0= 'INT' ) ) | (otherlv_3= '@' ( (lv_token_4_0= RULE_STRING ) ) ) | (otherlv_5= 'rule' ( (otherlv_6= RULE_ID ) ) ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:616:1: ( ( (lv_is_id_0_0= 'ID' ) ) | ( (lv_is_string_1_0= 'STR' ) ) | ( (lv_is_int_2_0= 'INT' ) ) | (otherlv_3= '@' ( (lv_token_4_0= RULE_STRING ) ) ) | (otherlv_5= 'rule' ( (otherlv_6= RULE_ID ) ) ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:616:1: ( ( (lv_is_id_0_0= 'ID' ) ) | ( (lv_is_string_1_0= 'STR' ) ) | ( (lv_is_int_2_0= 'INT' ) ) | (otherlv_3= '@' ( (lv_token_4_0= RULE_STRING ) ) ) | (otherlv_5= 'rule' ( (otherlv_6= RULE_ID ) ) ) )
int alt7=5;
switch ( input.LA(1) ) {
case 21:
{
alt7=1;
}
break;
case 22:
{
alt7=2;
}
break;
case 23:
{
alt7=3;
}
break;
case 24:
{
alt7=4;
}
break;
case 25:
{
alt7=5;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 7, 0, input);
throw nvae;
}
switch (alt7) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:616:2: ( (lv_is_id_0_0= 'ID' ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:616:2: ( (lv_is_id_0_0= 'ID' ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:617:1: (lv_is_id_0_0= 'ID' )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:617:1: (lv_is_id_0_0= 'ID' )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:618:3: lv_is_id_0_0= 'ID'
{
lv_is_id_0_0=(Token)match(input,21,FOLLOW_21_in_ruleSyntax1414);
newLeafNode(lv_is_id_0_0, grammarAccess.getSyntaxAccess().getIs_idIDKeyword_0_0());
if (current==null) {
current = createModelElement(grammarAccess.getSyntaxRule());
}
setWithLastConsumed(current, "is_id", true, "ID");
}
}
}
break;
case 2 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:632:6: ( (lv_is_string_1_0= 'STR' ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:632:6: ( (lv_is_string_1_0= 'STR' ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:633:1: (lv_is_string_1_0= 'STR' )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:633:1: (lv_is_string_1_0= 'STR' )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:634:3: lv_is_string_1_0= 'STR'
{
lv_is_string_1_0=(Token)match(input,22,FOLLOW_22_in_ruleSyntax1451);
newLeafNode(lv_is_string_1_0, grammarAccess.getSyntaxAccess().getIs_stringSTRKeyword_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getSyntaxRule());
}
setWithLastConsumed(current, "is_string", true, "STR");
}
}
}
break;
case 3 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:648:6: ( (lv_is_int_2_0= 'INT' ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:648:6: ( (lv_is_int_2_0= 'INT' ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:649:1: (lv_is_int_2_0= 'INT' )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:649:1: (lv_is_int_2_0= 'INT' )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:650:3: lv_is_int_2_0= 'INT'
{
lv_is_int_2_0=(Token)match(input,23,FOLLOW_23_in_ruleSyntax1488);
newLeafNode(lv_is_int_2_0, grammarAccess.getSyntaxAccess().getIs_intINTKeyword_2_0());
if (current==null) {
current = createModelElement(grammarAccess.getSyntaxRule());
}
setWithLastConsumed(current, "is_int", true, "INT");
}
}
}
break;
case 4 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:664:6: (otherlv_3= '@' ( (lv_token_4_0= RULE_STRING ) ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:664:6: (otherlv_3= '@' ( (lv_token_4_0= RULE_STRING ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:664:8: otherlv_3= '@' ( (lv_token_4_0= RULE_STRING ) )
{
otherlv_3=(Token)match(input,24,FOLLOW_24_in_ruleSyntax1520);
newLeafNode(otherlv_3, grammarAccess.getSyntaxAccess().getCommercialAtKeyword_3_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:668:1: ( (lv_token_4_0= RULE_STRING ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:669:1: (lv_token_4_0= RULE_STRING )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:669:1: (lv_token_4_0= RULE_STRING )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:670:3: lv_token_4_0= RULE_STRING
{
lv_token_4_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_ruleSyntax1537);
newLeafNode(lv_token_4_0, grammarAccess.getSyntaxAccess().getTokenSTRINGTerminalRuleCall_3_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getSyntaxRule());
}
setWithLastConsumed(
current,
"token",
lv_token_4_0,
"STRING");
}
}
}
}
break;
case 5 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:687:6: (otherlv_5= 'rule' ( (otherlv_6= RULE_ID ) ) )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:687:6: (otherlv_5= 'rule' ( (otherlv_6= RULE_ID ) ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:687:8: otherlv_5= 'rule' ( (otherlv_6= RULE_ID ) )
{
otherlv_5=(Token)match(input,25,FOLLOW_25_in_ruleSyntax1562);
newLeafNode(otherlv_5, grammarAccess.getSyntaxAccess().getRuleKeyword_4_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:691:1: ( (otherlv_6= RULE_ID ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:692:1: (otherlv_6= RULE_ID )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:692:1: (otherlv_6= RULE_ID )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:693:3: otherlv_6= RULE_ID
{
if (current==null) {
current = createModelElement(grammarAccess.getSyntaxRule());
}
otherlv_6=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleSyntax1582);
newLeafNode(otherlv_6, grammarAccess.getSyntaxAccess().getRuleRuleCrossReference_4_1_0());
}
}
}
}
break;
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleSyntax"
// $ANTLR start "entryRuleRule"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:712:1: entryRuleRule returns [EObject current=null] : iv_ruleRule= ruleRule EOF ;
public final EObject entryRuleRule() throws RecognitionException {
EObject current = null;
EObject iv_ruleRule = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:713:2: (iv_ruleRule= ruleRule EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:714:2: iv_ruleRule= ruleRule EOF
{
newCompositeNode(grammarAccess.getRuleRule());
pushFollow(FOLLOW_ruleRule_in_entryRuleRule1619);
iv_ruleRule=ruleRule();
state._fsp--;
current =iv_ruleRule;
match(input,EOF,FOLLOW_EOF_in_entryRuleRule1629);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRule"
// $ANTLR start "ruleRule"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:721:1: ruleRule returns [EObject current=null] : (otherlv_0= 'rule' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_alternatives_3_0= ruleSyntaxSeq ) ) (otherlv_4= '|' ( (lv_alternatives_5_0= ruleSyntaxSeq ) ) )* otherlv_6= ';' ) ;
public final EObject ruleRule() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
Token otherlv_6=null;
EObject lv_alternatives_3_0 = null;
EObject lv_alternatives_5_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:724:28: ( (otherlv_0= 'rule' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_alternatives_3_0= ruleSyntaxSeq ) ) (otherlv_4= '|' ( (lv_alternatives_5_0= ruleSyntaxSeq ) ) )* otherlv_6= ';' ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:725:1: (otherlv_0= 'rule' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_alternatives_3_0= ruleSyntaxSeq ) ) (otherlv_4= '|' ( (lv_alternatives_5_0= ruleSyntaxSeq ) ) )* otherlv_6= ';' )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:725:1: (otherlv_0= 'rule' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_alternatives_3_0= ruleSyntaxSeq ) ) (otherlv_4= '|' ( (lv_alternatives_5_0= ruleSyntaxSeq ) ) )* otherlv_6= ';' )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:725:3: otherlv_0= 'rule' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_alternatives_3_0= ruleSyntaxSeq ) ) (otherlv_4= '|' ( (lv_alternatives_5_0= ruleSyntaxSeq ) ) )* otherlv_6= ';'
{
otherlv_0=(Token)match(input,25,FOLLOW_25_in_ruleRule1666);
newLeafNode(otherlv_0, grammarAccess.getRuleAccess().getRuleKeyword_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:729:1: ( (lv_name_1_0= RULE_ID ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:730:1: (lv_name_1_0= RULE_ID )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:730:1: (lv_name_1_0= RULE_ID )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:731:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRule1683);
newLeafNode(lv_name_1_0, grammarAccess.getRuleAccess().getNameIDTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getRuleRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"ID");
}
}
otherlv_2=(Token)match(input,12,FOLLOW_12_in_ruleRule1700);
newLeafNode(otherlv_2, grammarAccess.getRuleAccess().getColonKeyword_2());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:751:1: ( (lv_alternatives_3_0= ruleSyntaxSeq ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:752:1: (lv_alternatives_3_0= ruleSyntaxSeq )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:752:1: (lv_alternatives_3_0= ruleSyntaxSeq )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:753:3: lv_alternatives_3_0= ruleSyntaxSeq
{
newCompositeNode(grammarAccess.getRuleAccess().getAlternativesSyntaxSeqParserRuleCall_3_0());
pushFollow(FOLLOW_ruleSyntaxSeq_in_ruleRule1721);
lv_alternatives_3_0=ruleSyntaxSeq();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getRuleRule());
}
add(
current,
"alternatives",
lv_alternatives_3_0,
"SyntaxSeq");
afterParserOrEnumRuleCall();
}
}
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:769:2: (otherlv_4= '|' ( (lv_alternatives_5_0= ruleSyntaxSeq ) ) )*
loop8:
do {
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==26) ) {
alt8=1;
}
switch (alt8) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:769:4: otherlv_4= '|' ( (lv_alternatives_5_0= ruleSyntaxSeq ) )
{
otherlv_4=(Token)match(input,26,FOLLOW_26_in_ruleRule1734);
newLeafNode(otherlv_4, grammarAccess.getRuleAccess().getVerticalLineKeyword_4_0());
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:773:1: ( (lv_alternatives_5_0= ruleSyntaxSeq ) )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:774:1: (lv_alternatives_5_0= ruleSyntaxSeq )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:774:1: (lv_alternatives_5_0= ruleSyntaxSeq )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:775:3: lv_alternatives_5_0= ruleSyntaxSeq
{
newCompositeNode(grammarAccess.getRuleAccess().getAlternativesSyntaxSeqParserRuleCall_4_1_0());
pushFollow(FOLLOW_ruleSyntaxSeq_in_ruleRule1755);
lv_alternatives_5_0=ruleSyntaxSeq();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getRuleRule());
}
add(
current,
"alternatives",
lv_alternatives_5_0,
"SyntaxSeq");
afterParserOrEnumRuleCall();
}
}
}
break;
default :
break loop8;
}
} while (true);
otherlv_6=(Token)match(input,13,FOLLOW_13_in_ruleRule1769);
newLeafNode(otherlv_6, grammarAccess.getRuleAccess().getSemicolonKeyword_5());
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRule"
// $ANTLR start "entryRuleSyntaxSeq"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:803:1: entryRuleSyntaxSeq returns [EObject current=null] : iv_ruleSyntaxSeq= ruleSyntaxSeq EOF ;
public final EObject entryRuleSyntaxSeq() throws RecognitionException {
EObject current = null;
EObject iv_ruleSyntaxSeq = null;
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:804:2: (iv_ruleSyntaxSeq= ruleSyntaxSeq EOF )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:805:2: iv_ruleSyntaxSeq= ruleSyntaxSeq EOF
{
newCompositeNode(grammarAccess.getSyntaxSeqRule());
pushFollow(FOLLOW_ruleSyntaxSeq_in_entryRuleSyntaxSeq1805);
iv_ruleSyntaxSeq=ruleSyntaxSeq();
state._fsp--;
current =iv_ruleSyntaxSeq;
match(input,EOF,FOLLOW_EOF_in_entryRuleSyntaxSeq1815);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleSyntaxSeq"
// $ANTLR start "ruleSyntaxSeq"
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:812:1: ruleSyntaxSeq returns [EObject current=null] : ( (lv_parts_0_0= ruleSyntax ) )+ ;
public final EObject ruleSyntaxSeq() throws RecognitionException {
EObject current = null;
EObject lv_parts_0_0 = null;
enterRule();
try {
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:815:28: ( ( (lv_parts_0_0= ruleSyntax ) )+ )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:816:1: ( (lv_parts_0_0= ruleSyntax ) )+
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:816:1: ( (lv_parts_0_0= ruleSyntax ) )+
int cnt9=0;
loop9:
do {
int alt9=2;
int LA9_0 = input.LA(1);
if ( ((LA9_0>=21 && LA9_0<=25)) ) {
alt9=1;
}
switch (alt9) {
case 1 :
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:817:1: (lv_parts_0_0= ruleSyntax )
{
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:817:1: (lv_parts_0_0= ruleSyntax )
// ../dk.sdu.mmmi.sgl/src-gen/dk/sdu/mmmi/sgl/parser/antlr/internal/InternalSpreadsheetGrammarLanguage.g:818:3: lv_parts_0_0= ruleSyntax
{
newCompositeNode(grammarAccess.getSyntaxSeqAccess().getPartsSyntaxParserRuleCall_0());
pushFollow(FOLLOW_ruleSyntax_in_ruleSyntaxSeq1860);
lv_parts_0_0=ruleSyntax();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getSyntaxSeqRule());
}
add(
current,
"parts",
lv_parts_0_0,
"Syntax");
afterParserOrEnumRuleCall();
}
}
break;
default :
if ( cnt9 >= 1 ) break loop9;
EarlyExitException eee =
new EarlyExitException(9, input);
throw eee;
}
cnt9++;
} while (true);
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleSyntaxSeq"
// Delegated rules
public static final BitSet FOLLOW_ruleGrammar_in_entryRuleGrammar75 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleGrammar85 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_11_in_ruleGrammar122 = new BitSet(new long[]{0x0000000000000010L});
public static final BitSet FOLLOW_RULE_ID_in_ruleGrammar139 = new BitSet(new long[]{0x0000000000001000L});
public static final BitSet FOLLOW_12_in_ruleGrammar156 = new BitSet(new long[]{0x0000000000000010L});
public static final BitSet FOLLOW_RULE_ID_in_ruleGrammar176 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_13_in_ruleGrammar188 = new BitSet(new long[]{0x0000000002004002L});
public static final BitSet FOLLOW_ruleElement_in_ruleGrammar209 = new BitSet(new long[]{0x0000000002004002L});
public static final BitSet FOLLOW_ruleElement_in_entryRuleElement246 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleElement256 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleBlock_in_ruleElement303 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleRule_in_ruleElement330 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleBlock_in_entryRuleBlock365 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleBlock375 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_14_in_ruleBlock412 = new BitSet(new long[]{0x0000000000000010L});
public static final BitSet FOLLOW_RULE_ID_in_ruleBlock429 = new BitSet(new long[]{0x0000000000008000L});
public static final BitSet FOLLOW_15_in_ruleBlock446 = new BitSet(new long[]{0x0000000000010010L});
public static final BitSet FOLLOW_ruleColumn_in_ruleBlock467 = new BitSet(new long[]{0x0000000000010010L});
public static final BitSet FOLLOW_16_in_ruleBlock480 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleColumn_in_entryRuleColumn516 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleColumn526 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_ID_in_ruleColumn568 = new BitSet(new long[]{0x00000000000E0000L});
public static final BitSet FOLLOW_17_in_ruleColumn591 = new BitSet(new long[]{0x00000000000E0000L});
public static final BitSet FOLLOW_ruleColumnDefinition_in_ruleColumn626 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_13_in_ruleColumn638 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleColumnDefinition_in_entryRuleColumnDefinition674 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleColumnDefinition684 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleMandatoryColumn_in_ruleColumnDefinition731 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleOptionalColumn_in_ruleColumnDefinition758 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleMandatoryColumn_in_entryRuleMandatoryColumn793 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleMandatoryColumn803 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_18_in_ruleMandatoryColumn840 = new BitSet(new long[]{0x0000000000104000L});
public static final BitSet FOLLOW_ruleColumnSpec_in_ruleMandatoryColumn861 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleOptionalColumn_in_entryRuleOptionalColumn897 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleOptionalColumn907 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_19_in_ruleOptionalColumn944 = new BitSet(new long[]{0x0000000000104000L});
public static final BitSet FOLLOW_ruleColumnSpec_in_ruleOptionalColumn965 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleColumnSpec_in_entryRuleColumnSpec1001 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleColumnSpec1011 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleRowSpec_in_ruleColumnSpec1058 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleBlockSpec_in_ruleColumnSpec1085 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleRowSpec_in_entryRuleRowSpec1120 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleRowSpec1130 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_20_in_ruleRowSpec1167 = new BitSet(new long[]{0x0000000000000020L});
public static final BitSet FOLLOW_RULE_STRING_in_ruleRowSpec1184 = new BitSet(new long[]{0x0000000000001000L});
public static final BitSet FOLLOW_12_in_ruleRowSpec1201 = new BitSet(new long[]{0x0000000003E00000L});
public static final BitSet FOLLOW_ruleSyntax_in_ruleRowSpec1222 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleBlockSpec_in_entryRuleBlockSpec1258 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleBlockSpec1268 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_14_in_ruleBlockSpec1305 = new BitSet(new long[]{0x0000000000000010L});
public static final BitSet FOLLOW_RULE_ID_in_ruleBlockSpec1325 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleSyntax_in_entryRuleSyntax1361 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleSyntax1371 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_21_in_ruleSyntax1414 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_22_in_ruleSyntax1451 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_23_in_ruleSyntax1488 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_24_in_ruleSyntax1520 = new BitSet(new long[]{0x0000000000000020L});
public static final BitSet FOLLOW_RULE_STRING_in_ruleSyntax1537 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_25_in_ruleSyntax1562 = new BitSet(new long[]{0x0000000000000010L});
public static final BitSet FOLLOW_RULE_ID_in_ruleSyntax1582 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleRule_in_entryRuleRule1619 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleRule1629 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_25_in_ruleRule1666 = new BitSet(new long[]{0x0000000000000010L});
public static final BitSet FOLLOW_RULE_ID_in_ruleRule1683 = new BitSet(new long[]{0x0000000000001000L});
public static final BitSet FOLLOW_12_in_ruleRule1700 = new BitSet(new long[]{0x0000000003E00000L});
public static final BitSet FOLLOW_ruleSyntaxSeq_in_ruleRule1721 = new BitSet(new long[]{0x0000000004002000L});
public static final BitSet FOLLOW_26_in_ruleRule1734 = new BitSet(new long[]{0x0000000003E00000L});
public static final BitSet FOLLOW_ruleSyntaxSeq_in_ruleRule1755 = new BitSet(new long[]{0x0000000004002000L});
public static final BitSet FOLLOW_13_in_ruleRule1769 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleSyntaxSeq_in_entryRuleSyntaxSeq1805 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleSyntaxSeq1815 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleSyntax_in_ruleSyntaxSeq1860 = new BitSet(new long[]{0x0000000003E00002L});
} | [
"[email protected]"
] | |
9663dd542a308a3c835c1ff9d6fb5b147f0fc4d5 | 4c19dad1062c9728c347b80a0e04e924d7b9f2d4 | /app/src/main/java/com/example/cloudlet/ingunibo/cloudlettestapp/SendPositionsThread.java | 6e8d7b938b3844d6bcf5fc3274e49c5c3aa20265 | [] | no_license | solimand/CloudletTestApp | e7d459529b340e0f7737fe7ecf6018de0be1627c | 2b157ee9458b3bbf179de8468b0977e1b52a7055 | refs/heads/master | 2021-01-23T07:55:12.075019 | 2017-03-15T16:41:42 | 2017-03-15T16:41:42 | 80,513,587 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,482 | java | package com.example.cloudlet.ingunibo.cloudlettestapp;
import android.util.Log;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
public class SendPositionsThread extends Thread {
private static final int CLOUDLET_SERVER_POSITIONS_PORT=11111;
private static final String TAG = "SendPositionsThread";
//DEBUG
// private static final String cloudletAddr="homespartaco25.duckdns.org";
//private static final String cloudletAddr="137.204.57.29";
private Socket sendPositionsSocket;
private BufferedReader in;
//private PrintWriter out;
private ObjectOutputStream out;
private InetAddress discoveredAddr;
private double [][] positionsToSend = new double
[CloudletClientConfiguration.NUM_POSITIONS][2];
public SendPositionsThread(InetAddress inetaddr, double [][] positions){
super();
// this.discoveredAddr=inetaddr;
//DEBUG TODO Delete
try{
this.discoveredAddr=InetAddress.getByName("137.204.57.29");
}
catch(UnknownHostException uhe){
Log.e(TAG, "UnknownHostException ");
uhe.printStackTrace();
}
this.positionsToSend=positions;
}
@Override
public void run() {
try {
// sendPositionsSocket = new Socket(this.discoveredAddr,
sendPositionsSocket = new Socket("137.204.57.29",
CLOUDLET_SERVER_POSITIONS_PORT);
in = new BufferedReader(new InputStreamReader(sendPositionsSocket
.getInputStream()));
//out = new PrintWriter(sendPositionsSocket.getOutputStream());
out = new ObjectOutputStream(sendPositionsSocket.getOutputStream());
out.writeObject(this.positionsToSend);
out.flush();
Log.d(TAG, "Completed trasmission to cloudlet.");
stopConnection();
}
catch (IOException ioe) {
Log.e(TAG, "IOException during send data position to the cloud, EXIT");
ioe.printStackTrace();
}
}
/*garbage collector*/
public void stopConnection() throws IOException{
if (sendPositionsSocket!=null) sendPositionsSocket.close();
if(in!=null) in.close();
if(out!=null) out.close();
}
}
| [
"[email protected]"
] | |
cf5bb9db58bb8dd22dd187f43681662eb3ca914f | 5653dcc4a81180b2ac00be0cb03efd62e8538551 | /src/main/java/com/catalyticds/credstash/DecryptedSecret.java | cbc56337f6acdeefdfb49b65bee78d7362ed1ed9 | [
"Apache-2.0"
] | permissive | catalyticds/spring-cloud-credstash | 276864b49ccea22dbc54782ce856c0480a3bc4ac | 2cfd2b6ab8ce61a9905728690e5d13ceff2a4a74 | refs/heads/master | 2021-06-24T01:14:37.155456 | 2019-08-09T15:16:04 | 2019-08-09T15:16:04 | 104,360,694 | 1 | 1 | Apache-2.0 | 2019-08-09T15:16:05 | 2017-09-21T14:45:46 | Java | UTF-8 | Java | false | false | 1,632 | java | package com.catalyticds.credstash;
/**
* @author reesbyars on 9/30/17.
*/
public class DecryptedSecret {
private final String table;
private final String name;
private final String version;
private final String secret;
DecryptedSecret(
String table,
String name,
String version,
String secret) {
this.table = table;
this.name = name;
this.version = version;
this.secret = secret;
}
public String getTable() {
return table;
}
public String getName() {
return name;
}
public String getVersion() {
return version;
}
public String getSecret() {
return secret;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DecryptedSecret that = (DecryptedSecret) o;
return table.equals(that.table) &&
name.equals(that.name) &&
version.equals(that.version) &&
secret.equals(that.secret);
}
@Override
public int hashCode() {
int result = table.hashCode();
result = 31 * result + name.hashCode();
result = 31 * result + version.hashCode();
result = 31 * result + secret.hashCode();
return result;
}
@Override
public String toString() {
return "DecryptedSecret{" +
"table='" + table + '\'' +
", name='" + name + '\'' +
", version='" + version + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
a0ab579c75dad3043d1329fc8f1349ad1da18149 | a3b2135d5b5c9ae32427c33f1529b0819852d833 | /src/main/java/cn/gongyan/learn/beans/entity/Theme.java | 746d9eb5601306556a86a1f93dec3bbe875b8290 | [] | no_license | gongdadiao/online-learn-system-backend | 64be2a4585cf12cee651f150faebf73822424a66 | 48433e1150149f5ed0304daf7a2531d1f707dfd3 | refs/heads/master | 2022-08-21T05:51:16.940583 | 2020-05-27T07:12:49 | 2020-05-27T07:12:49 | 261,398,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 902 | java | package cn.gongyan.learn.beans.entity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;
@Entity
@Table(name = "theme")
@Getter
@Setter
@JsonIgnoreProperties(value = { "handler","hibernateLazyInitializer" }, ignoreUnknown = true)
@DynamicInsert
public class Theme {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "theme_id")
private Integer themeId;
@Column(name = "theme_class_id")
private String themeClassId;
@Column(name = "theme_name")
private String themeName;
@Column(name = "theme_seq")
private Long themeSeq;
@Column(name = "theme_description")
private String themeDescription;
} | [
"[email protected]"
] | |
bbdf6c17b482bbfc8a268711a8d237138c162154 | 3e1cb853e6388477997e38850843636c27843e3b | /src/main/java/com/anhvv/hibernate/example/ActionType.java | efd93d9e25ae7936bf5324556aaaecfbe51eca3c | [] | no_license | vuonganhvu/hibernate-example | db3099be0c2ac0224ad89547d0f0e2919264840b | b747057e4780b0868439882352fc482310d7e462 | refs/heads/master | 2022-12-28T19:57:36.447707 | 2020-10-14T02:34:50 | 2020-10-14T02:34:50 | 261,242,055 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 83 | java | package com.anhvv.hibernate.example;
public enum ActionType {
PAYMENT, TASK
}
| [
"[email protected]"
] | |
bcfe202372e0986a2465fa4dba7d91ffccc02535 | cc654da34e46c6e571f72d66ebbba07b821d170b | /app/src/main/java/com/example/tcm/muke/entity/Menu.java | e8cf91fbe93fe914be0461e672fd35f083f32d0b | [] | no_license | 0606tcm/TravleUI | 1b840df36a3295a9e8f7ae262b9738a6ec4c80ec | 5bc4f8e5e69f4ed878f3dd0acd5cfe5af5c0d854 | refs/heads/master | 2022-11-14T07:43:12.225416 | 2020-07-12T13:20:22 | 2020-07-12T13:20:22 | 279,008,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 263 | java | package com.example.tcm.muke.entity;
/**
* Created by tcm on 2020/7/9.
*/
public class Menu {
public int icon;
public String menuName;
public Menu(int icon, String menuName) {
this.icon = icon;
this.menuName = menuName;
}
}
| [
"[email protected]"
] | |
fcd3ec3b7b3890b0579fe17807bcf8bc06b2e779 | 2624a375473f6fe56233c8560363c286b199416f | /dados/src/mx/com/dominio/Test.java | d85bd499326a9dc7deffa71eadd98458a322f344 | [] | no_license | pablonolasco/Curso-Java-Profundida | 657ed61ab43dfb3f1c6d4a2b13425315de71c03a | 31ef8185ebe85c78d58eac1242cec9747755bb76 | refs/heads/master | 2023-04-02T22:13:42.134222 | 2021-04-18T16:19:50 | 2021-04-18T16:19:50 | 331,140,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,315 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mx.com.dominio;
/**
*
* @author Windows10
*/
public class Test {
public static void main(String[] args) {
int dado1 = 0;
int dado2 = 0;
int b[][] = new int[6][6];
int result = 0;
for (int i = 0; i < b.length; i++) {
System.out.println("-----Persona: " + (i + 1)+"-----");
for (int j = 0; j < b[i].length; j++) {
System.out.println("lanzamiento " + (j + 1));
dado1 = (int) Math.round(Math.random() * 6);
System.out.println("Lanzamiento dado 1:" + dado1);
dado2 = (int) Math.round(Math.random() * 6);
System.out.println("Lanzamiento dado 2:" + dado2);
result = dado1 + dado2;
b[i][j] = result;
}
System.out.println("------------");
System.out.println("");
}
System.out.println("Contenido");
for (int[] fila : b) {
for (int lanzamiento : fila) {
System.out.print(lanzamiento + " ");
}
System.out.println("");
}
}
}
| [
"[email protected]"
] | |
189bd66c6e517f504ed9e7f7ac8f5207ad301688 | fc41b9f670a628aadac91343fb05bfc2cb49dc0f | /src/com/ride/wordfreq/MainClass.java | f315c968fd86a0527e7ac0af8be868984ea2a85c | [] | no_license | Rikhard-Dong/WordFrequency | cb57c8fa3c736436848280b554f36e88219a392d | 61adafb0df242ce467aa870adf816a32b60e3ab0 | refs/heads/master | 2021-01-20T05:13:39.978903 | 2017-04-29T03:56:18 | 2017-04-29T03:56:18 | 89,762,017 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,591 | java | package com.ride.wordfreq;
import java.io.IOException;
import java.util.*;
/**
* Created by ride on 17-4-27.
* 运行
*/
public class MainClass {
private final static String test1 = "txt/test1.txt";
private final static String test2 = "txt/test2.txt";
private final static String dict = "txt/2-2-3lem.txt";
private final static String transDict = "txt/transDict.txt";
private final static String freqTest = "txt/freqTest.txt";
private final static String out2CSV = "txt/out.csv";
private final static String out = "txt/out.txt";
private final static String theOldManAndTheSea = "txt/the old man and the sea.txt";
public static void main(String args[]) {
/*System.out.print(ReadFile.read(test1));
System.out.println(ReadFile.read(test2, "utf-8"));*/
HashMap<String, String> dictMap = Dict.readDict(test1);
String inPut = ReadFile.read(theOldManAndTheSea);
HashMap<String, Integer> freqMap = ParseFile.getFreq(inPut, dictMap);
Map<String, Integer> sortMap;
try {
sortMap = SortMap.sortMap(freqMap);
int i = 0;
for (Map.Entry<String, Integer> entry : sortMap.entrySet()) {
i++;
System.out.println("key=" + entry.getKey() + ", value=" + entry.getValue());
if (i > 20) {
break;
}
}
OutPut.write2CSV(sortMap, out2CSV);
OutPut.write(sortMap, out, transDict);
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
3bd518d941283b94e2e62704a3330c007db68e69 | 7e4e6c0d065d80dc5351bc9f0763d16ad1a3137c | /src/com/yan/design/mode/builder/demo1/MacbookBuilder.java | 108783b137a7101ff3cbb277fad6464024adc50f | [] | no_license | yang163email/DesignModeDemo | d6866467925d6c8bdcb8194611f9d6b0238c9a30 | a6a37c1867aabd06559effc2db8b856c83667b4a | refs/heads/master | 2021-09-05T12:21:46.405160 | 2018-01-27T14:27:25 | 2018-01-27T14:27:25 | 113,465,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | package com.yan.design.mode.builder.demo1;
/**
* @author : 楠GG
* @date : 2017/11/13 22:05
* @description : 具体的builder类,MacbookBuilder
*/
public class MacbookBuilder extends Builder {
private Computer mComputer = new Macbook();
@Override
public void buildBoard(String board) {
mComputer.setBoard(board);
}
@Override
public void buildDisplay(String display) {
mComputer.setDisplay(display);
}
@Override
public void buildOS() {
mComputer.setOS();
}
@Override
public Computer create() {
return mComputer;
}
}
| [
"[email protected]"
] | |
c1c19029cc47cdc08d29f898e339d81229590ae7 | 547d982300bdf45d7c802db676928bddc08c4d1c | /library-rental-project/src/main/java/blog/naver/bluesangil7/book/service/Genre.java | 36af6eb6e2e67a70fbfcf15c1ae0b15935b33ec8 | [] | no_license | bluesang/library | 3304b7417fec0bfa409676f359f298da008f4fe2 | c6c2417066a92815931c6cfc80112c0e8bbbe95f | refs/heads/master | 2021-01-11T16:03:30.876533 | 2017-03-20T08:30:28 | 2017-03-20T08:30:28 | 79,995,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 517 | java | package blog.naver.bluesangil7.book.service;
public class Genre {
private int genreNo;
private String genreName;
public int getGenreNo() {
return genreNo;
}
public void setGenreNo(int genreNo) {
this.genreNo = genreNo;
}
public String getGenreName() {
return genreName;
}
public void setGenreName(String genreName) {
this.genreName = genreName;
}
@Override
public String toString() {
return "Genre [genreNo=" + genreNo + ", genreName=" + genreName + "]";
}
}
| [
"Administrator@smart20106"
] | Administrator@smart20106 |
ca17e8d494eab2780f2bb19f225a2a481986dfb1 | 83000658e56ff09005ae4765d487707dc77d9b29 | /CurrencyConverterAutomationTesting/src/com/neha/seleniumwebdriver/test/Helplink.java | d88d286402dab7f3af2e3bf26af53d5098da63ee | [] | no_license | Neha-Panchal/Testing | f40aa55d075ee854a6a6cca179d8fb57bbb9070f | 3b1559bcac8fe5de5cd030901cc9bb4471ad0a49 | refs/heads/master | 2023-01-21T07:44:43.382111 | 2020-11-30T00:05:37 | 2020-11-30T00:05:37 | 317,067,677 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,355 | java | package com.neha.seleniumwebdriver.test;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class Helplink {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", ".\\driver\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
JavascriptExecutor js = (JavascriptExecutor) driver;
driver.get("https://www1.oanda.com/currency/converter/");
driver.manage().window().maximize();
WebElement Element = driver.findElement(By.linkText("HELP"));
js.executeScript("arguments[0].scrollIntoView();", Element);
//driver.findElement(By.xpath("//a[@href='/help/how-to-use-currency-converter']")).click();
//driver.findElement(By.linkText("HELP")).click();
//new WebDriverWait(driver,30).until(ExpectedConditions.visibilityOfElementLocated(By.partialLinkText("HELP"))).click();
driver.findElement(By.xpath("/html/body/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/div[3]/span[2]/a/span[1]")).click();
}
}
| [
"[email protected]"
] | |
5c048eda0afedf12503a5b4c8f6a2450d8c9cfe6 | 3c1a6bb9d01dea902a437edd9aec673b481960c1 | /DS/Trees/AVL/TreeNode.java | 52d808c12581d8337fe8ccf3521567788b1e575d | [] | no_license | ravishankar15/Algorithms | 8141207dbd6dc10059d7f13b9dd6087b48087424 | b2b3b7bd9e77df370b7acfc1d8db46bfab15eadd | refs/heads/master | 2023-05-31T12:51:54.628870 | 2023-05-14T17:06:43 | 2023-05-14T17:06:43 | 107,365,295 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | public class TreeNode{
private int data;
private int height;
private TreeNode left;
private TreeNode right;
private int count; //For handling duplicates
public TreeNode(int data, TreeNode left, TreeNode right){
this.data = data;
this.left = left;
this.right = right;
height = 1;
}
public int getData() {
return data;
}
public void setData(int data) {
this.data = data;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public TreeNode getLeft() {
return left;
}
public void setLeft(TreeNode left) {
this.left = left;
}
public TreeNode getRight() {
return right;
}
public void setRight(TreeNode right) {
this.right = right;
}
} | [
"[email protected]"
] | |
aecab2ac7b4dfa59d8ef637db78897a984dbefc1 | 738dc7d8fb34cb9d2df16f11f70dccbc79920c91 | /ArrayLab/src/Array.java | 78b4f6ab1816a48089c38af7ec112518628557a2 | [] | no_license | Raptura/CIS-1068 | ea902cfa0544814e6f07ab2018b9eb2c7ac36f1b | 83e0b90c53aa68adff72ed8e8ea0f80ada564afe | refs/heads/master | 2021-01-12T11:37:19.538253 | 2016-10-28T18:34:33 | 2016-10-28T18:34:33 | 72,232,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,174 | java |
public class Array {
int[] array;
public static void main(String[] args){
int[] a = new int[]{12,23,4,5,6,3,3,2,1};
Array arrayObj = new Array(a);
arrayObj.bubbleSort();
arrayObj.print();
int val = arrayObj.binarySearch(12);
System.out.println("12 is found at index:" + val);
}
public Array(int[] array){
this.array = array;
}
public void bubbleSort(){
boolean swapped = true;
int temp;
while (swapped){
swapped = false;
for(int i = 0; i < array.length - 1; i++){
if(array[i] > array[i + 1]){
temp = array[i];
array[i] = array[i+1];
array[i + 1] = temp;
swapped = true;
}
}
}
}
public int binarySearch(int query){
int begin = 0;
int end = array.length - 1;
int mid;
while(begin <= end){
mid = (int) Math.floor((begin + end) / 2);
if(query == array[mid]){
return mid;
}
if(query > array[mid]){
begin = mid + 1;
}
if(query < array[mid]){
end = mid - 1;
}
}
return -1;
}
public void print(){
for(int i = 0; i < array.length; i++){
System.out.println(array[i]);
}
}
} | [
"[email protected]"
] | |
1f99a95eb4b89ded1c66c301ab2508bba14aa39d | 46ef04782c58b3ed1d5565f8ac0007732cddacde | /platform.core/core.session/src/org/modelio/vcore/model/spi/mm/AbstractMofRepositoryMigrator.java | 58bee8ea904e2944f4d13740c615698df1cba37c | [] | no_license | daravi/modelio | 844917412abc21e567ff1e9dd8b50250515d6f4b | 1787c8a836f7e708a5734d8bb5b8a4f1a6008691 | refs/heads/master | 2020-05-26T17:14:03.996764 | 2019-05-23T21:30:10 | 2019-05-23T21:30:45 | 188,309,762 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,265 | java | /*
* Copyright 2013-2018 Modeliosoft
*
* This file is part of Modelio.
*
* Modelio is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Modelio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Modelio. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.modelio.vcore.model.spi.mm;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import org.modelio.vbasic.progress.IModelioProgress;
import org.modelio.vcore.smkernel.mapi.MetamodelVersionDescriptor;
import org.modelio.vcore.smkernel.meta.mof.MofMetamodel;
/**
* Default implementation of {@link IMofRepositoryMigrator} that does nothing.
* @author cma
*/
@objid ("34bad46f-90f1-460f-bbb6-1c71e877b2ff")
public abstract class AbstractMofRepositoryMigrator implements IMofRepositoryMigrator {
@objid ("93ecc77e-9b66-417d-9dd6-03b3dffae92f")
private MetamodelVersionDescriptor fromMetamodel;
@objid ("6f46d606-7f75-487f-9319-1149374e1e70")
private MetamodelVersionDescriptor targetMetamodel;
@objid ("39616f93-325a-4f3f-a61e-cf8b23e271e8")
private MetamodelChangeDescriptor metamodelChangeDescriptor;
/**
* @param fromMetamodel the source metamodel
* @param targetMetamodel the target metamodel
*/
@objid ("dab9b2d8-6853-4bbb-8621-61e32d111ac2")
public AbstractMofRepositoryMigrator(MetamodelVersionDescriptor fromMetamodel, MetamodelVersionDescriptor targetMetamodel) {
this.fromMetamodel = fromMetamodel;
this.targetMetamodel = targetMetamodel;
this.metamodelChangeDescriptor = new MetamodelChangeDescriptor();
}
/**
* @return a resume of metamodel changes between {@link #getSourceMetamodel()} and {@link #getTargetMetamodel()}.
*/
@objid ("99bb457b-cbea-4bbe-b2e9-e24a96246e20")
@Override
public MetamodelChangeDescriptor getMetamodelChanges() {
return this.metamodelChangeDescriptor;
}
/**
* @return the metamodel from which this migration can run.
*/
@objid ("b5cf5ec8-98c5-4e4d-b73f-399139ff777b")
@Override
public MetamodelVersionDescriptor getSourceMetamodel() {
return this.fromMetamodel;
}
/**
* @return the metamodel to which the implementation will migrate the model.
*/
@objid ("8be7763c-21ea-4fe6-8da0-f8d6e181336d")
@Override
public MetamodelVersionDescriptor getTargetMetamodel() {
return this.targetMetamodel;
}
/**
* Modify the metamodel so that it can read the {@link #getSourceMetamodel()} repository.
* @param metamodel the metamodel at the {@link #getTargetMetamodel() target} state.
* @throws org.modelio.vcore.model.spi.mm.MofMigrationException on fatal failure preventing migration
*/
@objid ("1ace3f1f-715c-4ba6-8d40-b818959c8e21")
@Override
public void prepareMetamodel(MofMetamodel metamodel) throws MofMigrationException {
// nothing
}
/**
* Migrates the given repository using the given session.
* @param monitor a progress monitor
* @param session the migration session
*/
@objid ("544f2651-6490-43c5-973a-e77c2daf7cb4")
@Override
public void run(IModelioProgress monitor, IMofSession session) {
// nothing
}
/**
* Set the metamodel changes descriptor.
* @param changes the metamodel changes descriptor.
* @return this instance
*/
@objid ("51fb6e5e-e0dc-4081-832c-bb26c442b750")
public IMofRepositoryMigrator setMetamodelChanges(MetamodelChangeDescriptor changes) {
this.metamodelChangeDescriptor = changes;
return this;
}
@objid ("a0f58c5b-e84e-46a0-a291-8b5972bf4438")
@Override
public String toString() {
return getClass().getSimpleName()+"[from "+getSourceMetamodel()+" to "+getTargetMetamodel()+"]";
}
}
| [
"[email protected]"
] | |
b51103976cc42742ff9035e67bc1dfe3ff4ec1ee | 59b6e9387608822d2a087d718ca8255296fe4afd | /app/src/main/java/com/global/toolbox/clock/ClockAdapter.java | 194c46a8b500dc9ccec0424a65f933de2264ee17 | [] | no_license | VEMTK/new_toolbox_game | bfd41c918170889ded90bbb9d354ea89ac407b4a | d378de8220a23aaab2af0bb504e03001940fda78 | refs/heads/master | 2020-12-02T07:49:45.632413 | 2017-07-10T03:18:20 | 2017-07-10T03:18:20 | 96,731,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,089 | java | package com.global.toolbox.clock;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.global.toolbox.R;
import java.util.List;
/**
* Created by xlc on 2016/10/12.
*/
public class ClockAdapter extends BaseAdapter {
private LayoutInflater layoutInflater;
private List<Clock> mList;
private Context mContext;
public ClockAdapter(Context context, List<Clock> s) {
layoutInflater = LayoutInflater.from(context);
this.mList = s;
this.mContext=context;
}
@Override
public int getCount() {
return mList.size();
}
@Override
public Object getItem(int position) {
return mList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = layoutInflater.inflate(R.layout.clock_time_item, null);
holder.textView = (TextView) convertView.findViewById(R.id.clock_time_text);
holder.jiange = (TextView) convertView.findViewById(R.id.clock_jiange);
holder.current_time = (TextView) convertView.findViewById(R.id.clock_current_time);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.textView.setText(mList.get(position).getTimes());
holder.jiange.setText(mList.get(position).getJiange());
holder.current_time.setText(mList.get(position).getCurrent_time());
return convertView;
}
public final class ViewHolder {
public TextView textView,jiange,current_time;
}
}
| [
"[email protected]"
] | |
6ecf51b28b7130baff0696fb8e438f32129413ac | 181072dbdb1a6a522db7e6e182ac4ed9ad059c86 | /src/main/java/com/KL/member/service/CardService.java | b359f82a79afec599ef13644cc1dbbd06b82e48d | [] | no_license | seongjunLee96/KL | 58f2dbe423744266ddb7bb15ce312d6d1eb0b0ff | 8b6f707e05784c56f3e87b815f3423583c8783b3 | refs/heads/master | 2020-04-02T11:53:12.549963 | 2018-10-23T23:49:54 | 2018-10-23T23:49:54 | 147,130,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,692 | java | package com.KL.member.service;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.ModelAndView;
import com.KL.member.dao.MemberDAO;
import com.KL.member.dao.PtDAO;
import com.KL.member.vo.MemberVO;
import com.KL.member.vo.PtVO;
@Service
public class CardService {
private ModelAndView mav;
@Autowired
private PtService pt;
@Autowired
private BCryptPasswordEncoder passEncoder;
@Autowired
private HttpSession session;
@Autowired
private PtDAO ptDAO;
public ModelAndView ptpay(PtVO ptVO,HttpServletResponse response,String id,String tranl,String title,String start,String end,int price) throws IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
mav = new ModelAndView();
PtVO cardtest2=ptDAO.cardtest(ptVO);
try {
if(ptVO.getId().equals(cardtest2.getId()) ) {
out.println("<script>");
out.println("alert('신청시간에 이미 수강하는 강의가 있습니다.');");
out.println("location.href='pton'");// 이전 페이지로 이동!
out.println("</script>");
out.close();
}else {
if(ptVO.getId().equals(cardtest2.getId()) && ptVO.getTitle().equals(cardtest2.getTitle())){
out.println("<script>");
out.println("alert('동일한강의는 신청이 불가능 합니다.');");
out.println("location.href='pton'");// 이전 페이지로 이동!
out.println("</script>");
out.close();
}
else {
int result = ptDAO.addpt(ptVO);
if (result == 0) {
// 등록 실패하면
mav.setViewName("Pt/ptr");
} else {
// 등록 성공하면
out.println("<script>");
out.println("alert('결제가완료되었습니다..');");
out.println("location.href='pton'");
out.println("</script>");
out.close();
/*mav.addObject("cardtest", cardtest);
mav.setViewName("redirect:/textList"); */
}
} }
}catch(NullPointerException ne){
int result = ptDAO.addpt(ptVO);
if (result == 0) {
// 등록 실패하면
mav.setViewName("ptr");
} else {
// 등록 성공하면
out.println("<script>");
out.println("alert('결제가완료되었습니다..');");
out.println("location.href='pton'");
out.println("</script>");
out.close();
}
}
return mav;
}
}
| [
"[email protected]"
] | |
e21179a55fc962b77cd32e0bdabab4162bf9a226 | 34c02bc58256cc884dd54656147188a5bac8a731 | /Student_DB/StudentDatabase.java | 123839ab91702403b933073a38111c50b8bf0c4d | [] | no_license | Aryangpt007/JWT | 1afadc5543c2389bfc748c0615c7d34d0d4dc41f | da21ed27a22edca1e29cfe20a1c7cfc24d1f5e05 | refs/heads/master | 2020-04-03T06:28:06.467191 | 2018-08-07T19:40:07 | 2018-08-07T19:40:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,092 | java | import java.io.*;
import java.util.*;
class StudentDatabase
{
ArrayList<Student> s, A, B, C, F;
StudentDatabase()
{
s= new ArrayList<Student>();
A= new ArrayList<Student>();
B= new ArrayList<Student>();
C= new ArrayList<Student>();
F= new ArrayList<Student>();
}
void addStu(Student newStu)
{
s.add(newStu);
assignGrades();
}
void editStu(Student newStu, int pos)
{ s.set(pos, newStu); }
int deleteStu(long prn)
{
int ans= searchByPrn(prn);
if(ans==-404)
return -404;
else
s.remove(ans);
return 1;
}
void sortByPrn()
{
Student temp;
for(int i=0; i<s.size(); ++i)
{
for(int j=0; j<s.size()-1-i; ++j)
{
if(s.get(j).prn>s.get(j+1).prn)
{
temp = s.get(j);
s.set(j, s.get(j+1));
s.set(j+1, temp);
}
}
}
}
void sortByMarks()
{
Student temp;
for(int i=0; i<s.size(); ++i)
{
for(int j=0; j<s.size()-1-i; ++j)
{
if(s.get(j).totalMks<s.get(j+1).totalMks)
{
temp = s.get(j);
s.set(j, s.get(j+1));
s.set(j+1, temp);
}
}
}
}
void sortByName()
{
Student temp;
for(int i=0; i<s.size(); ++i)
{
for(int j=0; j<s.size()-1-i; ++j)
{
if(((s.get(j).name).compareTo(s.get(j+1).name)>0))
{
temp = s.get(j);
s.set(j, s.get(j+1));
s.set(j+1, temp);
}
}
}
}
void assignGrades()
{
for(Student x: s)
{
if(x.percentage<40)
x.grade= 'F';
else if(x.percentage<60)
x.grade= 'C';
else if(x.percentage<80)
x.grade= 'B';
else
x.grade= 'A';
}
}
void classify()
{
for(Student x: s)
{
switch(x.grade)
{
case 'A':
A.add(x);
break;
case 'B':
B.add(x);
break;
case 'C':
C.add(x);
break;
case 'F':
F.add(x);
break;
}
}
}
void displayGradeCategory(char grade)
{
assignGrades();
classify();
for(Student x: s)
{
if(x.grade==grade)
display(x);
}
}
int searchByPrn(long prn)
{
boolean found= false;
int position= -1;
for(Student x: s)
{
if(x.prn==prn)
{
found= true;
position= s.indexOf(x);
}
if(found)
break;
}
if(found)
return position;
return -404;
}
int searchByPosition(int pos)
{
if (pos>=0 && pos<s.size())
return pos;
else
return -404;
}
int searchByName(String name)
{
boolean found= false;
int position= -1;
for(Student x: s)
{
if((x.name).equalsIgnoreCase(name))
{
found= true;
position= s.indexOf(x);
}
if(found)
break;
}
if(found)
return position;
return -404;
}
void display(Student s)
{
System.out.println("________________________________________________");
System.out.print("NAME: "+s.name+"\t");
System.out.println("PRN: "+s.prn);
System.out.print("AGE: "+s.age+"\t");
System.out.println("DATE OF BIRTH: "+s.dob);
System.out.println("................................................");
System.out.println("\t\tMARKS");
System.out.println("................................................");
System.out.println("Subject 1\t\t"+s.sub1);
System.out.println("Subject 2\t\t"+s.sub2);
System.out.println("Subject 3\t\t"+s.sub3);
System.out.println("Subject 4\t\t"+s.sub4);
System.out.println("Subject 5\t\t"+s.sub5);
System.out.println("Subject 6\t\t"+s.sub6);
System.out.println("................................................");
System.out.println("PERCENTAGE: "+s.percentage+"\tGRADE: "+s.grade);
System.out.println("................................................");
}
void display(long prn)
{
int found= searchByPrn(prn);
if(found== -404)
System.out.println("Sorry! No student with this PRN");
else
display(s.get(found));
}
void display(int pos)
{
if(pos>=0 && pos<s.size())
display(s.get(pos));
else
System.out.println("Wrong position entered!");
}
void display(String name)
{
int found= searchByName(name);
if(found== -404)
System.out.println("Sorry! No student with this PRN");
else
display(s.get(found));
}
void display()
{
for(Student x: s)
{
display(x);
System.out.println();
}
}
} | [
"[email protected]"
] | |
1004410ac2e95e438654fd9b7778146f8942064b | 64624f404053ee762f404233c2984074092def5e | /mybatis_day03_3_user_OneToMany/src/main/java/com/lqh/domain/User.java | 1fae9901c01a9a462f2d3c9401338f9aad660d95 | [] | no_license | bjlqh/mybatis | 7a6a33cb30a1b8701a8a2b5cef0e48221233c781 | b35641314b17186d43175e143e0cbcf52d37bb19 | refs/heads/master | 2022-07-25T08:38:16.397215 | 2019-06-09T15:54:16 | 2019-06-09T15:54:16 | 191,024,861 | 0 | 0 | null | 2022-06-21T01:15:08 | 2019-06-09T15:43:13 | Java | UTF-8 | Java | false | false | 1,480 | java | package com.lqh.domain;
import java.util.Date;
import java.util.List;
public class User {
private Integer id;
private String username;
private String sex;
private Date birthday;
private String address;
private List<Account> accounts;
public List<Account> getAccounts() {
return accounts;
}
public void setAccounts(List<Account> accounts) {
this.accounts = accounts;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", username='" + username + '\'' +
", sex='" + sex + '\'' +
", birthday=" + birthday +
", address='" + address + '\'' +
", accounts=" + accounts +
'}';
}
}
| [
"[email protected]"
] | |
3be3006c4c30358cbd75e4c7a16c207995088a36 | a4e2fcf2da52f479c2c25164599bbdb2628a1ffa | /soft/sextante_lib/sextante/src/es/unex/sextante/outputs/NullOutputChannel.java | 125ed5256c54601945fade66e42d3650000de4eb | [] | no_license | GRSEB9S/sextante | 126ffc222a2bed9918bae3b59f87f30158b9bbfe | 8ea12c6c40712df01e2e87b02d722d51adb912ea | refs/heads/master | 2021-05-28T19:24:23.306514 | 2013-03-04T15:21:30 | 2013-03-04T15:21:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package es.unex.sextante.outputs;
public class NullOutputChannel
implements
IOutputChannel {
@Override
public String getAsCommandLineParameter() {
return "!";
}
}
| [
"[email protected]"
] | |
a619c3028cbed251530b17addd346aea7a32e9c9 | 6be39fc2c882d0b9269f1530e0650fd3717df493 | /weixin反编译/sources/com/tencent/mm/plugin/appbrand/game/l.java | e2963f5db93c9b4333b8a94260fc0d3dfb68740a | [] | no_license | sir-deng/res | f1819af90b366e8326bf23d1b2f1074dfe33848f | 3cf9b044e1f4744350e5e89648d27247c9dc9877 | refs/heads/master | 2022-06-11T21:54:36.725180 | 2020-05-07T06:03:23 | 2020-05-07T06:03:23 | 155,177,067 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,390 | java | package com.tencent.mm.plugin.appbrand.game;
import android.content.SharedPreferences;
import android.webkit.JavascriptInterface;
import com.tencent.mm.plugin.appbrand.debugger.q;
import com.tencent.mm.plugin.appbrand.g.b;
import com.tencent.mm.plugin.appbrand.g.f;
import com.tencent.mm.plugin.appbrand.j;
import com.tencent.mm.plugin.appbrand.jsapi.d;
import com.tencent.mm.plugin.appbrand.r.h;
import com.tencent.mm.plugin.report.service.g;
import com.tencent.mm.sdk.platformtools.ad;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.storage.c;
public final class l {
boolean jaQ = false;
j jaR;
f jaS;
com.tencent.mm.plugin.appbrand.g.a jaT;
com.tencent.mm.plugin.appbrand.g.a jaU;
private Boolean jaV = null;
private class a {
private a() {
}
/* synthetic */ a(l lVar, byte b) {
this();
}
@JavascriptInterface
public final int create(String str) {
int i;
synchronized (l.this) {
if (!l.this.jaQ || l.this.jaS == null) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "create subContext failed. mStateReady = [%b] mSubContextAddon = [%s]", Boolean.valueOf(l.this.jaQ), l.this.jaS);
i = -1;
} else {
b aek = l.this.jaS.aek();
l lVar = l.this;
if (aek.adY()) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "bindSubContext subContext = [" + aek + "]");
} else if (lVar.jaU == null) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "initSubJSContext mBridgeHolder == null");
} else {
lVar.jaU.a(aek, "WeixinJSContext");
}
String str2 = "";
if (!lVar.aeq()) {
aek.addJavascriptInterface(new d(lVar.jaR, aek), "WeixinJSCore");
str2 = a.a(lVar.jaR.iuk, "wxa_library/android.js", true);
}
x.i("MicroMsg.WAGameWeixinJSContextLogic", "Inject WAGameSubContext to SubContext");
str2 = bi.oM(str2) + a.a(lVar.jaR.iuk, "WAGameSubContext.js", false);
g.pWK.a(778, 17, 1, false);
h.a(aek, str2, new com.tencent.mm.plugin.appbrand.r.h.a() {
public final void pH(String str) {
x.i("MicroMsg.WAGameWeixinJSContextLogic", "Inject SDK WAGameSubContext Script suc: %s", str);
g.pWK.a(778, 19, 1, false);
}
public final void fs(String str) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "Inject SDK WAGameSubContext Script Failed: %s", str);
g.pWK.a(778, 18, 1, false);
com.tencent.mm.plugin.appbrand.report.a.C(l.this.jaR.iuk.mAppId, 24, 0);
com.tencent.mm.plugin.appbrand.report.a.a(l.this.jaR.mAppId, l.this.jaR.iuk.isS.iRU.iJb, l.this.jaR.iuk.isS.iRU.iJa, 778, 18);
}
});
l lVar2 = l.this;
if (!bi.oN(str)) {
String a = a.a(lVar2.jaR.iuk, str, false);
if (bi.oN(a)) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "bussiness code is null [%s]", a);
} else {
x.i("MicroMsg.WAGameWeixinJSContextLogic", "Inject SubContext subContext.js");
g.pWK.a(778, 21, 1, false);
h.a(aek, str, a, new com.tencent.mm.plugin.appbrand.r.h.a() {
public final void pH(String str) {
x.i("MicroMsg.WAGameWeixinJSContextLogic", "Inject SDK subContext Script suc: %s", str);
g.pWK.a(778, 23, 1, false);
}
public final void fs(String str) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "Inject SDK subContext Script Failed: %s", str);
g.pWK.a(778, 22, 1, false);
com.tencent.mm.plugin.appbrand.report.a.C(l.this.jaR.mAppId, 24, 0);
com.tencent.mm.plugin.appbrand.report.a.a(l.this.jaR.mAppId, l.this.jaR.iuk.isS.iRU.iJb, l.this.jaR.iuk.isS.iRU.iJa, 778, 22);
}
});
q.a(lVar2.jaR.iuk, aek, str);
}
}
x.i("MicroMsg.WAGameWeixinJSContextLogic", "create subContext success = [%d]", Integer.valueOf(aek.adZ()));
i = aek.adZ();
}
}
return i;
}
@JavascriptInterface
public final void destroy(int i) {
synchronized (l.this) {
if (!l.this.jaQ || l.this.jaS == null) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "destroy subContext failed. mStateReady = [%b] mSubContextAddon = [%s] contextId = [%d]", Boolean.valueOf(l.this.jaQ), l.this.jaS, Integer.valueOf(i));
return;
}
l.this.jaS.kh(i);
}
}
}
public l(j jVar, b bVar) {
if (jVar == null || bVar == null) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "Input failed. service is [%s] jsRuntime = [%s]", jVar, bVar);
return;
}
f fVar = (f) bVar.v(f.class);
if (fVar == null) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "Input failed. jsRuntime not support subContext");
} else if (fVar.aej() == null) {
x.e("MicroMsg.WAGameWeixinJSContextLogic", "Input failed. subContext has no main jscontext, you should to init it first.");
} else {
synchronized (this) {
this.jaR = jVar;
this.jaS = fVar;
this.jaT = fVar.aej();
this.jaQ = true;
}
}
}
public final boolean aeq() {
if (this.jaV == null) {
boolean z;
long Wz = bi.Wz();
SharedPreferences cgg = ad.cgg();
int i = cgg != null ? cgg.getInt("useisolatectxwxalibrary", 0) : 0;
if (i == 1) {
z = true;
} else {
if (i != -1) {
com.tencent.mm.ipcinvoker.wx_extension.a.a aVar = b.gOV;
c fp = com.tencent.mm.ipcinvoker.wx_extension.a.a.fp("100378");
if (fp == null || !fp.isValid()) {
z = false;
} else if (bi.getInt((String) fp.civ().get("useisolatectxwxalibrary"), 0) == 1) {
z = true;
}
}
z = false;
}
this.jaV = Boolean.valueOf(z);
x.i("MicroMsg.WAGameWeixinJSContextLogic", "read ShouldUseIsolateCtxWxaLibrary cost time = [%d]", Long.valueOf(bi.bB(Wz)));
}
return this.jaV.booleanValue();
}
}
| [
"[email protected]"
] | |
0c5a1513acb1e0887a2e54f82e6dcf78d92d1311 | de202508b4a88ab39c5cb5291febad6ba7afa882 | /app/src/main/java/be/pxl/parkingdata/brussel/BxlParkingWrapper.java | c8ea13ac48add04a26b6394cbbee06652ee938a3 | [] | no_license | PXL-Smart-ICT/open-parking | b6fff43ca471c2beb592efc1ae9b5a33304faaa5 | f02bee65f9ca13c9cd58dc32f20cbf81f7b51ad2 | refs/heads/master | 2021-05-29T08:14:29.939454 | 2015-05-13T07:49:55 | 2015-05-13T07:49:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 689 | java | package be.pxl.parkingdata.brussel;
import java.util.List;
public class BxlParkingWrapper {
private int nhits;
private BxlParameters parameters;
private List<BxlParkingRecord> records;
public synchronized int getNhits() {
return nhits;
}
public synchronized void setNhits(int nhits) {
this.nhits = nhits;
}
public synchronized BxlParameters getParameters() {
return parameters;
}
public synchronized void setParameters(BxlParameters parameters) {
this.parameters = parameters;
}
public synchronized List<BxlParkingRecord> getRecords() {
return records;
}
public synchronized void setRecords(List<BxlParkingRecord> records) {
this.records = records;
}
}
| [
"[email protected]"
] | |
2a17ef730c209ac43c0258a470320225e7a9a382 | 606b815682acff90e784473969eaa857ebcfac27 | /151-Reverse-Words-in-a-String/solution.java | 3ca05b69efb4c63320daf1058dcad91570b88a01 | [] | no_license | jellylidong/My-Leetcode-Track | 39f73e6c396fdf53d22f7f164587d58a29400499 | 12d7160e9d3141f123d27dbfca84ebe42c15314c | refs/heads/master | 2021-01-17T10:20:53.057037 | 2016-07-15T04:45:50 | 2016-07-15T04:45:50 | 58,507,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | public class Solution {
public String reverseWords(String str) {
// = s.trim();
String[] ss = str.split("\\s+");
StringBuilder sb = new StringBuilder();
for(int i = ss.length-1; i >= 0; i--){
sb.append(ss[i]);
sb.append(" ");
}
return sb.toString().trim();
}
} | [
"[email protected]"
] | |
6f3bf4715f4d3e11116103364c138543e2aa9af4 | fa6e5cbf615cc1c56f3a5cb50f2c817c0fa96d13 | /OutpatientManagementModule/OutpatientManagement.DAL/src/com/lea/dal/hibernate/DatabaseRepository.java | fe114df044e4a5f7738af88089601abdbd36dabf | [] | no_license | LeaRezic/JavaExamAssignment | 5cf71b705626e6bd304dd8357e76848f7c587545 | fb2de3e57d1de45fa4fae2391875137fa8fe0f80 | refs/heads/master | 2020-03-21T21:30:51.738011 | 2018-07-19T09:16:43 | 2018-07-19T09:16:43 | 139,067,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,374 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.lea.dal.hibernate;
import com.lea.dal.domain.entities.*;
import com.lea.dal.domain.repositories.Repository;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
/**
*
* @author Lea
*/
public class DatabaseRepository implements Repository {
private List<?> getAllEntitiesOfType(String className) {
List<?> entityList = new ArrayList<>();
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
String currentQuery = "FROM " + className;
entityList = session.createQuery(currentQuery).list();
tx.commit();
} catch (HibernateException ex) {
if (tx != null) {
tx.rollback();
}
ex.printStackTrace();
} finally {
session.close();
}
return entityList;
}
private EntityBase getEntityByIdOfType(String className, int id) {
EntityBase entity = () -> 0;
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
String currentQuery = "FROM " + className + " WHERE id = " + id;
entity = (EntityBase) session.createQuery(currentQuery).list().iterator().next();
tx.commit();
} catch (HibernateException ex) {
if (tx != null) {
tx.rollback();
}
ex.printStackTrace();
} finally {
session.close();
}
return entity;
}
@Override
public Doctor getDoctorById(int id) {
return (Doctor) getEntityByIdOfType(Doctor.class.getSimpleName(), id);
}
@Override
public List<Doctor> getAllDoctors() {
return (ArrayList<Doctor>) getAllEntitiesOfType(Doctor.class.getSimpleName());
}
@Override
public Patient getPatientById(int id) {
return (Patient) getEntityByIdOfType(Patient.class.getSimpleName(), id);
}
@Override
public List<Patient> getAllPatients() {
return (ArrayList<Patient>) getAllEntitiesOfType(Patient.class.getSimpleName());
}
@Override
public List<Patient> getAllPatientsByDoctor(int id) {
List<Patient> patients = new ArrayList<>();
getAllPatients().forEach(p -> p.getAppointments()
.forEach(a -> {
if (a.getDoctor().getIddoctor() == id) {
patients.add(p);
}
}));
return patients;
}
@Override
public Boolean insertOrUpdatePatient(Patient p) {
insertOrUpdateEntity(p.getBasicDetailsByBasicDetailsId());
insertOrUpdateEntity(p.getBasicDetailsByNextOfKinId());
insertOrUpdateEntity(p.getComplaintDetails());
insertOrUpdateEntity(p.getLifestyleDetails());
insertOrUpdateEntity(p.getMedicalDetails());
insertOrUpdateEntity(p.getPersonalDetails());
insertOrUpdateEntity(p);
return true;
}
@Override
public Boolean insertOrUpdateDoctor(Doctor d) {
insertOrUpdateEntity(d.getBasicDetails());
insertOrUpdateEntity(d);
return true;
}
@Override
public List<MaritalStatus> getAllMaritalStatuses() {
return (ArrayList<MaritalStatus>) getAllEntitiesOfType(MaritalStatus.class.getSimpleName());
}
@Override
public List<DoctorSpecialization> getAllDoctorSpecializations() {
return (ArrayList<DoctorSpecialization>) getAllEntitiesOfType(DoctorSpecialization.class.getSimpleName());
}
@Override
public List<BloodType> getAllBloodTypes() {
return (ArrayList<BloodType>) getAllEntitiesOfType(BloodType.class.getSimpleName());
}
@Override
public List<Appointment> getAllAppointments() {
return (ArrayList<Appointment>) getAllEntitiesOfType(Appointment.class.getSimpleName());
}
@Override
public Boolean insertOrUpdateAppointment() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public EmergencyRegistration getEmergencyRegistrationById(int id) {
return (EmergencyRegistration) getEntityByIdOfType(EmergencyRegistration.class.getSimpleName(), id);
}
@Override
public List<EmergencyRegistration> getAllEmeregencyRegistrations() {
return (ArrayList<EmergencyRegistration>) getAllEntitiesOfType(EmergencyRegistration.class.getSimpleName());
}
@Override
public List<HospitalService> getAllHospitalServices() {
return (List<HospitalService>) getAllEntitiesOfType(HospitalService.class.getSimpleName());
}
private void insertOrUpdateEntity(EntityBase entity) {
if (entity.fetchEntityId() == 0) {
insertEntity(entity);
} else {
updateEntity(entity);
}
}
private int insertEntity(EntityBase entity) {
int newId = -1;
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
newId = (int) session.save(entity);
tx.commit();
} catch (HibernateException ex) {
if (tx != null) {
tx.rollback();
}
ex.printStackTrace();
} finally {
session.close();
}
return newId;
}
private void updateEntity(EntityBase entity) {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
session.update(entity);
tx.commit();
} catch (HibernateException ex) {
if (tx != null) {
tx.rollback();
}
ex.printStackTrace();
} finally {
session.close();
}
}
@Override
public List<City> getAllCities() {
return (List<City>) getAllEntitiesOfType(City.class.getSimpleName());
}
@Override
public List<Country> getAllCountries() {
return (List<Country>) getAllEntitiesOfType(Country.class.getSimpleName());
}
@Override
public City getCityById(int id) {
return (City) getEntityByIdOfType(City.class.getSimpleName(), id);
}
@Override
public BloodType getBloodTypeById(int id) {
return (BloodType) getEntityByIdOfType(BloodType.class.getSimpleName(), id);
}
@Override
public MaritalStatus getMaritalStatusById(int id) {
return (MaritalStatus) getEntityByIdOfType(MaritalStatus.class.getSimpleName(), id);
}
@Override
public DoctorSpecialization getDoctorSpecializationById(int id) {
return (DoctorSpecialization) getEntityByIdOfType(DoctorSpecialization.class.getSimpleName(), id);
}
@Override
public Boolean insertEmergencyRegistration(EmergencyRegistration er) {
insertOrUpdateEntity(er);
return true;
}
@Override
public void deleteEmergencyRegistration(EmergencyRegistration er) {
deleteEntity(er);
}
private void deleteEntity(EntityBase entity) {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
session.delete(entity);
tx.commit();
} catch (HibernateException ex) {
if (tx != null) {
tx.rollback();
}
ex.printStackTrace();
} finally {
session.close();
}
}
@Override
public HospitalService getHospitalServiceById(int id) {
return (HospitalService) getEntityByIdOfType(HospitalService.class.getSimpleName(), id);
}
@Override
public Appointment getAppointmentById(int id) {
return (Appointment) getEntityByIdOfType(Appointment.class.getSimpleName(), id);
}
}
| [
"[email protected]"
] | |
523a8accf668c6cd276030f74215eb89d0ed63c0 | d2ebda1552ecf3773feb5e70f42884c171c5be56 | /Module 4/Module4/Replay2.java | 67c24a2dbe95bf4c5564f057b2d9b50e8bb1f350 | [] | no_license | rhmvu/VU-Introduction-to-Programming-Assignments | c48fdef301521f84d427d3553b196d272393d1f4 | dcee6d7cd14c59026c08c0c712cc39601aee4813 | refs/heads/master | 2021-07-03T11:46:09.493292 | 2017-09-17T15:42:07 | 2017-09-17T15:43:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,459 | java | package Module4;
import ui.UserInterfaceFactory;
import java.io.PrintStream;
import java.util.Scanner;
import ui.OthelloReplayUserInterface;
import ui.UIAuxiliaryMethods;
class Replay2 {
static final int BLACK = 2;
static final int WHITE = 1;
int waitingTime,
x,
y,
player;
Boolean move;
OthelloReplayUserInterface ui;
PrintStream out;
Scanner input = UIAuxiliaryMethods.askUserForInput().getScanner();
Replay2(){
ui = UserInterfaceFactory.getOthelloReplayUI();
out = new PrintStream(System.out);
}
void start(){
ui.place(4-1, 5-1, BLACK);
ui.place(5-1, 4-1, BLACK);
ui.place(5-1, 5-1, WHITE);
ui.place(4-1, 4-1, WHITE);
ui.showChanges();
scanner();
}
void scanner(){
while(input.hasNextLine()){
Scanner lineScanner= new Scanner(input.nextLine());
inputParser(lineScanner);
changer();
}
}
void inputParser(Scanner lineScanner){
String inputPlayer= lineScanner.next();
player= setPlayer(inputPlayer);
waitingTime= lineScanner.nextInt();
String stringMove= lineScanner.next();
move = stringMove.equals("move")? true: false;
if(move==false){
ui.printf("player %s: passed\n", inputPlayer);
scanner();
}
int conquer = -1;
while (lineScanner.hasNext()){
String xaxis = lineScanner.next();
int yaxis= lineScanner.nextInt();
getLocation(xaxis.charAt(0),yaxis);
ui.place(x,y, player);
ui.showChanges();
conquer ++;
}
ui.printf("player %s: conquered %d pieces\n", inputPlayer, conquer);
}
int setPlayer(String inputPlayer){
int result= inputPlayer.equals("white") ? WHITE: BLACK;
return result;
}
void getLocation(char xaxis,int yaxis){
switch (xaxis){
case 'a': x=0; break;
case 'b': x=1; break;
case 'c': x=2; break;
case 'd': x=3; break;
case 'e': x=4; break;
case 'f': x=5; break;
case 'g': x=6; break;
case 'h': x=7; break;
}
switch(yaxis){
case 1: y= 0; break;
case 2: y= 1; break;
case 3: y= 2; break;
case 4: y= 3; break;
case 5: y= 4; break;
case 6: y= 5; break;
case 7: y= 6; break;
case 8: y= 7; break;
}
}
void changer(){
ui.place(x,y, player);
if(waitingTime >0){
ui.wait(waitingTime);
ui.showChanges();
}
if(input.hasNextLine()){
scanner();
} else{
ui.clearStatusBar();
ui.printf("The game is finished, the GUI wil close in 10 seconds");
ui.wait(10000);
System.exit(0);
}
}
public static void main(String[] args) {
new Replay2().start();
}
} | [
"[email protected]"
] | |
b1afab38d5430738f6a6d5c57d6f7dc7944d86bd | b264d24c401fea860eb82d85cd5843ea93b2a1b1 | /src/main/java/com/springingdream/products/api/ProductNotFoundAdvice.java | 7859522f09f90714fce51eff1edbac4bf6292200 | [] | no_license | SpringingDream/products | 7f86ef500ae944fa22f4d4d22d24fcfc08c3f0e7 | 3f24c2e3a7aee592f70cfeaf15c00e874fe7d9c5 | refs/heads/master | 2020-04-11T19:51:26.604783 | 2018-12-27T01:37:58 | 2018-12-27T01:37:58 | 162,049,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package com.springingdream.products.api;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
@ControllerAdvice
public class ProductNotFoundAdvice {
@ResponseBody
@ExceptionHandler(ProductNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
String notFound(ProductNotFoundException e) {
return e.getMessage();
}
}
| [
"[email protected]"
] | |
cd3027240b42b26ef7844d0231d4b7f9f7f2a9b2 | b45b62a6896038bd20036dd8af408487d3d129bd | /src/isMatch.java | 1b22ae7d81c5c4e3ced408a2f8a75509298eaa2f | [] | no_license | MickeyZeng/Code-Practice | 1a2d7acabb2bc27f4b0eef4e517c7cc63fced1bd | 8d6967bc2ac6a10f547131f23def97bdc59acc76 | refs/heads/master | 2023-03-30T00:25:47.400805 | 2021-04-09T07:24:09 | 2021-04-09T07:24:09 | 258,943,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 281 | java | import java.util.ArrayList;
public class isMatch {
public static void main(String[] args) {
System.out.println(isMatch("aa","a"));
}
public static boolean isMatch(String s, String p) {
//还有好多的动态规划没写
return false;
}
}
| [
"[email protected]"
] | |
013d67246a1a679ebf29e20b473af65ea2c1af65 | c82deda73cb8af591ae3232915fd3ae831b286ae | /hedera-node/src/test/java/com/hedera/services/files/interceptors/ConfigListUtilsTest.java | 06b43c3cc3495d93cd1101d04da70308fa2aecc2 | [
"Apache-2.0"
] | permissive | BitBondtmUK/hedera-services | 1ca57a7c0335f731b1136f03d838469670e1a154 | a0f349b0b7ed88370ffc471148462ba4d1d9ba0e | refs/heads/master | 2022-12-03T18:12:17.603960 | 2020-08-26T04:37:35 | 2020-08-26T04:37:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,291 | java | package com.hedera.services.files.interceptors;
/*-
*
* Hedera Services Node
*
* Copyright (C) 2018 - 2020 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import com.hedera.services.files.MetadataMapFactory;
import com.hederahashgraph.api.proto.java.ServicesConfigurationList;
import com.hederahashgraph.api.proto.java.Setting;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import static com.hedera.services.files.interceptors.ConfigListUtils.*;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
@RunWith(JUnitPlatform.class)
class ConfigListUtilsTest {
private ServicesConfigurationList example = ServicesConfigurationList.newBuilder()
.addNameValue(Setting.newBuilder()
.setName("key")
.setValue("value"))
.build();
@Test
public void recognizesParseable() {
// given:
var nonsense = "NONSENSE".getBytes();
var truth = example.toByteArray();
// when:
var nonsenseFlag = isConfigList(nonsense);
var truthFlag = isConfigList(truth);
// then:
assertFalse(nonsenseFlag);
assertTrue(truthFlag);
}
@Test
public void parsesToDefaultIfInvalid() {
// expect:
Assertions.assertEquals(
ServicesConfigurationList.getDefaultInstance(),
uncheckedParse("NONSENSE".getBytes()));
}
@Test
public void parses() {
// expect:
Assertions.assertEquals(example, uncheckedParse(example.toByteArray()));
}
@Test
public void cannotBeConstructed() {
// expect:
assertThrows(IllegalStateException.class, ConfigListUtils::new);
}
}
| [
"[email protected]"
] | |
eaad6c8dc8df4006c8de512a80c9a01421046c7a | b277c94b78cd231373d08567860e1020beda0513 | /javadev/src/exam/oop11/TVUser.java | b740383ab5cb89e84932841b659d10d1ac9539b2 | [] | no_license | MorimKang/Hello-Java | 74743deca45b36e745079649e9ab7d6dacd8ce63 | d3bf26bbe36f3daaa9bf914ff870ff4b5d3f13e2 | refs/heads/master | 2020-04-16T09:50:36.261845 | 2019-03-02T10:30:44 | 2019-03-02T10:30:44 | 165,478,987 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 317 | java | package exam.oop11;
public class TVUser {
public static void main(String[] args) {
TV tv = new XiaomiTV(); //업캐스팅. 자동형변환.
// System.out.println(TV.volt);
tv.powerOn();
tv.channelUp();
tv.channelUp();
tv.soundUp();
tv.soundUp();
tv.soundDown();
tv.powerOff();
}
}
| [
"[email protected]"
] | |
742376b1ac3f2a58b3f090cb75b44dceccc4bef3 | dbe1827a9c1a4305c27768417580dd8284644c09 | /src/test/java/com/codekul/EmailDemo/EmailDemoApplicationTests.java | 2481061ac9b584517d09fae15794769a451146bb | [] | no_license | bhorpooja/EmailDemo | fae1e51f49e934744bbfc57495849612c76b832d | 1d9846051d306c29f7ea2b4f1cf5ad1f1b5eea51 | refs/heads/master | 2021-05-06T21:05:22.503393 | 2017-11-29T10:20:15 | 2017-11-29T10:20:15 | 112,460,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package com.codekul.EmailDemo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class EmailDemoApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"bhorpooja222gmail.com"
] | bhorpooja222gmail.com |
f26997f3ab0f44fa44a676b3fa55c775e5387460 | d09219b9a0a445eff5527f15b99bbcffde82120a | /pact/provider/jvm-provider/src/main/java/calculator/power/PowerStatus.java | 99d899ab8f52f5ae6b9ebeaff1951431e65c2b8f | [] | no_license | signed/talk-contract-tests | 64bc19bed761a3c816e6f2b49629a4e7a08c5f01 | 05d995659ccfbef3912f60c2b50916786017deb9 | refs/heads/master | 2023-01-10T04:42:41.948577 | 2020-10-28T18:38:54 | 2020-10-28T18:38:54 | 122,981,496 | 3 | 2 | null | 2023-01-06T01:48:36 | 2018-02-26T14:30:15 | Java | UTF-8 | Java | false | false | 79 | java | package calculator.power;
public class PowerStatus {
public String status;
}
| [
"[email protected]"
] | |
6820d5a929753a756e00e2746dcf777215f23c5c | 0ac791743dec7dc31c899e504db0e30b346c3d7c | /src/java/br/com/great/contexto/Objeto.java | e00d2a82ac2f1a9ac25ea8234f30941a09adce10 | [] | no_license | carleandro7/webservidor2 | 5758fe66ab2ade32439bdee8880f3d5edde7fb06 | ed1b59b1577e4f2f37c9c6dffa402bde833ed3e2 | refs/heads/master | 2021-01-10T18:08:23.455822 | 2015-04-30T11:11:00 | 2015-04-30T11:11:00 | 29,984,623 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | package br.com.great.contexto;
public class Objeto {
private Posicao posicao;
public Posicao getPosicao() {
return posicao;
}
public void setPosicao(Posicao posicao) {
this.posicao = posicao;
}
}
| [
"[email protected]"
] | |
04e713944fbe82a86ef27157300eb1f25a14dd6f | a24ccb271d78b56bc4e7ccf2f3c5626730e2a071 | /music/src/main/java/com/jcs/music/DimentionUtils.java | e176a8d6cb1868753b66b48acae6e10c316feb39 | [] | no_license | Jichensheng/ToolsPractice | c74e136183cbb9115bca197dee38a5b2efc447c9 | c4e5b6788bf30915bd7c88080e0dee1e61265fa4 | refs/heads/master | 2021-01-19T19:35:51.359950 | 2017-09-07T11:33:10 | 2017-09-07T11:33:10 | 88,426,455 | 0 | 0 | null | 2017-08-15T02:54:06 | 2017-04-16T16:07:21 | Java | UTF-8 | Java | false | false | 1,517 | java | package com.jcs.music;
import android.content.Context;
/**
* author:Jics
* 2017/6/26 13:55
*/
public class DimentionUtils {
/**
* 将px值转换为dip或dp值,保证尺寸大小不变
*
* @param pxValue
* (DisplayMetrics类中属性density)
* @return
*/
public static int px2dip(Context context, float pxValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (pxValue / scale + 0.5f);
}
/**
* 将dip或dp值转换为px值,保证尺寸大小不变
*
* @param dipValue
* (DisplayMetrics类中属性density)
* @return
*/
public static int dip2px(Context context, float dipValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dipValue * scale + 0.5f);
}
/**
* 将px值转换为sp值,保证文字大小不变
*
* @param pxValue
* (DisplayMetrics类中属性scaledDensity)
* @return
*/
public static int px2sp(Context context, float pxValue) {
final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
return (int) (pxValue / fontScale + 0.5f);
}
/**
* 将sp值转换为px值,保证文字大小不变
*
* @param spValue
* (DisplayMetrics类中属性scaledDensity)
* @return
*/
public static int sp2px(Context context, float spValue) {
final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
return (int) (spValue * fontScale + 0.5f);
}
}
| [
"[email protected]"
] | |
f4e02d95dd7b2f66376289fcd25c68633df03f66 | 22727214a106f8c65c31a6a4a293b7ab97e8cd23 | /api/src/main/java/project/soa/model/User.java | 32cdd6c36a00cde2a63d7d572b8c684f31fc3d35 | [
"MIT"
] | permissive | kstypa/soa-project | 8b691d7e277f7fe723c6752ea755ed33d2df1ffa | 14e98b13848c9606892735d19411f1f94f56a301 | refs/heads/master | 2022-07-19T14:01:18.686246 | 2019-06-24T08:42:17 | 2019-06-24T08:42:17 | 190,364,992 | 0 | 0 | MIT | 2022-06-21T01:16:55 | 2019-06-05T09:20:58 | Java | UTF-8 | Java | false | false | 596 | java | package project.soa.model;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.io.Serializable;
@Entity(name = "soa_users")
@Data
@NoArgsConstructor
public class User implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String login;
private String password;
private String first_name;
private String last_name;
@Enumerated(EnumType.STRING)
@Basic(fetch = FetchType.EAGER)
private Role role;
public enum Role { MANAGER, CLIENT, COOK, DELIVERY_BOY }
}
| [
"[email protected]"
] | |
2090454ac5f3597b32743784b1fb98453d0a9ba9 | a3e9de23131f569c1632c40e215c78e55a78289a | /alipay/alipay_sdk/src/main/java/com/alipay/api/domain/KoubeiMarketingDataCustomreportDetailQueryModel.java | b36e1d3f8c342963f63e0d72db904cca0197ee25 | [] | no_license | P79N6A/java_practice | 80886700ffd7c33c2e9f4b202af7bb29931bf03d | 4c7abb4cde75262a60e7b6d270206ee42bb57888 | refs/heads/master | 2020-04-14T19:55:52.365544 | 2019-01-04T07:39:40 | 2019-01-04T07:39:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 自定义数据报表规则详情查询接口
*
* @author auto create
* @since 1.0, 2018-07-26 14:04:13
*/
public class KoubeiMarketingDataCustomreportDetailQueryModel extends AlipayObject {
private static final long serialVersionUID = 6556497565787439776L;
/**
* 自定义报表的规则KEY
*/
@ApiField("condition_key")
private String conditionKey;
public String getConditionKey() {
return this.conditionKey;
}
public void setConditionKey(String conditionKey) {
this.conditionKey = conditionKey;
}
}
| [
"[email protected]"
] | |
824b4d298c616a95f42c4a5d33745781578dbb5b | c0cdf03000f2856cbcbeae69b06671fc62aecf52 | /src/ReplIt/OOP_10.java | 6ee151bfb33a426adf1ee8478cd6b367ad5922b0 | [] | no_license | nshaltaeva/Summer2019_Java | 4e2497f9162d3d020d1027c40dae8abd29614051 | db095e3fdaee52b519744e3a2e45c6d8a8a8d7ba | refs/heads/master | 2020-07-22T21:49:06.934240 | 2019-12-10T22:12:21 | 2019-12-10T22:12:21 | 207,339,317 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 174 | java | package ReplIt;
public class OOP_10 {
public static int plus(int a, int b) {
return a+b;
}
public static int minus(int a, int b) {
return a-b;
}
}
| [
"[email protected]"
] | |
51900de7a4011a6e3c69cfed1db3cd04cf3b335c | 540d56e24fa1d5c3875bb80a36d416ee4a5d26e8 | /commonlib/src/main/java/com/leifu/commonlib/view/dialog/LoadingDialog.java | 341a40fc2ef44b92ce7d55af8d257c77ad831e79 | [] | no_license | leifu1107/CommonLibDemo | f44e7b29aa68ce6dbb673f01712c206ba00d1886 | 14ec822400678b25e402d03f0273376cf3e0f323 | refs/heads/master | 2020-09-13T18:17:10.463701 | 2020-08-28T09:15:40 | 2020-08-28T09:15:40 | 222,865,651 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,237 | java | package com.leifu.commonlib.view.dialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.leifu.commonlib.R;
/**
* 自定义Dialog
*/
public class LoadingDialog extends Dialog {
private Context context;
/**
* 跟随Dialog 一起显示的message 信息!
*/
private String msg;
public LoadingDialog(Context context, int theme, String msg) {
super(context, theme);
this.context = context;
this.msg = msg;
}
public LoadingDialog(Context context, String msg) {
super(context, R.style.loadingDialog);
this.context = context;
this.msg = msg;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View view = View.inflate(context, R.layout.custom_view_loading, null);
TextView textView = (TextView) view.findViewById(R.id.tv_message);
if (!TextUtils.isEmpty(msg)) {
textView.setText(msg);
}
setContentView(view);
}
@Override
protected void onStop() {
super.onStop();
}
}
| [
"[email protected]"
] | |
17c6a6aab070876f3568a875316da79186c88ea9 | 3092e4a4444eef59d5f92e1b57ffd889fb84de46 | /app/src/test/java/com/example/android/quakereportreal/ExampleUnitTest.java | 9f87c5fd2b8d29964d46b25e70b95678153886ec | [] | no_license | IvanShkilevv/Quake-Report | d516dfbafb142db675cb54a1e246209b9043d57a | 92a0c0749a8b5c73a62019ee9a8dd046ef8db3fa | refs/heads/master | 2022-12-28T05:16:14.135501 | 2020-10-08T17:39:42 | 2020-10-08T17:39:42 | 285,533,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.example.android.quakereportreal;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
387a7b0c5a26c5244a048b1a049b265aaf5a66d2 | d1bc713654a452bad95a6252765d85da175e6320 | /frontAgain.java | 30d1254d3d90cbda36bddb33e210f5df3a28572f | [
"MIT"
] | permissive | SAIMON-AHMED/frontAgain.java | 5bebb6405fee1cd0e6e1f06c60403de416800679 | 50ee7728fe3bf813bac896f44b5acf456067868c | refs/heads/main | 2023-08-07T19:50:43.872181 | 2021-10-09T08:37:30 | 2021-10-09T08:37:30 | 415,251,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | /*
Given a string, return true if the first 2 chars in the string also appear at the end of the string, such as with "edited".
frontAgain("edited") → true
frontAgain("edit") → false
frontAgain("ed") → true
*/
public boolean frontAgain(String str) {
return (str.length() >= 2 && str.substring(0,2).equals(str.substring(str.length()-2)));
}
| [
"[email protected]"
] | |
30069f4045643524906fe89c0c129767d3cf26ec | b33bd318003bcc8f36ac33d31ed384759da832d8 | /src/main/java/ro/msg/learning/shop/controller/ShopController.java | 14f184df8677b4b9e59c6687e37104a61b7781cc | [] | no_license | hapreanmanuel/shop | 21817792c28a820c28b2b9a2f3b799fc4694850d | 324fd8e7cafc2d112e8291c3312db887ab50e285 | refs/heads/master | 2021-05-11T10:05:29.083590 | 2018-03-19T08:54:35 | 2018-03-19T08:54:35 | 114,617,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,958 | java | package ro.msg.learning.shop.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
import ro.msg.learning.shop.domain.Customer;
import ro.msg.learning.shop.domain.Order;
import ro.msg.learning.shop.dto.OrderCreationDto;
import ro.msg.learning.shop.dto.OrderSpecifications;
import ro.msg.learning.shop.domain.Product;
import ro.msg.learning.shop.service.ShopService;
import ro.msg.learning.shop.service.StockService;
import java.util.List;
/*
Main controller class for shop application
*/
@RestController
@RequestMapping("/shop")
public class ShopController {
private ShopService shopService;
private StockService stockService;
@Autowired
public ShopController(ShopService shopService, StockService stockService) {
this.shopService = shopService;
this.stockService = stockService;
}
@GetMapping(value = "/products",
produces = "application/json")
public List<Product> getAllProducts(){
return shopService.getAllProducts();
}
@GetMapping(value = "/customers",
produces = "application/json")
public List<Customer> getCustomers() { return shopService.getAllCustomers(); }
@PostMapping(value = "/orders/create",
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = "application/json")
public Order createOrder(@RequestBody OrderCreationDto request, Authentication authentication){
OrderSpecifications os = shopService.createOrderSpecifications(request, authentication.getName());
return shopService.createNewOrder(os);
}
@PostMapping(value="/orders/process/{orderId}",
produces = "application/json")
public Order processOrder(@PathVariable int orderId){
return stockService.processOrder(orderId);
}
}
| [
"[email protected]"
] | |
2eaacd4f81a5ac370f14ab09f4ff9ba6f2e6dc11 | b9d60892a5556b2b21cf8fa31f1fb4b5425ccc9c | /app/src/main/java/cl/estudiohumboldt/jitfront/DeviSpinnerAdapter.java | c30293a7d601ffdc274b245022144d92a7b1956e | [] | no_license | cristhoper/jitfront-android | 5cb46bcd205496d6a0f4ae5422de9bde558f5fa8 | 22ab4c15d774218a8e834a9d675a9543690d9776 | refs/heads/master | 2021-10-26T04:52:35.306359 | 2019-04-10T17:32:54 | 2019-04-10T17:32:54 | 180,455,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package cl.estudiohumboldt.jitfront;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import java.util.ArrayList;
class DeviSpinnerAdapter extends ArrayAdapter {
private ArrayList<BluetoothDevice> mLeDevices;
DeviSpinnerAdapter(Context ctx){
super(ctx, android.R.layout.simple_spinner_dropdown_item);
mLeDevices = new ArrayList<BluetoothDevice>();
}
void addDevice(BluetoothDevice device){
if (!mLeDevices.contains(device)){
mLeDevices.add(device);
}
}
public BluetoothDevice getDevice(int pos){
return mLeDevices.get(pos);
}
public void clear(){
mLeDevices.clear();
}
@Override
public int getCount() {
return mLeDevices.size();
}
@Override
public Object getItem(int position) {
return mLeDevices.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
}
| [
"[email protected]"
] | |
8dfeba72232dc28ee7d557a2c7b24cad8040e600 | 2d09a42489a840090a41b613a3146c5af9050278 | /src/main/java/uz/doston/springjwtsecurity/model/User.java | 652a19ce658f51c4b6615261ffa2cc1874c8ab4c | [] | no_license | Doston1316/SpringJwtSecurity | 1a22c4b60a516f6bff8ef6e77c5b47d485c4909e | 04adb3c2e285fcfef66385453aca1d019a68a6ad | refs/heads/master | 2023-07-15T14:12:28.862885 | 2021-09-04T04:47:18 | 2021-09-04T04:47:18 | 402,966,003 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,932 | java | package uz.doston.springjwtsecurity.model;
import uz.doston.springjwtsecurity.enam.Status;
import javax.persistence.*;
import java.util.Set;
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String userName;
private String email;
private String password;
private String firstName;
private String lastName;
// @Enumerated(EnumType.STRING)
private Status status;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "user_role",
joinColumns = @JoinColumn(name = "user_id",referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(name = "role_name",referencedColumnName = "name"))
private Set<Role> roles;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public Set<Role> getRoles() {
return roles;
}
public void setRoles(Set<Role> roles) {
this.roles = roles;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
| [
"[email protected]"
] | |
41803d39ea2018a390c07fc794fb19b4b13f5e10 | 39727ab097675f93d6ef025dfdc66f5037ad791b | /hc-mdm-dao/src/main/java/com/hc/scm/mdm/dao/mapper/BasBillTypeMapper.java | d7db6677fb25cebdabd1310f41965cbfae0a3a5c | [] | no_license | lijinxi/hc-mdm | be58e76b9b7310df0d67ba394fed4f1744c8b2da | 5679e9257251417a8db268237648e6ea2c618087 | refs/heads/master | 2021-01-10T08:43:05.723534 | 2015-12-17T07:34:47 | 2015-12-17T07:34:47 | 47,642,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 381 | java | package com.hc.scm.mdm.dao.mapper;
import com.hc.scm.common.base.mapper.BaseCrudMapper;
/**
* Description: 请写出类的用途
* All rights Reserved, Designed Byhc* Copyright: Copyright(C) 2014-2015
* Company: Wonhigh.
* @author: luojw
* @date: 2015-03-26 14:51:54
* @version 1.0.0
*/
public interface BasBillTypeMapper extends BaseCrudMapper {
} | [
"[email protected]"
] | |
9c41dae10112c444740c34781826312877cb4658 | 5622d518bac15a05590055a147628a728ca19b23 | /mate-tools/src/main/java/is2/util/.svn/text-base/OptionsSuper.java.svn-base | 0a40f73a63db52e210a81f00e8b582117befc1a5 | [
"GPL-3.0-only",
"BSD-2-Clause"
] | permissive | JULIELab/jcore-dependencies | e51349ccf6f26c7b7dab777a9e6baacd7068b853 | a303c6a067add1f4b05c4d2fe31c1d81ecaa7073 | refs/heads/master | 2023-03-19T20:26:55.083193 | 2023-03-09T20:32:13 | 2023-03-09T20:32:13 | 44,806,492 | 4 | 2 | BSD-2-Clause | 2022-11-16T19:48:08 | 2015-10-23T10:32:10 | Java | UTF-8 | Java | false | false | 6,237 | package is2.util;
import is2.io.CONLLReader09;
import java.io.File;
public class OptionsSuper {
public String trainfile = null;
public String testfile = null;
public File trainforest = null;
public String nbframes = null;
public String pbframes = null;
public boolean nopred = false;
public boolean upper = false;
public boolean train = false;
public boolean eval = false;
public boolean test = false;
public boolean keep = false;
public boolean flt = false;
public boolean loadTaggerModels =false;
public String modelName = "prs.mdl";
public String modelTaggerName = null;
public String useMapping = null;
public String device = "C:";
public String tmp = null;
public boolean createForest = true;
public boolean decodeProjective = false;
public double decodeTH = 0.3d;
public String format = "CONLL";
public int formatTask =9;
public int numIters = 10;
public int best = 1000;
public String outfile = "dp.conll";
public String charset = "UTF-8";
public String phraseTrain = null;
public String phraseTest = null;
public String goldfile = null;
public String gout = "sec23.gld";
public String features = null;
public String lexicon = null;
public int hsize = 0x07ffffff;
public int maxLen = 2000;
public int maxForms = Integer.MAX_VALUE;
public int beam = 4;
public float prune = -100000000;
public String third ="";
public String second ="";
public String first ="";
public int cross=10;
//public boolean secondOrder = true;
public boolean useRelationalFeatures = false;
public int count = 10000000;
public int cores = Integer.MAX_VALUE;
public int start = 0;
public int minOccureForms = 0;
public int tt=30; // tagger averaging
public boolean allFeatures =false;
public boolean normalize =false;
public boolean no2nd =false;
public boolean noLemmas=false;
public boolean few2nd =false,noLinear=false,noMorph=false;
public String clusterFile;
// output confidence values
public boolean conf =false;
public String phraseFormat="penn"; // tiger | penn
public boolean average = true;
public boolean label =false;
public boolean stack=false;
public boolean oneRoot = false;
public String significant1 =null,significant2 =null;
// horizontal stacking
public int minLength =0, maxLength =Integer.MAX_VALUE;
public boolean overwritegold =false;
public static final int MULTIPLICATIVE=1, SHIFT=2;
public int featureCreation = MULTIPLICATIVE;
public OptionsSuper (String[] args, String dummy) {
for(int i = 0; i < args.length; i++) {
i = addOption(args,i);
}
}
public OptionsSuper() {}
public int addOption(String args[], int i) {
if (args[i].equals("-train")) {
train = true;
trainfile = args[i+1];
} else if (args[i].equals("-eval")) {
eval = true;
goldfile =args[i+1]; i++;
} else if (args[i].equals("-gout")) {
gout =args[i+1]; i++;
} else if (args[i].equals("-test")) {
test = true;
testfile = args[i+1]; i++;
} else if (args[i].equals("-sig1")) {
significant1 = args[i+1]; i++;
} else if (args[i].equals("-sig2")) {
significant2 = args[i+1]; i++;
} else if (args[i].equals("-i")) {
numIters = Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-out")) {
outfile = args[i+1]; i++;
} else if (args[i].equals("-cluster")) {
clusterFile = args[i+1]; i++;
}
else if (args[i].equals("-count")) {
count = Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-model")) {
modelName = args[i+1]; i++;
} else if (args[i].equals("-tmodel")) {
this.modelTaggerName = args[i+1]; i++;
} else if (args[i].equals("-nonormalize")) {
normalize=false;
} else if (args[i].equals("-float")) {
flt =true;
} else if (args[i].equals("-hsize")) {
hsize= Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-charset")) {
charset= args[++i];
} else if (args[i].equals("-pstrain")) {
this.phraseTrain=args[i+1]; i++;
} else if (args[i].equals("-pstest")) {
this.phraseTest=args[i+1]; i++;
} else if (args[i].equals("-len")) {
maxLen= Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-cores")) {
cores= Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-start")) {
start= Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-max")) {
maxLength= Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-min")) {
minLength= Integer.parseInt(args[i+1]); i++;
} else if (args[i].equals("-noLemmas")) {
noLemmas= true;
} else if (args[i].equals("-noavg")) {
this.average= false;
} else if (args[i].equals("-label")) {
label= true;
} else if (args[i].equals("-stack")) {
stack= true;
} else if (args[i].equals("-overwritegold")) {
overwritegold = true;
} else if (args[i].equals("-format")) {
formatTask = Integer.parseInt(args[++i]);
} else if (args[i].equals("-tt")) {
tt = Integer.parseInt(args[++i]);
} else if (args[i].equals("-min-occure-forms")) {
minOccureForms = Integer.parseInt(args[++i]);
} else if (args[i].equals("-loadTaggerModels")) {
this.loadTaggerModels=true;;
} else if (args[i].equals("-feature_creation")) {
this.featureCreation = args[++i].equals("shift")?SHIFT:MULTIPLICATIVE;
}
return i;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("FLAGS [");
sb.append("train-file: " + trainfile);
sb.append(" | ");
sb.append("test-file: " + testfile);
sb.append(" | ");
sb.append("gold-file: " + goldfile);
sb.append(" | ");
sb.append("output-file: " + outfile);
sb.append(" | ");
sb.append("model-name: " + modelName);
sb.append(" | ");
sb.append("train: " + train);
sb.append(" | ");
sb.append("test: " + test);
sb.append(" | ");
sb.append("eval: " + eval);
sb.append(" | ");
sb.append("training-iterations: " + numIters);
sb.append(" | ");
sb.append("decode-type: " + decodeProjective);
sb.append(" | ");
sb.append("create-forest: " + createForest);
sb.append(" | ");
sb.append("format: " + format);
sb.append("]\n");
return sb.toString();
}
} | [
"[email protected]"
] | ||
08808dbd040a016a999e6e51a07b945ca8831499 | c7a6c52d123aaf87a97bcfbe5eba2f251d757dfa | /GirdView_link/app/src/main/java/com/example/girdview_link/Main2Activity.java | 0724afe741ba4f9d24ad6a8d9bbba3c154ec73fe | [] | no_license | vhnghia/Gridview | 508e4e5cfcfdb3ea41e02823825379c32f9448dc | 6025668f7d43f0957016408ef133c7cea09661d0 | refs/heads/master | 2020-08-08T18:26:57.736926 | 2019-10-09T10:27:44 | 2019-10-09T10:27:44 | 213,888,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 677 | java | package com.example.girdview_link;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
public class Main2Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
Intent intent = getIntent();
String url = intent.getStringExtra("link");
System.out.println(url);
WebView webView = (WebView)findViewById(R.id.webview1);
webView.loadUrl(url);
webView.getSettings().setJavaScriptEnabled(true);
}
}
| [
"[email protected]"
] | |
05ad5d6fba7811c087ff89479db3940f8f59ccd4 | 8311139d16e04e0ada7a45b8c530ae2e5f600b1c | /jaxws/hugeWsdl.war/WEB-INF/classes/com/redhat/gss/ws9/BigObject8.java | 0f8cbfa450c31fe31556317d887081c21c6e3431 | [] | no_license | kylape/support-examples | b9a494bf7dbc3671b21def7d89a32e35d4d0d00c | ade17506093fa3f50bc8d8a685572cf6329868e7 | refs/heads/master | 2020-05-17T10:43:54.707699 | 2014-11-28T16:22:14 | 2014-11-28T16:22:14 | 6,583,210 | 2 | 2 | null | 2014-06-19T22:38:39 | 2012-11-07T17:27:56 | Java | UTF-8 | Java | false | false | 4,251 | java | package com.redhat.gss.ws9;
public class BigObject8
{
private String arg0 = null;
private String arg1 = null;
private String arg2 = null;
private String arg3 = null;
private String arg4 = null;
private String arg5 = null;
private String arg6 = null;
private String arg7 = null;
private String arg8 = null;
private String arg9 = null;
private String arg10 = null;
private String arg11 = null;
private String arg12 = null;
private String arg13 = null;
private String arg14 = null;
private String arg15 = null;
private String arg16 = null;
private String arg17 = null;
private String arg18 = null;
private String arg19 = null;
private String arg20 = null;
private String arg21 = null;
private String arg22 = null;
private String arg23 = null;
private String arg24 = null;
private String arg25 = null;
public String getArg25()
{
return this.arg25;
}
public void setArg25(String arg25)
{
this.arg25 = arg25;
}
public String getArg24()
{
return this.arg24;
}
public void setArg24(String arg24)
{
this.arg24 = arg24;
}
public String getArg23()
{
return this.arg23;
}
public void setArg23(String arg23)
{
this.arg23 = arg23;
}
public String getArg22()
{
return this.arg22;
}
public void setArg22(String arg22)
{
this.arg22 = arg22;
}
public String getArg21()
{
return this.arg21;
}
public void setArg21(String arg21)
{
this.arg21 = arg21;
}
public String getArg20()
{
return this.arg20;
}
public void setArg20(String arg20)
{
this.arg20 = arg20;
}
public String getArg19()
{
return this.arg19;
}
public void setArg19(String arg19)
{
this.arg19 = arg19;
}
public String getArg18()
{
return this.arg18;
}
public void setArg18(String arg18)
{
this.arg18 = arg18;
}
public String getArg17()
{
return this.arg17;
}
public void setArg17(String arg17)
{
this.arg17 = arg17;
}
public String getArg16()
{
return this.arg16;
}
public void setArg16(String arg16)
{
this.arg16 = arg16;
}
public String getArg15()
{
return this.arg15;
}
public void setArg15(String arg15)
{
this.arg15 = arg15;
}
public String getArg14()
{
return this.arg14;
}
public void setArg14(String arg14)
{
this.arg14 = arg14;
}
public String getArg13()
{
return this.arg13;
}
public void setArg13(String arg13)
{
this.arg13 = arg13;
}
public String getArg12()
{
return this.arg12;
}
public void setArg12(String arg12)
{
this.arg12 = arg12;
}
public String getArg11()
{
return this.arg11;
}
public void setArg11(String arg11)
{
this.arg11 = arg11;
}
public String getArg10()
{
return this.arg10;
}
public void setArg10(String arg10)
{
this.arg10 = arg10;
}
public String getArg9()
{
return this.arg9;
}
public void setArg9(String arg9)
{
this.arg9 = arg9;
}
public String getArg8()
{
return this.arg8;
}
public void setArg8(String arg8)
{
this.arg8 = arg8;
}
public String getArg7()
{
return this.arg7;
}
public void setArg7(String arg7)
{
this.arg7 = arg7;
}
public String getArg6()
{
return this.arg6;
}
public void setArg6(String arg6)
{
this.arg6 = arg6;
}
public String getArg5()
{
return this.arg5;
}
public void setArg5(String arg5)
{
this.arg5 = arg5;
}
public String getArg4()
{
return this.arg4;
}
public void setArg4(String arg4)
{
this.arg4 = arg4;
}
public String getArg3()
{
return this.arg3;
}
public void setArg3(String arg3)
{
this.arg3 = arg3;
}
public String getArg2()
{
return this.arg2;
}
public void setArg2(String arg2)
{
this.arg2 = arg2;
}
public String getArg1()
{
return this.arg1;
}
public void setArg1(String arg1)
{
this.arg1 = arg1;
}
public String getArg0()
{
return this.arg0;
}
public void setArg0(String arg0)
{
this.arg0 = arg0;
}
}
| [
"[email protected]"
] | |
61c2d16c42c78c2bc96ea048223c5d25cdecf83e | 9fe3d1e8d19fe7f5de467b092a3e4cf8d5351ad8 | /app/src/main/java/com/trabajofinal/razasypelajescercatomartinez/ConfiguracionActivity.java | 0dfcede0f1ebe45f6e7f674151509f6f8de04483 | [] | no_license | emiiimartinez/RazasYPelajesCercatoMartinez | 1f805261f2c2d8112ba5a8d88f2eb06c5d559c36 | 2afd6086ad4db2531c1c0c9a5c517b01ca13ca6b | refs/heads/master | 2020-04-23T08:26:42.806483 | 2019-03-09T03:09:24 | 2019-03-09T03:09:24 | 160,571,426 | 0 | 0 | null | 2018-12-10T17:55:29 | 2018-12-05T20:00:06 | Java | UTF-8 | Java | false | false | 3,013 | java | package com.trabajofinal.razasypelajescercatomartinez;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Switch;
public class ConfiguracionActivity extends AppCompatActivity {
Switch levelSwitch;
Switch audioSwitch;
RadioGroup interactionRadioGroup,minijuegoRadioGroup;
RadioGroup recoViewModeRadioGroup, recoFilterRadioGroup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_configuracion);
setValues();
}
private void setValues() {
levelSwitch = findViewById(R.id.levelSwitch);
audioSwitch = findViewById(R.id.audioSwitch);
recoFilterRadioGroup = findViewById(R.id.filterViewModeRadioGroup);
interactionRadioGroup = findViewById(R.id.interactionRadioGroup);
minijuegoRadioGroup = findViewById(R.id.minijuegoRadioGroup);
recoViewModeRadioGroup = findViewById(R.id.recoViewModeRadioGroup);
SharedPreferences configPreferences = getSharedPreferences(getString(R.string.config_preferences),Context.MODE_PRIVATE);
levelSwitch.setChecked(configPreferences.getBoolean(getString(R.string.level2_pref_key), false));
audioSwitch.setChecked(configPreferences.getBoolean(getString(R.string.fem_audio_pref_key), false));
recoFilterRadioGroup.check(configPreferences.getInt(getString(R.string.reco_filter_key), R.id.razaRadioBtn));
interactionRadioGroup.check(configPreferences.getInt(getString(R.string.interaction_pref_key), R.id.InteracARadBtn));
minijuegoRadioGroup.check(configPreferences.getInt(getString(R.string.minijuego_pref_key), R.id.RPRadioBtn));
recoViewModeRadioGroup.check(configPreferences.getInt(getString(R.string.reco_view_mode_pref_key), R.id.listRadioBtn));
}
public void onAccept(View view) {
SharedPreferences sharedPref = getSharedPreferences(getString(R.string.config_preferences),Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putBoolean(getString(R.string.fem_audio_pref_key), audioSwitch.isChecked());
editor.putBoolean(getString(R.string.level2_pref_key), levelSwitch.isChecked());
editor.putInt(getString(R.string.reco_filter_key), recoFilterRadioGroup.getCheckedRadioButtonId());
editor.putInt(getString(R.string.minijuego_pref_key), minijuegoRadioGroup.getCheckedRadioButtonId());
editor.putInt(getString(R.string.interaction_pref_key), interactionRadioGroup.getCheckedRadioButtonId());
editor.putInt(getString(R.string.reco_view_mode_pref_key), recoViewModeRadioGroup.getCheckedRadioButtonId());
editor.apply();
finish();
}
}
| [
"[email protected]"
] | |
321b7ec6e27de4e811665548320f9ea8d49414a3 | 214a006fd60cb7cb35d61157f3d215f3491d7f43 | /app/src/test/java/com/example/a0110541/security_incident_reporting/ExampleUnitTest.java | ed9bc6998ff5d9fcbfbe586b86bafcebf2f28b82 | [] | no_license | Simmy33/Security_Incident_App | d1baf89a474643ecf30ebd616cd8faf6fe7d3743 | 15f047de5bbe4b9f327cfac23d229b0c3ed5f6c9 | refs/heads/master | 2021-01-17T16:04:01.148084 | 2016-07-19T00:07:41 | 2016-07-19T00:07:41 | 63,645,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package com.example.a0110541.security_incident_reporting;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
08955bb1f0086e0770f5ccd6200b9c88c8d07264 | 08512248d6cac19af9566e1c947b55ef82a5cca2 | /src/main/java/ua/moskovych/taras/services/GroupService.java | c8f39ff16bd7ce6cb5ac150bff47715b8829eff5 | [] | no_license | TarasMoskovych/Timetable | 0fd1cfab11a8458030b842408a371d5ad3f4a69b | 50ff53685132708944cc1594bf5b445193f5a9c6 | refs/heads/master | 2021-05-15T09:10:45.829879 | 2017-10-23T18:32:08 | 2017-10-23T18:32:08 | 108,007,524 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 435 | java | package ua.moskovych.taras.services;
import ua.moskovych.taras.entity.Group;
import java.util.List;
/**
* Created by Taras on 02.04.2017.
*/
public interface GroupService {
List<Group> findAll();
String getName(int id);
void add(Group group);
void add(String name, int count);
void delete(int id);
void edit(int id, String name, int nos);
Group findByName(String name);
Group findById(int id);
}
| [
"[email protected]"
] | |
bde4f9defba3490eeed8444acafa7af9462442d2 | d0745ec4fb1fa0ea25a6eda4da289b77de904304 | /persistence/src/main/java/com/aaron/persistence/entities/Rank.java | 42ed3e807f2f2ac5f85fe17e47b815fc981b9bac | [] | no_license | yangwenjie008/learning | 6989123f94e42e1516a3339ab23705f3d89662c7 | 1326767cc724b753b143da6873fca60fd7c3c429 | refs/heads/main | 2023-02-23T10:09:40.024889 | 2021-01-25T18:24:34 | 2021-01-25T18:24:34 | 325,772,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 120 | java | package com.aaron.persistence.entities;
public enum Rank {
ENSIGN,LIEUTENANT,COMMANDER,CAPTAIN,COMMODORE,ADMIRAL
}
| [
"[email protected]"
] | |
139e6a3b1ff5f40415a3b1307e6d6905e95da6b9 | 3003f91470ab630def55d25c00f5723bd49a1c13 | /kaltura-sample-code/src/main/java/us/zoom/cms/exception/BadServiceException.java | c02854912f2ab1f8ee49775d788478481c76815c | [
"MIT"
] | permissive | WeilerWebServices/Zoom | ea79b71cfe69d5d08e917dd6fc022e3d438518c2 | 5d548805ba93ee55e0da79fae67c7ccab6320b9b | refs/heads/master | 2022-11-10T18:03:31.323755 | 2020-07-07T07:28:13 | 2020-07-07T07:28:13 | 273,389,548 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 955 | java | /* Copyright (c) 2018 Zoom Video Communications, Inc., All Rights Reserved */
package us.zoom.cms.exception;
import org.springframework.http.HttpStatus;
/**
* Created by kavithakannan on 3/9/18.
*/
@SuppressWarnings("ClassWithoutNoArgConstructor")
public class BadServiceException extends RuntimeException {
private HttpStatus httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
public HttpStatus getHttpStatus() {
return httpStatus;
}
/**
* Constructs a new runtime exception with the specified detail message.
* The cause is not initialized, and may subsequently be initialized by a
* call to {@link #initCause}.
* @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()}
* method.
*/
public BadServiceException(HttpStatus httpStatus, String message) {
super(message);
this.httpStatus = httpStatus;
}
} | [
"[email protected]"
] | |
0cfb0315d3478b6ef0a813f47ae817ff866ee1df | cf6db2647b285ef065a3d6e16d28874e9d1b3293 | /SpringHelloWorldAnnotation/src/com/deepsingh44/controller/Reception.java | 79203331dba0a54d77f6c4da2b3eee9d51976e5f | [] | no_license | deepsingh44/Spring-Hibernate-Project-Tutorial | d7accc49514e028ae96f1e7d5ab21da6f3ec8f97 | dd038b59e95117604e9cd0508b4216a7b0e0b98b | refs/heads/master | 2023-03-30T02:35:21.944443 | 2021-04-07T06:26:34 | 2021-04-07T06:26:34 | 353,610,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 705 | java | package com.deepsingh44.controller;
import org.springframework.web.
servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import com.deepsingh44.config.AppConfig;
//We just create Reception class as a FrontController
public class Reception
extends AbstractAnnotationConfigDispatcherServletInitializer{
@Override
protected Class<?>[] getRootConfigClasses() {
// TODO Auto-generated method stub
return new Class[] {AppConfig.class};
}
@Override
protected Class<?>[] getServletConfigClasses() {
// TODO Auto-generated method stub
return null;
}
@Override
protected String[] getServletMappings() {
// TODO Auto-generated method stub
return new String[] {"/"};
}
}
| [
"[email protected]"
] | |
67ea7691e4d52cb89f9361a37b73c740aabc6dae | 3723f569324664a12a584b72b446a79c74f2a7b4 | /project/src/main/java/cn/com/intra_mart/controller/ui_if/user/model/ImageCropParam.java | 1008728163632cbc9d753e864ad9d0074ee86ccf | [
"MIT"
] | permissive | shujw/ui_if | 949a5e40a0ca007bcec1e06a94dd5297bfe135e2 | f077f255825d1f2fd0d19a019822e98cd47fd13e | refs/heads/master | 2021-05-03T15:57:19.554950 | 2018-02-06T09:30:00 | 2018-02-06T09:30:00 | 120,432,947 | 0 | 0 | null | 2018-02-06T09:38:41 | 2018-02-06T09:38:40 | null | UTF-8 | Java | false | false | 2,136 | java | package cn.com.intra_mart.controller.ui_if.user.model;
public class ImageCropParam {
private Integer orgWidth;
private Integer orgHeight;
private Integer x;
private Integer y;
private Integer width;
private Integer height;
private Integer rotate;
private Float scaleX;
private Float scaleY;
private Integer resizeX;
private Integer resizeY;
Boolean isCrop = false;
private String imgContent;
private String imgFileName;
public String getImgContent() {
return imgContent;
}
public void setImgContent(String imgContent) {
this.imgContent = imgContent;
}
public String getImgFileName() {
return imgFileName;
}
public void setImgFileName(String imgFileName) {
this.imgFileName = imgFileName;
}
public Integer getX() {
return x;
}
public void setX(Integer x) {
this.x = x;
}
public Integer getY() {
return y;
}
public void setY(Integer y) {
this.y = y;
}
public Integer getWidth() {
return width;
}
public void setWidth(Integer width) {
this.width = width;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
public Integer getRotate() {
return rotate;
}
public void setRotate(Integer rotate) {
this.rotate = rotate;
}
public Float getScaleX() {
return scaleX;
}
public void setScaleX(Float scaleX) {
this.scaleX = scaleX;
}
public Float getScaleY() {
return scaleY;
}
public void setScaleY(Float scaleY) {
this.scaleY = scaleY;
}
public Boolean getIsCrop() {
return isCrop;
}
public void setIsCrop(Boolean isCrop) {
this.isCrop = isCrop;
}
public Integer getOrgWidth() {
return orgWidth;
}
public void setOrgWidth(Integer orgWidth) {
this.orgWidth = orgWidth;
}
public Integer getOrgHeight() {
return orgHeight;
}
public void setOrgHeight(Integer orgHeight) {
this.orgHeight = orgHeight;
}
public Integer getResizeX() {
return resizeX;
}
public void setResizeX(Integer resizeX) {
this.resizeX = resizeX;
}
public Integer getResizeY() {
return resizeY;
}
public void setResizeY(Integer resizeY) {
this.resizeY = resizeY;
}
}
| [
"hui.jin@intra-mart"
] | hui.jin@intra-mart |
7333545587b44d53a14282eaaba0c10bfe04b234 | ca1ddd2bff75d8e580956449d25a321914622eff | /project/src/main/java/com/grantwiswell/banking/service/EmployeeLoginService.java | 20566e60bc51f56cf0ae3f0e430a97c204cb7a41 | [
"MIT"
] | permissive | Grantimatter/ROC | 1155bbb6cc7ca0be81ce5dfdce1eba5095b5990c | 3771acc5c224f76b30febdc8208b61eb05c5bd57 | refs/heads/main | 2023-02-12T15:54:49.418636 | 2021-01-04T03:07:26 | 2021-01-04T03:07:26 | 305,429,503 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 204 | java | package com.grantwiswell.banking.service;
import com.grantwiswell.banking.model.Employee;
public interface EmployeeLoginService {
public Employee employeeLogin(String user_name, String password);
}
| [
"[email protected]"
] | |
3429f41d3c9e7d15eb94541eb925fd88ad2dfe08 | c1b4ec7a48645e2cd82e7b5d794bcf403b7d72dd | /mulanbay-pms/src/main/java/cn/mulanbay/pms/web/bean/response/chart/ScatterChartDetailData.java | 21ddbd89b0405ae53e2e559eb589fe7dbc1af2c6 | [
"Apache-2.0"
] | permissive | zbeol/mulanbay-server | 7245766cdcd6564c4d0dc0552fcbc4124b94cdb2 | ffadd9e5b774875bb798145073482c0cabef0195 | refs/heads/master | 2023-03-27T04:11:51.619489 | 2021-03-27T00:42:15 | 2021-03-27T00:42:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,466 | java | package cn.mulanbay.pms.web.bean.response.chart;
import java.util.ArrayList;
import java.util.List;
/**
* 散点图
*
* @author fenghong
* @create 2017-07-10 21:44
*/
public class ScatterChartDetailData {
private String name;
private Object xAxisAverage;
private List<Object[]> data = new ArrayList<>();
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Object getxAxisAverage() {
return xAxisAverage;
}
public void setxAxisAverage(Object xAxisAverage) {
this.xAxisAverage = xAxisAverage;
}
public List<Object[]> getData() {
return data;
}
public void setData(List<Object[]> data) {
this.data = data;
}
public void addData(Object[] os) {
if (os.length < 3) {
data.add(new Object[]{os[0], os[1], 1});
} else {
data.add(os);
}
}
public void appendData(Object x, Object y, double v) {
Object[] oo = this.getData(x, y);
if (oo == null) {
this.addData(new Object[]{x, y, v});
} else {
v += Double.valueOf(oo[2].toString());
oo[2] = v;
}
}
private Object[] getData(Object x, Object y) {
for (Object[] oo : data) {
if (oo[0].equals(x) && oo[1].equals(y)) {
return oo;
}
}
return null;
}
}
| [
"[email protected]"
] | |
41a06b6195633a86aaa1921a90b067c5e78ab425 | 4464f722fdfe38bdc374ba4659524ab6ee3a5b2f | /app/src/test/java/com/example/useraddressmapv3/ExampleUnitTest.java | 21434d949bf0dfc76ee2fe1ed7621e323f3681fe | [] | no_license | lina1301/AndroidMap | 60776d2c58166087fc389b6984516a750f877755 | 5165caf3c11d7a7f3ef2db8b092ce3310ae2a17b | refs/heads/master | 2020-07-29T21:05:55.814978 | 2019-09-21T09:35:58 | 2019-09-21T09:35:58 | 209,959,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package com.example.useraddressmapv3;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
7484b0bebe551b07ad3a679c74fb1e7738be050c | be457457e0ef74ba69543de13e3e064eab4b0ec1 | /JaBaeProject/JaBaeProject/src/JaBae/Customer/DAO/MemberDAO.java | 2d066663e7b3f98498ff074476e49803dafcb9be | [] | no_license | codingdobby/JavaProject-delivery | 091f6ebb3081e972ef0b9624ca647fd9cfb4b3e1 | dfea501181717843e5823dac172237cd65a15407 | refs/heads/master | 2021-08-02T10:35:46.489700 | 2021-07-21T15:33:13 | 2021-07-21T15:33:13 | 213,139,025 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,798 | java | package JaBae.Customer.DAO;
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import JaBae.Customer.VO.MemberVO;
public class MemberDAO {
//Data Access Object
// 공식처럼 사용,사용 많이 함
private Connection conn = null;
private PreparedStatement pstm = null;
private ResultSet rs = null; // select문 수행 후 결과를 저장하는 객체
public void connectDB() {
String url = "jdbc:oracle:thin:@localhost:1521/xe"; // 2.url설정
String id = "Sample";
String pwd = "sample";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");// 1.드라이버 로딩
System.out.println("jdbc 연결 성공");
conn = DriverManager.getConnection(url, id, pwd); // 3.db연결 접속 확인
System.out.println("oracle연결 성공");
} catch (ClassNotFoundException e) {
System.out.println("jdbc 연결 실패");
e.printStackTrace();
} catch (SQLException e) {
System.out.println("orcale연결 실패");
}
}
public void closeDB() {
try {
if (pstm != null)
pstm.close();
if (rs != null)
rs.close();
conn.close();
} catch (SQLException e) {
// TODO: handle exception
e.printStackTrace();
}
}
/*****************************************************************************************/
//아이디 조회하기 로그인
public boolean getid(String id) {
boolean result = false;
connectDB();
String SQL = "select cus_id from customer where cus_id=?";
try {
pstm = conn.prepareStatement(SQL);
pstm.setString(1, id);
rs = pstm.executeQuery();
if (rs.next()) {
result = true;
} else {
result = false;
}
// rs테이블의 모든 레코드를 botari에 담는 과정
} catch (SQLException e) {
e.printStackTrace();
} // 공식
closeDB();
return result;
}
/*****************************************************************************************/
//selectView 화면 포인트 조회
public MemberVO getPoint(String id) {
connectDB();
String SQL = "select point from customer where cus_id=?";// 회원인지 아닌지 구별
MemberVO vo = null;// ==>int a;
try {
pstm = conn.prepareStatement(SQL);
pstm.setString(1, id);
rs = pstm.executeQuery(); // select 문 수행시
// 결과 출력
if (rs.next() == true) {
vo = new MemberVO();
vo.setPoint(rs.getInt("point"));
} else {
}
} catch (SQLException e) {
e.printStackTrace();
}
closeDB();
return vo;
}
/*****************************************************************************************/
// 정보 수정 페이지에 값 바로 뜨게 동작하는 기능
public MemberVO getInfo(String idchk) { //
ArrayList<MemberVO> botari = new ArrayList<MemberVO>();
connectDB();
String SQL = "select name, birth,substr(tel, 0,3) as tel1 , substr(tel,5,4) as tel2 , substr(tel,10,4) as tel3, addr from customer where cus_id=? ";
MemberVO vo = null;// 결과를 담는 그릇 객체
try {
pstm = conn.prepareStatement(SQL);
pstm.setString(1, idchk);
rs = pstm.executeQuery(); // select 문 수행 결과가 rs 테이블에 다 담겨져 있음
// rs 테이블의 모든 레코드를 botari에 담는다
if (rs.next() == true) {
vo = new MemberVO();// 1개의 레코드를 담을 빈그릇(vo)을 준비
vo.setName(rs.getString("name"));
vo.setTel(rs.getString("tel1"));
vo.setTel2(rs.getString("tel2"));
vo.setTel3(rs.getString("tel3"));
vo.setAddr(rs.getString("addr"));
if (rs.getString("birth") == null) {
vo.setBirth("");
} else {
vo.setBirth(rs.getString("birth"));
}
}
} catch (
SQLException e) {
e.printStackTrace();
}
closeDB();
return vo;
}
/*****************************************************************************************/
// 고객 정보 수정
public void Update(String pwd, String local, String addr, String tel, String birth, String cus_id) {
connectDB();
String SQL = "update customer set pwd=? ,l_no_cus_fk = (select l_no from loc where loc = ?), addr=? ,tel=?,birth=? where cus_id=?";
try {
pstm = conn.prepareStatement(SQL);
pstm.setString(1, pwd);
pstm.setString(2, local);
pstm.setString(3, addr);
pstm.setString(4, tel);
pstm.setString(5, birth);
pstm.setString(6, cus_id);
pstm.executeUpdate();
} catch (SQLException se) {
se.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
closeDB();
}
}
/*****************************************************************************************/
// 탈퇴 기능
public void Delete(String id) {
connectDB();
String SQL = "delete from customer where cus_id=?";
try {
pstm = conn.prepareStatement(SQL);
pstm.setString(1, id);
pstm.executeUpdate();
} catch (SQLException se) {
se.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
closeDB();
}
}
/*****************************************************************************************/
// 아이디 찾기
public MemberVO getID(String name, String tel) { //
connectDB();
String SQL = "select cus_id from customer where name=? and tel=?";
MemberVO vo = null;// 결과를 담는 그릇 객체
try {
pstm = conn.prepareStatement(SQL);
pstm.setString(1, name);
pstm.setString(2, tel);
rs = pstm.executeQuery(); // select 문 수행 결과가 rs 테이블에 다 담겨져 있음
// rs 테이블의 모든 레코드를 botari에 담는다
if (rs.next() == true) {
vo = new MemberVO();// 1개의 레코드를 담을 빈그릇(vo)을 준비
vo.setCus_id(rs.getString("cus_id"));
}
} catch (
SQLException e) {
e.printStackTrace();
}
closeDB();
return vo;
}
/*****************************************************************************************/
// 비밀번호 찾기
public MemberVO getPwd(String id, String tel) { //
connectDB();
String SQL = "select substr(pwd,0,3) as pwd , substr(pwd, 6,3) as pwd2 from customer where cus_id=? and tel=?";
MemberVO vo = null;// 결과를 담는 그릇 객체
try {
pstm = conn.prepareStatement(SQL);
pstm.setString(1, id);
pstm.setString(2, tel);
rs = pstm.executeQuery(); // select 문 수행 결과가 rs 테이블에 다 담겨져 있음
// rs 테이블의 모든 레코드를 botari에 담는다
if (rs.next() == true) {
vo = new MemberVO();// 1개의 레코드를 담을 빈그릇(vo)을 준비
vo.setPwd(rs.getString("pwd"));
vo.setPwd2(rs.getString("pwd2"));
}
} catch (
SQLException e) {
e.printStackTrace();
}
closeDB();
return vo;
}
} | [
"[email protected]"
] | |
2c9c8f0219f23c3670bb9061ca0c2404858d2d94 | 545b2ff0dcc7ca42f7bafd9faea2d5ea3b0b274e | /apiDemos/src/main/java/com/example/android/apis/view/GridLayout3.java | 2f8068b0fe32dd3d18178ea6845eb1ca229fb3ac | [] | no_license | ssj64260/Google-ApiDemos | da285dc735fa33e6992683ef1b2a24b036a2ceb9 | a40bd16b91e1eae22cd60f9f7911e0f1b095f891 | refs/heads/master | 2021-01-19T14:40:39.845120 | 2017-11-26T09:08:34 | 2017-11-26T09:08:34 | 88,182,178 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,965 | java | /*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.apis.view;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridLayout;
import android.widget.TextView;
import com.example.android.apis.BaseActivity;
import static android.text.InputType.TYPE_CLASS_TEXT;
import static android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
import static android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD;
import static android.widget.GridLayout.ALIGN_BOUNDS;
import static android.widget.GridLayout.BASELINE;
import static android.widget.GridLayout.CENTER;
import static android.widget.GridLayout.FILL;
import static android.widget.GridLayout.LEFT;
import static android.widget.GridLayout.LayoutParams;
import static android.widget.GridLayout.RIGHT;
import static android.widget.GridLayout.Spec;
import static android.widget.GridLayout.spec;
/**
* A form, showing use of the GridLayout API. Here we demonstrate use of the row/column order
* preserved property which allows rows and or columns to pass over each other when needed.
* The two buttons in the bottom right corner need to be separated from the other UI elements.
* This can either be done by separating rows or separating columns - but we don't need
* to do both and may only have enough space to do one or the other.
*/
public class GridLayout3 extends BaseActivity {
public static View create(Context context) {
GridLayout p = new GridLayout(context);
p.setUseDefaultMargins(true);
p.setAlignmentMode(ALIGN_BOUNDS);
Configuration configuration = context.getResources().getConfiguration();
if ((configuration.orientation == Configuration.ORIENTATION_PORTRAIT)) {
p.setColumnOrderPreserved(false);
} else {
p.setRowOrderPreserved(false);
}
Spec titleRow = spec(0);
Spec introRow = spec(1);
Spec emailRow = spec(2, BASELINE);
Spec passwordRow = spec(3, BASELINE);
Spec button1Row = spec(5);
Spec button2Row = spec(6);
Spec centerInAllColumns = spec(0, 4, CENTER);
Spec leftAlignInAllColumns = spec(0, 4, LEFT);
Spec labelColumn = spec(0, RIGHT);
Spec fieldColumn = spec(1, LEFT);
Spec defineLastColumn = spec(3);
Spec fillLastColumn = spec(3, FILL);
{
TextView c = new TextView(context);
c.setTextSize(32);
c.setText("Email setup");
p.addView(c, new LayoutParams(titleRow, centerInAllColumns));
}
{
TextView c = new TextView(context);
c.setTextSize(16);
c.setText("You can configure email in a few simple steps:");
p.addView(c, new LayoutParams(introRow, leftAlignInAllColumns));
}
{
TextView c = new TextView(context);
c.setText("Email address:");
p.addView(c, new LayoutParams(emailRow, labelColumn));
}
{
EditText c = new EditText(context);
c.setEms(10);
c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
p.addView(c, new LayoutParams(emailRow, fieldColumn));
}
{
TextView c = new TextView(context);
c.setText("Password:");
p.addView(c, new LayoutParams(passwordRow, labelColumn));
}
{
TextView c = new EditText(context);
c.setEms(8);
c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD);
p.addView(c, new LayoutParams(passwordRow, fieldColumn));
}
{
Button c = new Button(context);
c.setText("Manual setup");
p.addView(c, new LayoutParams(button1Row, defineLastColumn));
}
{
Button c = new Button(context);
c.setText("Next");
p.addView(c, new LayoutParams(button2Row, fillLastColumn));
}
return p;
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(create(this));
}
} | [
"[email protected]"
] | |
2ac2030ff08102513d032fa26320f7cba798aa54 | 90ece9f4ae98bc9207eb80dce23fefadd7ce116d | /trunk/gaoshin-core/src/main/java/com/gaoshin/amazon/jax/ItemSearchResponse.java | 8da34f6e3ec5970c76f6ed4b8cb4196ac996c728 | [] | no_license | zhangyongjiang/unfuddle | 3709018baafefd16003d3666aae6808c106ee038 | e07a6268f46eee7bc2b4890c44b736462ab89642 | refs/heads/master | 2021-01-24T06:12:21.603134 | 2014-07-06T16:14:18 | 2014-07-06T16:14:18 | 21,543,421 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,775 | java |
package com.gaoshin.amazon.jax;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://webservices.amazon.com/AWSECommerceService/2010-09-01}OperationRequest" minOccurs="0"/>
* <element ref="{http://webservices.amazon.com/AWSECommerceService/2010-09-01}Items" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"operationRequest",
"items"
})
@XmlRootElement(name = "ItemSearchResponse")
public class ItemSearchResponse {
@XmlElement(name = "OperationRequest")
protected OperationRequest operationRequest;
@XmlElement(name = "Items")
protected List<Items> items;
/**
* Gets the value of the operationRequest property.
*
* @return
* possible object is
* {@link OperationRequest }
*
*/
public OperationRequest getOperationRequest() {
return operationRequest;
}
/**
* Sets the value of the operationRequest property.
*
* @param value
* allowed object is
* {@link OperationRequest }
*
*/
public void setOperationRequest(OperationRequest value) {
this.operationRequest = value;
}
/**
* Gets the value of the items property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the items property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getItems().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Items }
*
*
*/
public List<Items> getItems() {
if (items == null) {
items = new ArrayList<Items>();
}
return this.items;
}
}
| [
"[email protected]"
] | |
f4357046f70accad3f7f9216d6a5f1e4834e5681 | b7a38d4f758d9e5eb24e5ee5f10509aef171573a | /app/app/src/main/java/com/emilio/tvseriesquiz/interactor/entities/SaveEntitiesInteractor.java | f05192f3a2a42cc6142baaa7e6c0ec872e77e185 | [] | no_license | EmilioBello/TV-Series-Quiz-3 | 695a3e4aa921105fe893d1cb094bb75aa81b4175 | 52a1b5911d5d2351af8a6d0153fb6ac47f8d4fd9 | refs/heads/master | 2021-04-02T16:52:31.690529 | 2020-03-18T17:36:51 | 2020-03-18T17:36:51 | 248,297,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 680 | java | package com.emilio.tvseriesquiz.interactor.entities;
import androidx.annotation.NonNull;
import com.emilio.tvseriesquiz.model.realm.repository.RealmRepository;
import java.util.List;
public class SaveEntitiesInteractor<Pojo, DAO>{
private final Class<Pojo> typePojo;
private final Class<DAO> typeDAO;
public SaveEntitiesInteractor(@NonNull final Class<Pojo> typePojo, @NonNull final Class<DAO> typeDAO) {
this.typePojo = typePojo;
this.typeDAO = typeDAO;
}
public void init(@NonNull final List<Pojo> list) {
RealmRepository<Pojo, DAO> repository = new RealmRepository<>(typePojo, typeDAO);
repository.save(list);
}
}
| [
""
] | |
0c0ce3309b63ef6c371afd3179cf53d6cd0f8898 | f13fe5d482e0970ec51eb12c1db6270291365fac | /server/src/test/java/org/elasticsearch/ingest/ConditionalProcessorTests.java | f484957d897f1dfd39367e58ee72e04185d857bb | [
"Apache-2.0",
"LicenseRef-scancode-elastic-license-2018",
"LicenseRef-scancode-other-permissive"
] | permissive | seanmcrw/elasticsearch | e8633f8d72c1895ce0349cc73eb7f0cb29932ec9 | 9621c1a796c2f7747479eb912f1435d84686ffd9 | refs/heads/master | 2020-07-30T19:28:17.456445 | 2019-09-24T09:27:58 | 2019-09-24T09:27:58 | 191,790,339 | 0 | 0 | Apache-2.0 | 2019-06-13T15:38:46 | 2019-06-13T15:38:46 | null | UTF-8 | Java | false | false | 10,412 | java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.ingest;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.script.MockScriptEngine;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptModule;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.script.ScriptType;
import org.elasticsearch.test.ESTestCase;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.LongSupplier;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ConditionalProcessorTests extends ESTestCase {
public void testChecksCondition() throws Exception {
String conditionalField = "field1";
String scriptName = "conditionalScript";
String trueValue = "truthy";
ScriptService scriptService = new ScriptService(Settings.builder().build(),
Collections.singletonMap(
Script.DEFAULT_SCRIPT_LANG,
new MockScriptEngine(
Script.DEFAULT_SCRIPT_LANG,
Collections.singletonMap(
scriptName, ctx -> trueValue.equals(ctx.get(conditionalField))
),
Collections.emptyMap()
)
),
new HashMap<>(ScriptModule.CORE_CONTEXTS)
);
Map<String, Object> document = new HashMap<>();
LongSupplier relativeTimeProvider = mock(LongSupplier.class);
when(relativeTimeProvider.getAsLong()).thenReturn(0L, TimeUnit.MILLISECONDS.toNanos(1), 0L, TimeUnit.MILLISECONDS.toNanos(2));
ConditionalProcessor processor = new ConditionalProcessor(
randomAlphaOfLength(10),
new Script(
ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG,
scriptName, Collections.emptyMap()), scriptService,
new Processor() {
@Override
public IngestDocument execute(final IngestDocument ingestDocument){
if(ingestDocument.hasField("error")){
throw new RuntimeException("error");
}
ingestDocument.setFieldValue("foo", "bar");
return ingestDocument;
}
@Override
public String getType() {
return null;
}
@Override
public String getTag() {
return null;
}
}, relativeTimeProvider);
//false, never call processor never increments metrics
String falseValue = "falsy";
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document);
ingestDocument.setFieldValue(conditionalField, falseValue);
processor.execute(ingestDocument);
assertThat(ingestDocument.getSourceAndMetadata().get(conditionalField), is(falseValue));
assertThat(ingestDocument.getSourceAndMetadata(), not(hasKey("foo")));
assertStats(processor, 0, 0, 0);
ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document);
ingestDocument.setFieldValue(conditionalField, falseValue);
ingestDocument.setFieldValue("error", true);
processor.execute(ingestDocument);
assertStats(processor, 0, 0, 0);
//true, always call processor and increments metrics
ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document);
ingestDocument.setFieldValue(conditionalField, trueValue);
processor.execute(ingestDocument);
assertThat(ingestDocument.getSourceAndMetadata().get(conditionalField), is(trueValue));
assertThat(ingestDocument.getSourceAndMetadata().get("foo"), is("bar"));
assertStats(processor, 1, 0, 1);
ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document);
ingestDocument.setFieldValue(conditionalField, trueValue);
ingestDocument.setFieldValue("error", true);
IngestDocument finalIngestDocument = ingestDocument;
expectThrows(RuntimeException.class, () -> processor.execute(finalIngestDocument));
assertStats(processor, 2, 1, 2);
}
@SuppressWarnings("unchecked")
public void testActsOnImmutableData() throws Exception {
assertMutatingCtxThrows(ctx -> ctx.remove("foo"));
assertMutatingCtxThrows(ctx -> ctx.put("foo", "bar"));
assertMutatingCtxThrows(ctx -> ((List<Object>)ctx.get("listField")).add("bar"));
assertMutatingCtxThrows(ctx -> ((List<Object>)ctx.get("listField")).remove("bar"));
}
public void testTypeDeprecation() throws Exception {
String scriptName = "conditionalScript";
ScriptService scriptService = new ScriptService(Settings.builder().build(),
Collections.singletonMap(
Script.DEFAULT_SCRIPT_LANG,
new MockScriptEngine(
Script.DEFAULT_SCRIPT_LANG,
Collections.singletonMap(
scriptName, ctx -> {
ctx.get("_type");
return true;
}
),
Collections.emptyMap()
)
),
new HashMap<>(ScriptModule.CORE_CONTEXTS)
);
LongSupplier relativeTimeProvider = mock(LongSupplier.class);
when(relativeTimeProvider.getAsLong()).thenReturn(0L, TimeUnit.MILLISECONDS.toNanos(1), 0L, TimeUnit.MILLISECONDS.toNanos(2));
ConditionalProcessor processor = new ConditionalProcessor(
randomAlphaOfLength(10),
new Script(
ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG,
scriptName, Collections.emptyMap()), scriptService,
new Processor() {
@Override
public IngestDocument execute(final IngestDocument ingestDocument){
return ingestDocument;
}
@Override
public String getType() {
return null;
}
@Override
public String getTag() {
return null;
}
}, relativeTimeProvider);
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), Collections.emptyMap());
processor.execute(ingestDocument);
assertWarnings("[types removal] Looking up doc types [_type] in scripts is deprecated.");
}
private static void assertMutatingCtxThrows(Consumer<Map<String, Object>> mutation) throws Exception {
String scriptName = "conditionalScript";
CompletableFuture<Exception> expectedException = new CompletableFuture<>();
ScriptService scriptService = new ScriptService(Settings.builder().build(),
Collections.singletonMap(
Script.DEFAULT_SCRIPT_LANG,
new MockScriptEngine(
Script.DEFAULT_SCRIPT_LANG,
Collections.singletonMap(
scriptName, ctx -> {
try {
mutation.accept(ctx);
} catch (Exception e) {
expectedException.complete(e);
}
return false;
}
),
Collections.emptyMap()
)
),
new HashMap<>(ScriptModule.CORE_CONTEXTS)
);
Map<String, Object> document = new HashMap<>();
ConditionalProcessor processor = new ConditionalProcessor(
randomAlphaOfLength(10),
new Script(
ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG,
scriptName, Collections.emptyMap()), scriptService, null
);
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document);
ingestDocument.setFieldValue("listField", new ArrayList<>());
processor.execute(ingestDocument);
Exception e = expectedException.get();
assertThat(e, instanceOf(UnsupportedOperationException.class));
assertEquals("Mutating ingest documents in conditionals is not supported", e.getMessage());
assertStats(processor, 0, 0, 0);
}
private static void assertStats(ConditionalProcessor conditionalProcessor, long count, long failed, long time) {
IngestStats.Stats stats = conditionalProcessor.getMetric().createStats();
assertThat(stats.getIngestCount(), equalTo(count));
assertThat(stats.getIngestCurrent(), equalTo(0L));
assertThat(stats.getIngestFailedCount(), equalTo(failed));
assertThat(stats.getIngestTimeInMillis(), greaterThanOrEqualTo(time));
}
}
| [
"[email protected]"
] | |
ef123e1270ee402d0fe21a9441e68e3458c4dfd0 | 8f9c708daf399e2ef084924896352842aba486de | /app/src/main/java/com/wjs/collectioncode/recyclerview/snaphelper/SnapAdapter.java | 12b40085185b99607df26b060cdd3c6babcacd60 | [] | no_license | wangjishan/CollectionCode-master | e639427b4221e18f521d45ee68fcc76efa652603 | ddc060d1e3ddf7550e6acce55bb94d829a9783d6 | refs/heads/master | 2021-01-21T11:11:00.461752 | 2017-03-20T10:12:44 | 2017-03-20T10:12:44 | 83,531,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,542 | java | package com.wjs.collectioncode.recyclerview.snaphelper;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSnapHelper;
import android.support.v7.widget.RecyclerView;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.wjs.collectioncode.R;
import java.util.ArrayList;
public class SnapAdapter extends RecyclerView.Adapter<SnapAdapter.ViewHolder> {
public static final int VERTICAL = 0;
public static final int HORIZONTAL = 1;
private ArrayList<Snap> mSnaps;
// Disable touch detection for parent recyclerView if we use vertical nested recyclerViews
private View.OnTouchListener mTouchListener = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
v.getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
};
public SnapAdapter() {
mSnaps = new ArrayList<>();
}
public void addSnap(Snap snap) {
mSnaps.add(snap);
}
@Override
public int getItemViewType(int position) {
Snap snap = mSnaps.get(position);
switch (snap.getGravity()) {
case Gravity.CENTER_VERTICAL:
return VERTICAL;
case Gravity.CENTER_HORIZONTAL:
return HORIZONTAL;
case Gravity.START:
return HORIZONTAL;
case Gravity.TOP:
return VERTICAL;
case Gravity.END:
return HORIZONTAL;
case Gravity.BOTTOM:
return VERTICAL;
}
return HORIZONTAL;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = viewType == VERTICAL ? LayoutInflater.from(parent.getContext())
.inflate(R.layout.adapter_snap_vertical, parent, false)
: LayoutInflater.from(parent.getContext())
.inflate(R.layout.adapter_snap, parent, false);
if (viewType == VERTICAL) {
view.findViewById(R.id.recyclerView).setOnTouchListener(mTouchListener);
}
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Snap snap = mSnaps.get(position);
holder.snapTextView.setText(snap.getText());
if (snap.getGravity() == Gravity.START || snap.getGravity() == Gravity.END) {
holder.recyclerView.setLayoutManager(new LinearLayoutManager(holder
.recyclerView.getContext(), LinearLayoutManager.HORIZONTAL, false));
holder.recyclerView.setOnFlingListener(null);
new GravitySnapHelper(snap.getGravity()).attachToRecyclerView(holder.recyclerView);
} else if (snap.getGravity() == Gravity.CENTER_HORIZONTAL
|| snap.getGravity() == Gravity.CENTER_VERTICAL
|| snap.getGravity() == Gravity.CENTER) {
holder.recyclerView.setLayoutManager(new LinearLayoutManager(holder
.recyclerView.getContext(), snap.getGravity() == Gravity.CENTER_HORIZONTAL ?
LinearLayoutManager.HORIZONTAL : LinearLayoutManager.VERTICAL, false));
holder.recyclerView.setOnFlingListener(null);
new LinearSnapHelper().attachToRecyclerView(holder.recyclerView);
} else { // Top / Bottom
holder.recyclerView.setLayoutManager(new LinearLayoutManager(holder
.recyclerView.getContext()));
holder.recyclerView.setOnFlingListener(null);
new GravitySnapHelper(snap.getGravity()).attachToRecyclerView(holder.recyclerView);
}
holder.recyclerView.setAdapter(new Adapter(snap.getGravity() == Gravity.START
|| snap.getGravity() == Gravity.END
|| snap.getGravity() == Gravity.CENTER_HORIZONTAL, snap.getApps()));
}
@Override
public int getItemCount() {
return mSnaps.size();
}
public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView snapTextView;
public RecyclerView recyclerView;
public ViewHolder(View itemView) {
super(itemView);
snapTextView = (TextView) itemView.findViewById(R.id.snapTextView);
recyclerView = (RecyclerView) itemView.findViewById(R.id.recyclerView);
}
}
}
| [
"[email protected]"
] | |
ceb178ee5f6a79c5025126bfa43e1362768ff501 | 9af8a544ef460830e3279caf7d4e883b6b684f8a | /lujpersist/src/main/java/luj/persist/internal/data/field/type/str/StrModificationApplier.java | 1fc11f1d45d7681008f1a90cb520dd466077b4e5 | [] | no_license | lowZoom/lujpersist | 093cf3e1736a249985ce003b352dd4bc42ba8e42 | b2ee19246a5de52a16147d897999189babfdf0f2 | refs/heads/master | 2022-11-28T13:49:00.931923 | 2022-02-16T11:21:46 | 2022-02-16T11:21:46 | 149,903,136 | 0 | 0 | null | 2022-11-16T02:20:39 | 2018-09-22T18:02:31 | Java | UTF-8 | Java | false | false | 281 | java | package luj.persist.internal.data.field.type.str;
import org.springframework.stereotype.Service;
@Service
public class StrModificationApplier {
public void apply(DbStr state) {
String newValue = state.getMod();
state.setMod(null);
state.setValue(newValue);
}
}
| [
"[email protected]"
] | |
ab746010b066c20e165571ef93e6cc1c9daeb477 | 2c80567a4f341b4f5734a42df8f1db034eb2ead6 | /game2048/src/main/java/com/guang/sun/game/camera/util/ImageUtil.java | 93885cc0fe2cccdad4a0c238e29191c7be55a4dc | [
"Apache-2.0"
] | permissive | Guangdinghou/android-gpuimage | 1115b53a3871d273e0a7dfa6803835f6f3cdd94f | fb99fbe6882a73827a65969524b098ddf55adef3 | refs/heads/master | 2021-01-17T06:35:44.526841 | 2016-04-14T09:44:38 | 2016-04-14T09:44:38 | 56,140,284 | 0 | 0 | null | 2016-04-13T09:50:17 | 2016-04-13T09:50:17 | null | UTF-8 | Java | false | false | 474 | java | package com.guang.sun.game.camera.util;
import android.graphics.Bitmap;
import android.graphics.Matrix;
public class ImageUtil {
/**
* ��תBitmap
* @param b
* @param rotateDegree
* @return
*/
public static Bitmap getRotateBitmap(Bitmap b, float rotateDegree){
Matrix matrix = new Matrix();
matrix.postRotate((float)rotateDegree);
Bitmap rotaBitmap = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, false);
return rotaBitmap;
}
}
| [
"guangdinghou"
] | guangdinghou |
1fa48b4c929bbcbc62124d965448ba8ebbc09f4a | 7c72cb055c2905aea3e7f971808b13113ca66c88 | /Entornos2/src/Ej2Test.java | 52559bed07e0337b5a4f44f44c0a38ae3b60547e | [] | no_license | tejedorjesus/Segundo-trimestre | 193cfbbd7cf57b83d2b82bf69bce884bb0dff3f8 | 9ea8a8f2446a66aab86653c8d66a43e525c863d4 | refs/heads/master | 2021-05-06T08:18:32.914325 | 2018-04-23T19:48:25 | 2018-04-23T19:48:25 | 114,010,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 161 | java | import static org.junit.Assert.*;
import org.junit.Test;
public class Ej2Test {
@Test
public void testContar_letra() {
fail("Not yet implemented");
}
}
| [
"[email protected]"
] | |
dda8a4cc906e4b1cb63523f227ccef8bb8ac0b6a | 509be6d3604b3590fe9be061e1fd39d013277423 | /app/src/main/java/falleight/isft/StockData.java | 8a994d7373eba240455c93a6ebdd93d1f58dfc2d | [] | no_license | hayabusata/ISFT | 13377644a073b35f76eafe5c80110ebf49ded7fe | 44e7734ad765397a5ad6f10282e531cd32a3caf0 | refs/heads/master | 2021-01-19T13:31:30.650579 | 2017-03-05T03:04:34 | 2017-03-05T03:04:34 | 82,395,872 | 0 | 0 | null | 2017-02-25T14:27:22 | 2017-02-18T15:26:51 | Java | UTF-8 | Java | false | false | 1,217 | java | package falleight.isft;
public class StockData {
private int id;
private String email;
private String password;
private String name;
private String status;
private String roomNumber;
private String type;
private String word;
public int getId() {
return this.id;
}
public void setId(int newId) {
this.id = newId;
}
public String getEmail() {
return this.email;
}
public void setEmail(String newEmail) {
this.email = newEmail;
}
public String getPassword() {
return this.password;
}
public void setPassword(String newPassword) {
this.password = newPassword;
}
public String getName() {
return this.name;
}
public void setName(String newName) {
this.name = newName;
}
public String getStatus() {
return this.status;
}
public void setStatus(String newStatus) {
this.status = newStatus;
}
public String getRoomNumber() {
return this.roomNumber;
}
public void setRoomNumber(String newRoomNumber) {
this.roomNumber = newRoomNumber;
}
public String getType() { return this.type; }
public void setType(String newType) {this.type = newType; }
public String getWord() { return this.word; }
public void setWord(String newWord) {this.word = newWord; }
} | [
"[email protected]"
] | |
fce2076814d4ff7d964d64b688421876f513fbca | d3b1c4613d8dfbd0f85e85e75764a7511b1e6c3c | /app/src/main/java/br/eng/ecarrara/beerwith/data/BeerWithDbHelper.java | 8ec6d53b6b2f7cbc404b871a4dcf29e7c0e827c4 | [
"MIT"
] | permissive | ecarrara-araujo/BeerWith | 277a0db93ea6ce3fe55e882ee8266cfee189fb10 | 3845254c42eb7fb6f03609cc1c0e293c21e8eebf | refs/heads/master | 2021-01-01T20:17:13.806017 | 2015-08-28T20:03:35 | 2015-08-28T20:03:35 | 41,577,840 | 5 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,236 | java | package br.eng.ecarrara.beerwith.data;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import br.eng.ecarrara.beerwith.data.BeerWithContract.DrinkWithEntry;
/**
* Created by ecarrara on 13/12/2014.
*/
public class BeerWithDbHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;
public static final String DATABASE_NAME = "drinkwith.db";
public BeerWithDbHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
final String SQL_CREATE_DRINK_WITH_TABLE = "CREATE TABLE " +
DrinkWithEntry.TABLE_NAME + " (" +
DrinkWithEntry._ID + " INTEGER PRIMARY KEY, " +
DrinkWithEntry.COLUMN_DRINKING_DATE + " TEXT NOT NULL, " +
DrinkWithEntry.COLUMN_BEER_DESC + " TEXT NOT NULL, " +
DrinkWithEntry.COLUMN_CONTACT_URI + " TEXT NOT NULL " +
");";
db.execSQL(SQL_CREATE_DRINK_WITH_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
return;
}
}
| [
"[email protected]"
] | |
9e5f0c44b80358e7d4b641e0f1e63cd38de8df2a | 2198dfe33f375e85201fc0d2fc1e6514cfc257f1 | /ovidiurosu/ql_src/ql/error/ErrorList.java | 46678f7374a0c0cc3928bb97496f4e793084040a | [
"Apache-2.0"
] | permissive | software-engineering-amsterdam/poly-ql | c073e19da80ab66ae540f7438d6637fb55286c07 | acde6f943265e8aca08e1fe1ce213bcb1b5f9421 | refs/heads/master | 2022-05-01T10:05:32.627053 | 2022-04-19T12:05:26 | 2022-04-19T12:05:26 | 16,277,142 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | package ql.error;
import java.util.ArrayList;
import java.util.Iterator;
/**
* @author orosu
*/
public class ErrorList
{
private final ArrayList<IError> _value;
public ErrorList()
{
this._value = new ArrayList<IError>();
}
public Iterator<IError> iterator()
{
return this._value.iterator();
}
public void add(IError error)
{
this._value.add(error);
}
public void addAll(ErrorList errorList)
{
Iterator<IError> iterator = errorList.iterator();
while (iterator.hasNext()) {
this.add(iterator.next());
}
}
public int size()
{
return this._value.size();
}
public IError get(int index)
{
return this._value.get(index);
}
}
| [
"[email protected]"
] | |
9708abab900bcf2d790fbda0ab30a9ffb0b972ed | a9cf4118e0f032331542d38b7d29c60734a712bf | /src/Code_99_LuanShua/Code_0797.java | cfb1ea04f8aaca6509129bfa2e4a99c86d8e5a12 | [] | no_license | jchen-96/leetCode | 5531571fb43ffc5023250f1ca21c1ebe5922aa8c | 4e411c9818d5d3194192b67016edafad36d75b29 | refs/heads/master | 2021-07-13T17:54:26.108694 | 2020-09-20T11:54:54 | 2020-09-20T11:54:54 | 176,665,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 951 | java | package Code_99_LuanShua;
//https://leetcode-cn.com/problems/all-paths-from-source-to-target/
// need to read
// dfs 深度优先搜索,回溯算法
import java.util.ArrayList;
import java.util.List;
public class Code_0797 {
public List<List<Integer>> allPathsSourceTarget(int[][] graph) {
List<List<Integer>> result=new ArrayList<>();
List<Integer> item=new ArrayList<>();
int n=graph.length;
dfs(result,item,0,n-1,graph);
return result;
}
private void dfs(List<List<Integer>> result,List<Integer> item,int i,int target,int[][] graph){
if(i==target){
item.add(i);
result.add(new ArrayList<>(item));
item.remove(item.size()-1);
return;
}
item.add(i);
for(int index=0;index<graph[i].length;index++){
dfs(result,item,graph[i][index],target,graph);
}
item.remove(item.size()-1);
}
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.